Reputation: 373
I created a test-café runner file and running a test using selenium grid. Its working fine from my machine but we need to do same operation using GitLab pipeline.
Using pipeline, I am able to connect with selenium grid server but always getting Time-out error.
When I logged into the selenium node server to check, I can see that testcafe open a chrome browser instance but not able to start the test.
Here is my pipeline error:
Selenium server address is set to: http://myserver:4444/wd/hub
Error: Unable to open the "selenium:chrome" browser due to the following error:
WebDriverError: unknown error: net::ERR_CONNECTION_TIMED_OUT
(Session info: chrome=102.0.5005.[63](https://gitlab.com/automation-test/load-testing/-/jobs/2556429847#L63))
at Object.throwDecodedError (/etc/gitlab-runner/builds/1idHsSdk/0/automation-test/load-testing/node_modules/selenium-webdriver/lib/error.js:522:15)
at parseHttpResponse (/etc/gitlab-runner/builds/1idHsSdk/0/automation-test/load-testing/node_modules/selenium-webdriver/lib/http.js:549:13)
at Executor.execute (/etc/gitlab-runner/builds/1idHsSdk/0/automation-test/load-testing/node_modules/selenium-webdriver/lib/http.js:475:28)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
at Object.execute (/etc/gitlab-runner/builds/1idHsSdk/0/automation-test/load-testing/node_modules/selenium-webdriver/lib/webdriver.js:735:17)
at BrowserConnection._runBrowser (/etc/gitlab-runner/builds/1idHsSdk/0/automation-test/load-testing/node_modules/testcafe/src/browser/connection/index.ts:214:32)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
YAML File
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
stages:
- deploy
e2e_tests:
stage: deploy
tags:
- shell-executor
image: node:12.13.0-alpine
before_script:
- npm install
script:
- node testcafe_runner.js
Package.json
{
"name": "TestCafe-TestRunner",
"version": "0.0.0",
"license": "MIT",
"private": true,
"devDependencies": {
"testcafe":"1.18.6",
"testcafe-browser-provider-selenium":"1.2.0",
"testcafe-reporter-html":"^1.4.4",
"testcafe-reporter-xunit":"^2.1.0",
"find-free-port":"2.0.0",
"node-cmd":"^3.0.0",
"internal-ip":"6.2.0",
"fs-extra":"^6.0.1",
"csv-parser":"^2.3.2",
"csv-writer":"^1.6.0"
}
}
Any help would be much appreciated
Upvotes: 0
Views: 413
Reputation: 2355
The TestCafe documentation states that you will need to use their docker image, or install testcafe
in an image with the necessary browser runtimes you will be testing against.
Upvotes: 1