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

Skipped Scenarios missing from cucumber.json files #288 #329

Merged
merged 2 commits into from
Jun 1, 2020

Conversation

jcundill
Copy link
Contributor

Addresses #288

Currently skipped tests, those not matching the tags used for the run, are not added to the cucumber.json files generated during that run.

This PR adds them back into the generated files.

Changes:
In createTestsFromFeature pass all the scenarios into createTestFromScenarios but mark the subset that should actually be executed with a shouldRun flag.

In createTestFromScenarios check if the scenario should be executed and if not just add it to the cucumberDataCollector and tell mocha that we skipped this test.

Fix the cucumberDataCollector not to fail the scenario if mocha tells it that the test was skipped.

@jcundill jcundill linked an issue Feb 29, 2020 that may be closed by this pull request
@lgandecki lgandecki self-assigned this Mar 26, 2020
@lgandecki lgandecki merged commit 5a28f9e into badeball:master Jun 1, 2020
@lgandecki
Copy link
Collaborator

sorry, I took so long, tough few months for our organization... :) Looks good though! Thanks for the work

@lgandecki
Copy link
Collaborator

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@badeball
Copy link
Owner

badeball commented Jul 6, 2020

This has the unforunate consequence of running before- & after-hooks for all skipped tests. If I now mark a test with @focus that is part of a file with 50+ scenarios, then it takes quite a lot of time for Cypress to even reach the focused test. Hence, this breaks the workflow in my case.

I'm not sure what the best option here is though. Generating Cucumber reports is already quite a headache.

@lgandecki
Copy link
Collaborator

damn.. that's definitely not what we want. I guess when you use @Focus in the GUI you don't need the reports though? maybe we could disable it unless someone runs cypress with run instead of open?

@badeball
Copy link
Owner

badeball commented Jul 7, 2020

I'm just brainstorming here, but do we need to call it() at all? Can we skip it, if we merely need to call onStartScenario and onFinishScenario. Omitting it would mess up order I believe and all skipped tests would appear first. Does this matter?

@lgandecki
Copy link
Collaborator

I'm not sure.. It sounds reasonable. @jcundill ?

@rcaunt
Copy link

rcaunt commented Jul 23, 2020

We have another issue here now. We pass our output file to Jira TM4J via the automation end point and we get the result Test Result Status with name skipped not found.

We've added this into TM4J and can manually mark our tests cases as skipped within a test cycle but we can't get the automation working with it.

Granted not strictly an issue with this library.

@JuergenKindler
Copy link

JuergenKindler commented Oct 9, 2020

See the same with Serenity/Cucumber ... seems TM4J endpoint /rest/atm/1.0/automation/execution/cucumber/projectId cannot cope with
"result": { "duration": 2365000, "status": "skipped" }

That seems to be a general problem on TM4J.

@rcaunt
Copy link

rcaunt commented Oct 12, 2020

@JuergenKindler I raised #419 about the issue, it seems that TM4J weren't too fussed about fixing it and therefore I wrote a post-processing script which we run after our tests, prior to submission to TM4J, which removes any tests that are fully skipped.

@JuergenKindler
Copy link

That's what I was also planning for now. But as soon as I have a way to contact their support, I will push here.

MateuszNowosad referenced this pull request in MateuszNowosad/cypress-cucumber-preprocessor Jun 11, 2021
…solving step definition files

Rewrite of getStepDefinitionPaths function to fix various issues and inconsistencies with resolving
of step definition files from locations defined in config.

BREAKING CHANGE: Users that don't use any workarounds for this issue should be unaffected. But its
no longer possible to have stepDefinitions and nonGlobalStepBaseDir simultaneously defined in the
config since they are synonymous.

fix #329, fix #553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip Scenarios Data Missing in cucumber.json
6 participants