What could be the reason that BeforeAllCallback runs before Each Test #3158
pratyushdeshpande
started this conversation in
General
Replies: 1 comment 2 replies
-
A Are you perhaps configuring your build to fork test execution per test class? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am running Parallel test with Selenium and I have implemented BeforeEachCallback, AfterEachCallback, BeforeAllCallback and also ExtensionContext.Store.CloseableResource and used this class as @ExtendsWith annotation with all my test Classes.
I have implemented a Different Namespace, e.g. Namespace.create("QATEST") and putting a resources in the namespace.
My All tests are Parameterized tests with custom annotation created using @ArgumentsSource .
When I execute my tests, even if sequentially or parallelly, I see that BeforeAll block of code is executed before every Parameterized test execution similar to how beforeEach executes. Also same behaviour observed for Closeable Resource.
What could be the reason for this behaviour/am I missing something? and what could be done to change this to normal behaviour of executing BeforeAll block only once before executing all tests and closeableResouce block to execute once after all tests are executed.
Using:
Junit5 : 5.8.2
Selenium 4: 4.7.2
Beta Was this translation helpful? Give feedback.
All reactions