• Comportamento testLike() shouldIncreaseLikeCount() Given I am in the page “Home” And The like count is “2” And I haven't liked it before When I like the page Then I should see like count “3”
• Comportamento testLike() shouldIncreaseLikeCount() Given I am in the page “Home” And The like count is “2” And I haven't liked it before When I like the page Then I should see like count “3” Spec Estória
vim features/like.feature Feature: Like In order to express what I like As an user I need to be able to like pages Scenario: Like a single page Given I am in the page "Home" And The like count is "2" And I haven't liked it before When I like the page Then I should see like count "3" $ bin/behat Finalmente, Behat!
vim features/like.feature Feature: Like In order to express what I like As an user I need to be able to like pages Scenario: Like a single page Given I am in the page "Home" And The like count is "2" And I haven't liked it before When I like the page Then I should see like count "3" $ bin/behat Gherkin Finalmente, Behat!
vim features/like.feature Feature: Like In order to express what I like As an user I need to be able to like pages Scenario: Like a single page Given I am in the page "Home" And The like count is "2" And I haven't liked it before When I like the page Then I should see like count "3" $ bin/behat Gherkin Finalmente, Behat! Behat CLI
definitions for undefined steps with these snippets: /** * @Given /^I am in the page "([^"]*)"$/ */ public function iAmInThePage($arg1) { throw new PendingException(); } /** * @Given /^The like count is "([^"]*)"$/ */ public function theLikeCountIs($arg1); /** * @Given /^I haven\'t liked it before$/ */ public function iHavenTLikedItBefore(); /** * @When /^I like the page$/ */ public function iLikeThePage(); /*...*/
definitions for undefined steps with these snippets: /** * @Given /^I am in the page "([^"]*)"$/ */ public function iAmInThePage($arg1) { throw new PendingException(); } /** * @Given /^The like count is "([^"]*)"$/ */ public function theLikeCountIs($arg1); /** * @Given /^I haven\'t liked it before$/ */ public function iHavenTLikedItBefore(); /** * @When /^I like the page$/ */ public function iLikeThePage(); /*...*/ Contexto Pendente
= new User("alganet"); $this->page = new Page($name); } function theLikeCountIs($count) { $this->page->likeCount = $count; } function IHaventLikedItBefore() { if (isset($this->page->likes[$this->user->id])) unset($this->page->likes[$this->user->id]); } Contextos de BDD com Estórias
} function IShouldSeeLikeCount($number) { if ($number !== $this->page->likeCount) throw new Exception("Like count is in fact $number"); } Contextos de BDD com Estórias
} function IShouldSeeLikeCount($number) { if ($number !== $this->page->likeCount) throw new Exception("Like count is in fact $number"); } Contextos de BDD com Estórias PHP Puro
Like In order to express what I like As an user I need to be able to like pages Scenario: Like a single page Given I am in the page "Home" And The like count is "2" And I haven't liked it before When I like the page Then I should see like count "3" $ bin/behat
Like In order to express what I like As an user I need to be able to like pages Scenario: Like a single page Given I am in the page "Home" And The like count is "2" And I haven't liked it before When I like the page Then I should see like count "3" $ bin/behat Mesma feature
} function IShouldSeeLikeCount($number) { $pageLikeCount = $this->session ->getPage() ->find('css', '.likeCount') ->getText(); if ($number != $pageLikeCount); throw new Exception("Like count is in fact $number"); } Outro contexto, mesma estória
} function IShouldSeeLikeCount($number) { $pageLikeCount = $this->session ->getPage() ->find('css', '.likeCount') ->getText(); if ($number != $pageLikeCount); throw new Exception("Like count is in fact $number"); } Outro contexto, mesma estória Mink