首页 > 解决方案 > 赛普拉斯和 Docker - 无法运行,因为未找到规范文件

问题描述

我正在尝试在 docker 容器中运行 cypress 测试。我已经简化了我的设置,所以我可以尝试运行一个简单的容器实例并执行一些测试。

我正在使用 docker-compose

version: '2.1'
services:
  e2e:
    image: test/e2e:v1
    command: ["./node_modules/.bin/cypress", "run", "--spec", "integration/mobile/all.js"]
    build:
      context: .
      dockerfile: Dockerfile-cypress
    container_name: cypress
    network_mode: host

和我的 Dockerfile-cypress

FROM cypress/browsers:chrome69

RUN mkdir /usr/src/app
WORKDIR /usr/src/app

RUN npm install cypress@3.1.0

COPY cypress /usr/src/app/cypress
COPY cypress.json /usr/src/app/cypress

RUN ./node_modules/.bin/cypress verify

当我docker-compose up在构建图像后运行时,我看到

cypress | name_to_handle_at on /dev: Operation not permitted
cypress | Can't run because no spec files were found.
cypress |
cypress | We searched for any files matching this glob pattern:
cypress |
cypress | integration/mobile/all-control.js
cypress exited with code 1

我已验证我的 cypress 文件和文件夹已被复制,并且我可以验证我的测试文件是否存在。我已经坚持了一段时间,除了放弃之外我不确定该怎么做。

任何指导表示赞赏。

标签: docker-composecypress

解决方案


结果赛普拉斯会自动检查/cypress/integration文件夹。将我所有的柏树文件移动到这个文件夹中就可以了。


推荐阅读