-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Group tests to improve performance by reducing the amount of page loads #2943
Comments
Hey @Lakitna, Cypress allows you to define a global before, beforeEach, afterEach, and after within the support files. We definitely encourage you to extend and add onto Cypress as needed. The bundle concept in the Mocha UI looks pretty useful. Is there an issue when you try to run the bundle UI with Cypress? |
I haven't gotten the UI working but that might be because of the old Mocha version in Cypres 3.x. I'll try getting things working on the 4.0 branch. If that's not the solution I frankly don't know where to look to implement this since I can't reach the mocha options of the Cypress Mocha instance as far as I'm aware. For reporters, the options are exposed. But for other stuff, it's not. |
So update time. I've been able to get the UI to show up in It comes basically down to the issue that I can't change the Mocha UI of Cypress without forking it. I can see two options to enable test grouping:
If anyone has got any other suggestions I would love to hear them! |
Closing this feature request since it hasn’t gotten a lot of interest over the years. We’ve more recently inteoduced cy.session, which will run some set of commands in a session then reload the state of the App to that session. It may achieve what was originally asked here in some cases. |
Current behavior:
When you want to improve runtime by reducing page loads you have to order your tests by their run order, even if that doesn't make sense from a logical standpoint.
I want to use Cypress to test a single page application that's different based on the parameters with which it's loaded. In this case, the parameters are
userId
andauthorization
. The application can get pretty complex so I order my test files by the part of the application they are testing. In some cases, properly testing the part of the application under test requires reloading the application with different parameters.That also means that in my current implementation I'm reloading the page 50+ times, about 35 of which are the exact same page with the same
userId
andauthorization
. That's pretty wasteful.Desired behavior:
I want to be able to specify groups of tests across files that run with a single shared
before
script. That would allow me to set up the page in thebefore
script and run my tests on that one instance of the application, greatly reducing the number of repeated steps required for running the suite.Thinking I could control the Mocha instance of Cypress I wrote a Mocha UI to solve this problem. This package accurately describes the desired behaviour for me.
I've been asking about a way to accomplish this on Gitter but I didn't get a response, that probably means there is no way to do this yet.
Versions
Cypress 3.1.3
Windows 7
Chrome 70
The text was updated successfully, but these errors were encountered: