and delete albums Scenario: The homepage loads Given I am on the homepage Then I should see text matching "My Album" tests/behat/features/bootstrap/album.feature
edit and delete albums Scenario: The homepage loads Given I am on the homepage Then I should see text matching "My Album” Scenario: Page does not exist Given I … Then I … tests/behat/features/bootstrap/album.feature
create, edit and delete albums Scenario: The homepage loads Given I am on the homepage Then I should see text matching “My Album” Scenario: Page does not exist Given I … Then I … Scenario: I can create an album Given I am on the homepage And I follow … tests/behat/features/bootstrap/album.feature
following definitions: And /^(?:|I )follow "(?P<link>(?:[^"]|\\")*)"$/ And /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/ And /^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/
albums Scenario: The homepage loads Given I am on the homepage Then I should see text matching "My Album" Scenario: Page does not exist Given I am on "/notexist" Then I should see text matching "Page not found" Scenario: Can create an album Given I am on the homepage And I follow "Add new album" And I fill in "artist" with "Queen" And I fill in "title" with “A kind of magic" And I press "Add" Then I should see text matching "A kind of magic" And I should be on the homepage Scenario: Can edit an album Given I am on the homepage And I follow "Edit" And I fill in "artist" with “Billy Joel" And I fill in "title" with “An Innocent Man" And I press "Save" Then I should see text matching “An Innocent Man" And I should be on the homepage tests/behat/features/bootstrap/album.feature
undefined) 25 steps (18 passed, 1 undefined, 6 skipped) 0m0.28s (14.25Mb) --- FeatureContext has missing steps. Define them with these snippets: /** * @Given I am on the add page */ public function iAmOnTheAddPage() { throw new PendingException(); } terminal
am on the add page And I fill in "artist" with "test123" And I fill in "title" with "test321" And I press "Add" Then I should see text matching "test123" And I should be on the homepage tests/behat/features/bootstrap/FeatureContext.php
to edit album by title :title */ public function iGoToEditAlbumByTitle($title) { $page = $this->getMink()->getSession()->getPage(); $editLink = $page->find(…); $this->visit($editLink); } tests/behat/features/bootstrap/FeatureContext.php
to edit album by title :title */ public function iGoToEditAlbumByTitle($title) { $page = $this->getMink()->getSession()->getPage(); $editLink = $page->find( 'css', sprintf('table tr td:contains("%s")', $title) ) ->getParent() ->findLink('Edit') ->getAttribute('href'); $this->visit($editLink); } tests/behat/features/bootstrap/FeatureContext.php
create, edit and delete albums Scenario: Can create an album Given I am on the homepage And I follow "Add new album" And I fill in "artist" with "Queen" And I fill in "title" with “A kind of magic" And I press "Add" Then I should see text matching "A kind of magic" And I should be on the homepage @db Scenario: Can edit an album Given I am on the homepage And I follow "Edit" And I fill in "artist" with “Billy Joel" And I fill in "title" with “An Innocent Man" And I press "Save" Then I should see text matching “An Innocent Man" And I should be on the homepage tests/behat/features/bootstrap/album.feature
delete albums Scenario: Can create an album Given I am on the homepage And I follow "Add new album" And I fill in "artist" with "Queen" And I fill in "title" with “A kind of magic" And I press "Add" Then I should see text matching "A kind of magic" And I should be on the homepage @defaultAlbumFixture Scenario: Can edit an album Given I am on the homepage And I follow "Edit" And I fill in "artist" with “Billy Joel" And I fill in "title" with “An Innocent Man" And I press "Save" Then I should see text matching “An Innocent Man" And I should be on the homepage tests/behat/features/bootstrap/album.feature