量角器失败,因为Chrome需要google登录

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

我的量角器测试在几周前工作正常,但是在没有更改我的代码后就停止了工作。我认为Google chrome已更新。

突然,当我启动测试时,通过键入“ npm run e2e”,测试将打开chrome浏览器(照常),但是现在它迫使我以chrome登录到我的Google帐户。看起来像这样:

Chrome forcing me to sign in

我该怎么办?

这是我如何在protractor.conf.js中配置我的浏览器

capabilities: {
    'browserName': 'chrome',
    chromeOptions: {
        args: [ "--window-size=800,600" ]
    }
},
angular google-chrome typescript protractor
1个回答
1
投票

也开始发生在我身上。我正在使用版本81.0.4044.113。

一种可能的解决方法是在无头模式下运行量角器,这意味着浏览器实际上并未打开。

将以下参数添加到量角器配置:

config.capabilities.chromeOptions = {
    args: [
      '--headless',
      '--disable-gpu',
      '--disable-browser-side-navigation'
    ]
  }
© www.soinside.com 2019 - 2024. All rights reserved.