Skip to content

Commit

Permalink
document testcontainers requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
jtnord committed Sep 11, 2024
1 parent fe0afc9 commit da7973e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/BROWSER.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ If the host running maven is different to the host running Selenium (e.g. `remot
If this is the case you can specify the address to use using:
`SELENIUM_PROXY_HOSTNAME=ip.address.of.host mvn install`
**Important**: this could exposed the proxy wider beyond your machine and expose other internal services, so this should only be used on private or internal networks to prevent any information leak.
The same issue will also impact any other containers started that the tests that the Browser (rather than Jenkins) needs to access.
For TestContainers you can additionally set `TESTCONTAINERS_HOST_OVERRIDE=ip.address.of.host`

## Avoid focus steal with Xvnc on Linux
If you select a real GUI browser, such as Firefox,
Expand Down
7 changes: 7 additions & 0 deletions docs/DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ It's best explained with an example:
# Using a custom docker network

If you are using a custom network for the container that executes the testing you may instruct the docker-fixtures to use the same one by setting the env variable `DOCKER_FIXTURES_NETWORK`to specify the network you want your fixtures to connect to.

# Using TestContainers with a remote webdriver

If you are using a containerized webdriver (or any other remote webdriver) then any containers launched will not be reachable from the remote web browser.
This will be an issue for some tests that require the browser interact with the container (e.g. for authentication).
If this is the case then the `TESTCONTAINERS_HOST_OVERRIDE` should be set to `host.docker.internal` or if the remote browser is non local the IP adddress of your machine.

1 change: 1 addition & 0 deletions vars.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ IF NOT DEFINED IP (

@echo on
set SELENIUM_PROXY_HOSTNAME=%IP%
set TESTCONTAINERS_HOST_OVERRIDE=%IP%
set JENKINS_LOCAL_HOSTNAME=%IP%
@echo.
@echo To start the remote firefox container run the following command:
Expand Down

0 comments on commit da7973e

Please sign in to comment.