Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/qase cypress 2.2.0 #697

Merged
merged 12 commits into from
Oct 24, 2024
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 33 additions & 14 deletions qase-cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,12 @@ Publish results simple and easy.

## Installation

To install the latest release version (2.0.x), run:
To install the latest release version (2.2.x), run:

```sh
npm install -D cypress-qase-reporter
```

<!-- if there's no current beta, comment the next block
-->

To install the latest beta version (2.1.x), run:

```sh
npm install -D cypress-qase-reporter@beta
```

## Updating from v1 to v2.1

To update an existing test project using Qase reporter from version 1 to version 2.1,
Expand All @@ -30,7 +21,7 @@ run the following steps:
- import { qase } from 'cypress-qase-reporter/dist/mocha'
+ import { qase } from 'cypress-qase-reporter/mocha'
```

2. Update reporter configuration in `cypress.config.js` and/or environment variables —
see the [configuration reference](#configuration) below.

Expand Down Expand Up @@ -68,6 +59,23 @@ run the following steps:
...
```

## Updating from v2.1 to v2.2

To update an existing test project using Qase reporter from version 2.1 to version 2.2,
run the following steps:

1. Add a metadata in the `e2e` section of `cypress.config.js`

```diff
...
e2e: {
setupNodeEvents(on, config) {
require('cypress-qase-reporter/plugin')(on, config)
+ require('cypress-qase-reporter/metadata')(on)
}
}
...

## Getting started

The Cypress reporter can auto-generate test cases
Expand All @@ -80,6 +88,17 @@ from Qase.io before executing tests. It's a more reliable way to bind
autotests to test cases, that persists when you rename, move, or
parameterize your tests.

### Metadata

- `qase.title` - set the title of the test case
- `qase.fields` - set the fields of the test case
- `qase.suite` - set the suite of the test case
- `qase.comment` - set the comment of the test case
- `qase.parameters` - set the parameters of the test case
- `qase.groupParameters` - set the group parameters of the test case
- `qase.ignore` - ignore the test case in Qase. The test will be executed, but the results will not be sent to Qase.
- `qase.step` - create a step in the test case

For example:

```typescript
Expand All @@ -88,6 +107,7 @@ import { qase } from 'cypress-qase-reporter/mocha';
describe('My First Test', () => {
qase(1,
it('Several ids', () => {
qase.title('My title');
expect(true).to.equal(true);
})
);
Expand Down Expand Up @@ -145,8 +165,6 @@ Example `cypress.config.js` config:
```js
import cypress from 'cypress';

import plugins from './cypress/plugins/index.js';

module.exports = cypress.defineConfig({
reporter: 'cypress-multi-reporters',
reporterOptions: {
Expand Down Expand Up @@ -180,7 +198,8 @@ module.exports = cypress.defineConfig({
video: false,
e2e: {
setupNodeEvents(on, config) {
return plugins(on, config);
require('cypress-qase-reporter/plugin')(on, config)
require('cypress-qase-reporter/metadata')(on)
},
},
});
Expand Down
74 changes: 71 additions & 3 deletions qase-cypress/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
# [email protected]

## What's new

Minor release of the Cypress reporter package

# [email protected]

## What's new

Added the ability to add attachments to tests or steps:

- `qase.attach` - add an attachment to test or step

```ts
it('test', () => {
qase.attach({ paths: '/path/to/file' });
qase.step('Step 1', () => {
cy.visit('https://example.com');
qase.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' });
});
});
```

# [email protected]

## What's new

Added the ability to add steps in tests:

- `qase.step` - add a step to the test

```ts
it('test', () => {
qase.step('Step 1', () => {
cy.visit('https://example.com');
});
});
```

# [email protected]

## What's new

Added the ability to specify a test metadata in tests:

- `qase.title` - set the test title
- `qase.fields` - set the test fields
- `qase.suite` - set the test suite
- `qase.comment` - set the test comment
- `qase.parameters` - set the test parameters
- `qase.groupParameters` - set the test group parameters
- `qase.ignore` - ignore the test in Qase

```ts
it('test', () => {
qase.title('Title');
qase.fields({ field: 'value' });
qase.suite('Suite');
qase.comment('Comment');
qase.parameters({ param: 'value' });
qase.groupParameters({ param: 'value' });
qase.ignore();

cy.visit('https://example.com');
});
```

# [email protected]

## What's new
Expand Down Expand Up @@ -40,8 +108,8 @@ The reporter will wait for all results to be sent to Qase and will not block the

## What's new

1. Cypress kills the process after the last tests.
The reporter will wait for all results to be sent to Qase and will not block the process after sending.
1. Cypress kills the process after the last tests.
The reporter will wait for all results to be sent to Qase and will not block the process after sending.

2. The reporter will collect suites and add them to results.

Expand All @@ -66,7 +134,7 @@ For more information about the new features and a guide for migration from v1, r

# [email protected]

Fixed an issue with multiple test runs created when Cypress is running
Fixed an issue with multiple test runs created when Cypress is running
multiple tests in parallel.

# [email protected]
Expand Down
Loading
Loading