framework • Based on top of PHPUnit • Have modules that provide common steps for testing • Designed for Growth: PageObjects, Helpers, Extensions • BDD-ready with Gherkin
architecture allow us to write unit tests? • Are we following TDD or not? • Does it really stands for quality? • Does it makes a perfect User Experience? Questions to be Asked
We do great design No, we actually screwed it at some point Our unit tests proves everything done right “Register” button on site can’t be clicked TDD!!! DDD!!! BDD!!! Client is not going to pay for this Expectations vs Reality
refactoring to implement tests • Choose the testing level you are comfortable with • Don’t take too much time into testing. Create business value • Do slow but constant refactoring
use Docker for headless browsers • PhantomJS (headless browser) • Cloud Testing Service (SauceLabs, BrowserStack) ◦ HINT: make sure you use them in your region • Browser emulation via HTTP client
team • Optimize usage of application (REST API for data) • Suggest better locators ◦ HINT: add locator classes or data-attributes to HTML elements • Suggest better tools • Use the same language (PHP)
Scenario: When I create a post And I open a post And I edit a post Then I see it has changed Then I delete a post Feature: CRUD for Post Scenario: create a post Scenario: view post Scenario: edit a post Scenario: delete a post POST is created via API for each test which requires it One Post for everything :(
service nginx start > /dev/null 2>&1 service php5-fpm start > /dev/null 2>&1 service mysql start > /dev/null 2>&1 phantomjs --webdriver=4444 > /dev/null 2>&1 & mailcatcher -f > /dev/null 2>&1 & echo "Running tests" cd /project/$1 # switch to application codecept run $2 # run tests from specific suite
Funnels to see if users are following right direction • Use Exception Notification • Logging Services • Realtime Customer Support ◦ Learn how users are using your applications
via Google Analytics API • To place better tracking goals ◦ HINT: Track all valuable active elements in scenario • To detect bugs in technically perfect code
Pros and Cons of testing levels • Quality is not only Testing but UX and Monitoring too • Build a proper test infrastructure for your CI • Use proper data management strategy • Receive user feedback, write regressions tests • Constantly improving by refactoring! With tests you are secure to do this.