Test Framework for Acne Selenium+Sahi

Embed Size (px)

Citation preview

Recommendation of a Strategy

Automation Testing Framework for Acne

Ibuildings

Selenium(PHPUnit) and Sahi

Overview

Core technologies

Automated Testing Framework

Selenium+SAHI framework

Introducing Pageness & data-driven tests

Continuous Integration with Jenkins for Sahi and Selenium

Demo

Q/A

Core Technologies

PHP

Test::PHPUnit

Testing Tools:-Selenium-Sahi

CI : Jenkins, Ant

Future : Behat or PHPSpec

QA Automation Goals

Automate everything, early

Long term, maintainable tests

Balance between regression Vs Smoke test suite

Selenium Grid

BDD approaches

Advance collaborative Test reporting

Phases of test automation

Phase1 : Rec/Playback, no looping,no conditions, no config, no abstraction.

Phase2: data-driven, array, parameters, looping.

Phase3: Modular, libraries, Abstraction, UI maps, config files, global properties.

Phase4: keyword driven, ODBC functions, spreadsheets.

Phase5: Oops, everything is in object. CI, multiple types of test.Dev contributes in test suite and integrate with CI

Test Framework

Core Vs Test Framework

Test Suite: tests, env,app,test group

Test configuration: URLs, username, passwords, machine configs

Test properties

Test Data Repository: XML, JSON, XLS, CVS

Parameterized Test

UI Mapping

Test Components

Test Scripts,

Test Reports, Logs

Benefits: Abstraction, multiple types of testing like unit, integration, load, generic test Api, test configuration, multithreading, CI

Fundamental Problems

Hardcoded locators

Performance

Frequently changing requirements

Combination of manual and automated testing

Selenium didn't work with dynamic locator

Geographically diverse team

Lack of effective JIRA workflows

Slow Xpath on IE with Selenium

Solutions

Pages removed hassle of hardcoded locators

Test readability become better due to pages

Sahi resolved performance and dynamic locators issue and wait.

Introducing QA in planning and estimation for better acceptance tests.

Collaborative method working among tester-developer-customers

Page-Objects

Acne has separate pages defined with global locator and method defined in abstract class

Pages like registration, home, login, category, product, checkout, payment etc

Page-ness cause tests more readable

Page-ness hides details by abstraction of classes

Page-Example

SampleTest using Page Object

Sample Smoke Test :Selenium

Sample Url Check: Selenium

Sample Sahi Test

Sahi Checkout Test

CI with Jenkins

We use Jenkins to run our unit as well as functionality test

Smoke tests run regularly give cross-browser feedback of basic functionality quickly.

Sanity tests gives feedback narrow regression within 5 min after deployment.

Overnight test suite run most of data-driven cross-browser tests.

Sahi tests executed much quicker than selenium tests

Integrated Sahi and Selenium with jenkins

Sahi build gives feedback within 3 minutes covering all basic functionality. We need that always green.

Example CI

Agile Testing

Agile testing best practices

Defined Definition of Done

Collaborative acceptance tests allow everyone in team to add more tests

Automated build and CI

QA in planning and estimation

Well defined JIRA workflows which gives multiples eyes before releasing product

Team understand Testing

Everyone contribute in documentation.

Significant automation and continuous feedback

Living documentation on relish https://www.relishapp.com/sjagtap/acne

How Test framework fits in Acne

Test framework with Regression and Sanity test suite.

Configuration on different browsers

Introduction of page object model

CI with Jenkins for Sahi and Selenium

Used power of PHPUnit than selenium

Combination of Selenium and Sahi

Agile Test documentation

Looking forward

We are looking forward to implement behat for BDD'ing Acne.

We have most of the features written in Gherkins already

We already have Sahi framework which support behat for launching browser.

Behat may not be alternative to unit and regression tests but it will streamline test process.

Demo

Any Suggestions?

Q & A

Thank You !!