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

Cypress runner hangs indefinitely when calling "this.skip()" in a test #314

Open
hammzj opened this issue Feb 10, 2023 · 0 comments
Open

Comments

@hammzj
Copy link

hammzj commented Feb 10, 2023

I have this plugin enabled with my Cypress 11.2.0 suite. We also use Cucumber for our tests so we have the cypress-cucumber-preprocessor plugin enabled as well. Due to some current constraints in our project, we cannot use test isolation and thus need to "fail fast" when a scenario fails in a feature file. Thus, we try to accomplish this with the following Cucumber hook:

const {Before} = require("@badeball/cypress-cucumber-preprocessor");

Before(function () {
    const suite = cy.state('test').parent;
    if (suite.tests.some(test => test.state === 'failed')) {
        cy.log('Failing fast, so all scenarios will be skipped');
        this.skip();
    }
})

I've noticed that calling this.skip() anywhere in the tests, like above, will cause the Cypress runner to hang indefinitely. It will first skip the next scenario, and then be unable to execute any more commands. The runner will need to be manually shut down. I've discovered that by removing the cypress-failed-log plugin, tests can be skipped without any issue, but this plugin basically breaks Cypress when trying to skip a test.

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

1 participant