Skip to content

Bug Report: WebDriver — Tests do not run with restart = false inside Docker Container #5148

Description

@myrepojuly

When running CodeceptJS tests with the WebDriver helper and restart: false inside a Docker container, tests never start execution. On a local runner (outside Docker), the same tests run fine

The problem appears to be with this line in codeceptjs/lib/helper/WebDriver.js:

await this.browser.sessionSubscribe({ events: ['log.entryAdded'] })

If I comment out this line, the tests execute without issues.

This issue only happens inside Docker. On a local runner (outside Docker), the same tests run fine.

Minimal Reproducible Example:
Repo: https://github.com/myrepojuly/codecetpjssample

Steps to reproduce:

  1. Clone the repo above.
  2. Run npx codeceptjs run --verbose inside a Docker container with WebDriver helper and restart: false.
    docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:134.0.6998.165-20250525

For Mac: docker run --platform linux/x86_64 -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:134.0.6998.165-20250525

  1. Observe that tests never execute.
  2. Comment out the sessionSubscribe line and rerun → tests pass.

Expected Behavior
Tests should execute correctly with restart: false inside Docker, same as on local runner.

Environment
CodeceptJS: 3.7.4
WebdriverIO: 9.15.0
Runner: Docker (Selenium container + CodeceptJS test runner)
Local machine: works fine

Notes:
Not sure what sessionSubscribe({ events: ['log.entryAdded'] }) is intended to do.

Activity

  1. myrepojuly commented on Sep 14, 2025

    @myrepojuly
    Author

    @kobenguyent @DavertMik Could you check the above as this is preventing us from running the tests even in Selenium Grid on EKS. The only option that works is to downgrade CodeceptJS to version 3.6.8 along with WebdriverIO version

  2. myrepojuly commented on Sep 15, 2025

    @myrepojuly
    Author

    @kobenguyent Shouldn’t we add a check before subscribing to BiDi events? For example:

    if (config.bidiProtocol) {
     await this.browser.sessionSubscribe({ events: ['log.entryAdded'] }); 
    }
    

    This would ensure that CodeceptJS only attempts to subscribe to BiDi logging when the protocol is explicitly enabled in the configuration

  3. kobenguyent commented on Sep 15, 2025

    @kobenguyent
    Collaborator

    @myrepojuly may you happen to check if this resolved the issue?

    #5095

  4. myrepojuly commented on Sep 15, 2025

    @myrepojuly
    Author

    Fixed via [#5095 ] (#5095)

  5. myrepojuly commented on Sep 15, 2025

    @myrepojuly
    Author

    Hey @kobenguyent , could you push for a beta release if a full (stable) release isn’t planned yet?

  6. myrepojuly commented on Sep 16, 2025

    @myrepojuly
    Author

    Thanks @kobenguyent for the beta release. Appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions