npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

protractor-xray-reporter

v1.0.6

Published

Xray reporter for Jasmin and Protractor

Downloads

18

Readme

npm version

Generates X-Ray for Jira test executions for protractor tests.

How to use

  • Install protractor-xray-reporter with npm
npm install --save-dev protractor-xray-reporter
  • Update your protractor.conf.js file
const XrayReporter = require('protractor-xray-reporter');

// Jasmine does not support promises for reporters, but protractor does for
// onPrepare and onComplete. We can use that to make the reporter async as
// well. Generate two promises on onPrepare and add them as arguments to the
// reporter.
let onPrepareDefer;
let onCompleteDefer;

exports.config = {
    'specs': [
        'example_spec.js'
    ],
    'framework': 'jasmine2',
    'directConnect': true,
    'capabilities': {
        // the name is what the test set will be called. Default is 'no name'
        'name': 'Google Chrome',
        'browserName': 'chrome'
    },
    'onPrepare': function() {

        // first promise is to make sure we get the test set name before the tests start.
        onPrepareDefer = protractor.promise.defer();
        // second promise is to make sure everything is done before protractor
        // quits
        onCompleteDefer = protractor.promise.defer();

        const options = {
            'screenshot': 'fail',
            'version': '1.0',
            'jiraUser': 'XXX',
            'jiraPassword': 'XXX',
            'xrayUrl': 'https://jira.com/rest/raven/1.0/import/execution'
        };

        // add the reporter
        jasmine.getEnv().addReporter(XrayReporter(options, onPrepareDefer, onCompleteDefer, browser));

        // return the promises for onPrepare..
        return onPrepareDefer.promise;
    },
    'onComplete': function() {
        // ..and onComplete
        return onCompleteDefer.promise;
    }
};

Options

  • screenshot

protractor-xray-reporter can attach screenshots to test executions. Default is fail

  • never Never attach screenshots
  • fail only attach screenshots if the test failed
  • always always attach screenshots

protractor-xray-reporter can work with wswebcreation/protractor-image-comparison. If you have protractor-image-comparison configured, the comparison images will also be uploaded.

  • version

You can attach a version to the execution. The version has to exist before it is used, currently this reporter does not create versions.

  • jiraUser (required)
  • jiraPassword (required)
  • xrayUrl (required)

This is your Xray api url

Test Setup

A test set is represented by a describe block. The test set ID has to be added at the end of the description with an @ symbol.

A test step is represented by an it block.

If you want to use image comparison, the tag has to be added to the name of the test step with an @ symbol. You can use any tag you like, as long as it is unique and has no spaces.

describe('test set description @ABC-1', function() {

    it('should do something', function() {
        expect(2).toEqual(2);
    });

    it('should do something else @123', function() {
        expect(3).toEqual(3);
        expect(browser.params.imageComparison.checkElement((element), '123')).toBeLessThan(3.5);
    });

});

References

Xray API documentation

http://confluence.xpand-addons.com/pages/viewpage.action?pageId=19695422