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

beforeEach recommendation not working as intended #139

Closed
cookiescrumbs opened this issue Feb 3, 2019 · 5 comments
Closed

beforeEach recommendation not working as intended #139

cookiescrumbs opened this issue Feb 3, 2019 · 5 comments

Comments

@cookiescrumbs
Copy link

cookiescrumbs commented Feb 3, 2019

It looks like the beforeEach hook is running before every feature and not just the one it's suppose to be related to... Please see screen shot from the example repo.

image

Log: "This will run before every scenario of GoogleNews.feature test, but NEVER for Facebook/Google feature files"

@lgandecki
Copy link
Collaborator

oh wow, you are right - this happens when you run all feature files together in the cypress open GUI.
But, when I create two js files:

beforeEach(() => {
  cy.log("This only before the first one");
});

describe("abcd", () => {
  it("dfsdfs", () => {});
});

and

beforeEach(() => {
  cy.log("This only before the second one");
});

describe("abc", () => {
  it("dfsdf", () => {});
});

it runs both befores when I run them together, but only one, when separately. I don't think this is how cypress should work. It makes little sense for the same test to behave the same when:

  1. run separately
  2. run with cypress run
    but differently with
  • running with cypress open when doing the "run all specs"

@lgandecki
Copy link
Collaborator

@cookiescrumbs cypress team acknowledged it as a bug on their side: cypress-io/cypress#3323 . Thank you for the report, I'm closing this one for now as it is not related to our plugin. :-(

@avikhazra
Copy link

@lgandecki : we are getting cucumber JSON as output. How to use this JSON as an HTML cucumber report. Multiple cucumber report is recommended in github but it is creating report before the test starts. Could please help me with that.

@Avik-Guha
Copy link

@lgandecki : we are getting cucumber JSON as output. How to use this JSON as an HTML cucumber report. Multiple cucumber report is recommended in github but it is creating report before the test starts. Could please help me with that.

I am also facing same issue. Multiple cucumber report is creating report before the test starts. Is there any solution for this?

@lgandecki
Copy link
Collaborator

Sorry, this is not a use-case me or any of our clients have. Feel free to create another issue, and one of the other maintainers might help you.
We are always happy to take PRs as well. :)

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

4 participants