Coder Social home page Coder Social logo

jasmine-reporter-for-zapi's Introduction

Protractor reporter for Zephyr's Cloud API (ZAPI) on JIRA cloud.

This is a reporter that can be hooked into your Jasmine tests, to auto update Zephyr test cases in Jira.

Step 1: Add to your protractor.conf.js file. Example

const ZapiReporter = require('protractor-zephyr-cloud-reporter-for-jira-cloud');

// 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': [
        './test/example.spec.js'
    ],
    'framework': 'jasmine2',
    'directConnect': true,
    'capabilities': {
        'name': 'Google Chrome',
        'browserName': 'chrome'
    },
    'onPrepare': function() {

        // first promise is to make sure the cycle is created before the tests start.
        onPrepareDefer = protractor.promise.defer();
        // second promise is to make sure everything is done before protractor
        // quits
        onCompleteDefer = protractor.promise.defer();

        // add the reporter
        try {
        jasmine.getEnv().addReporter(ZapiReporter(onPrepareDefer, onCompleteDefer, browser));
    }
    catch(err) {
        console.log(err)
    }

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

Step 2: Supply a ZAPI_ACCESS_KEY, ZAPI_SECRET_KEY, and ASSIGNEE via environment variables, and run your tests

ZAPI_ACCESS_KEY=XXXXX ZAPI_SECRET_KEY=YYYYYYY ASSIGNEE=bk protractor protractor.conf.js

Step 3: Annotate your specs with the JIRA key corresponding to the Zephyr test in JIRA

// If the following passes, a test execution for APPLY-2302 will be marked PASS.  Otherwise FAIL.  
describe('Suite: Search companies @APPLY-2302', function() {

    it("should return something @STEP-1", async() => {
        var foo = "bar"
        expect(foo).toEqual("bar")
    });

});

## Debugging 
pass DEBUG=true to enable verbose API calls to help with debugging 

jasmine-reporter-for-zapi's People

Contributors

boriskozak avatar

Stargazers

Ngoc Vu avatar

Watchers

 avatar James Cloos avatar Ngoc Vu avatar

jasmine-reporter-for-zapi's Issues

Is there any way to pass the projectID

I have been trying to integrate this, but having an issue to pass the projectID. is there a way to do it?

{"errorType":"ERROR","clientMessage":"Cannot parse parameter projectId as Long: For input string: \"\"","errorCode":151}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.