ThucydidesA quick reviewCristian CoțoiApr 2013
•Pronunciation•Introduction•BDD/TDD/ATDD•Setting up the project (Maven)•Writing code (Junit, Jbehave)•Running tests (Eclip...
IN YOUR ZONEThucydides3•Prounciation• thUU-sih-dih-dees•What is Thucydides• Webdriver• JBehave/EasyB
IN YOUR ZONEBehavior Driven Development4What is BDD…Stories & ScenariosAs a [X]I want [Y]So that [Z]
IN YOUR ZONEATDD vs TDD5•Tests are focused on business rule orbehavior.•Written by the team.•For the whole team•They are r...
IN YOUR ZONEBDD Stories & Scenarios6Story• Title: Customer pays billsthrough internet banking• As a customer,• I want to p...
IN YOUR ZONESetting up the project7JDK• At least 5IDE• EclipseMaven• Sonatype repository• mvn archetype:generate
IN YOUR ZONEWriting stuff8Features •@FeatureJBehave•Stories•ScenariosMid level•Junit tests•Mapped to Jbehave linesLow leve...
IN YOUR ZONERunning tests - Eclipse9• Extend ThucydidesJUnitStories• Refine with• findStoriesIn• findStoriesCalled• Run/De...
IN YOUR ZONERunning tests - Maven10• 1. If the project is clean, first run• mvn test thucydides:archetype• Any other norma...
IN YOUR ZONELive demo11Theory Practice
IN YOUR ZONEStep 0 – Define feature(s)12• Define the feature to be tested, so it willappear in the reports.
IN YOUR ZONEStep 1 – Define Story13• Create the .story file• Write the story• Write scenarios
IN YOUR ZONEStep 2 – Story Steps14• First line matches a step used in the previous tests.
IN YOUR ZONEStep 2 – Story Steps15WhenThen
IN YOUR ZONEStep 3 – Low level – user operations16
IN YOUR ZONEStep 3 – Low level – PageObject17
IN YOUR ZONEQuiz Time18•Get the title of all the posts on page•Assert all titles contain keyword•Assert titles not contain...
IN YOUR ZONESolution19
IN YOUR ZONEQuestions20Cristian Coțoi| Senior Testerthank you
Upcoming SlideShare
Loading in …5
×

Thucydides - a brief review

1,176 views

Published on

A review for Thucydides automation framework. Includes a section for a tests organization suggestion and a practical example.

Published in: Technology, Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,176
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • HelloDisclaimer
  • Summary
  • Thucydides is a tool that lets you use WebDriver-based unit or BDD tests to write more flexible and more reusable WebDriver-based tests, and also to generate documentation about your acceptance tests, including a narrative description of test, along with the corresponding screen shots, and also high-level summaries and aggregations of the test results.Jbehave & Easybsunt 2 formate de scriere a story-urilor agile, cel din urmă fiind bazat pe groovy.Am lucrat cuacest framework pentru câtevasăpt și am căutat inițial funcționalități pentru testarea cross-browser-testing.
  • BDD a evoluat din practicile agile și a fost conceput pentru a le face mai accesibile și eficiente pentru echipele de dezvoltare.Principalul beneficiu este capacitatea de a scrie testele într-un limbaj accesibil tuturor membrilor echipei.X reprezintă o persoană, Y reprezintă o funcționalitate iar Z reprezintă un beneficiu obținut prin implementarea funcționalității. Această abordare are capacitatea de a defini valoarea unei funcționalități încă înainte de a fi implementată. Dacă nu este astfel definită atunci există riscul de a implementa o funcționalitate de tipul „pentru-că-așa-vrea-clientul”. Aici este momentul în care unele cerințe „mistice” sunt filtrate corespunzător.Momentan există 2 abordări care sunt o „implementare” a BDD: ATDD & TDD.
  • Ca un studiu de cazam avea un story pentru achitarea facturilor prin internet banking.Iar un scenariu `happy flow` ar fi…
  • Before attempting to create a new project, you need to update settings.xml and include the Sonatype OSS Maven repository (http://oss.sonatype.org/). Releases can be obtained from the release repository (https://oss.sonatype.org/content/repositories/releases/). Snapshot releases are available on the Sonatype OSS Snapshot repository (https://oss.sonatype.org/content/repositories/snapshot/).
  • Cum este structurat un proiect:FeaturesAjută în rapoarte prin asocierea testelor cu funcționalitățiledeSunt doar clase goale care reprezintă funcționalitățile aplicațieiJBehaveStoriesScenariosKeyword-urile sunt bazate pe conceptul BDD (Given, When, Then, And etc.)MidlevelJunittests conectate la scenarii folosind anotații (@Given, @When, @Then etc.)Se pot folosi expresii regulate, tabele, data-driven-testsLowlevelPageObjectFicare pagină are User (steps) class
  • Running tests with maven has the advantage of generating reports.
  • We will be testing the wordpress application for some basic functionalities.
  • Motivul pentru care acesta este pas nu pare să fie integrabil cu JBehave, ci doar cu testele story-urile scrise în easyB sau JUnit.
  • Thucydides - a brief review

    1. 1. ThucydidesA quick reviewCristian CoțoiApr 2013
    2. 2. •Pronunciation•Introduction•BDD/TDD/ATDD•Setting up the project (Maven)•Writing code (Junit, Jbehave)•Running tests (Eclipse, Maven)•Live demo
    3. 3. IN YOUR ZONEThucydides3•Prounciation• thUU-sih-dih-dees•What is Thucydides• Webdriver• JBehave/EasyB
    4. 4. IN YOUR ZONEBehavior Driven Development4What is BDD…Stories & ScenariosAs a [X]I want [Y]So that [Z]
    5. 5. IN YOUR ZONEATDD vs TDD5•Tests are focused on business rule orbehavior.•Written by the team.•For the whole team•They are run frequently by the team.•New tests fail until story is done. Oldertests should all pass.•Tests are focused on technical aspects ofthe application.•Written by developers•...for developers•They are run frequently by the team.•All tests pass 100% before commit andintegration.ATDD TDDIn both cases tests are written before the solution code.They look similar but are not replacements for each other.
    6. 6. IN YOUR ZONEBDD Stories & Scenarios6Story• Title: Customer pays billsthrough internet banking• As a customer,• I want to pay bills throughinternet banking,• So that I don’t have to make atrip to each supplier.Scenario 1• Scenario 1: There is enoughcredit• Given the account is in credit• And the user is properlyauthenticated• When the customer attempts tomake a payment to a supplier• And he inputs the correct billdetails• Then ensure the transaction isrecorded• And ensure the amount ofmoney is debited
    7. 7. IN YOUR ZONESetting up the project7JDK• At least 5IDE• EclipseMaven• Sonatype repository• mvn archetype:generate
    8. 8. IN YOUR ZONEWriting stuff8Features •@FeatureJBehave•Stories•ScenariosMid level•Junit tests•Mapped to Jbehave linesLow level•PageObject•Every page has a corresponding PageObject class.•Get & set for the page•No assertions•User (steps) class•Emulates the user.•Performs assertions
    9. 9. IN YOUR ZONERunning tests - Eclipse9• Extend ThucydidesJUnitStories• Refine with• findStoriesIn• findStoriesCalled• Run/Debug
    10. 10. IN YOUR ZONERunning tests - Maven10• 1. If the project is clean, first run• mvn test thucydides:archetype• Any other normal test run• mvn integration-test thucydides:archetype• Only this one will run the tests and generate a report for that
    11. 11. IN YOUR ZONELive demo11Theory Practice
    12. 12. IN YOUR ZONEStep 0 – Define feature(s)12• Define the feature to be tested, so it willappear in the reports.
    13. 13. IN YOUR ZONEStep 1 – Define Story13• Create the .story file• Write the story• Write scenarios
    14. 14. IN YOUR ZONEStep 2 – Story Steps14• First line matches a step used in the previous tests.
    15. 15. IN YOUR ZONEStep 2 – Story Steps15WhenThen
    16. 16. IN YOUR ZONEStep 3 – Low level – user operations16
    17. 17. IN YOUR ZONEStep 3 – Low level – PageObject17
    18. 18. IN YOUR ZONEQuiz Time18•Get the title of all the posts on page•Assert all titles contain keyword•Assert titles not containing keyword are not displayed
    19. 19. IN YOUR ZONESolution19
    20. 20. IN YOUR ZONEQuestions20Cristian Coțoi| Senior Testerthank you

    ×