-
In Visual Studio Code, install the Playwright Test for VSCode extension.
-
Install Node.js.
npx playwright install
-
Clone, install dependencies, and open the repo in VSCode:
git clone https://github.com/cephalin/screenshot-automation.git cd screenshot-automation npm install code .
-
In VSCode, open the command palette and type "Test: Install Playwright".
-
Go to the Test browser and choose one of the tests to run.
Supply Azure/GitHub credentials in .env.
-
Run the following command in the repo root to generate auth.json:
npx playwright codegen --save-storage=auth.json
-
In the pop-up browser, log into Azure portal and GitHub. Close the browser.
-
Above the Playwright script in *.spec.ts (under /tests), reference auth.json.
test.use({ storageState: "auth.json" });