Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将颤振ui测试与docker集成:无头铬合金上的驾驶测试_Docker_Flutter_Continuous Integration_Integration Testing_Flutterdriver - Fatal编程技术网

将颤振ui测试与docker集成:无头铬合金上的驾驶测试

将颤振ui测试与docker集成:无头铬合金上的驾驶测试,docker,flutter,continuous-integration,integration-testing,flutterdriver,Docker,Flutter,Continuous Integration,Integration Testing,Flutterdriver,我需要将颤振试驾集成到GitlabCI中。我想用chrome作为设备创建docker容器的最简单的方法(我使用GitlabCI,但如果使用纯docker、CircleCI、TravisCI或一些进入AWS的管道或许多其他方法,您也会遇到同样的问题)。 但我得到了这个错误: Found multiple connected devices: test_drive_1 | Web Server • web-server • web-javascript • Flutter Tools test_

我需要将颤振试驾集成到GitlabCI中。我想用chrome作为设备创建docker容器的最简单的方法(我使用GitlabCI,但如果使用纯docker、CircleCI、TravisCI或一些进入AWS的管道或许多其他方法,您也会遇到同样的问题)。 但我得到了这个错误:

 Found multiple connected devices:
test_drive_1  | Web Server • web-server • web-javascript • Flutter Tools
test_drive_1  | Chrome     • chrome     • web-javascript • Google Chrome 74.0.3729.108
test_drive_1  | Using device Web Server.
test_drive_1  | Starting application: test_driver/app.dart
test_drive_1  | Launching test_driver/app.dart on Web Server in release mode...
test_drive_1  | Compiling test_driver/app.dart for the Web...                      29.8s
test_drive_1  | test_driver/app.dart is being served at http://localhost:36571
test_drive_1  | Application finished.
test_drive_1  | Waiting for connection from Dart debug extension at http://localhost:36571
test_drive_1  | Unable to start WebDriver Session for Flutter for Web testing. 
test_drive_1  | Make sure you have the correct WebDriver Server running at 4444. 
test_drive_1  | Make sure the WebDriver Server matches option --browser-name. 
test_drive_1  | WebDriverException (61): invalid argument: perfLoggingPrefs specified, but performance logging was not enabled
test_drive_1  |   (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-33-generic x86_64)
flutter_test_app_test_drive_1 exited with code 0
完整的例子是。 要复制问题,请执行以下操作:

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
有趣的文件如下所示:

  • Dockerfile:
  • 运行\u test\u drive.sh:
  • docker-compose.yml

我将chrome和chrome驱动程序版本升级到最新版本,现在可以使用了!所以好好工作吧

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'