0.2.0 • Published 5 years ago

agent-js-nightwatch v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

agent-js-nightwatch

Agent for integration NightwatchJS with ReportPortal.

How to use

  1. Install the agent in your project:
    npm install --save-dev agent-js-nightwatch
  2. Create rp.json file with reportportal configuration:

    {
        // client settings
        "token": "00000000-0000-0000-0000-000000000000",
        "endpoint": "https://your.reportportal.server/api/v1",
        "project": "YourReportPortalProjectName",
        "launch": "YourLauncherName",
        // agent settings
        "agentOptions": {
            "launchParams": {
                "attributes": [
                    {
                        "key": "YourKey",
                        "value": "YourValue"
                    },
                    {
                        "value": "YourValue"
                    }
                ],
                "description": "Your launch description",
                "rerun": true,
                "rerunOf": "00000000-0000-0000-0000-000000000000"
            }
        }
    }

    Where

    • rerun - to enable rerun
    • rerunOf - UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name
  3. Create reporter.js file with code like:

    const NightwatchAgent = require('agent-js-nightwatch');
    const config = require('./rp.json');
    const agent = new NightwatchAgent(config);
    
    module.exports = {
        write : (results, options, done) => {
          return agent.startReporting(results, done);
        }
    };
  4. Create the nightwatch.json configuration file.

  5. Run your tests with --config and --reporter options specified:

nightwatch --config ./nightwatch.json --reporter ./reporter.js

Example

To run example:

npm run example:{exampleName}
0.2.0

5 years ago