"圣诞快乐,亲爱的聪明的参与者“
test-dev:
stage: test
script:
- mkdir -p tests/js/screens/diffs
- docker run --rm -d --name=browser_$CI_JOB_ID -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome
- npx mocha tests/js/screenshots-* --timeout 50000
- npx playwright test tests/js/pw_*
- php artisan test
- docker stop browser_$CI_JOB_ID
artifacts:
when: always
name: $CI_COMMIT_SHA
untracked: true
paths:
- tests/js/screens
- tests/js/report
cache:
when: always
paths:
- storage/framework
- vendor/ #composer packages
- node_modules
- public
key:
files:
- vendor/ #composer packages
- composer.lock
tags:
- test_new_runner
相同的作业,但正在进行重建
test-dev:
# allow_failure: true
stage: test
image: selenium/standalone-chrome
script:
- mkdir -p tests/js/screens/diffs
# - docker run --rm -d --name=browser_$CI_JOB_ID -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome
- npx mocha tests/js/screenshots-* --timeout 50000
- npx playwright test tests/js/pw_*
- php artisan test
# - docker stop browser_$CI_JOB_ID
artifacts:
when: always
name: $CI_COMMIT_SHA
untracked: true
paths:
- tests/js/screens
- tests/js/report
cache:
when: always
paths:
- storage/framework
- vendor/ #composer packages
- node_modules
- public
key:
files:
- vendor/ #composer packages
- composer.lock
tags:
- test_new_runner
我想删除Docker Launch,因为它失败了,但我不知道如何使用它的图像,但如果我使用图像,我没有npx内,我不知道如何做到这一点,有人能帮助这个吗?
1条答案
按热度按时间g6baxovj1#
您可以使用基础映像
docker:20.10.16
,然后安装npx
,然后使用service
运行docker dind
,然后在Docker中运行selenium浏览器。例如:
希望这个管用。