question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"spec" strategy does not work in headed mode

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

When test file A fails (with failFast enabled), failFast plugin is skipping future test spec that also has failFast enabled.

To Reproduce Steps to reproduce the behavior

cypress.json "env": { "FAIL_FAST_PLUGIN": true, "FAIL_FAST_ENABLED": false },

failFast1.js describe('in failFast1', { "failFast": {"enabled": true} }, function() { it('failFast1', function() { cy.log('testing in failFast1 file'); expect(1).equal(0); }) })

failFast2.js describe('in failFast2', { "failFast": {"enabled": true} }, function() { it('failFast2', function() { cy.log('testing in failFast2 file'); expect(2).equal(1); }) })

failFast3.js describe('in failFast3', { "failFast": {"enabled": true} }, function() { it('failFast3', function() { cy.log('testing in failFast3 file'); expect(3).equal(2); }) })

Expected behavior A clear and concise description of what you expected to happen.

I assume it would only failFast the describe in existing test spec, and not future ones.

Logs If applicable, add logs to help explain your problem.

image

** Operating system, Node.js an npm versions, or browser version (please complete the following information)😗*

  • OS: [e.g. Ubuntu 18.04] - Mac
  • Node.js: [e.g. 8.11.1] - v12.18.4
  • npm: [e.g. 5.6.0] - 6.14.10
  • Browser: [e.g. Chrome 73.0.3683] - Electron 87
  • failFast: 2.3.2

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hansiemithuncommented, Jul 14, 2022

Thanks, @javierbrea - it’s working. I thought we cannot configure it in multiple places and hence felt it was not working…

1reaction
javierbreacommented, Jul 14, 2022

@hansiemithun , That configuration only has sense if you have the plugin completely disabled using environment variables and you want to enable it only for that test: https://github.com/javierbrea/cypress-fail-fast#configuration-by-test.

If you want to skip all other tests in the same spec file whenever one fails, then you should have this environment variables in your cypress.json file:

{
  "env":
  {
    "FAIL_FAST_STRATEGY": "spec",
    "FAIL_FAST_ENABLED": true
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress- Test Runner - Tools QA
This article covers the steps of How to execute the Cypress test with Cypress Test Runner? Execute Cypress tests from Command Line?
Read more >
How To Run Cypress Tests In Headless Mode - YouTube
How do you run a test in Cypress in headless mode ? ... + Online scalable Selenium Grid to perform Manual as well...
Read more >
Command Line - Cypress Documentation
By default, Cypress will run tests headlessly during cypress run . Passing --headed will force the browser to be shown. This matches how...
Read more >
Routes - Networking | OpenShift Container Platform 3.11
The source load balancing strategy does not distinguish between external ... If set true , override the spec.host value for a route with...
Read more >
git-reset Documentation - Git
Does not touch the index file or the working tree at all (but resets the head to <commit> , just like all modes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found