Headless Chrome量角器无法在AWS CodeBuild上使用,但可以在本地使用

问题描述 投票:5回答:1

我有一个需要进入Google身份验证的网页,然后才能进入一个有角度的网页,并且我已经建立了一些非常基本的端到端测试,这些测试在Linux中与Chrome Headless一样具有吸引力:

  1. 查找用户名字段
  2. 输入正确的电子邮件地址,然后单击下一步
  3. 输入登录密码
  4. 一旦通过Google身份验证,它将验证页面标题为“费用”

这是我在终端机中收到的最后一条消息:在46秒内成功执行3项规格中的3项。

但是,在AWS CodeBuild中,我们也使用Linux(Ubuntu)容器,并且一次失败[[every。这是第一个错误:...茉莉花开始

    查找用户名字段
  1. 输入正确的测试电子邮件地址
  • 0个已识别的h1标签Expense App E2E初始测试套件费用的索引页应该可以正常工作

      [[31m✗应该与测试用户正确登录·[39m
  • [[31m-·[39m·[31mFailed:
  • 未使用定位器找到元素]
  • :By(css选择器,* [id =“ identifierId”]]][[elementArrayFinder.getWebElements.then(/codebuild/output/src609592849/src/node_modules/protractor/built/element.js:814:27)的39m]
  • 这是protractor.conf.js中的设置信息:

    capabilities: { 'browserName': 'chrome', chromeOptions: { args: ["--headless", "--disable-dev-shm-usage", "--no-sandbox", "--disable-gpu", "--window-size=1280x960"] } }, directConnect: true, // Test scripts communicate directly with Chrome Driver, so they start up and run faster

    从package.json,我正在使用:“ e2e”:“ ng e2e --port 4200”,

    从buildspec-test.yml,我有以下post_build命令:-npm运行e2e

    为什么Chrome Headless在http://localhost:4200上找不到我的网页,而在本地Linux发行版上却没有问题,但是当他们都运行Ubuntu Linux时却无法在AWS CodeBuild中找到它?本地版本:Ubuntu 18.04.1 LTSAWS CodeBuild版本:Ubuntu Ubuntu 14.04.5 LTS(Trusty)

    请让我知道,并提前致谢!

    真诚地,

    PW

  • angular protractor e2e-testing google-chrome-headless aws-codebuild
    1个回答
    0
    投票
    是,我有这个答案。一位朋友和同事(谢谢,Bill T.)能够使用Ubuntu 18.04LTS创建Docker容器,并让我在AWS CodeBuild中运行它,并在其中运行[[worked
    © www.soinside.com 2019 - 2024. All rights reserved.