Giter Site home page Giter Site logo

Comments (3)

jennifer-shehane avatar jennifer-shehane commented on June 15, 2024

There is a before:run and after:run API as part of setupNodeEvents that does this.

I'm not sure if we could hook into this once a spec has begun, so that you could run Cypress tests.... it would require quite a bit of rework anyway.

from cypress.

jprealini avatar jprealini commented on June 15, 2024

Thanks for the input @jennifer-shehane

Yeah, I know I can use those apis. The problem is that the whole setup and cleanup processes in our scenario make use of a lot of cypress commands, which blocks us from being able to call them from there.

It would be awesome if we could have a true global before hook (one that runs just one at the beginning of the test run) and a true global after hook (that runs just once, after the whole test run has completed)... Are there any limitations that would prevent Cypress to provide such functionality?

Thanks again.

from cypress.

jprealini avatar jprealini commented on June 15, 2024

NOTE: I know that using the after or afterEach hooks to cleanup state or test data is an anti pattern. The problem we face is that we are required by dba's to cleanup every test data we create in the lower environments databases for our tests as soon as the test runs are completed.

We could (and that's what we are doing) delete the users after each spec is completed. The problem with that is that we are creating between 4 and 10 users depending on the run type, and creating that amount of users takes a lot of time... If we have to create them before each spec, with 20 specs we will have more than 40 minutes taken only for test users setup and cleanup.

That's why we decided to create a set of users on startup, use them across all our test run, and clean them up when we are done...

Hope that makes sense.

from cypress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.