首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在gitlab-ci上启动selenoid?

如何在gitlab-ci上启动selenoid?
EN

Stack Overflow用户
提问于 2021-03-31 23:06:29
回答 1查看 386关注 0票数 0

我正在尝试在gitlab-ci上运行测试,但我不知道启动selenoid的命令是什么。在本地,这个命令看起来像./ Cm selenoid start,但是在从服务启动selenoid的情况下如何指定,我不知道。这是我的.gitlab-ci.yml

代码语言:javascript
复制
stages:
  - testing

ya_test:
  stage: testing
  tags:
    - docker
  services:
    - selenoid/chrome
  image: python:3.9-alpine
  before_script:
    - pip3 install -r requirements.txt
    - selenoid/chrome start         #???????
  script:
    - pytest -s
  allow_failure: true

test fixture中指定什么地址?本地主机:4444?谢谢你的帮助!

EN

回答 1

Stack Overflow用户

发布于 2021-04-18 11:32:46

要在Chrome中启动Selenoid,可以试试这个yml。使用webdriver.Remote(command_executor="http://selenoid__chrome:4444",和desired_capabilities=DesiredCapabilities.CHROME)连接options=chrome_options,并添加无沙箱到选项。

代码语言:javascript
复制
image: python:3.8

stages:
  - test

test:
  stage: test

  services:
    - name: aerokube/selenoid
    - name: selenoid/chrome:89.0

  before_script:
    - echo "Install environment"
    - apt-get update -q -y
    - pip3 install -r requirements.txt

  script:
    - echo "Run all tests"
    - py.test -s -v  --junitxml=report.xml test.py

  # if you want detailed report at GitLab add artifacts 
  artifacts:
    when: always
    reports:
      junit: report.xml
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66890431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档