Mais conteúdo relacionado Semelhante a Automated UI testing done right (DDDSydney) (20) Automated UI testing done right (DDDSydney)2. Mehdi Khalili
Senior Developer at Readify
Active Open Source Projects:
• BDDfy
• Seleno
• Humanizer
Blog: www.mehdi-khalili.com
Twitter: @MehdiKhalili
3. These practices are performed by
professional developers and testers.
Please DO try this at home
Authorized and written by Mehdi Khalili
8. Selenium
http://seleniumhq.org/projects/webdriver/
PM> Install-Package Selenium.WebDriver
9. BDDfy
A simple BDD framework to use and extend!
BDDfy turns your traditional unit tests
into BDD behaviours
11. Seleno
helps you write
Automated UI Tests
the RIGHT way!
13. samples are from Seleno
codebase and can be found at
https://github.com/TestStack/TestStack.Seleno
14. In a nutshell
• UI Testing: a likely failure
• From horrid to awesome in three steps
• A few tips (time permitting)
• Q&A
18. a lot of teams
have a “great start” at
UI Testing
19. a lot of teams
then struggle with
UI Testing
20. a lot of teams
then fail at
UI Testing
22. because UI Tests are
hard to maintain
24. but
you can
mitigate
these issues
34. a quick look
at the sample
https://github.com/TestStack/TestStack.Seleno
41. a link on the page
becomes a
method on the
Page Object
42. clicking a link on the page
turns into calling a method
on the Page Object
44. textbox
a
on the page becomes a
string property
on the Page Object
45. filling a textbox on the
page turns into setting a
string property on the
Page Object
50. … and you will get another
Page Object as the return
value of the method
54. step 2:
Page
Components
Compose your Page Objects of
smaller pieces
84. use a BDD framework
to implement your
acceptance criteria
85. use a BDD framework
to turn your tests into
living documentation
87. use the
test results
as a
progress report
88. use the
test results
as a support for
manual testing
101. do
NOT
be fuzzy
with your selectors
102. do
NOT
rely on the structure
of your page
103. do
NOT
rely on the
surrounding elements
107. be explicit:
add id on your
elements to
support your tests
122. ISomePage
A/B testing
PCPage iPadPage
pages
123. … and use one
test script for all
page variations
125. do
NOT
create a
Page Object
until you need it
126. do
NOT
add an action to
Page Object
until you need it
127. do
NOT
add a property to
Page Object
until you need it
128. do
NOT
add a getter to
your property
until you need it
131. fix
the broken test right
when it breaks
139. when Done Right it is
well worth it
141. time for a few Qs
&
hopefully few As
Blog: www.mehdi-khalili.com
Twitter: @MehdiKhalili
http://www.mehdi-khalili.com/presentations/automated-ui-testing-done-right-at-dddsydney
143. Please complete your feedback
forms, and return them to the
registration desk for a chance
to win a
Nokia Lumia
Notas do Editor The framework is called BDDfy because it BDDfies (as in turns into BDD) your otherwise traditional unit tests The framework is called BDDfy because it BDDfies (as in turns into BDD) your otherwise traditional unit tests Some code here + demoWhy it is different from the previous approachBut changing a name still breaks the tests Show a demo of a change on an id that breaks a test Show a demo of a change on an id that breaks a test Showing the demo with Page<T>Showing the differenceShowing that changing a property name gives compile time error UI Tests are no different Add a photo of an element being targetted