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

Allure-results can't be created if "context.skip" or "describe.skip" is presented in suite body #65

Closed
Seitar18 opened this issue Apr 9, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Seitar18
Copy link

Seitar18 commented Apr 9, 2021

Allure-results can't be created for spec file if "context.skip" or "return this.skip();" at "before" hook are presented in suite body so it doesn't even appears as tests at allure report results when all specs passed. Mocha/mochawesome handle this correctly but this plugin unfortunately not.

Steps to reproduce:

  1. Use modified attached* cypress/examples/actions.spec file at cloned project(I've just remove all(except the first) actions from your original file for more speed and results visibility; reproduced the same at production with big number of tests)
  2. run "yarn cy:run" at project directory
  3. Observe the result

Expected result
Plugin should correctly handle test statements and create corresponding test result:

Actual result

  1. https://pastebin.com/4EK0uYcF - context.skip example actions.spec file with partially skipped tests
    https://pastebin.com/hq7Xa59r- console output
    Allure results wasn't created
  2. https://pastebin.com/cYfmYbNF - another context.skip example actions.spec file with all spec.file tests skipped
    hhttps://pastebin.com/1tC2inqjr- console output
    Allure results wasn't created

Environment :

  • Cypress version: 6.8.0
  • OS: Reproduced on latest Debian and MacOS
  • cypress-allure-plugin version. Tried both on the 2.3.5 and 2.4.0
@Seitar18 Seitar18 added the bug Something isn't working label Apr 9, 2021
@Shelex
Copy link
Owner

Shelex commented Apr 9, 2021

@Seitar18 Thank you for opening issue.
Actually it is known one. I have no idea why Cypress after receiving mocha "pending" event (that happens when next test\suite should be skipped) and if there is no other tests\hooks left - just stops cypress runner and as a result no commands could be used, so results are not saved.

It will require proper investigation if this could be fixed or workaround found.
I assume empty after hook may work in case you don't have any hooks yet.

@Seitar18
Copy link
Author

Seitar18 commented Apr 9, 2021

@Shelex thank you for your answer.
Unfortunately we have many before hooks at those tests.
So, may be global after hook should help?

@Shelex
Copy link
Owner

Shelex commented Apr 9, 2021

@Shelex thank you for your answer.
Unfortunately we have many before hooks at those tests.
So, may be global after hook should help?

When I was debugging such issue it helped me. When any other executable is scheduled after skipped test - allure results writer is fine.

@Seitar18
Copy link
Author

Seitar18 commented Apr 9, 2021

@Shelex thank you for your answer.
Unfortunately we have many before hooks at those tests.
So, may be global after hook should help?

When I was debugging such issue it helped me. When any other executable is scheduled after skipped test - allure results writer is fine.

Thanks a lot[2]!
This call at support/index.js is solved this problem.
after(function () {
});

@Shelex
Copy link
Owner

Shelex commented Apr 9, 2021

@Seitar18 glad it helped!
However it should be addressed properly, so let's leave issue opened.

@Shelex
Copy link
Owner

Shelex commented Jun 4, 2021

Addressed in 2.6.0.

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