Skip to content

Commit

Permalink
Merge pull request #444 from hvitis/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
n3r authored Sep 29, 2023
2 parents fa666f3 + f39ee8b commit 6dd0b2c
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions qase-cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,42 @@ npm install cypress-qase-reporter

## Example of usage

If you want to decorate come test with Qase Case ID you could use qase function:
In order to connect Qase tests with your automated JavaScript tests you need to pass your `testId` and the test itself to the `qase` function.
You can see example usage with [CypressJS](https://docs.qase.io/documentation/general/get-started-with-the-qase-platform/create-a-test-run#quick-test-case) tests:

```typescript
import { qase } from 'cypress-qase-reporter/dist/mocha';
const testId = 1

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

```
You can also pass testId to a list if the automated test corresponds to multiple of you test cases in Qase:
```typescript
import { qase } from 'cypress-qase-reporter/dist/mocha';

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

```
If you are going to use several specifications for execution and you have in config

If you are going to use several specifications for execution and you have in config

```bash
"runComplete": true
```
then it is necessary to additionally set in the project settings
then it is necessary to additionally set in the [project settings](https://docs.qase.io/documentation/general/get-started-with-the-qase-platform/create-a-project/project-settings) the following option:

```
Allow to add results for cases in closed runs.
```
Expand All @@ -68,11 +70,11 @@ https://app.qase.io/run/QASE_PROJECT_CODE

## Configuration

Reporter options (* - required):
Reporter options (__*__ - required):

- *`apiToken` - Token for API access, you can find more information
- `apiToken` __*__ - Token for API access, you can find more information
[here](https://developers.qase.io/#authentication)
- *`projectCode` - Code of your project (can be extracted from main
- `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)
Expand All @@ -83,12 +85,19 @@ Reporter options (* - required):
- `sendScreenshot` [true/false] - Permission to send screenshots to Qase TMS
- `runComplete` [true/false] - Permission for automatic completion of the test run

#### You can check example configuration with multiple reporters in [demo project (cypress v10)](examples_cypress_v10/cypress.config.js) and [demo project (cypress v6)](examples_cypress_v6/cypress.json).
#### Example

Configuration with multiple reporters:
[demo project (cypress v10)](examples_cypress_v10/cypress.config.js)
and
[demo project (cypress v6)](examples_cypress_v6/cypress.json).

## Environment

Supported ENV variables:

- `QASE_REPORT` - You **should** pass this ENV if you want to use
qase reporter
- `QASE_REPORT` __*__ - You **should** pass 1 to 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
Expand Down

0 comments on commit 6dd0b2c

Please sign in to comment.