1. Introducing ThucydidesAutomated Acceptance Tests, Step by
stepJohn Ferguson SmartFriday, 9 March 12
2. So who is this guy, anyway? Consulta nt TrainerMentorAuthor
Speaker Coder John Ferguson Smar tFriday, 9 March 12
3. ATDDor Specication by exampleFriday, 9 March 12
4. ATDDor Specication by example The story of your appFriday, 9
March 12
5. Friday, 9 March 12
6. User stories As a job seeker I want to nd jobs in relevant
categories So that I can nd a suitable jobFriday, 9 March 12
7. User stories As a job seeker I want to nd jobs in relevant
categories So that I can nd a suitable job Features/EpicsFriday, 9
March 12
8. User stories As a job seeker I want to nd jobs in relevant
categories So that I can nd a suitable job Acceptance criteria The
job seeker can see available categories on the home page The job
seeker can look for jobs in a given category The job seeker can see
what category a job belongs toFriday, 9 March 12
9. User stories As a job seeker I want to nd jobs in relevant
categories So that I can nd a suitable job Acceptance criteria The
job seeker can see available categories on the home page The job
seeker can look for jobs in a given category The job seeker can see
what category a job belongs to scenario "A job seeker can see the
available job categories on the home page", { when "the job seeker
is looking for a job", then "the job seeker can see all the
available job categories" } Automated acceptance testFriday, 9
March 12
10. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories"
}Automated acceptance testFriday, 9 March 12
11. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories"
}Automated acceptance testImplemented development testsFriday, 9
March 12
12. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories"
}Automated acceptance testImplemented development tests Implemented
acceptance testsFriday, 9 March 12
13. Automated acceptance criteriaFriday, 9 March 12
14. Automated acceptance criteriaDene your goalsFriday, 9 March
12
15. Automated acceptance criteriaFriday, 9 March 12
16. Automated acceptance criteriakeep you on trackFriday, 9
March 12
17. Automated acceptance criteriaFriday, 9 March 12
18. Automated acceptance criteriaProvide better
visibilityFriday, 9 March 12
19. Automated acceptance criteriaFriday, 9 March 12
20. Automated acceptance criteriaAllow faster release
cyclesFriday, 9 March 12
21. Automated acceptance criteriaFriday, 9 March 12
22. Automated acceptance criteriaReduce RiskFriday, 9 March
12
23. Automated acceptance criteriaFriday, 9 March 12
24. Automated acceptance criteriaReduce CostsFriday, 9 March
12
25. Why should developers write web tests?Friday, 9 March
12
26. Why should developers write web tests?Shouldnt QA be doing
that?Friday, 9 March 12
27. Why only do QA at the end of the project?Friday, 9 March
12
28. Real quality cannot be injected at the endFriday, 9 March
12
29. Real quality cannot be injected at the end It must be part
of the processFriday, 9 March 12
30. Leave the boring stuff to the automated tests...Friday, 9
March 12
31. ...and empower your QA teamFriday, 9 March 12
32. ...and empower your QA team Let testers focus on more
intelligent testingFriday, 9 March 12
33. Acceptance Tests The high-level view So where are we
at?Friday, 9 March 12
34. Low level web testsWebDriver rocks! Focus on
implementationFriday, 9 March 12
35. How do we bridge the gap?Friday, 9 March 12
36. How do we bridge the gap? Test stepsFriday, 9 March 12
37. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories" }
AutomatedTest stepsFriday, 9 March 12
38. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories" }
Automated scenario "The user can see the available job categories
on the home page", { when "the job seeker is looking for a job",
{job_seeker.open_jobs_page() } then "the job seeker can see all the
available job categories", {job_seeker.should_see_job_categories
"Java Developers", "Groovy Developers" } }ImplementedTest
stepsFriday, 9 March 12
39. scenario "A job seeker can see the available job categories
on the home page", { when "the job seeker is looking for a job",
then "the job seeker can see all the available job categories" }
Automated scenario "The user can see the available job categories
on the home page", { when "the job seeker is looking for a job",
{job_seeker.open_jobs_page() } then "the job seeker can see all the
available job categories", {job_seeker.should_see_job_categories
"Java Developers", "Groovy Developers" } }
ImplementedJobSeekerStepsJobSeekerStepsJobSeekerStepsopen_jobs_page()
Test
stepsopen_jobs_page()open_jobs_page()should_see_job_categories(String...
categories)should_see_job_categories(String... categories)...
should_see_job_categories(String... categories)......Step
librariesFriday, 9 March 12
40. scenario "The user can see the available job categories on
the home page", { when "the job seeker is looking for a job",
{job_seeker.open_jobs_page() } then "the job seeker can see all the
available job categories", {job_seeker.should_see_job_categories
"Java Developers", "Groovy Developers" } }Implemented Tests
JobSeekerSteps JobSeekerSteps JobSeekerSteps open_jobs_page()
open_jobs_page() open_jobs_page()
should_see_job_categories(String... categories)
should_see_job_categories(String... categories) ...
should_see_job_categories(String... categories) ... ...Step
librariesTest stepsFriday, 9 March 12
41. scenario "The user can see the available job categories on
the home page", { when "the job seeker is looking for a job",
{job_seeker.open_jobs_page() } then "the job seeker can see all the
available job categories", {job_seeker.should_see_job_categories
"Java Developers", "Groovy Developers" } }Implemented Tests
JobSeekerSteps JobSeekerSteps JobSeekerSteps open_jobs_page()
open_jobs_page() open_jobs_page()
should_see_job_categories(String... categories)
should_see_job_categories(String... categories) ...
should_see_job_categories(String... categories) ... ...Step
librariesTest steps Page ObjectsFriday, 9 March 12
42. Test stepsFriday, 9 March 12
43. Test stepsFriday, 9 March 12
44. Test stepsFriday, 9 March 12
45. Test stepsFriday, 9 March 12
46. Test stepsFriday, 9 March 12
47. Test steps help organize your testsFriday, 9 March 12
48. Test stepsFriday, 9 March 12
49. Test steps are a communication toolFriday, 9 March 12
50. Test stepsFriday, 9 March 12
51. Test steps are reusable building blocksFriday, 9 March
12
52. Test stepsFriday, 9 March 12
53. Test stepshelp estimate progressFriday, 9 March 12
54. And so we built a tool...Friday, 9 March 12
55. Friday, 9 March 12
56. Webdriver/Selenium 2 extensionFriday, 9 March 12
57. Webdriver/Selenium 2 extensionOrganize tests, stories and
featuresFriday, 9 March 12
58. Webdriver/Selenium 2 extensionOrganize tests, stories and
features Record/report test executionFriday, 9 March 12
59. Webdriver/Selenium 2 extensionOrganize tests, stories and
features Record/report test execution Measure functional
coverageFriday, 9 March 12
60. Friday, 9 March 12
61. Thucydides in actionFriday, 9 March 12
62. Thucydides in action A simple demo appFriday, 9 March
12
63. Dening your acceptance testsscenario "Ajob seeker{ can see
the available j ob categori when "the j es on the h ob seeker i ome
page", then "the j s looking f ob seeker c o r a j o b ", } an see
allthe available job categories" scenario "The administrator adds a
new category to the system", { given "a new category needs to be
added to the system", when "the administrator adds a new category",
then "the system should confirm that the category has been
created", and "the new category should be visible to job seekers",
} scenario "The administrator deletes a ca{tegory from the system",
given "a category needs to be deleted", when "the administrator
deletes a catego then "the system will ry",confirm that the cate
and "the deleted category has been delete gory should no longer
d",} be visible to job se eker s",Friday, 9 March 12
64. Dening your acceptance testsscenario "Ajob seeker{ can see
the available j ob categori when "the j es on the h ob seeker i ome
page", then "the j s looking f ob seeker c o r a j o b ", } an see
allthe available job categories" scenario "The administrator adds a
new category to the system", { given "a new category needs to be
added to the system", when "the administrator adds a new category",
then "the system should confirm that the category has been
created", and "the new category should be visible to job seekers",
} scenario "The administrator deletes a ca{tegory from the system",
given "a category needs to be deleted", when "the administrator
deletes a catego then "the system will ry",confirm that the cate
and "the deleted category has been delete gory should no longer
d",} be visible to job se eker s",focus on business valueFriday, 9
March 12
65. Dening your acceptance testsscenario "Ajob seeker{ can see
the available j ob categori when "the j es on the h ob seeker i ome
page", then "the j s looking f ob seeker c o r a j o b ", } an see
allthe available job categories" scenario "The administrator adds a
new category to the system", { given "a new category needs to be
added to the system", when "the administrator adds a new category",
then "the system should confirm that the category has been
created", and "the new category should be visible to job seekers",
}{ scenario "The administrator deletes a ca tegory from the
system", ...dened in business terms given "a category needs to be
deleted", when "the administrator deletes a catego then "the system
will ry",confirm that the cate and "the deleted category has been
delete gory should no longer d",} be visible to job se eker
s",focus on business valueFriday, 9 March 12
66. Dening your acceptance testsscenario "Ajob seeker{ can see
the available j ob categori when "the j es on the h ob seeker i ome
page", then "the j s looking f ob seeker c o r a j o b ", } an see
allthe available job categories" High level requirements...
scenario "The administrator adds a new category to the system", {
given "a new category needs to be added to the system", when "the
administrator adds a new category", then "the system should confirm
that the category has been created", and "the new category should
be visible to job seekers", }{ scenario "The administrator deletes
a ca tegory from the system", ...dened in business terms given "a
category needs to be deleted", when "the administrator deletes a
catego then "the system will ry",confirm that the cate and "the
deleted category has been delete gory should no longer d",} be
visible to job se eker s",focus on business valueFriday, 9 March
12
67. Organizing your requirements public class Application {
@Feature public class ManageCompanies { public class AddNewCompany
{} public class DeleteCompany {} public class ListCompanies {} }
@Feature public class ManageCategories { public class
AddNewCategory {} public class ListCategories {} public class
DeleteCategory {} } @Feature public class BrowseJobs { public class
UserLookForJobs {} public class UserBrowsesJobTabs {} } }Friday, 9
March 12
68. Organizing your requirementsFeatures public class
Application { @Feature public class ManageCompanies { public class
AddNewCompany {} public class DeleteCompany {} public class
ListCompanies {} } @Feature public class ManageCategories { public
class AddNewCategory {} public class ListCategories {} public class
DeleteCategory {} } @Feature public class BrowseJobs { public class
UserLookForJobs {} public class UserBrowsesJobTabs {} } }Friday, 9
March 12
69. Organizing your requirementsFeatures public class
Application { @Feature public class ManageCompanies { public class
AddNewCompany {} public class DeleteCompany {} public class
ListCompanies {} } @Feature public class ManageCategories { public
class AddNewCategory {} public class ListCategories {} public class
DeleteCategory {} } @Feature Stories public class BrowseJobs {
public class UserLookForJobs {} public class UserBrowsesJobTabs {}
} }Friday, 9 March 12
70. Organizing your requirementsFeatures public class
Application { @Feature public class ManageCompanies { public class
AddNewCompany {} public class DeleteCompany {} public class
ListCompanies {} } @Feature public class ManageCategories { public
class AddNewCategory {} public class ListCategories {} public class
DeleteCategory {} } @Feature Stories public class BrowseJobs {
public class UserLookForJobs {} public class UserBrowsesJobTabs {}
} }Friday, 9 March 12
71. Implementing your acceptance testsusing
"thucydides"thucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryscenario "The
administrator adds a new category to the system",{ given "a new
category needs to be added to the
system",{administrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}
when "the administrator adds a new category",{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job
seekers",{job_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
72. Implementing your acceptance testsusing "thucydides" We are
testing this storythucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryscenario "The
administrator adds a new category to the system",{ given "a new
category needs to be added to the
system",{administrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}
when "the administrator adds a new category",{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job
seekers",{job_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
73. Implementing your acceptance testsusing "thucydides" We are
testing this storythucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryAn acceptance
criteriascenario "The administrator adds a new category to the
system",{ given "a new category needs to be added to the
system",{administrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}
when "the administrator adds a new category",{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job
seekers",{job_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
74. Implementing your acceptance testsusing "thucydides" We are
testing this storythucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryAn acceptance
criteriascenario "The administrator adds a new category to the
system",{ given "a new category needs to be added to the system",{
Narrative
styleadministrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}
when "the administrator adds a new category",{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job
seekers",{job_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
75. Implementing your acceptance testsusing "thucydides" We are
testing this storythucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryAn acceptance
criteriascenario "The administrator adds a new category to the
system",{ given "a new category needs to be added to the system",{
Narrative
styleadministrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}Step
through an when "the administrator adds a new category", example{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job
seekers",{job_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
76. Implementing your acceptance testsusing "thucydides" We are
testing this storythucydides.uses_steps_from
AdministratorStepsthucydides.uses_steps_from
JobSeekerStepsthucydides.tests_story AddNewCategoryAn acceptance
criteriascenario "The administrator adds a new category to the
system",{ given "a new category needs to be added to the system",{
Narrative
styleadministrator.logs_in_to_admin_page_if_first_time()administrator.opens_categories_list()}Step
through an when "the administrator adds a new category", example{
administrator.selects_add_category()
administrator.adds_new_category("Scala Developers","SCALA")}then
"the system should confirm that the category has been
created",{administrator.should_see_confirmation_message "The
Category has been created"}and "the new category should be visible
to job seekers",{Still
high-leveljob_seeker.opens_jobs_page()job_seeker.should_see_job_category
"Scala Developers"}}Friday, 9 March 12
77. Some folks prefer
JUnit...@RunWith(ThucydidesRunner.class)@Story(AddNewCategory.class)public
class AddCategoryStory {@Managedpublic WebDriver
webdriver;@ManagedPages(defaultUrl = "http://localhost:9000")public
Pages pages;@Stepspublic AdministratorSteps
administrator;@Stepspublic JobSeekerSteps job_seeker;@Testpublic
void administrator_adds_a_new_category_to_the_system()
{administrator.logs_in_to_admin_page_if_first_time();administrator.opens_categories_list();administrator.selects_add_category();administrator.adds_new_category("Java
Developers","JAVA");administrator.should_see_confirmation_message("The
Category has been created"); job_seeker.opens_job_page();
job_seeker.should_see_job_category("Java Developers");}@Pending
@Testpublic void
administrator_adds_an_existing_category_to_the_system() {}}Friday,
9 March 12
78. Some folks prefer
JUnit...@RunWith(ThucydidesRunner.class)@Story(AddNewCategory.class)
Thucydides handles thepublic class AddCategoryStory {web driver
instances@Managedpublic WebDriver
webdriver;@ManagedPages(defaultUrl = "http://localhost:9000")public
Pages pages;@Stepspublic AdministratorSteps
administrator;@Stepspublic JobSeekerSteps job_seeker;@Testpublic
void administrator_adds_a_new_category_to_the_system()
{administrator.logs_in_to_admin_page_if_first_time();administrator.opens_categories_list();administrator.selects_add_category();administrator.adds_new_category("Java
Developers","JAVA");administrator.should_see_confirmation_message("The
Category has been created"); job_seeker.opens_job_page();
job_seeker.should_see_job_category("Java Developers");}@Pending
@Testpublic void
administrator_adds_an_existing_category_to_the_system() {}}Friday,
9 March 12
79. Some folks prefer
JUnit...@RunWith(ThucydidesRunner.class)@Story(AddNewCategory.class)
Thucydides handles thepublic class AddCategoryStory {web driver
instances@Managedpublic WebDriver
webdriver;@ManagedPages(defaultUrl = "http://localhost:9000")public
Pages pages;@Stepspublic AdministratorSteps
administrator;@StepsUsing the same stepspublic JobSeekerSteps
job_seeker;@Testpublic void
administrator_adds_a_new_category_to_the_system()
{administrator.logs_in_to_admin_page_if_first_time();administrator.opens_categories_list();administrator.selects_add_category();administrator.adds_new_category("Java
Developers","JAVA");administrator.should_see_confirmation_message("The
Category has been created"); job_seeker.opens_job_page();
job_seeker.should_see_job_category("Java Developers");}@Pending
@Testpublic void
administrator_adds_an_existing_category_to_the_system() {}}Friday,
9 March 12
80. Some folks prefer
JUnit...@RunWith(ThucydidesRunner.class)@Story(AddNewCategory.class)
Thucydides handles thepublic class AddCategoryStory {web driver
instances@Managedpublic WebDriver
webdriver;@ManagedPages(defaultUrl = "http://localhost:9000")public
Pages pages;@Stepspublic AdministratorSteps
administrator;@StepsUsing the same stepspublic JobSeekerSteps
job_seeker;@Testpublic void
administrator_adds_a_new_category_to_the_system()
{administrator.logs_in_to_admin_page_if_first_time();administrator.opens_categories_list();administrator.selects_add_category();administrator.adds_new_category("Java
Developers","JAVA");administrator.should_see_confirmation_message("The
Category has been created"); job_seeker.opens_job_page();
job_seeker.should_see_job_category("Java Developers");} Tests can
be pending@Pending @Testpublic void
administrator_adds_an_existing_category_to_the_system() {}}Friday,
9 March 12
81. Dening your test stepspublic class AdministratorSteps
extends ScenarioSteps {@Steppublic void opens_categories_list()
{AdminHomePage page =
getPages().get(AdminHomePage.class);page.open();page.selectObjectType("Categories");}@Steppublic
void selects_add_category() {CategoriesPage categoriesPage =
getPages().get(CategoriesPage.class);categoriesPage.selectAddCategory();}@Steppublic
void adds_new_category(String label, String code) {EditCategoryPage
newCategoryPage =
getPages().get(EditCategoryPage.class);newCategoryPage.saveNewCategory(label,
code);}@Steppublic void should_see_confirmation_message(String
message) {AdminPage page =
getPages().get(AdminPage.class);page.shouldContainConfirmationMessage(message);}@Steppublic
void deletes_category(String name)
{opens_categories_list();displays_category_details_for(name);deletes_category();}}Friday,
9 March 12
82. Dening your test stepspublic class AdministratorSteps
extends ScenarioSteps {A step library@Steppublic void
opens_categories_list() {AdminHomePage page =
getPages().get(AdminHomePage.class);page.open();page.selectObjectType("Categories");}@Steppublic
void selects_add_category() {CategoriesPage categoriesPage =
getPages().get(CategoriesPage.class);categoriesPage.selectAddCategory();}@Steppublic
void adds_new_category(String label, String code) {EditCategoryPage
newCategoryPage =
getPages().get(EditCategoryPage.class);newCategoryPage.saveNewCategory(label,
code);}@Steppublic void should_see_confirmation_message(String
message) {AdminPage page =
getPages().get(AdminPage.class);page.shouldContainConfirmationMessage(message);}@Steppublic
void deletes_category(String name)
{opens_categories_list();displays_category_details_for(name);deletes_category();}}Friday,
9 March 12
83. Dening your test stepspublic class AdministratorSteps
extends ScenarioSteps {A step library@Steppublic void
opens_categories_list() {AdminHomePage page =
getPages().get(AdminHomePage.class);page.open();page.selectObjectType("Categories");}
High level steps...@Steppublic void selects_add_category()
{CategoriesPage categoriesPage =
getPages().get(CategoriesPage.class);categoriesPage.selectAddCategory();}@Steppublic
void adds_new_category(String label, String code) {EditCategoryPage
newCategoryPage =
getPages().get(EditCategoryPage.class);newCategoryPage.saveNewCategory(label,
code);}@Steppublic void should_see_confirmation_message(String
message) {AdminPage page =
getPages().get(AdminPage.class);page.shouldContainConfirmationMessage(message);}@Steppublic
void deletes_category(String name)
{opens_categories_list();displays_category_details_for(name);deletes_category();}}Friday,
9 March 12
84. Dening your test stepspublic class AdministratorSteps
extends ScenarioSteps {A step library@Steppublic void
opens_categories_list() {AdminHomePage page =
getPages().get(AdminHomePage.class);page.open();page.selectObjectType("Categories");}
High level steps...@Steppublic void selects_add_category()
{CategoriesPage categoriesPage =
getPages().get(CategoriesPage.class);categoriesPage.selectAddCategory();}@Steppublic
void adds_new_category(String label, String code) {EditCategoryPage
newCategoryPage =
getPages().get(EditCategoryPage.class);newCategoryPage.saveNewCategory(label,
code);} ...implemented@Steppublic void
should_see_confirmation_message(String message) {with Page
ObjectsAdminPage page =
getPages().get(AdminPage.class);page.shouldContainConfirmationMessage(message);}@Steppublic
void deletes_category(String name)
{opens_categories_list();displays_category_details_for(name);deletes_category();}}Friday,
9 March 12
85. Dening your test stepspublic class AdministratorSteps
extends ScenarioSteps {A step library@Steppublic void
opens_categories_list() {AdminHomePage page =
getPages().get(AdminHomePage.class);page.open();page.selectObjectType("Categories");}
High level steps...@Steppublic void selects_add_category()
{CategoriesPage categoriesPage =
getPages().get(CategoriesPage.class);categoriesPage.selectAddCategory();}@Steppublic
void adds_new_category(String label, String code) {EditCategoryPage
newCategoryPage =
getPages().get(EditCategoryPage.class);newCategoryPage.saveNewCategory(label,
code);} ...implemented@Steppublic void
should_see_confirmation_message(String message) {with Page
ObjectsAdminPage page =
getPages().get(AdminPage.class);page.shouldContainConfirmationMessage(message);}@Step
...or with other stepspublic void deletes_category(String name)
{opens_categories_list();displays_category_details_for(name);deletes_category();}}Friday,
9 March 12
86. Dening your page objectspublic class EditCategoryPage
extends PageObject {@FindBy(id="object_label")WebElement
label;@FindBy(id="object_code")WebElement
code;@FindBy(name="_save")WebElement saveButton;public
EditCategoryPage(WebDriver driver) {super(driver);}public void
saveNewCategory(String labelValue, String codeValue)
{typeInto(label, labelValue);typeInto(code,
codeValue);saveButton.click();}}Friday, 9 March 12
87. Dening your page objectspublic class EditCategoryPage
extends PageObject {@FindBy(id="object_label")WebElement label;
Provides some useful@FindBy(id="object_code")utility
methods...WebElement code;@FindBy(name="_save")WebElement
saveButton;public EditCategoryPage(WebDriver driver)
{super(driver);}public void saveNewCategory(String labelValue,
String codeValue) {typeInto(label, labelValue);typeInto(code,
codeValue);saveButton.click();}}Friday, 9 March 12
88. Dening your page objectspublic class EditCategoryPage
extends PageObject {@FindBy(id="object_label")WebElement label;
Provides some useful@FindBy(id="object_code")utility
methods...WebElement code;@FindBy(name="_save")WebElement
saveButton;public EditCategoryPage(WebDriver driver)
{super(driver);}public void saveNewCategory(String labelValue,
String codeValue) {typeInto(label, labelValue);typeInto(code,
codeValue);saveButton.click();}}but otherwise a normal WebDriver
Page ObjectFriday, 9 March 12
89. Then we run the tests...Friday, 9 March 12
90. Thucydides reportsFriday, 9 March 12
91. Thucydides reportsFriday, 9 March 12
92. Thucydides reports Browse the featuresFriday, 9 March
12
93. Browse the storiesFriday, 9 March 12
94. Browse the storiesFriday, 9 March 12
95. Browse the stories Browse the storiesFriday, 9 March
12
96. Browse the storiesFriday, 9 March 12
97. Browse the stories Browse the test scenariosFriday, 9 March
12
98. Browse the stories Browse the test scenariosFriday, 9 March
12
99. Illustrating the test paths A
testscenarioStepsTestscenariosFriday, 9 March 12
100. Friday, 9 March 12
101. Illustrating the test paths ScreenshotsFriday, 9 March
12
102. Functional coverage FeaturesFriday, 9 March 12
103. Functional coverageUser storiesFriday, 9 March 12
104. Functional coverageFriday, 9 March 12
105. Functional coverage Passing testsFriday, 9 March 12
106. Functional coverage Passing tests Failing testsFriday, 9
March 12
107. Functional coveragePassing tests Pending testsFailing
testsFriday, 9 March 12
108. Functional coverageFriday, 9 March 12
109. Functional coverage PlannedFriday, 9 March 12
110. Functional coveragePlanned DoneFriday, 9 March 12
111. Functional coveragePlanned Done BrokenFriday, 9 March
12
112. Functional coverage Test scenariosFriday, 9 March 12
113. Functional coverageFriday, 9 March 12
114. Thucydides in Action A simple real-world testFriday, 9
March 12
115. Thucydides in Action A simple real-world testFriday, 9
March 12
116. Thucydides in ActionFriday, 9 March 12
117. Thucydides in ActionFriday, 9 March 12
118. Thucydides in ActionGroovy shortcuts to obtaina page
objectFriday, 9 March 12
119. Thucydides in ActionGroovy shortcuts to obtaina page
objectFriday, 9 March 12
120. Thucydides in Action Groovy shortcuts to obtain a page
object A simple page objectFriday, 9 March 12
121. Thucydides in ActionFriday, 9 March 12
122. Thucydides in ActionFriday, 9 March 12
123. Thucydides in ActionFriday, 9 March 12
124. Thucydides in ActionDSL for HTML tablesFriday, 9 March
12
125. Thucydides in ActionFriday, 9 March 12
126. Thucydides in ActionStore eld values betweentest
stepsFriday, 9 March 12
127. Thucydides in ActionStore eld values betweentest
stepsFriday, 9 March 12
128. Thucydides in ActionStore eld values betweentest steps
...and use them laterFriday, 9 March 12
129. ReferencesFriday, 9 March 12
130. References github.com/thucydides-webtestsFriday, 9 March
12
131. References github.com/thucydides-webtests
thucydides-webtests.comFriday, 9 March 12
132. References github.com/thucydides-webtests
thucydides-webtests.comwakaleo.com/thucydidesFriday, 9 March
12
133. Introducing ThucydidesAutomated Acceptance Tests, Step by
step John Ferguson SmartEmail: [email protected] Web:
hEp://www.wakaleo.com TwiEer: wakaleoFriday, 9 March 12