starter-playwright
starter-playwright copied to clipboard
Suggestion: Replace hard-coded URLS with ENV parameters
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