
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
cypress-qase-reporter
Advanced tools
Publish results simple and easy.
To install the latest release version (2.2.x), run:
npm install -D cypress-qase-reporter
To update an existing test project using Qase reporter from version 1 to version 2.1, run the following steps:
Change import paths in your test files:
- import { qase } from 'cypress-qase-reporter/dist/mocha'
+ import { qase } from 'cypress-qase-reporter/mocha'
Update reporter configuration in cypress.config.js
and/or environment variables —
see the configuration reference below.
Add a hook in the e2e
section of cypress.config.js
:
...
e2e: {
+ setupNodeEvents(on, config) {
+ require('cypress-qase-reporter/plugin')(on, config)
}
}
...
If you already override before:run
or after:run
hooks in your cypress.config.js
, use this instead:
const { beforeRunHook, afterRunHook } = require('cypress-qase-reporter/hooks');
...
e2e: {
setupNodeEvents(on, config) {
+ on('before:run', async () => {
+ console.log('override before:run');
+ await beforeRunHook(config);
+ });
+ on('after:run', async () => {
+ console.log('override after:run');
+ await afterRunHook(config);
+ });
},
},
...
To update an existing test project using Qase reporter from version 2.1 to version 2.2, run the following steps:
Add a metadata in the e2e
section of cypress.config.js
...
e2e: {
setupNodeEvents(on, config) {
require('cypress-qase-reporter/plugin')(on, config)
+ require('cypress-qase-reporter/metadata')(on)
}
}
...
The Cypress reporter can auto-generate test cases and suites from your test data. Test results of subsequent test runs will match the same test cases as long as their names and file paths don't change.
You can also annotate the tests with the IDs of existing test cases 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.
qase.title
- set the title of the test caseqase.fields
- set the fields of the test caseqase.suite
- set the suite of the test caseqase.comment
- set the comment of the test caseqase.parameters
- set the parameters of the test caseqase.groupParameters
- set the group parameters of the test caseqase.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 caseqase.attach
- attach a file or content to the test caseFor detailed instructions on using annotations and methods, refer to Usage.
For example:
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);
})
);
// a test can check multiple test cases
qase([2, 3],
it('Correct test', () => {
expect(true).to.equal(true);
})
);
qase(4,
it.skip('Skipped test', () => {
expect(true).to.equal(true);
})
);
});
To execute Cypress tests and report them to Qase.io, run the command:
QASE_MODE=testops npx cypress run
or
npm test
You can try it with the example project at examples/cypress
.
A test run will be performed and available at:
https://app.qase.io/run/QASE_PROJECT_CODE
Qase Cypress reporter can be configured in multiple ways:
cypress.config.js
,qase.config.json
,For a full list of configuration options, see the Configuration reference.
Example cypress.config.js
config:
import cypress from 'cypress';
module.exports = cypress.defineConfig({
reporter: 'cypress-multi-reporters',
reporterOptions: {
reporterEnabled: 'cypress-mochawesome-reporter, cypress-qase-reporter',
cypressMochawesomeReporterReporterOptions: {
charts: true,
},
cypressQaseReporterReporterOptions: {
debug: true,
testops: {
api: {
token: 'api_key',
},
project: 'project_code',
uploadAttachments: true,
run: {
complete: true,
},
},
framework: {
cypress: {
screenshotsFolder: 'cypress/screenshots',
}
}
},
},
video: false,
e2e: {
setupNodeEvents(on, config) {
require('cypress-qase-reporter/plugin')(on, config)
require('cypress-qase-reporter/metadata')(on)
},
},
});
Check out the example of configuration for multiple reporters in the demo project.
If you use Cucumber, you need to add the following configuration in cypress.config.js
:
import cypress from 'cypress';
const cucumber = require('cypress-cucumber-preprocessor').default;
module.exports = cypress.defineConfig({
reporter: 'cypress-multi-reporters',
reporterOptions: {
reporterEnabled: 'cypress-mochawesome-reporter, cypress-qase-reporter',
cypressMochawesomeReporterReporterOptions: {
charts: true,
},
cypressQaseReporterReporterOptions: {
debug: true,
testops: {
api: {
token: 'api_key',
},
project: 'project_code',
uploadAttachments: true,
run: {
complete: true,
},
},
framework: {
cypress: {
screenshotsFolder: 'cypress/screenshots',
},
},
},
},
video: false,
e2e: {
setupNodeEvents(on, config) {
on('file:preprocessor', cucumber());
require('cypress-qase-reporter/plugin')(on, config);
require('cypress-qase-reporter/metadata')(on);
},
specPattern: 'cypress/e2e/*.feature',
},
});
And add the following lines in support/e2e.js
file:
import { enableCucumberSupport } from "cypress-qase-reporter";
enableCucumberSupport();
Check out the example of configuration for multiple reporters in the demo project.
We maintain the reporter on LTS versions of Node.
cypress >= 8.0.0
FAQs
Qase Cypress Reporter
The npm package cypress-qase-reporter receives a total of 7,957 weekly downloads. As such, cypress-qase-reporter popularity was classified as popular.
We found that cypress-qase-reporter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.