starter-playwright icon indicating copy to clipboard operation
starter-playwright copied to clipboard

Suggestion: Replace hard-coded URLS with ENV parameters

Open yairEO opened this issue 8 months ago • 0 comments

https://playwright.dev/docs/test-parameterize#passing-environment-variables

For example:

import "dotenv/config";

...

async goto() {
  await this.page.goto(proccess.env.TESTS_URL);
}

In my .env file I've configured the following:

TESTS_URL=http://localhost:3000
TESTS_BACKEND_API_URL=https://foo.bar

yairEO avatar May 29 '24 09:05 yairEO