How to make protractor run with puppeteer and chrome 78?

后端 未结 2 1889
悲&欢浪女
悲&欢浪女 2021-01-21 19:24

I am using Protractor for Angular E2E Tests + Puppeteer for a consistent Chrome Version in all CI-Servers.

Lately I am getting SessionNotCreatedError: session not

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-21 20:07

    I had a similar problem to this, however my issue was with Chrome 81.

    E/launcher - session not created: This version of ChromeDriver only supports Chrome version 81

    My solution was the below two steps:

    1) Dont let Angular install the latest available webdriver for you when running ng e2e, by using the --webdriverUpdate flag and setting it to false.

    2) Use the webdriver-manager from protractor and manually specify which webdriver to use:

    node_modules/protractor/bin/webdriver-manager update --versions.chrome=80.0.3987.106 --gecko false --standalone false

    3) add this to the "pree2e" step as to be automatically executed before the e2e step:

    "pree2e": "node_modules/protractor/bin/webdriver-manager update --versions.chrome=80.0.3987.106 --gecko false --standalone false"

    To see which webdrivers are installed, use node_modules/protractor/bin/webdriver-manager status.

    https://github.com/angular/webdriver-manager/blob/legacy/docs/versions.md#download-a-specific-version

    https://angular.io/cli/e2e#options

    versions used:

    "protractor": "5.4.3"
    "puppeteer": "2.1.1"
    
    Angular CLI: 9.1.0
    Node: 12.2.0
    OS: linux x64
    

提交回复
热议问题