Karate UI-based tests run successfully locally with karate-chrome (steps here) which starts a container with an exposed port.
Now, I am trying to run the tests within the karate-chrome container in CI. I have started the karate-chrome container with KARATE_SOCAT_START=true
and then executed the java -jar (standalone jar) command to run the tests. Non-UI based tests pass but the UI tests are throwing the following exception:
ERROR com.intuit.karate - http request failed:
15:26:09 DOCKER: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9222 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
Note that driverTarget with docker has not been configured. Only the following driver's configuration:
* configure driver = { type: 'chrome', start: false, showDriverLog: true, port:9222 ,pollAttempts: 5}
Is it possible to make it work this way or should a custom docker image be set up?