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

jasmine flags, oneFailurePerSpec and stopSpecOnExpectationFailure don't work well #178

Closed
razielron opened this issue Apr 11, 2021 · 2 comments

Comments

@razielron
Copy link

Hi, I am using wdio that uses jasmine under the hood.
I have problem when I set any of those flags to the jasmineOpts object in the config file:

oneFailurePerSpec: true,
stopSpecOnExpectationFailure: true,

Those flags do not work properly, they don't stop anything and when I use the flag failFast: true
it works but it stops the whole suite on failure and not just the current test.

I need to stop current describe on any error, can any one assist with this?

I am using WebdriverIO v7

@sgravrock
Copy link
Member

Jasmine doesn't provide a way to stop an entire describe but not the whole suite. The idea is that each spec is supposed to be independent of the others, so the failure of one spec doesn't necessarily mean that the others can't run and pass. Are you by any chance trying to write a test suite where each spec is a step that depends on the ones before it to set up its preconditions? Jasmine isn't meant to be used that way.

It sounds like you're probably configuring Jasmine through wdio-jasmine-framework. Based on a quick look at that package's source, it looks like both the oneFailurePerSpec and stopSpecOnExpectationFailure flags should have the effect of making Jasmine stop each spec (but not the entire describe) on the first error but continue to run the remaining specs.

@sgravrock
Copy link
Member

Closing since we haven't heard anything in some time, and I don't think there's anything to be fixed in Jasmine here.

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

2 participants