redhat-developer / vscode-extension-tester

ExTester: Your Essential UI Testing Companion for Visual Studio Code Extensions! Seamlessly execute UI tests with Selenium WebDriver, ensuring robustness and reliability in your extension development journey. Simplify UI testing for your VS Code extensions and elevate the quality of your user interface effortlessly.
Apache License 2.0
247 stars 70 forks source link

[🚀 Request] How to provide vscode-style authentication via API #518

Open YuggothFungi opened 1 year ago

YuggothFungi commented 1 year ago

Expected Behavior

Actual Behavior

Steps to Reproduce the Problem

Manual steps are:

  1. VS code creates an URL to the web server
  2. User logs in on the web server and is provided with token from oauth server
  3. Token is returned as vscode://url (vs code's personal app protocol) that is pushed into browser, thus redirecting the call to vs code application
  4. User confirms to pass the URL to VS code and then confirms receiving the URL inside VS code instance - authentication is successful.

How I planned to solve the issue:

  1. Get vscode://url string from oauth server - OK
  2. Request vscode://url by any means - NO SOLUTION FOUND
  3. Wait for notification inside VS Code browser to accept that url - PENDING, but should be trivial

I tried several different ways: 1) created python script that runs vscode://url. But in my case it starts a new instance of VS Code instead of transferring the URL to Extension host instance. 2) inside "it" test called await driver.get('vscode://url') - nothing happens 3) installed matching chromium version and running the same driver.get('vscode://url') from it - it starts new instance of Browser, thus ending my test.

Specifications

YuggothFungi commented 1 year ago

Currently I can work around this by using CLI command to start VS Code with added " --open-url -- "vscode://url" " arguments.