-
Notifications
You must be signed in to change notification settings - Fork 348
Open
Labels
Description
Description
Problem
Some Playwright tests in the repository use hardcoded URLs such as:
http://localhost:8080/signin
Using absolute URLs makes the tests dependent on a specific environment and port. This can cause problems when running tests in different environments such as:
- CI pipelines
- staging deployments
- local environments using different ports
Because of this, the tests are less flexible and harder to reuse.
Proposed Solution
Instead of hardcoding the full URL, Playwright’s baseURL configuration can be used.
Before
await page.goto("http://localhost:8080/signin")After
await page.goto("/signin")Then define the base URL in playwright.config.js:
use: {
baseURL: process.env.BASE_URL || "http://localhost:8080"
}Benefits
- Tests become environment-agnostic
- Easier integration with CI
- More maintainable Playwright tests
- Allows running tests against staging or other environments easily
Next Steps
If this approach looks good, I would be happy to open a PR to update the Playwright tests and configure baseURL in the Playwright configuration.
Reactions are currently unavailable