agent-js-cypress
agent-js-cypress copied to clipboard
Test run is broken when there is retry for test and parameter reportHooks set to true in reporter configuration
Hello
I have next error when there is a retry for test and parameter reportHooks:true
in reporter configuration.
Note: it is reproduced when test has hook
Code to reproduce: configs/config.js
const {defineConfig} = require('cypress');
const registerReportPortalPlugin = require('@reportportal/agent-js-cypress/lib/plugin');
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
registerReportPortalPlugin(on, config);
return config;
},
retries: {
runMode: 1,
openMode: 0
}
},
})
configs/reporters.config
const {defineConfig} = require('cypress');
module.exports = {
reporterEnabled: "@reportportal/agent-js-cypress",
reportportalAgentJsCypressReporterOptions: {
endpoint: "END_POINT",
apiKey: 'API_KEY',
launch: 'LAUNCH_NAME',
project: 'PROJECT_NAME',
description: 'RP_DESCRIPTION',
autoMerge: true,
skippedIssue: false,
reportHooks: true,
integrationFolder: "cypress/e2e",
attributes: [
{
key:"build",
value: 'RP_BUILD',
},
],
}
}
cypress/e2e/test.cy.js
describe('Test', () => {
beforeEach('Login to project page', () => {
cy.visit('https://www.google.com/');
});
it('test', () => {
cy.get('#lnXdpd').should('exist');
cy.get('#lnXdpd').not('exist');
})
});
package.json
{
"devDependencies": {
"@reportportal/agent-js-cypress": "^5.3.0",
"cypress": "^13.11.0"
},
"dependencies": {
"cypress-multi-reporters": "^1.6.4"
}
}