CodeceptJS E2E Framework with Cucumber and Saucelabs cloud
This framework contains Gherkin BDD Tests with CodeceptJS & uses Should.JS assertion library. Intgrated with Saucelabs to run on Multibrowsers in Parallel
-
Why BDD? Read my Medium post here
-
Run All feature files in Parallel
-
Run All feature files on Multi-Browsers - run them all in Parallel
-
Scenarios are written in Cucumber Gherkin BDD Syntax, a.k.a
.feature
files. Prefer writing Declartive Test Scenarios -
Run on SauceLabs. Single browser or Multi-Browsers in Parallel
-
Uses Should.js Assertions Library. Various assertions with examples are available here
-
Reduces Flakiness with RetryFailedSteps plugin and a Webdriver's SmartWait
-
Page objects follow
<name_of_page>.page.js
naming pattern, and created under pages directory -
Step Definitions files follows
<name_of_step>.steps.js
naming pattern, and created under step_definitions directory -
Soft Assertions: Collect more errors in a single run rather than failing test at first failure!
This framework comes with the Interactive CLI which will setup the entire framework in one-go.
Follow the below steps to launch CLI, and follow the CLI instructions. CLI also runs the Sample Github tests to test your setup (this step is optional)
Yarn is required. Install Yarn
git clone https://github.com/gkushang/codeceptjs-e2e.git
cd codeceptjs-e2e/packages/codeceptjs-cucumber
yarn
npm run cli
CodeceptJS E2E Framework with Cucumber and Saucelabs Integration
- Interactive CLI to get started
- Run Cucumber Scenarios on local browsers or chrome:headless
- Run all the Feature files in Parallel
- Run tests on Sauce Labs
- Single Browser
- Multi Browsers. Runs all the Feature files in Parallel on Multibrowsers
- Soft Assertions: Collect more errors in a single run rather than failing test at first failure!
- Launch HTML report
To get started, follow the instructions on codeceptjs-cucumber
CodeceptJs Integration with Saucelabs. Ease of Configuration!
- Easy to run tests on Saucelabs with command
yarn acceptance --profile sauce:chrome
- Easy to run tests on Multibrowsers / Cross-Browsers. All tests in Parallel with command
yarn acceptance:multibrowsers --profile sauce:chrome,ie,safari
To get started, follow the instructions on codeceptjs-saucelabs
Shared Master Configurations & Helpers
To get started, follow the instructions on codeceptjs-shared
Codecpetjs-e2e packed into the container with Node and Java.
Codecpetjs-e2e Docker makes it very simple to build your CI Job.
To run your Codecptjs-e2e tests on Saucelabs thru Jenkins, add below stage to your Jenkinsfile:
stage('CodeceptJS Acceptance') {
sh "docker run --env SAUCE_KEY --env SAUCE_USERNAME -v ${env.WORKSPACE}/:/acceptance --rm gkushang/codeceptjs-e2e --debug --profile sauce:${browser}"
}
- If you tests uses any enviornment variables, pass to the Docker image thru
--env
param as shown above - Select browser on Saucelabs thru
${browser}
environment variable - Mount your workspace to the Docker container with
-v
param as shown above.