testcontainers / testcontainers/testcontainers-java

[Bug]: Junit5 {BrowserWebDriverContainer with VncRecordingMode.RECORD_FAILING is not recording}

Open
#10,270 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Selenium

Testcontainers version

1.21.0

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host Arch

x64

Docker version
Client:
 Cloud integration: v1.0.22
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.10
 Git commit:        dea9396
 Built:             Thu Nov 18 00:42:51 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:35:39 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
What happened?

Starting Junit5 integration with selenium. BrowserWebDriverContainer with VncRecordingMode.RECORD_FAILING is not recording the videos. It record when i change recording mode to RECORD_ALL

@Testcontainers
public class TC8110_TestContainer {

@Container
private static BrowserWebDriverContainer<?> browserContainer =
    new BrowserWebDriverContainer<>()
        .withCapabilities(new ChromeOptions())
        .withEnv("DEBUG","true")
        .withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_FAILING, SeleniumHelper.getRecordingFolder().toFile(), VncRecordingContainer.VncRecordingFormat.MP4);

@Test
public void testExample() {
    WebDriver driver = browserContainer.getWebDriver();
    driver.get("http://example.com");
    // Add your assertions here
   // assertEquals("Example Domain12", driver.getTitle());
    Assertions.assertEquals("http://example.com", driver.getTitle());
   // throw new IllegalStateException("hello test exception");
}
Relevant log output

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BrowserWebDriverContainer and reproduce the JUnit 5 example using VncRecordingMode.RECORD_FAILING, Windows, and Docker 20.10.11. Compare its behavior with RECORD_ALL and inspect the recording output and container lifecycle; done means failing tests produce an MP4 recording while passing tests retain the documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.