Feature: The site should display information about the user group Scenario: See next event on the home page Given there is a scheduled meetup "September Gathering" When I go to the homepage Then I should see "Next Event" And I should see "September Gathering" And I should see "See details" 21 . 1
Feature: The site should display information about the user group Scenario: See next event on the home page Given there is a scheduled meetup "September Gathering" When I go to the homepage Then I should see "Next Event" And I should see "September Gathering" And I should see "See details" 21 . 2
Feature: The site should display information about the user group Scenario: See next event on the home page Given there is a scheduled meetup "September Gathering" When I go to the homepage Then I should see "Next Event" And I should see "September Gathering" And I should see "See details" 21 . 3
Feature: The site should display information about the user group Scenario: See next event on the home page Given there is a scheduled meetup "September Gathering" When I go to the homepage Then I should see "Next Event" And I should see "September Gathering" And I should see "See details" 21 . 4
Feature: The site should display information about the user group Scenario: See next event on the home page Given there is a scheduled meetup "September Gathering" When I go to the homepage Then I should see "Next Event" And I should see "September Gathering" And I should see "See details" 21 . 5
GHERKIN SPEAKS MANY LANGUAGES #language: bg Функционалност: Информация за групата Като потенциален член на групата искам да мога да открия информация за нея Сценарий: показване на информация за групата Когато съм на началната страница То трябва да виждам "PHP Varna" И трябва да виждам "PHP User Group of Varna, Bulgaria." 21 . 6
CREATE A CONTEXT AND USE HOOKS use \Behat\MinkExtension\Context\RawMinkContext; class FeatureContext extends RawMinkContext { /** @beforeStep */ public function setBrowserSize() { $this->getSession()->resizeWindow(1200, 800); } } 24 . 1
DEFINING STEPS /** * @When I click on the ":menuItem" menu item * @When I go to about page */ public function iClickOnTheMenuItem( $menuItem = 'About' ) { $this->getSession()->getPage() ->find('css', "a:contains($menuItem)") ->click(); } 24 . 2
/** * @Given /^there is a scheduled meetup "([^"]*)"$/ */ public function thereIsAScheduledMeetup( $name ) { $date = new DateTime(); // P1D means a period of 1 day $date->add( new DateInterval( 'P1D' ) ); $this->scheduleMeetup(compact('name', 'date')); } 24 . 3
WHAT DO WE GET? Integration with WordPress trough a suite of drivers including wp-cli and the REST api Fully integrated with Behat Behat contexts covering WordPress functionality 25 . 3
PRE-DEFINED STEPS Scenario: Viewing a single page Given I am viewing a post: | post_type | post_title | post_content | post_status | | page | My about page | About this site | publish | Then I should see "My about page" And I should see "About this site" 25 . 4