[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

qase-tms/qase-cypress

THIS REPO IS DEPRECATED. IT WAS MOVED HERE


Qase TMS Cypress Reporter

License

Installation

npm install cypress-qase-reporter

Configuration

Reporter options (* - required):

  • *apiToken - Token for API access, you can find more information here
  • *projectCode - Code of your project (can be extracted from main page of your project: https://app.qase.io/project/DEMOTR - DEMOTR is project code here)
  • runId - Run ID from Qase TMS (also can be got from run URL)
  • logging [true/false] - Enabled debug logging from reporter or not

Example cypress.json config:

{
    "reporter": "cypress-qase-reporter",
    "reporterOptions": {
        "apiToken": "578e3b73a34f06e84eafea103cd44dc24253b2c5",
        "projectCode": "PRJCODE",
        "runId": 45,
        "logging": true
    }
}

You can check example configuration with multiple reporters in demo project

Supported ENV variables:

  • QASE_REPORT - You should pass this ENV if you want to use qase reporter
  • QASE_RUN_ID - Pass Run ID from ENV and override reporter options
  • QASE_RUN_NAME - Set custom Run name, when new run is created
  • QASE_RUN_DESCRIPTION - Set custom Run description, when new run is created

Using Reporter

If you want to decorate come test with Qase Case ID you could use qase function:

import { qase } from 'cypress-qase-reporter/dist/mocha';

describe('My First Test', () => {
    qase([1,2],
        it('Several ids', () => {
            expect(true).to.equal(true);
        })
    );
    qase(3,
        it('Correct test', () => {
            expect(true).to.equal(true);
        })
    );
    qase(4,
        it.skip('Skipped test', () => {
            expect(true).to.equal(true);
        })
    );
    qase(5,
        it('Failed test', () => {
            expect(true).to.equal(false);
        })
    );
});

Running Qase Reporter

To start cypress run with qase reporter run it like this:

QASE_REPORT=1 npx cypress run

Reporter in console