100% found this document useful (1 vote)
215 views14 pages

Test Framework For Air Canada

Adonis Celestine has over 10 years of experience in software testing. He will present on a test automation framework that uses Protractor, Cucumber, and Cucumber Sandwich. The framework allows for behavior driven development, automated acceptance testing, and faster development of high quality software. It generates HTML reports on test runs. Challenges include gaps in current processes, responsive design, and deciding what to test. Best practices include using page objects, Gherkin syntax, visual review, and accessibility testing.

Uploaded by

Sumit Jagota
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
215 views14 pages

Test Framework For Air Canada

Adonis Celestine has over 10 years of experience in software testing. He will present on a test automation framework that uses Protractor, Cucumber, and Cucumber Sandwich. The framework allows for behavior driven development, automated acceptance testing, and faster development of high quality software. It generates HTML reports on test runs. Challenges include gaps in current processes, responsive design, and deciding what to test. Best practices include using page objects, Gherkin syntax, visual review, and accessibility testing.

Uploaded by

Sumit Jagota
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Panacea

A TEST FRAMEWORK USING PROTRACTOR,


CUCUMBER & CUCUMBER SANDWICH

Adonis Celestine
ABOUT THE SPEAKER

Adonis Celestine

Adonis has more than 10 years of industry experience in Software Testing. He has good
expertise on Software Test automation and consultation.
Adonis is passionate about test innovations and making testing simpler and more interesting.
He has implemented this framework for multiple projects on a large scale and in this
presentation he shares the experience, best practices and challenges in using this framework.

email : [email protected] 0617468887 Adonis Celestine


THE TOOLS

CUCUMBER
Cucumber is a leading BDD tool which lets software development teams
describe how software should behave in a business readable domain
specific language.

PROTRACTOR
Protractor is an E2E test tool developed by google to test Angular
applications.

CUCUMBER SANDWICH
Cucumber Sandwich generates awesome html reports on the fly. It
monitors your Cucumber json report directory for changes & generates
the report.
WHY NEW FRAMEWORK

Gaps in the current process

Technology changes & responsive design

Something light and free

What are you testing

Test Reporting
BEHAVIOUR DRIVEN DEVELOPMENT

GIVEN– Some
preconditions

WHEN– an
BDD event occurs A programmers mind

Travel(“market”);
If(isPresent(“egg”)){
buyMilk(6);
} else {
THEN– you see buyMilk(1);
an outcome }

More Collaboration Automated Acceptance Tests Faster & High Quality


CUCUMBER & GHERKIN
Feature: Search on internet
@Regression @Smoke
Scenario Outline:Search keywords protractor & cucumber

Given I open the search <engine>


When I type <keyword>
And I click search
Then I see the search results Feature: Descriptive text of what is desired

Examples: Scenario Outline: Some determinable business situation

Given some precondition


|engine|keyword|
And some other precondition
|google|protractor| When some action by the actor
|google|angularjs| And some other action
|bing|protractor| Then some testable outcome is achieved
And something else we can check happens too

Examples:
Test Data

BDD IS TDD done right It’s the language the business understands
PROTRACTOR
BDD Test Reporting

The glue code

Browser Driver

System Under Test

Angular locators Multi browser capabilities E2E Test the whole chain
ng-binding, ng-
repeat, ng-
textarea, ng-model
, WaitForAngular
PROTRACTOR IN AN ANGULAR PAGE
The Feature file The Config file

Feature: Check the weather exports.config = {


@chain
Scenario Outline:Check the weather of Amsterdam specs: ['test/SystemTest/features/*.feature' ],
Given I open weather.com
When I type Amsterdam in the search box framework: 'cucumber',
And I click search
Then I must be able to see the weather <overview> cucumberOpts: {

Examples: require: ['features/step_definitions/*_steps.js',


'features/support/*.js'],
|overview| format: 'pretty'
|Today| },
|5 Day| capabilities: { browserName: 'firefox‘ }
|10 Day| };
|Weekend|
|Monthly|
The Spec file

this.When(/^I type Amsterdam in the search box$/, function (callback) {

browser.element(by.xpath(“(//input[@name=‘search’])”).sendKeys(“Amsterdam”).then(call
back);
}); Demo
PROTRACTOR IN A NON ANGULAR PAGE
browser.ignore
Acts like Synchronization
Selenium = true
browser.driver
Use a wait
instead of
function driver

More identifiers
Applications
Switches that will be
between migrated to
angular and angular in
non angular future
pages
Demo
PROTRACTOR ON MOBILE

Doesn’t support The Config file


Install android
native apps SDK capabilities:
{ browserName:
'chrome',
'appium-version':
Mobile Configure '1.0',
browsers Protractor platformName:
'Android',
platformVersion:
Appium '4.4.2‘
Install Appium , deviceName:
Selendroid 'Android
Emulator', }
CUCUMBER SANDWICH

Demo
CHALLENGES
THE BEST PRACTICES & TIPS

Using page objects

The Gherkin Syntax

Visual Review

Accessibility testing

Debugging

User stories in Jira


THANK YOU!
FOR YOUR ATTENTION

REFERENCES
https://angular.github.io/protractor/
https://cucumber.io/
https://www.linkedin.com/profile/view?id=AAMAAAbro_EBdKrNNLuUAOzF3KxGRpDkWydxp
uE&trk=hp-identity-name
http://testautomation.applitools.com/post/94994807787/protractor-vs-selenium-which-is-
easier

You might also like