I have the following circleci job to run my testcafe tests,
# Job to run testcafe e2e test suite
e2e-test:
executor: machine-ubuntu
description: Run e2e tests on local app in the pipeline container
working_directory: ~/project
parameters:
is_local:
type: boolean
default: true
testcafe_base_url:
type: string
default: https://localhost:4180/<redacted>
steps:
- checkout:
path: ~/project
- browser-tools/install-browser-tools
- install-dependencies
- run:
name: Install ffmeg for video recording
command: npm i @ffmpeg-installer/ffmpeg
- when:
condition: << parameters.is_local >>
steps:
- run:
name: Setup docker compose file
command: ./scripts/setup-docker-compose-file.sh
- run:
name: Run app locally
command: docker-compose up -d
- run:
name: Wait for app to be live
command: ./scripts/wait-for-server.sh <<parameters.testcafe_base_url>>
- run:
name: Run e2e test suite
command: npm run testcafe:chrome:headless chromium --no-sandbox testcafe/fixtures/*.ts --config-file .testcaferc.ci.json -r xunit:/tmp/test-results/testcafe/results.xml --video /tmp/artifacts/videos
environment:
TESTCAFE_BASE_URL: <<parameters.testcafe_base_url>>
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/artifacts/videos
however, I keep getting the following
The Chrome 99.0.4844.51 / Linux 0.0 browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault
Here is the message within circleci
Everything is green up until it starts running the tests, I’ve ran these locally and they all pass, so not sure what’s going on.
Here is my executors and orbs
executors:
docker-node:
resource_class: large
docker:
- image: cimg/node:16.13.1
machine-ubuntu:
machine:
image: ubuntu-2004:202010-01
commands:
install-dependencies:
description: Installs dependencies
steps:
- checkout:
path: ~/project
- run:
name: NPM install
command: npm ci
- run:
name: NPM cdk
command: cd cdk && npm ci
orbs:
browser-tools: circleci/[email protected]