Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

BDD, Behat, Mink and other Wonderful Things

via SymfonyCasts

Overview

Looking for Behat v2.5 of the tutorial? See https://knpuniversity.com/screencast/behat-v25.

Behat is my absolute favorite library to use. First, it let's me think about the behavior of my features first, before I start developing. In this tutorial, we'll do that, and it'll change the way you develop. Second, Behat turns that written behavior into functional tests against your application. Does your feature behave correctly? Just run the automated robots to find out!

Along the way, we'll master Mink - the partner library to Behat - and solve all sorts of common problems, like:

  • Running scenarios in a real browser
  • Properly waiting or JavaScript events
  • Leveraging Behat hooks
  • Multiple contexts
  • Loading Database fixtures and clearing data
  • Bootstrapping your application (specifically Symfony)
  • Using the authenticated user
  • Tagging scenarios
  • How to put BDD into practice
  • Keeping the velociraptors in their pen.

Let's do this!

Syllabus

  • From Install to JS Testing
  • BDD Features
  • Scenarios
  • Behat
  • Behat Hooks Background
  • Mink
  • Finding Elements by CSS and Name
  • Behat Loves Mink (Free Definitions from MinkExtension)
  • Scenario Outline
  • Mink Session inside FeatureContext
  • Context Organization and Behat Suites
  • Building a Login Scenario
  • Controlling the Database
  • The SymfonyExtension & Clearing Data Between Scenarios
  • Practice: Find Elements, Login with 1 Step and Debug
  • When *I* do Something: Handling the Current User
  • Practicing BDD: Plan, then Build
  • Master JavaScript with Waits & Debugging
  • Debugging and Taking Screenshots with JavaScript
  • Gherkin Tables: Given I have the following:
  • Finding inside HTML Tables
  • Clicking a Row in a Table (i.e. Complex Selectors)
  • Tagging Scenarios in order to Load Fixtures

Taught by

Ryan Weaver and Leanna Pelham

Reviews

Start your review of BDD, Behat, Mink and other Wonderful Things

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.