Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.
/ cogE2E Public archive

Cognifide default setup for Puppeteer and Protractor tests.

License

Notifications You must be signed in to change notification settings

wttech/cogE2E

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E2E config

Default setup for Puppeteer and Protractor tests.

Installation

$ npm install coge2e --global

Usage

$ coge2e init

Running this command will init setup and allow to select which configuration should be added.

Protractor setup

Running the tests

To run test with default configuration:

npm run test

There are two ways to run Protractor tests on specific environment: one way is to add another parameter --params.env [env_name]. List of available environment you an find in /data/env.json. The second way, easiest, is to run specific npm script: by default, configuration comes with 4 environments:

  • local - default environment which is tested when npm run test is executed
  • dev
  • staging
  • prod

In order to run tests on, for example, on prod environment simply run npm run test:prod

npm run test --params.env staging
/* or */
npm run test:staging

Real life example:

npm run test
    --suite homepage
    --exclude tests/analytics/homepage.js
    --params.env prod

/* or */

npm run test:prod
    --suite homepage
    --exclude tests/analytics/homepage.js

How to write Protractor tests

Puppeteer & Jest setup

Running the tests

Similar to Protractor config, default configuration comes with 4 default environments:

  • local - default environment which is tested when npm run test is executed
  • dev
  • staging
  • prod

Tests can be run on specific environment by running scripts like npm run test:prod. The only difference is that it's not possible to pass arguments like --params.env prod to the script, so trying to run npm run test --params.env prod will result in error. The only acceptable arguments are those that are available for Jest CLI options.

How to write Puppeteer tests

License

MIT

About

Cognifide default setup for Puppeteer and Protractor tests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •