-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Selenium container not using provided network #844
Comments
An update I was able to overcome the issue mentioned indirectly. I added the Selenium Container to the same network as the docker compose environment created using the With this workaround my tests are working. But this is not ideal. I am also recording the Selenium tests to see that it is working as expected, especially during writing the tests. With this workaround, I am not able to record the tests. From the code, seems like if recording is enabled a new network is created and shared across the selenium containers. So, I request your help for the following
Thanks for such a great project! |
Hi @GeezFORCE, I am not a JavaScript or Node developer, so likely I am going into a wrong direction here, but I don't think Testcontainers will exit here because of using Besides, I think your workaround is a good one, if your Selenium container is not supposed to hit the host, but rather another container, putting the Selenium container into the same network is the better approach.
I think that should be possible. |
Hi @kiview , Thank You for the reply. I am also pretty new to the JavaScript/ Node Ecosystem and coming from a Java background I am still wrapping my brain around how this all works. I also share your same view that the issue might be something going wrong with the code I implemented rather than with testcontainers. But, I am not able to find the correct way to debug this. I will wait for Cristian's comments on this. For the second recommendation, I think this might be a good enhancement as this is what a dev might expect when |
Hello @cristianrgreco
Is this feasible? |
Hi @GeezFORCE, yep that makes sense. The code in question is here:
It needs to use the provided network if provided, else create its own. Something like |
Encountering this issue when trying expose a host port in compose environment within jest global setup.
Expected Behaviour
Description of the Issue
I am writing a series of tests and as per the previous issue I opened, I was advised to try out jest global setup for creating the environment which can be reused. I moved to jest and was able to migrate most of my test cases.
I am right now trying to integrate some selenium tests into the mix. For this I was utilizing the Selenium Testcontainer module. For using the selenium container, I tried to expose the host ports as shown below and it fails. The port must be exposed and the compose environment must be up, but as soon as the port gets exposed the whole environment exits.
Alternatives Tried
I tried using top-level awaits, waiting for the port to get exposed and then starting the environment to no avail.
I also tried to share the docker compose network to selenium and that too does not seem to work.
Actual Behaviour
Test containers exits just after exposing the port
Testcontainer Logs
Steps to Reproduce
Environment Information
The text was updated successfully, but these errors were encountered: