After installing up Chrome and Chromedriver via gitlab-ci.yml, Chromedriver is initiated by ‘- chromedriver --port=4444’. At this point, all steps stop as Chromedriver is running:
How do I ensure subsequent steps are initiated/completed in this scenario?
gitlab-ci.yml:
# Webapp automates testing
webapp:test:
extends: .webapp:test
stage: test
allow_failure: true
before_script:
# Chrome and ChromeDriver dependencies
- cd $APP_DIR
- apt-get install -y wget unzip
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list
- apt-get update -y
# Download and Install chrome
- wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install -y /tmp/chrome.deb && rm /tmp/chrome.deb
# Download and install Chromedriver
- mkdir /chromedriver
- wget -q --continue -P /chromedriver "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chromedriver-linux64.zip"
- unzip /chromedriver/chromedriver* -d /chromedriver
# Put Chromedriver into the PATH
- chmod +x /chromedriver/chromedriver-linux64
- export PATH="/chromedriver/chromedriver-linux64:$PATH"
- |
if [ "$CI_COMMIT_REF_NAME" == "main" ]; then
TEST_URL="https://rova.test.apps.goldcoast.qld.gov.au/"
elif [ "$CI_COMMIT_REF_NAME" == "test" ]; then
TEST_URL="https://rova.test.apps.goldcoast.qld.gov.au/"
elif [ "$CI_COMMIT_REF_NAME" == "develop" ]; then
TEST_URL="https://rova.dev.apps.goldcoast.qld.gov.au/"
fi
only:
changes:
- front-end/flutter-app/**/*
- docker/base/**/*
- back-end/serverless-functions/function-app/**/*
- back-end/serverless-functions/function-app.tests/**/*
flutterapp.gitlab-ci.yml
## Webapp test
.webapp:test: &webapp_test
image: $CI_REGISTRY_IMAGE/flutter:latest
cache:
paths:
- .npm/
- node_modules/
script:
- apt-get update && apt-get install -y jq
- cd $APP_DIR
- cd /chromedriver/chromedriver-linux64
- chromedriver --version
- chromedriver --port=4444
- cd $APP_DIR
- flutter drive --driver=test_driver/integration_test.dart --target=integration_test/start_page.dart -d web-server
artifacts:
paths:
- $APP_DIR/test-results/
when: always
allow_failure: true
Please note, I am relatively new to GitLab CI, as you can probably tell. I am aware there may be further issues to resolve to get the one test running, once I can get past this issue, but am happy to receive any feedback at all on the way I have put this together.