1.3.1 • Published 8 months ago

jest-qase-reporter v1.3.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

Qase TMS Jest reporter

Publish results simple and easy.

How to integrate

npm install jest-qase-reporter

Using Reporter

The Jest reporter has the ability to auto-generate test cases and suites from your test data.

But if necessary, you can independently register the ID of already existing test cases from TMS before the executing tests. For example:

import { qase } from 'jest-qase-reporter/jest';

describe('My First Test', () => {
    test(qase([1,2], 'Several ids'), () => {
        expect(true).toBe(true);
    })

    test(qase(3, 'Correct test'), () => {
        expect(true).toBe(true);
    })

    test.skip(qase("4", 'Skipped test'), () => {
        expect(true).toBe(true);
    })

    test(qase(["5", "6"], 'Failed test'), () => {
        expect(true).toBe(false);
    })
});

To run tests and create a test run, execute the command (for example from folder examples):

QASE_MODE=testops npx jest

or

npm test

A test run will be performed and available at:

https://app.qase.io/run/QASE_PROJECT_CODE

Configuration

Reporter options (* - required):

  • mode - testops/off Enables reporter, default - off
  • debug - Enables debug logging, defaule - false
  • environment - To execute with the sending of the envinroment information
  • *testops.api.token - Token for API access, you can find more information here
  • *testops.project - Code of your project (can be extracted from main page of your project: https://app.qase.io/project/DEMOTR - DEMOTR is project code here)
  • testops.run.id - Pass Run ID
  • testops.run.title - Set custom Run name, when new run is created
  • testops.run.description - Set custom Run description, when new run is created
  • testops.run.complete - Whether the run should be completed

Example jest.config.js config:

module.exports = {
  reporters: [
    'default',
    [
      'jest-qase-reporter',
      {
        debug: true,
        environment: 1,
        testops: {
          api: {
            token: 'api_key'
          },
          project: 'project_code',
          run: {
            id: 45,
            complete: true,
          },
        },
      },
    ],
  ],
  ...
};

You can check example configuration with multiple reporters in example project.

Supported ENV variables:

  • QASE_MODE - Same as mode
  • QASE_DEBUG - Same as debug
  • QASE_ENVIRONMENT - Same as environment
  • QASE_TESTOPS_API_TOKEN - Same as testops.api.token
  • QASE_TESTOPS_PROJECT - Same as testops.project
  • QASE_TESTOPS_RUN_ID - Pass Run ID from ENV and override reporter option testops.run.id
  • QASE_TESTOPS_RUN_TITLE - Same as testops.run.title
  • QASE_TESTOPS_RUN_DESCRIPTION - Same as testops.run.description

Requirements

We maintain the reporter on LTS versions of Node. You can find the current versions by following the link

jest >= 28.0.0

2.0.0-beta.1

8 months ago

2.0.0-beta.0

8 months ago

1.3.1

9 months ago

1.3.0-alpha.0

2 years ago

1.3.0-alpha.2

2 years ago

1.3.0-alpha.1

2 years ago

1.3.0-alpha.4

2 years ago

1.3.0-alpha.3

2 years ago

1.2.3

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago