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
[💡 Feature]: Allow skipping anywhere in test execution #12770
Comments
I would say your expectation is failing then und you should have the test fail. Why would you prefer to skip it? |
Sorry a better way to phrase it is, an expectation that enables the test to continue isn't possible, e.g. a product variant is out of stock, skip the test for that variant. |
Do you see this type of feature implemented in other projects? |
I haven't seen it used before but would be beneficial. I understand that the lack of examples will make this request a low priority 🤷♂️ |
I will keep this open and would love other people to provide their opinion. I personally would say, if you run a test and it doesn't provide a DB state you can rely on, your test should fail. If you can manipulate the DB I recommend to use the let hasProperTestState = false
before(async () => {
hasPropertTestState = await checkTestState()
})
it('test', function () {
if (!hasProperTestState) {
return this.skip()
}
// ...
}) You can overwrite the |
Is your feature request related to a problem?
The problem is that sometimes when running a test, it becomes evident while on the page, that the test cannot continue as desired data/ setup isn't possible (smoke test), one cannot skip the test unless at the spec context.
Describe the solution you'd like.
I would love some globally available variable for
test
or something similar so that anywhere during execution, a test can choose to skip itself.This way somewhere in a test, one can just call
test.skip()
Describe alternatives you've considered.
A current workaround is to pass the
spec
context to helper functions downstreame.g.
enabling the functions
doesAThing(...)
andverifyDoesAThing(...)
to use the skip functionality like so:The text was updated successfully, but these errors were encountered: