在哪里把testing文件的webdriverIOtesting – 使用docker集装箱?

我不明白如何运行我的nodeJS应用程序的webdriverIO e2etesting。

正如你所看到的,我的nodeJS应用程序也作为docker容器运行。

但是现在我得到了一些非常基本的东西:

  1. 那么我要把我想要运行的testing文件放在哪里? 我必须将它们复制到webdriverio容器中吗? 如果是,在哪个文件夹?
  2. 那么我该如何运行testing呢?

这是我的docker组成所有需要的docker集装箱的设置:

services: webdriverio: image: huli/webdriverio:latest depends_on: - chrome - hub environment: - HUB_PORT_4444_TCP_ADDR=hub - HUB_PORT_4444_TCP_PORT=4444 hub: image: selenium/hub ports: - 4444:4444 chrome: image: selenium/node-chrome ports: - 5900 environment: - HUB_PORT_4444_TCP_ADDR=hub - HUB_PORT_4444_TCP_PORT=4444 depends_on: - hub myApp: container_name: myApp image: 'registry.example.com/project/app:latest' restart: always links: - 'mongodb' environment: - ROOT_URL=https://example.com - MONGO_URL=mongodb://mongodb/db mongodb: container_name: mongodb image: 'mongo:3.4' restart: 'always' volumes: - '/opt/mongo/db/live:/data/db' 

在这个链接中我有一个完整的小例子: Github

问:那么我必须把我想运行的testing文件放在哪里?

把它们放在运行Webdriver.io的容器中。

问:我必须将它们复制到Webdriverio容器中吗? 如果是,在哪个文件夹?

是。 把它们放在任何你想要的地方。 然后,如果你喜欢,你可以从一个command:脚本顺序运行。

问:那么我如何运行testing呢?

使用docker-compose uptesting容器将开始并开始运行它们。