tests: Streamline hosted Playwright local setup

Streamline the process of setting up Playwright for local development of hosted service tests using dotenv. Add short guide to README as well.
This commit is contained in:
Tom Koscielniak 2025-03-26 15:27:30 +01:00 committed by Klara Simickova
parent 8136e0fb5b
commit 781267f16c
6 changed files with 41 additions and 5 deletions

View file

@ -25,12 +25,12 @@ export const togglePreview = async (page: Page) => {
};
export const login = async (page: Page) => {
if (!process.env.USER || !process.env.PASSWORD) {
if (!process.env.PLAYWRIGHT_USER || !process.env.PLAYWRIGHT_PASSWORD) {
throw new Error('user or password not set in environment');
}
const user = process.env.USER;
const password = process.env.PASSWORD;
const user = process.env.PLAYWRIGHT_USER;
const password = process.env.PLAYWRIGHT_PASSWORD;
if (isHosted()) {
return loginConsole(page, user, password);