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

Test run is broken when there is retry for test and parameter reportHooks set to true in reporter configuration #193

Open
alesya-la opened this issue Jun 14, 2024 · 2 comments

Comments

@alesya-la
Copy link

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
image

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"
  }
}
@Pink-Bumblebee
Copy link

@AmsterGet , could you please check?

@niQo
Copy link

niQo commented Jun 20, 2024

same error here. The workaround is to set reportHooks to false and then it's not crashing anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants