Skip to content
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

Fixes #3998 and allows per test method screen recording #8617

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MartinAhrer
Copy link

This pull request is related to issue #3998.

BrowserWebDriverContainer is designed to execute each test in a fresh container.
However this is slow and not an option especially when test execution can't be parallelized.

Instead of recreating a fresh BrowserWebDriverContainer instance it may be sufficient to just re-create the VncRecorderContainer for each test.

This pull request offers a new method reinitializeVncRecorderContainer that tears down the vncRecordingContainer and creates a fresh instance. So it comes with out side effects of breaking existing functions.

With that update it is fairly simple to create a subclass of BrowserWebDriverContainer to take care of re-creating the vnc recorder by overriding the afterTest method.

class VncRecordingPerTestMethodBrowserWebDriverContainer<T extends VncRecordingPerTestMethodBrowserWebDriverContainer<T>>
		extends BrowserWebDriverContainer<T> {
	@Override
	public void afterTest(TestDescription description, Optional<Throwable> throwable) {
		super.afterTest(description, throwable);
		reinitializeVncRecorderContainer();
	}
}

@MartinAhrer MartinAhrer requested a review from a team as a code owner May 13, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant