I need to integrate flutter test drive into GitlabCI. I thing that easiest way to create a docker container (I use GitlabCI but you have the same problem if you use pure Docker or CircleCI or TravisCI or some pipeline into AWS or many other way) with chrome as device.
But I get this error:
The complete example is here.
To replicate the problem do this:
git clone https://gitlab.com/nicolalandro/flutter_test_app.git cd flutter_test_drive cd docker docker build -t flutter_test_drive . cd .. docker-compose up
The interesting file are the follow:
from cirrusci/flutter:stable RUN sudo apt update && sudo apt install -y gdebi-core libnss3 libgconf-2-4 ADD google-chrome-stable_current_amd64.deb . RUN sudo gdebi -n google-chrome-stable_current_amd64.deb WORKDIR /app ADD chromedriver . RUN sudo chmod +x chromedriver # upgrade flutter RUN cd /home/cirrus/sdks/flutter && git checkout master && git pull && flutter upgrade RUN flutter config --enable-web && flutter doctor
#!/bin/sh /app/chromedriver --whitelisted-ips --port=4444 & FOO_PID=$! # nohup sh -c /app/chromedriver --whitelisted-ips & flutter doctor flutter pub get flutter clean # run test flutter drive --target=test_driver/app.dart --release kill $FOO_PID
version: '3' services: test_drive: image: flutter_test_drive volumes: - .:/flutter_project working_dir: /flutter_project command: "./run_test_drive.sh" ports: - '8000:8000'
I upgrade the chrome and chrome driver versions to latest and now it work! So this code version work well.
Answered By – Nicola Landro
Answer Checked By – Mildred Charles (FlutterFixes Admin)