Upload
josh-cypher
View
178
Download
0
Embed Size (px)
Citation preview
Jumpstarting Selenium Testing in Your OrganizationJosh Cypher - Quality Automation Engineering Lead
November 2016
QUALITY AS PART OF THE DELIVERY PROCESS
• Test at each development stage • Unit test ALL THE THINGS• Identify boundaries between services • Test for behavior, not just function • Keep Exploring
Cucumber WHAT
+ BDD Framework for writing plain-english statements and mapping them to test code
+ Built around Given, When & Then statements that make up the Gherkin syntax
+ Features describe Value propositions
+ Scenarios evaluate Expectations
WHO + Business People
WHY + Produces Contextual Errors + Describes Customer Intentions
Selenium WHAT
+ Tool for automating web application testing by sending commands to Native Browser API's
+ Self-contained Library that is Framework-Agnostic + Supports Multiple Browsers, Proxies, & Devices
WHY + Provide a Friendly API to help write and maintain
tests + Bring Modularity & Realism to the testing
experience
HOW + Sends actionable commands to the browser and
returns data used for making assertions via the JSON Wire Protocol
Cucumber...SALAD + Cucumber draws relationships between
Gherkin Statements & Step Definitions + Test code Lives in the step definitions at it's
highest level
REGEX SUPPORT + Cucumber supports parameterization
through Regular Expressions + We can leverage regex to create a few very
Abstract step definitions that power many variations of tests
The Page Object Pattern + CSS selectors can often change in test code, Breaking all of our automation + We place these selectors and functions in domain-specific page objects that are
shared across the Global Scope
+ We can instantiate page objects as needed for efficiency
ANOTHER LEVEL OF ABSTRACTION + The page objects become the API that interacts with the user interface + One change to a single selector is fixed in One Place
+ Pages can Inherit, Extend, or work in Isolation of one another
NPM Install your-test-library
HOW + Wrap all your page objects, test data, utility classes, etc in a Publishable Package
+ Treat this code like Production code
+ Push updates to the library when the front-end changes.
+ Document and treat this like any public-facing API
WHY + Test with Whatever, Wherever + Have a single source of truth for ALL your testing needs. + Get developers involved in the process
Surgeon General's Warning:
-Using PhantomJS for UI Testing Accomplishes nothing and Can lead to Flaky Results / CANCER
WILL IT BLEND?
PUTTING IT ALL TOGETHER + We test specifics from the Gherkin layer + Step definitions support multiple parameters by
leveraging regex + Page Objects are instantiated one at a time
through dependency injection + Assertions are only made at the Step definition
level + Page objects live a completely decoupled
"testing library"
THANKS FOR LISTENING! LET’S DISCUSS.
github.com/dcypherthis@joshuacypher
Examples AUT - https://guitar-practice-app.herokuapp.com/
https://github.com/dcypherthis/gtr-test-xray https://github.com/dcypherthis/gtr-test-cucumberhttps://github.com/dcypherthis/gtr-test-mocha-bdd