POC: Refactor tests, increase speed, use API methods to create user#3427
POC: Refactor tests, increase speed, use API methods to create user#3427anshulxyz wants to merge 2 commits intoonline-go:mainfrom
Conversation
Review NotesThe speedup approach is interesting, but there are a few issues worth addressing before this lands. 1. Direct API calls conflict with project e2e policy
2. Silent CSRF token failureIn const csrftoken = cookies.find((c) => c.name === "csrftoken")?.value || "";If the CSRF cookie is not present after 3.
|
Add error handling for missing CSRF token Add error handling for setting starting rank Correct the localStorage key Disable dynamic help popups
|
Thanks for the POC — the speed improvement is significant. A few issues to address before this approach can be adopted: Conflicts with stated e2e test principles
The PR description mentions adding a dedicated UI registration test to compensate, but that test is not included here, leaving a coverage gap.
In |
I feel like if we're doing something that makes the testing process notably faster, so long as we've exercised those parts (such as user registration) with an actual e2e test, we don't need to always drive it through the whole browser method necessarily. That said, I defer to @GreenAsJade , if he feels it's better to always go through that whole process then I'm good with it too. |
|
Yeah I mentioned to Anshul - it's cool to deliberately to it. I suggested we make sure that we have one test in each "class" of test where the users are "real" not "pre-fab", just in case something depends on the signup flow. |
|
Maybe we should tell CLAUDE that we've decided this, in the README/CLAUDE, so it doesn't complain all the time, and checks that it's true! |
This is a Proof-of-Concept. Fixes slowness of the e2e tests to some degree.
Proposed Changes
In every test we don't have to test the user registration flow. That is taking a lot of time of the test. For e2e tests we can register users directly with the API instead of the UI. For speed.
We can have a single separate test for user registration through UI.
I have tested this with the4 demo board related tests, and have found that the newer tests are 60% faster.
Results:
I am all ears. Open to all suggestions.