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

Execution is stuck when a test is skipped and afterEach function is defined #77

Closed
haipinggong opened this issue Jun 15, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@haipinggong
Copy link

Describe the bug
The execution of Cypress is stuck if a test is skipped and there is an afterEach function defined in the spec.js file.

To Reproduce
Steps to reproduce the behavior:

  1. Add a test as in a spec.js file:
    it('skip', function () {
    this.skip()
    });
  2. Add an afterEach function in the same spec.js file
    afterEach(function () {
    cy.log('This is after each test')
    })
  3. Run that spec.js file with --env allure=true:
    npx cypress open --env allure=true
  4. Cypress execution is stuck after reaching that test case.

Expected behavior
The cypress execution should not be stuck. The test run can go on to the next test case.

Environment (please complete the following information):

  • Cypress version: 7.5.0
  • OS: Windows (10):

** Developer Tools Console Output **

Uncaught TypeError: Cannot read property 'startStep' of null
at AllureReporter.startHook (AllureReporter.js:364)
at Runner.eval (index.js:115)

Additional context
If the afterEach function is empty like:
afterEach(function () {}), the test execution is not stuck.

Please refer to the attached spec.js file that I modified in https://github.com/Shelex/cypress-allure-plugin-example
The js file cannot be uploaded so I renamed it to txt file.
steps.spec.txt

@Shelex
Copy link
Owner

Shelex commented Jun 17, 2021

Hi @haipinggong
Have provided a fix in v2.8.2 where it should be resolved.

Could you please check on your case?

@haipinggong
Copy link
Author

@Shelex , thanks. I have upgraded to v2.8.2 and I think it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants