-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
cucumber-json does not contain all scenarios if testing multiple URLs in one feature #417
Comments
Any comment on this? 🤔 |
Sorry, me and my team didn't work on nor uses this feature, it was provided by the community. We are definitely open to take a PR but can't really provide much more support than that at this moment. |
Ran into this exact same problem and followed the next approach: -Separated the feature files, one per different domain -In some of the features where same domain was used but needed to navigate to different URLs same domain to validate a text, we used cy.request instead of cy.visit and validated the response body. That was the only way the report were generated correctly. Hope it helps your case as well |
I'm facing exactly the same issue on Cypress version 6.1.0 @benjaminknauer @a8trejo thank you so much for your info! I couldn't figure out why my Api test results were ok but Ui ones were not. Has anyone found a workaround to stop Cypress from reloading every time? |
Problem exists in this code fragment:
possible fixes:
|
I updated my test repo https:/benjaminknauer/cypress-cucumber-preprocessor-cucumber-json-bug to the newest version (4.0.3). Still not fixed :( |
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far. Read more about the transfer of ownership here. The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so. |
We have the requirement to test multiple clients with different URLs. For this we have a given step which overwrites the base URL in the cypress object. If a cy.visit() is then executed on a "new" domain, the Cypress Runner is restarted.
See also:
https://docs.cypress.io/guides/references/best-practices.html#Setting-a-global-baseUrl
"As soon as it encounters a cy.visit (), Cypress then switches to the url of the main window to the url specified in your visit. This can result in a 'flash' or 'reload' when your tests first start."
This behavior means that all scenarios that were executed before the restart are not listed in the generated cucumber-json file.
Current behavior
cucumber-json file does not contain all scenarios if multiple URLs are tested in one feature.
Desired behavior
All scenarios should be present in cucumber-json file
Test code to reproduce
https:/benjaminknauer/cypress-cucumber-preprocessor-cucumber-json-bug
Feature: Test with multiple domains
Scenario: Test google
When you visit "https://www.google.de"
Then the url includes "google"
Scenario: Test ebay
When you visit "https://www.ebay.de"
Then the url includes "ebay"
--> Only
Test ebay
is present incucumber-json/test.cucumber.json
The text was updated successfully, but these errors were encountered: