如何使用GitLab CI设置Selenium E2Etesting?

我正在开发一个网站前端的Vue.js应用程序。

对于这个应用程序,我想使用单元和E2Etesting。 我用vue-cli构build了我的项目。

根据我的理解,vue-cli使用Karma进行unit testing,使用Nightwatch + Selenium进行E2Etesting。

我的.gitlab-ci.yml如下所示:

 stages: - test test:express: image: node:boron stage: test script: - cd backend/ - npm install --progress=false - ./node_modules/.bin/jasmine test:vue: image: node:boron stage: test script: - cd frontend/ - npm install --progress=false - npm test 

npm test运行e2e和unit testing,并在本地计算机上运行。 unit testing运行顺利,Selenium调出Chrome窗口并使用E2Etesting。

问题是不知道如何在GitLab CI上运行E2E Seleniumtesting。 它不断给我一个错误说:

Could not connect to Selenium Server. Have you started the Selenium Server yet? ,虽然之前说两行已经创build了Selenium服务器。

我如何在GitLab CI上运行E2E Seleniumtesting? 如果这是不可行的,我可以在GitLab CI上运行什么types的E2E?