Panacea A TEST FRAMEWORK USING PROTRACTOR CUCUMBER CUCUMBER
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 : adonis. sheeban@gmail. com 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 E 2 E 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 BDD WHEN– an event occurs THEN– you see an outcome More Collaboration A programmers mind Travel(“market”); If(is. Present(“egg”)){ buy. Milk(6); } else { buy. Milk(1); } Automated Acceptance Tests Faster & High Quality
CUCUMBER & GHERKIN Feature: Search on internet @Regression @Smoke Scenario Outline: Search keywords protractor & cucumber Given When And Then I open the search <engine> I type <keyword> I click search I see the search results Examples: |engine|keyword| |google|protractor| |google|angularjs| |bing|protractor| Feature: Descriptive text of what is desired Scenario Outline: Some determinable business situation Given some precondition And some other precondition When some action by the actor And some other action 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 Test Reporting BDD The glue code Browser Driver System Under Test Angular locators ng-binding, ngrepeat, ngtextarea, ng-model , Wait. For. Angular Multi browser capabilities E 2 E Test the whole chain
PROTRACTOR IN AN ANGULAR PAGE The Feature file The Config file Feature: Check the weather @chain Scenario Outline: Check the weather of Amsterdam Given I open weather. com When I type Amsterdam in the search box And I click search Then I must be able to see the weather <overview> exports. config = { Examples: |overview| |Today| |5 Day| |10 Day| |Weekend| |Monthly| specs: ['test/System. Test/features/*. feature' ], framework: 'cucumber', cucumber. Opts: { require: ['features/step_definitions/*_steps. js', 'features/support/*. js'], format: 'pretty' }, capabilities: { browser. Name: 'firefox‘ } }; The Spec file this. When(/^I type Amsterdam in the search box$/, function (callback) { browser. element(by. xpath(“(//input[@name=‘search’])”). send. Keys(“Amsterdam”). then(ca llback); }); Demo
PROTRACTOR IN A NON ANGULAR PAGE Acts like Selenium browser. ignore Synchronization = true Use a wait function browser. driver instead of driver More identifiers Switches between angular and non angular pages Applications that will be migrated to angular in future Demo
PROTRACTOR ON MOBILE Doesn’t support native apps Mobile browsers Appium Selendroid Install android SDK Configure Protractor Install Appium The Config file capabilities: { browser. Name: 'chrome', 'appium-version': '1. 0', platform. Name: 'Android', platform. Version: '4. 4. 2‘ , device. Name: 'Android Emulator', }
CUCUMBER SANDWICH Demo
CHALLENGES BDD is a mindset Huge learning curve Tools are new in the market Large Scenarios with multiple steps
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_EBd. Kr. NNLu. UAOz. F 3 Kx. GRp. Dk. Wydxp u. E&trk=hp-identity-name http: //testautomation. applitools. com/post/94994807787/protractor-vs-selenium-which-iseasier
- Slides: 14