Chernivtsi
Цель: Люди узнали,                                  что перед ними не фейк,Whoami                                  а челов...
BDT on PHP
в марте 2006 годаIntroduced by              Dan North       http://dannorth.net/introducing-bdd/
Test method names should be         sentences
BDD provides a“ubiquitous language”     for analysis
Business Story
Business Story
Business Story   I want casino with      blackjack & ...
In order to have fun            As User    I push “Green” buttonThen I get casino with blackjack              & ...
Gherkin SyntaxIn order to [some profit]As a [user_role]I need [some_functional]
Gherkin SyntaxFeature:In order to [some profit]As a [user_role]I need [some_functional]                           Scenario:...
Your native language    en           jp    fr           da    es           en-pirate    it           ...
Specifications should run
RSpec      JSpec     BehatCucumber   JBehave   Fabulous
RSpec      JSpec     BehatCucumber   JBehave   Fabulous
Inspired by Cucumber  Snippet examples     Symfony 2
Features  OutputEvents & Tags
# features/ls.featureFeature: ls  In order to see the directory structure  As a UNIX user  I need to be able to list the c...
# features/context/FeatureContext.php<?phpuse BehatBehatContextBehatContext;class FeatureContext extends BehatContext {   ...
What about web?
Minkhttp://mink.behat.org
Drivers     Headless   Browser                  Sahi      Goutte                Selenium/      Zombie                WebDr...
Page Objects Pattern$page = $this->getSession()->getPage();$element = $page->find(‘xpath’, ‘locator’);$element->click();
# features/context/FeatureContext.php<?phpuse BehatMinkContextMinkContext;class FeatureContext extends MinkContext {    /*...
One more thing
It is not a silver bullet
chitectural        re arO ne mo          levelNeed dictionaryRequir      e extre   isolatio   me            n
hitectural  ne more arcO         levelNeed dictionaryRequir      e extre   isolatio   me            n
Цель показать, что                           языковые конструкции                           имеют одинаковое              ...
Цель показать, что                                   языковые конструкции                                   имеют одинаков...
Regexp hell (?:[a-z0-9!#$%&*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&*+/=? ^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d- x7f]|...
hitectural   ne more arc O          level Need dictionaryRequi      re extr              eme   isolatio            n
Steps to Reproduce Scenario: clicking on Edit button leads to customer edit page Given I am at "BECustomerList" page When ...
What we learnt?
What we learnt?      Behavior      Feature                 Gherkin  Dan North                           Acceptance        ...
BDT on PHPOleksii Zozulenkoozozulenko@gmail.comautomated-testing.infodarktesting.blogspot.com
BDT on PHP
BDT on PHP
BDT on PHP
BDT on PHP
BDT on PHP
Upcoming SlideShare
Loading in …5
×

BDT on PHP

821 views
744 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
821
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • BDT on PHP

    1. 1. Chernivtsi
    2. 2. Цель: Люди узнали, что перед ними не фейк,Whoami а человек с опытом QA Team Lead !oacher automated-testing.info 5+ years of experience
    3. 3. BDT on PHP
    4. 4. в марте 2006 годаIntroduced by Dan North http://dannorth.net/introducing-bdd/
    5. 5. Test method names should be sentences
    6. 6. BDD provides a“ubiquitous language” for analysis
    7. 7. Business Story
    8. 8. Business Story
    9. 9. Business Story I want casino with blackjack & ...
    10. 10. In order to have fun As User I push “Green” buttonThen I get casino with blackjack & ...
    11. 11. Gherkin SyntaxIn order to [some profit]As a [user_role]I need [some_functional]
    12. 12. Gherkin SyntaxFeature:In order to [some profit]As a [user_role]I need [some_functional] Scenario: As user I should... Given [incomes] When [action] Then [result]
    13. 13. Your native language en jp fr da es en-pirate it ...
    14. 14. Specifications should run
    15. 15. RSpec JSpec BehatCucumber JBehave Fabulous
    16. 16. RSpec JSpec BehatCucumber JBehave Fabulous
    17. 17. Inspired by Cucumber Snippet examples Symfony 2
    18. 18. Features OutputEvents & Tags
    19. 19. # features/ls.featureFeature: ls In order to see the directory structure As a UNIX user I need to be able to list the currentdirectorys contents @ls @fe @tag2 Scenario: List 2 files in a directory Given I am in a directory "test" And I have a file named "foo" And I have a file named "bar" When I run "ls" Then I should get: """ bar foo """
    20. 20. # features/context/FeatureContext.php<?phpuse BehatBehatContextBehatContext;class FeatureContext extends BehatContext { /** * @Given /^I run "([^"]*)"$/ */ public function iRun($command) { exec($command); } //....}
    21. 21. What about web?
    22. 22. Minkhttp://mink.behat.org
    23. 23. Drivers Headless Browser Sahi Goutte Selenium/ Zombie WebDriver
    24. 24. Page Objects Pattern$page = $this->getSession()->getPage();$element = $page->find(‘xpath’, ‘locator’);$element->click();
    25. 25. # features/context/FeatureContext.php<?phpuse BehatMinkContextMinkContext;class FeatureContext extends MinkContext { /** * @Given /^I am "([^"]*)" user$/ */ public function iAmUser($username) { $this->getSession()->getPage()- >find(‘xpath’, ‘#username’)- >setValue($username); }}
    26. 26. One more thing
    27. 27. It is not a silver bullet
    28. 28. chitectural re arO ne mo levelNeed dictionaryRequir e extre isolatio me n
    29. 29. hitectural ne more arcO levelNeed dictionaryRequir e extre isolatio me n
    30. 30. Цель показать, что языковые конструкции имеют одинаковое занчение, но пишутся по разномуI am customer I fill in “smth”I am user I fill into “smth”
    31. 31. Цель показать, что языковые конструкции имеют одинаковое занчение, но пишутся по разномуI am customer I fill in “smth”I am user I fill into “smth” /^I am ?(user|customer)$/ /^I fill ?(in|into) "([^"]*)"$/
    32. 32. Regexp hell (?:[a-z0-9!#$%&*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&*+/=? ^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d- x7f]|[x01-x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a- z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?: 25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4] [0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[x01- x08x0bx0cx0e-x1fx21-x5ax53-x7f]|[x01-x09x0bx0cx0e- x7f])+)])
    33. 33. hitectural ne more arc O level Need dictionaryRequi re extr eme isolatio n
    34. 34. Steps to Reproduce Scenario: clicking on Edit button leads to customer edit page Given I am at "BECustomerList" page When I click on "Edit" for "user@example.com" Then I should get "BECustomerEdit" page of"user@example.com" Actual: http://test.serv/admin/newsletters.php Expected: http://test.serv/admin/customers/1507/ Failed asserting that <boolean:false> is true.
    35. 35. What we learnt?
    36. 36. What we learnt? Behavior Feature Gherkin Dan North Acceptance Behat/Mink
    37. 37. BDT on PHPOleksii Zozulenkoozozulenko@gmail.comautomated-testing.infodarktesting.blogspot.com

    ×