#ATAGTR2017
16th 17th March
Protractor BDD Approach
L&T InfoTech
Agile Testing Alliance Global Testing Retreat 2017
What is ?
Agile Testing Alliance Global Testing Retreat 2017
Why?
Agile Testing Alliance Global Testing Retreat 2017
Agile Testing Alliance Global Testing Retreat 2017
Protractor and BDD
Protractor is an open source, end to end testing framework designed
specifically for AngularJS web applications.
Protractor it is a solution integrator - combining powerful BDD frameworks
such as …
Agile Testing Alliance Global Testing Retreat 2017
How we will do it…
1 2 3 4 5 6
Create Automation
Suite with Protractor,
Cucumber and Gulp.
Create feature files from:
 User Stories / Use Cases
 Defect Steps
 Test Cases/Scenarios
Run the feature files and
create stubs [A stub is a
small program that
substitutes for a longer
program]
Create the executable
code with Protractor and
attach it to the feature
statements
Once the code is attached
to the feature
statements, we can
execute the same code
for same repeating
feature statements
We can select the features
that we want to execute
[existing applications+ Past
defects] and easily create
different runner files on
need basis and execute
the automation suite
Agile Testing Alliance Global Testing Retreat 2017
Approach for Protractor Cucumber
IDEA Define
FEATURE FILES
(.features)
STEP DEFINITION
(.js)
User Stories / Use Cases
PAGE OBJECT
(.js)
Static
TEST DATA
UTILITY FUNCTIONS
(.js)
CORE FUNCTIONS
(.js)
Dynamic
TEST DATA -
Json
ATOM EDITOR/ NOTEPAD-PLUS
Runner
(.js)
QA team/Disney team
Acceptance/
Report
Web driverJs
Application under test
Agile Testing Alliance Global Testing Retreat 2017
Agile Testing Alliance Global Testing Retreat 2017
Advantages of using Protractor and
Cucumber
 Feature statement written multiple times, will have a single
corresponding code attached.
 Write script once and Run on need basis.
 Records time to execute hence also tells us if performance has
improved/degraded from previous run results.
 Test results history with compare functionality.
 Can be auto triggered when Developers are using Code build in
Jenkins.
 Freeware hence saving project Budget.
 Automation scripts can be reused.
Agile Testing Alliance Global Testing Retreat 2017
Learning Outcomes
 Audience will be aware of protractor cucumber end to end
automation testing frameworks.
 Automation testing framework for AngularJs Applications.
 Easy and reliable object identification for AngularJs Application.
 Scripts are faster in execution.
Agile Testing Alliance Global Testing Retreat 2017
Best Practices
 Set screen size so that all the elements are visible.
 Page objects should be used to map the elements and write the functions
to perform actions.
 Simple, Clean and tidy folder structure. Exports and require should be used
to connect your specs and page objects.
 SVN/GitHub can be used as a version control.
Agile Testing Alliance Global Testing Retreat 2017
Agile Testing Alliance Global Testing Retreat 2017

ATAGTR2017 Protractor Cucumber BDD Approach

  • 1.
    #ATAGTR2017 16th 17th March ProtractorBDD Approach L&T InfoTech
  • 2.
    Agile Testing AllianceGlobal Testing Retreat 2017 What is ?
  • 3.
    Agile Testing AllianceGlobal Testing Retreat 2017 Why?
  • 4.
    Agile Testing AllianceGlobal Testing Retreat 2017
  • 5.
    Agile Testing AllianceGlobal Testing Retreat 2017 Protractor and BDD Protractor is an open source, end to end testing framework designed specifically for AngularJS web applications. Protractor it is a solution integrator - combining powerful BDD frameworks such as …
  • 6.
    Agile Testing AllianceGlobal Testing Retreat 2017 How we will do it… 1 2 3 4 5 6 Create Automation Suite with Protractor, Cucumber and Gulp. Create feature files from:  User Stories / Use Cases  Defect Steps  Test Cases/Scenarios Run the feature files and create stubs [A stub is a small program that substitutes for a longer program] Create the executable code with Protractor and attach it to the feature statements Once the code is attached to the feature statements, we can execute the same code for same repeating feature statements We can select the features that we want to execute [existing applications+ Past defects] and easily create different runner files on need basis and execute the automation suite
  • 7.
    Agile Testing AllianceGlobal Testing Retreat 2017 Approach for Protractor Cucumber IDEA Define FEATURE FILES (.features) STEP DEFINITION (.js) User Stories / Use Cases PAGE OBJECT (.js) Static TEST DATA UTILITY FUNCTIONS (.js) CORE FUNCTIONS (.js) Dynamic TEST DATA - Json ATOM EDITOR/ NOTEPAD-PLUS Runner (.js) QA team/Disney team Acceptance/ Report Web driverJs Application under test
  • 8.
    Agile Testing AllianceGlobal Testing Retreat 2017
  • 9.
    Agile Testing AllianceGlobal Testing Retreat 2017 Advantages of using Protractor and Cucumber  Feature statement written multiple times, will have a single corresponding code attached.  Write script once and Run on need basis.  Records time to execute hence also tells us if performance has improved/degraded from previous run results.  Test results history with compare functionality.  Can be auto triggered when Developers are using Code build in Jenkins.  Freeware hence saving project Budget.  Automation scripts can be reused.
  • 10.
    Agile Testing AllianceGlobal Testing Retreat 2017 Learning Outcomes  Audience will be aware of protractor cucumber end to end automation testing frameworks.  Automation testing framework for AngularJs Applications.  Easy and reliable object identification for AngularJs Application.  Scripts are faster in execution.
  • 11.
    Agile Testing AllianceGlobal Testing Retreat 2017 Best Practices  Set screen size so that all the elements are visible.  Page objects should be used to map the elements and write the functions to perform actions.  Simple, Clean and tidy folder structure. Exports and require should be used to connect your specs and page objects.  SVN/GitHub can be used as a version control.
  • 12.
    Agile Testing AllianceGlobal Testing Retreat 2017
  • 13.
    Agile Testing AllianceGlobal Testing Retreat 2017

Editor's Notes

  • #3 AngularJS (commonly referred to as "Angular" or "Angular.js") is a complete JavaScript-based open-source front-end web application  mainly maintained by Google to address many of the challenges encountered in developing single-page applications. AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag. AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions
  • #4 Protractor is an end-to-end test framework for Angular and AngularJS applications. It acts as an abstraction layer to make automation write and execute easily for Angular.js application.
  • #5 Angular JS applications have some extra HTML attributes like ng-repeater, ng-controller, ng-model.., etc. which are not included in Selenium locators. Selenium is not able to identify those web elements using Selenium code. So, Protractor on the top of Selenium can handle and controls those attributes in Web Applications. The protractor is an end to end testing framework for Angular JS based applications. While most frameworks focus on conducting unit tests for Angular JS applications, Protractor focuses on testing the actual functionality of an application.
  • #6 Jasmine is a behavior-driven development framework for testing JavaScript code. It is default framework that comes with Protractor. Cucumber is for Behaviour-Driven Development and uses gherkin . Mocha is a JavaScript test framework running on node.js, featuring browser support, asynchronous testing, test coverage reports, and use of any assertion library.