【问题标题】:Run specific spec files on cypress docker-compose setup在 cypress docker-compose setup 上运行特定的规范文件
【发布时间】:2021-06-11 04:39:28
【问题描述】:

我有一个 docker-compose 文件来运行 cypress 测试,但我看到它正在识别集成文件夹中的所有规范文件并运行测试。我想运行规范文件的一个子集。例如:只有一个特定的规范文件。

我尝试使用 command: 并且 cypress 运行没有帮助的特定文件。有没有办法使用 docker-compose 设置运行特定的规范文件。

version: '3.2'
services:
  cypress:
    image: 'cypress/included:6.6.0'
    environment:
      - CYPRESS_environment=test
    working_dir: /test
    volumes:
      - ./:/test

【问题讨论】:

    标签: docker-compose cypress


    【解决方案1】:

    如果你查看它使用入口点的 Dockerfile,那么你可以在 compose 文件中使用命令参数来运行特定文件

    version: '3.2'
    services:
      cypress:
        image: 'cypress/included:6.6.0'
        environment:
          - CYPRESS_environment=test
        working_dir: /test
        volumes:
          - ./:/test
        command: "--spec /test/integration/mytest.js"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-16
      • 2017-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-15
      • 1970-01-01
      相关资源
      最近更新 更多