Skip to content

BDD Selenium Framework that integrates Cucumber.js with Nemo.js & SauceLabs Cloud. Parallel executions with pretty HTML reports

Notifications You must be signed in to change notification settings

gkushang/nemo-cucumberjs-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nemo Cucumber.js Selenium Framework

BDD Selenium Framework that integrates Cucumber.js with Nemo.js & SauceLabs Cloud, and Parallel executions

npm devDependencies Status Build Status Code Climate

Framework Features

  • Cucumber BDD Framework
  • Supports latest Selenium 3 & Cucumber 2
  • Pretty HTML reports with Pie-charts
  • Parallel Executions of Cucumber Scenarios and/or Features
  • Selenium Page Objects; auto initialized
  • Multi-browsers/platforms coverage with SauceLabs
  • Parallel MultiBrowsers executions, e.g. runs X number of scenarios on more than one browsers, all in parallel
  • Nemo, a PayPal's open source Selenium Framework
  • Grunt Tasks to run Smoke, P1 and/or Acceptance tests

Very simple to use

Install WebDrivers

$ brew install chromedriver geckodriver

Clone the repo & run acceptance tests

$ git clone https://github.com/gkushang/nemo-cucumberjs-framework

$ cd nemo-cucumberjs-framework

$ npm i

$ grunt acceptance          //will run a default scenario and launch HTML report

Options

BROWSER

Type: String Default: chrome


$ BROWSER=firefox grunt acceptance

Runs test(s) locally on the firefox browser.

SAUCE

Type: String

Runs tests on saucelabs.com, if account is specified in the config.json. SAUCE option reads severCaps from the sauce.json file.


$ SAUCE=firefox grunt acceptance

The browser version, platform and other info will be read from config/sauce.json file.

BUILD

Type: String

Passes the Build ID to the SauceLabs test. SauceLabs uses the BUILD ID to create the test dashboard.


$ BUILD=unique_regression_artifact_id SAUCE=firefox grunt acceptance

Creates a tests Dashboard on SauceLabs with unique $BUILD.

--parallel (Grunt option)

Type: String Values: ['scenarios', 'features']


$ SAUCE=firefox grunt acceptance --parallel=scenarios

Runs scenarios in parallel. To run features in parallel, pass --paralllel=features

--tags (Grunt option)

Type: String Values: any scenario or feature tag


$ grunt acceptance --tags=@anyTestTag

e.g. grunt acceptance --tags=@login will run scenario(s) tagged with @login

Supports all available Cucumber options, such as --dry-run etc.

Run

Locally

Default browser is chrome, to run on firefox or any other browser locally

    
    $ BROWSER=firefox grunt acceptance
    

SauceLabs

SauceLabs browsers are available at sauce.json. Pick any one browser combination and pass it as a SAUCE param. BUILD param will create a pretty dashboard on Sauce for your respective test run.

    
    $ SAUCE=iPhone BUILD="`date`" grunt acceptance
    

BROWSER param is to run tests locally, while SAUCE is to run on SauceLabs

Parallel

Run any any platform, SAUCE or BROWSER.

Parallel Scenarios

e.g. Below command will run your Scenarios in parallel on Chrome browser on SauceLabs.


    $ SAUCE=chrome grunt acceptance --parallel=scenarios 

Parallel Features

    $ SAUCE=chrome grunt acceptance --parallel=features 

Run Multiple Browsers in Parallel on SauceLabs

e.g. Run all your scenarios in parallel on Chrome, Firefox and ie10 browsers


    $ SAUCE=chrome,firefox,ie10 grunt acceptance --parallel=features
     

Run single Tag


    $ grunt acceptance --tags=@yourTag
    

Add new Cucumber Features

  1. Add new features under acceptance/features
  2. Add step definitions under acceptance/step_definitions

Setup SauceLabs

  • Add your SauceLabs Username and AccessKey at config.json
  • Update/Edit SauceLabs browsers & platform at sauce.json as per your need.

Wants to add to your existing repository

  1. Copy acceptance folder & _cucumberjs.js & clean.js tasks to your development repo
    $ cp -R <path-to-nemo-cucumberjs-framework>/acceptance <path-to-your-repo>/
    
    $ cp -R <path-to-nemo-cucumberjs-framework>/tasks/ <path-to-your-repo>/tasks
  1. Merge or copy gruntfile.js

  2. Merge package.json

    npm i cucumber cucumber-html-reporter cucumber-parallel  cucumber-replicate@0.0.2 debug faker fs-finder grunt grunt-cli grunt-config-dir grunt-cucumberjs grunt-force-task lodash nemo@latest nemo-pageobjects nemo-saucelabs nemo-view@latest --save-dev

You are all set!


HTML Report


Alt text


About

BDD Selenium Framework that integrates Cucumber.js with Nemo.js & SauceLabs Cloud. Parallel executions with pretty HTML reports

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published