-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add Documentation how to login different users with parallel execution #1653
Comments
@MarcinVaadin do you remember how multithreading can be customised in TestBench, I recall we added a chapter about in for JUnit 5, but I couldn't quickly find it. |
I also recall we put multithreading config like here https://github.com/vaadin/testbench/blob/a645fddcaf19ff161f4cf4bedfe0e081709a429c/vaadin-testbench-integration-tests-junit5/src/test/resources/junit-platform.properties , but this is not in the main branch for some reason. |
That's a system property, which makes it really hard to configure this depending on the test class in action. Like I've created multiple classes to test different views that could theoretically all run in parallel without problem - so adding this system property would instantly remove the parallel execution of all those classes even tho I would also want to disable it for a specific class. Additionally this question adds a bit more to the mix, because it's also requesting documenting about the proper testing of different users with (the default enabled) multi threading. |
Is this a matter of you manually deleting sessions in code? The browser instances running in parallel should not share anything |
Are you sure? In my observation one month ago I had the feeling that chrome does share some things between the browser instances / tabs / however you call it. We have multiple tests that include different user-logins / logouts and all kind of events. Once those run in parallel, random tests failure occure from "this grid does not contain items (probably spring security returning another user for the current tab and therefore no items)" or multiple exceptions of this kind:
or
All problems went away once I extended |
Migrating from Junit4 based Testbench to the Junit5 based Testbench, I noticied that all tests are now executed in parallel - resulting in multiple errors with tests that using the same browser to log-in different users and therefore deleting the old session of the user.
Things I tested so far, but all failed in some way:
Parameters.setTestsInParallel(1);
ChromeOptions:.addArguments("--incognito")
@Execution(ExecutionMode.SAME_THREAD)
@TestInstance(Lifecycle.PER_CLASS)
@DirtiesContext(classMode = ClassMode.BEFORE_CLASS)
Working, but totally removing the possibility of paralle tests:
@TestMethodOrder(OrderAnnotation.class)
A normal class structure looks like this:
The text was updated successfully, but these errors were encountered: