-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Refactor existing tests and add new ones #254
Conversation
The login tests now have better assertions. And the login custom command can now use the cy.session experimental feature, which allows restoring the session of a user, which speeds up tests. But, for the login tests, we don't want any cache to be restored. This is why for the login tests we pass { cacheSession: false }
c7d21f0
to
9d4ced2
Compare
Such tests make use of the refactored login command, which means that only the first tests needs to log in via the GUI, while others benefit from the session to be restored from the cache. In this test suite, I've also create a custom command to cleanup all existing models on the beforeEach hook so that tests always start in a fresh state.
9d4ced2
to
5cc04c1
Compare
Not it's not. Are you running the tests against your local environment? Maybe I'll need to increase a timeout since the default one from Cypress might not be enough. @idmarjr, have you tried more than once? If so, does it always fails on the same step? |
Yes sir. I'm running it at localhost and tried to run it twice, once using Maybe someone else can run the tests as well to double check it? CC @ArthurMota9 @miltonbsn or @oicramps |
Maybe we can pair on it tomorrow so that I can investigate it further. |
Oddly, only one test is failing. The @miltonbsn, maybe you can help us out here. When visiting the relative URL |
531ba04
to
8501473
Compare
Hi @wlsf82, yes every time you visite
|
@idmarjr, can you pull the new code I pushed today and try again, please? Let's see if this commit 02c5314 will fix it. Cc @miltonbsn. |
Nope. 02c5314 did not solve the issue. 😢 |
Right after line 10 (the failure), I see that there's a @miltonbsn, is there a "kind" of user who gets all the models instead of only its own? |
To keep it documented, we discovered that, on @idmarjr's computer, the failure is related to the use of the experimental feature On everyone else's computer, What happens to on Id's computer is that when using But, we decided to keep using the feature since it speeds up tests, and in the meanwhile, Id will try it out on another computer. |
@bahmutov, any thoughts? |
I would use cypress-data-session and be done with it
…Sent from my iPhone
On Nov 19, 2021, at 20:12, Walmyr ***@***.***> wrote:
To keep it documented, we discovered that, on @idmarjr's computer, the failure is related to the use of the experimental feature cy.session. Without it, all tests worked fine.
On everyone else's computer, cy.session works fine .
What happens to on Id's computer is that when using cy.session, the getUserModels request that we are trying to intercept never happens, failing the test in the beforeEach hook.
But, we decided to keep using the feature since it speeds up tests, and in the meanwhile, Id will try it out on another computer.
@bahmutov, any thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Just to keep it documented, the issue only happens when the server is pointing to a remote MongoDB. If the server points to a local MongoDB everything works fine. |
For more details, read the commit messages.
See the tests running:
login.spec.js.mp4
models.spec.js.mp4
Cc @ArthurMota9, @idmarjr, and @miltonbsn.