【问题标题】:Angular e2e tests protractor chrome flags not working headlessAngular e2e 测试量角器镀铬标志不能无头工作
【发布时间】:2020-09-08 10:56:12
【问题描述】:

我正在尝试在我的量角器配置中设置 cookies-without-same-site-must-be-secure@2,它在没有无头运行时完美运行。但是当我启用无头运行时,它不起作用并且我的测试因此而失败。有解决方法还是我在这里做错了什么?

提前致谢。

 capabilities: {
    'browserName': 'chrome',
    'shardTestFiles': true,
    'maxInstances': 4,
    'chromeOptions': {
      args: [
        "lang=nl-NL",
        "--disable-gpu",
        "--window-size=1800,1080",
        "--no-sandbox",
        "--disable-infobars",
        "--disable-dev-shm-usage",
        "--headless"
    ],
      prefs: {
        intl: { accept_languages: "nl-NL" },
      },
      localState: {
        'browser': {
          'enabled_labs_experiments': ['cookies-without-same-site-must-be-secure@2']
        }
      }
    }
  }

【问题讨论】:

标签: angular protractor e2e-testing


【解决方案1】:

作为替代方案,我发现将 --disable-features=CookiesWithoutSameSiteMustBeSecure,SameSiteByDefaultCookies 添加到 args 数组中可以正常工作。这并不是真正解决标志不起作用的事实,而是针对这种特殊情况的解决方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-02
    • 2017-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-13
    • 2018-08-24
    • 1970-01-01
    相关资源
    最近更新 更多