This repository contains automated tests using Playwright to launch Visual Studio Code (VSCode) and install a specified extension from a VSIX file.
Launch Visual Studio Code as an Electron application.
Install extensions from VSIX files.
Basic test structure using Playwright's Page Object Model.
Before you begin, ensure you have the following:
Node.js (version 14 or later) installed.
Playwright installed. You can install it using npm.
Visual Studio Code installed on your system.
- Clone the Repository
git clone https://github.com/konveyor/kai-ci
cd kai-ci
- Install Dependencies
Install the required packages using npm:
npm install
Create .env file and copy the content of .env.example into it and provide appropriate values:
VSCODE_EXECUTABLE_PATH='/usr/share/code/code'
# URL to download the vsix file, update this if the URL is different.
DEFAULT_VSIX_DOWNLOAD_URL= 'https://github.com/konveyor/editor-extensions/releases/download/v0.0.1-dev%2B20241022/konveyor-linux-0.0.1.vsix'
To run the automated tests, use the following command:
npx playwright test
This command will execute all tests in your repository. To run a specific test file:
npx playwright test vscode.test.ts
-
Format code
npm run format
-
Check formatting
npm run check