vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.78k stars 6.33k forks source link

Cannot get e2e testing to work on Ubuntu 19.10 (Chrome 78) #4769

Closed ijdickinson closed 2 years ago

ijdickinson commented 4 years ago

Version

4.0.0

Reproduction link

https://github.com/ijdickinson/nightwatch-test

Environment info

Environment Info:

  System:
    OS: Linux 5.3 Ubuntu 19.10 (Eoan Ermine)
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 10.17.0 - /usr/bin/node
    Yarn: 1.17.3 - ~/.npm-packages/bin/yarn
    npm: 6.12.0 - ~/.npm-packages/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 70.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  4.0.5 
    @vue/babel-preset-jsx:  1.1.1 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.1.1 
    @vue/babel-sugar-v-on:  1.1.0 
    @vue/cli-overlay:  4.0.5 
    @vue/cli-plugin-babel: ^4.0.0 => 4.0.5 
    @vue/cli-plugin-e2e-nightwatch: ^4.0.0 => 4.0.5 
    @vue/cli-plugin-eslint: ^4.0.0 => 4.0.5 
    @vue/cli-plugin-router:  4.0.5 
    @vue/cli-plugin-unit-jest: ^4.0.0 => 4.0.5 
    @vue/cli-plugin-vuex:  4.0.5 
    @vue/cli-service: ^4.0.0 => 4.0.5 
    @vue/cli-shared-utils:  4.0.5 
    @vue/component-compiler-utils:  3.0.0 
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.3 
    jest-serializer-vue:  2.0.2 
    vue: ^2.6.10 => 2.6.10 
    vue-eslint-parser:  5.0.0 
    vue-hot-reload-api:  2.3.4 
    vue-jest:  3.0.5 
    vue-loader:  15.7.1 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 3.11.0

Steps to reproduce

  1. vue create nightwatch-test
  2. select options for e2e testing with nightwatch
  3. cd nightwatch-test
  4. yarn test:e2e

What is expected?

The default minimal test will run as expected in Chromium

What is actually happening?

Chromium shows error dialog:

Failed to load extension from: . Manifest file is missing or unreadable

Terminal shows an error message:

Running end-to-end tests ...

[Test With Pageobjects] Test Suite
==================================
Error: An error occurred while retrieving a new session:     "unknown error: Chrome failed to start: exited normally"
   at endReadableNT (_stream_readable.js:1143:12)
   at process._tickCallback (internal/process/next_tick.js:63:19)

This started happening after I upgraded to Ubuntu 19.10. A feature of this upgrade is that it replaces the usual apt install of Chromium with the snap installed version. Specifically it snap installs Chromium 78

ijdickinson commented 4 years ago

A little extra information on this: looking in chrome://version, I can see that the command line used to start Chrome is:

/snap/chromium/937/usr/lib/chromium-browser/chrome --no-default-browser-check 
  --no-first-run --password-store --disable-background-networking 
  --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor 
  --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources
  --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging 
  --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors 
  --load-extension=/tmp/.org.chromium.Chromium.KD8eNh/internal --log-level=0 
  --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=0
  --test-type=webdriver --use-mock-keychain 
  --user-data-dir=/tmp/.org.chromium.Chromium.vwoHgE --flag-switches-begin 
  --flag-switches-end data:

So the only extension that it is trying to load is /tmp/.org.chromium.Chromium.KD8eNh/internal. And, indeed, if I remove that command line switch, Chrome loads just fine.

Looking at the extension in /tmp, it looks OK (to my untrained eye):

$ ls -alR /tmp/.org.chrom*
.org.chromium.Chromium.KD8eNh:
total 80
drwx------  3 ian  ian   4096 Nov  8 17:31 ./
drwxrwxrwt 37 root root 65536 Nov  8 17:31 ../
drwx------  2 ian  ian   4096 Nov  8 17:31 internal/
-rw-r--r--  1 ian  ian   2578 Nov  8 17:31 internal.zip

.org.chromium.Chromium.KD8eNh/internal:
total 16
drwx------ 2 ian ian 4096 Nov  8 17:31 ./
drwx------ 3 ian ian 4096 Nov  8 17:31 ../
-rw------- 1 ian ian 1851 Jan  9  2019 background.js
-rw------- 1 ian ian  501 Jan  9  2019 manifest.json

.org.chromium.Chromium.LLiqBg:
total 80
drwx------  3 ian  ian   4096 Nov  8 17:31  ./
drwxrwxrwt 37 root root 65536 Nov  8 17:31  ../
drwx------  2 ian  ian   4096 Nov  8 17:31  Default/
-rw-r--r--  1 ian  ian      0 Nov  8 17:31 'First Run'
-rw-r--r--  1 ian  ian     78 Nov  8 17:31 'Local State'

.org.chromium.Chromium.LLiqBg/Default:
total 12
drwx------ 2 ian ian 4096 Nov  8 17:31 ./
drwx------ 3 ian ian 4096 Nov  8 17:31 ../
-rw-r--r-- 1 ian ian  713 Nov  8 17:31 Preferences

and

$ cat .org.chromium.Chromium.KD8eNh/internal/manifest.json 
{
  "key": "MIGfMA0[..elided for brevity..]htmIh2BQLwbiz",
  "name": "Chrome Automation Extension",
  "version": "1",
  "manifest_version": 2,
  "description": "Exposes extension APIs for automating Chrome",
  "background": {
    "scripts": ["background.js"]
  },
  "permissions": [
    "tabs", "management", "<all_urls>"
  ]
}

I can see that this might not be a Vue CLI issue per se. Happy to receive suggestions of which upstream support venue to take it to?

ijdickinson commented 2 years ago

Closing old issue