代码之家  ›  专栏  ›  技术社区  ›  Adrian Krebs

如何为Gitlab上的夜班E2e测试设置正确的硒主机?

  •  1
  • Adrian Krebs  · 技术社区  · 8 年前

    我想为vue.js应用程序添加一些e2e测试,并在管道中运行它们。 我的gitlab-ci.yml中的相应部分如下:

    e2e:
    image: node:8
    before_script:
      - npm install
    services:
      - name: selenium/standalone-chrome
      alias: chrome
    stage: testing
    script:
      - cd online-leasing-frontend
      - npm install
      - npm run test:e2e
    

    我的nightwatch.js配置:

    {
      "selenium": {
        "start_process": false
        },
      "test_settings": {
        "default": {
          "selenium_port": 4444,
          "selenium_host": "chrome"
        }
      }
    }
    

    Selenium_主机:chrome是将主机设置为Selenium服务的正确方式吗? 我得到以下错误,表明我的E2E测试无法连接到Selenium服务:

    连接被拒绝!Selenium服务器启动了吗?

    有什么小窍门吗?

    2 回复  |  直到 8 年前
        1
  •  1
  •   Adrian Krebs    8 年前

    this issue Kubernetes Executor Docker Executor 127.0.0.1 selenium_host

    {
      "selenium": {
        "start_process": false
        },
      "test_settings": {
        "default": {
          "selenium_port": 4444,
           "selenium_host": "127.0.0.1",
        }
      }
    }
    
        2
  •  0
  •   mibemerami    8 年前