0.1.9 • Published 5 years ago

wd-cucumber v0.1.9

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

webdriver-io-cucumber

Simple "ready for action" BDD solution based on webdriver-io and cucumber

Options for gulp task 'test':

  --version        Show version number                                 [boolean]
  --env, -e        Run tests on specified env with cread definded in
                   config/creds file                                  [required]
  --url, -u        Run tests on specified url, for default - base url for
                   specified environment
  --browser, -b    Run tests on specified browser, for default - Chrome
  --user, -l       Run tests on env with user login different from default for
                   this env
  --password, -p   Run tests on env with password different from default for
                   user specified in config/creds
  --tags, -t       Run scenarios with specified tags. If needs more than 1 tag,
                   it should be separated by commas
  --instances, -i  Run scenarios in parallel with specified number of browser
                   instances. For default: 1
  --help           Show help                                           [boolean]

Examples:

Run tests

    gulp test -e prd -i 4 -t "@smoke"

Create html report

    gulp report -e prd

If you need to test Angular app, add 'rootElement' into wdio.conf.js:

    rootElement: '<your_angular_root_element>'

Example of page object for Angular app

const AngularPage = require('wd-cucumber').AngularPage;

class Home extends AngularPage {
    constructor(selector = '.screen-fill-body', url = '/'){
        super(selector,url);
        this.defineComponent('Menu', new Menu());
        this.defineComponent('Packages', new Packages());
    }
}

Run tests in parallel with different credentials: 1. Start credential server (server example here) 2. Add credental manager functions in tests Get sessionId from createSessionId(<your_host:port>) Create user pool createUserPool(<your_host:port>, <your_env>, [{user: <user>, password: <password>}], sessionId)- before tests start (for example in wdio.config -> onPrepare()). Be aware, these functions are async! * Use lockUser()/unlockUser() for get and free user credential. For example:

            `browser.call(async () => credentials = await mg.lockUser('http://localhost:3002', <your_env_name>));`
* Delete user pool from server, after tests were done: `deleteUserPool(<your_host:port>, <your_env>, sessionId)`
0.1.9

5 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago