BDD, Behat, Mink and other Wonderful Things

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!


Your Guides

Ryan Weaver Leanna Pelham

Questions? Conversation?

  • 2016-01-19 weaverryan

    Hi Bartek!

    Yes, I have done this stuff before with a client (at least with iframes, but I think also with windows) - some of the details are fuzzy, but we were totally able to pull it off. As you probably already know, the key methods are on the Session: https://github.com/minkphp/Min.... I would use getWindowName() and getWindowNames() (https://github.com/minkphp/Min... to debug and figure out what all the window names are being called during the process.

    I know that's vague, but I hope it helps! Cheers!

  • 2016-01-19 Bartek

    Hi, How can I switch from one window to another. For example, my scenario is as follows -

    Scenario Outline: User login with Facebook
    When I press "siginFacebook"
    And I switch to the new tab
    And I fill in "<email>" for "email"
    And I fill in "<password>" for "pass"
    And Click the "u_0_2" select by "id"

    In this stage, as facebook login works, so popup window close automatically and it generates an error -
    "Window not found. The browser window may have been closed."

    Do you know how to come back to my original window after a successful facebook login?

  • 2015-10-13 weaverryan

    Hey!

    If you own the Behat 2.5 version, shoot us an email/contact message and we'll be happy to give anyone a coupon code to grab the 3.0 version free :).

    Cheers!

  • 2015-10-13 truthrevealer

    Should the owners of Behat 2.5 course purchase this one as well to get access to it?

  • 2015-10-13 Richard Bagshaw

    So much yes!! I want this one :) Behat 3!! :)