vscode-extension-tester icon indicating copy to clipboard operation
vscode-extension-tester copied to clipboard

[🚫 Bug] `Screenshots` doesn't exist

Open RedCMD opened this issue 4 months ago • 2 comments

Describe the bug

npm run ui-test claims failure screenshots can be found at test-resources\screenshots\20250918T180621 however the folder does not exist

Image Image

Steps to reproduce

1. clone https://github.com/redhat-developer/vscode-extension-tester-example
2. npm i
3. npm run ui-test

Logs

INFO: Screenshots of failures can be found in: C:\Users\RedCMD\AppData\Local\Temp\test-resources\screenshots\20250918T180621

Operating System

Windows 11

Visual Studio Code

1.104.1

vscode-extension-tester

8.17.0

NodeJS

node-v20.19.5-x64

npm

11.6.0

RedCMD avatar Sep 18 '25 06:09 RedCMD

can you please attach also console log which tests failed? this can happen in case failures are coming from hook methods such as after/before/afterAll/beforeAll and those are not imported from vscode-extension-tester package in test class

djelinek avatar Sep 23 '25 15:09 djelinek

it is failing on hook methods

 *  Executing task: npm run ui-test 


> [email protected] ui-test
> extest setup-and-run './out/ui-test/*.test.js' --code_settings settings.json --extensions_dir .test-extensions

Downloading VS Code: 1.104.1 / stable
VS Code exists in local cache, skipping download
ChromeDriver 138.0.7204.183 exists in local cache, skipping download
Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish
> npm run compile


> [email protected] compile
> tsc -p ./ && npm run lint


> [email protected] lint
> eslint src

 INFO  Files included in the VSIX:
helloworld-extester-0.1.0.vsix
├─ [Content_Types].xml
├─ extension.vsixmanifest
└─ extension/
   ├─ .gitignore [0.08 KB]
   ├─ .mocharc.js [0.09 KB]
   ├─ CODEOWNERS [0.34 KB]
   ├─ LICENSE.txt [11.3 KB]
   ├─ demo.gif [846.4 KB]
   ├─ eslint.config.mjs [1 KB]
   ├─ package.json [1.54 KB]
   ├─ readme.md [1.56 KB]
   ├─ icons/
   │  └─ logo.png [128.29 KB]
   └─ out/
      ├─ extension.js [4.36 KB]
      └─ extension.js.map [2.16 KB]

 DONE  Packaged: E:\repos\extensions\vscode-extension-tester-example\helloworld-extester-0.1.0.vsix (13 files, 769.58 KB)
Installing extensions...
Extension 'helloworld-extester-0.1.0.vsix' was successfully installed.
Loading mocha configuration from E:\repos\extensions\vscode-extension-tester-example\.mocharc.js


Detected user defined code settings
Writing code settings to C:\Users\RedCMD\AppData\Local\Temp\test-resources\settings\User\settings.json
Launching browser...


DevTools listening on ws://127.0.0.1:53213/devtools/browser/15957773-3c60-4bfe-91d2-69d4f3671803
Warning: 'allow-pre-commit-input' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-background-networking' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-backgrounding-occluded-windows' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-client-side-phishing-detection' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-default-apps' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-hang-monitor' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-popup-blocking' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-prompt-on-repost' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'disable-sync' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-automation' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-logging' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'log-level' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'first-run' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'service-autorun' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'remote-debugging-port' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'test-type' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'use-mock-keychain' is not in the list of known options, but still passed to Electron/Chromium.
  1) "before all" hook in "{root}"
  2) "after all" hook in "{root}"

  0 passing (2s)
  2 failing

  1) "before all" hook in "{root}":
     SessionNotCreatedError: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
      at Object.throwDecodedError (node_modules\selenium-webdriver\lib\error.js:523:15)
      at parseHttpResponse (node_modules\selenium-webdriver\lib\http.js:524:13)
      at Executor.execute (node_modules\selenium-webdriver\lib\http.js:456:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  2) "after all" hook in "{root}":
     TypeError: Cannot read properties of undefined (reading 'manage')
      at VSBrowser.quit (node_modules\vscode-extension-tester\out\browser.js:214:44)
      at Context.<anonymous> (node_modules\vscode-extension-tester\out\suite\runner.js:133:31)
      at process.processImmediate (node:internal/timers:483:21)



INFO: Screenshots of failures can be found in: C:\Users\RedCMD\AppData\Local\Temp\test-resources\screenshots\20250924T084515


 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run ui-test" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

RedCMD avatar Sep 23 '25 20:09 RedCMD