before() from support/index.js called twice
See original GitHub issueCurrent behavior:
before() used in support/index.js being called twice.
Desired behavior:
Test code to reproduce
support/index.js
// Import commands.js using ES2015 syntax:
import './commands';
import faker from 'faker';
export const nameSeed = faker.random.words(3);
before('define nameSeed', () => {
cy.log(`Name seed for this run is: ${nameSeed}`);
});
after('log out', () => {
cy.log(nameSeed);
});
Versions
4.11.0, MacOS, Chrome
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
callback being called twice when my unit test fails
js ? chai?) is using exceptions. So my answer is based on that assumption. It seems that node-neo4j is recalling the callback function...
Read more >Cypress basics: before(), beforeEach(), after() and afterEach()
I like to think of all hooks as being "squashed" together before executing a test or a describe() block. Using beforeEach block in...
Read more >Writing and Organizing Tests - Cypress Documentation
The order of hook and test execution is as follows: All before() hooks run (once); Any beforeEach() hooks run; Tests run; Any afterEach() ......
Read more >Be careful when running all specs together - Gleb Bahmutov
The support file runs in the browser, right before the spec file runs. We can see the support file and the spec file...
Read more >The Most Common Cypress Mistakes - Christian Lüdemann
Before you start reading, I want to you know that this post comes with a fee… ... For that reason, you risk flakiness...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, maybe you are requiring the index file twice somehow?
We recommend questions relating to how to use Cypress be asked in our community chat. Also try searching our existing GitHub issues, reading through our documentation, or searching Stack Overflow for relevant answers.
@sagenicky Please provide a full reproducible example so we can see if the behavior is expected or not for ourselves.