Update tests to not use a hard coded localhost:3000#1949
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Playwright E2E tests to avoid hard-coded http://localhost:3000 URLs so tests can run against a configurable port (and leverage Playwright’s baseURL support).
Changes:
- Replaced many
page.goto("http://localhost:3000/...")calls with relative navigations likepage.goto("/..."). - Introduced
BASE_URL(derived fromprocess.env.PORT) in a few tests/mocks that still construct absolute URLs. - Updated mocked storage state origin/shareable URLs to use the configurable base URL.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/viewXdrToJsonPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/viewJsonToXdrPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/urlParams.test.ts | Uses BASE_URL for deep-link navigations with query params. |
| tests/e2e/txDashTokenSummary.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashStateChange.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashSignatures.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashResourceProfiler.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashInfo.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashFeeBreakdown.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashEvents.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashContracts.test.ts | Switches navigation to relative URL. |
| tests/e2e/txDashClassicOperations.test.ts | Switches navigation to relative URL. |
| tests/e2e/submitTransactionPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/smartContractsVersionHistory.test.ts | Switches navigation to relative URL. |
| tests/e2e/smartContractsStorage.test.ts | Switches navigation to relative URL in helper. |
| tests/e2e/smartContractsContractInfo.test.ts | Switches navigation to relative URL. |
| tests/e2e/simulateTransactionPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/signerSelector.test.ts | Uses BASE_URL when creating a new context/page for navigation. |
| tests/e2e/signTransactionPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/savedTransactions.test.ts | Switches navigation to relative URL (includes manual context usage). |
| tests/e2e/savedSmartContractIds.test.ts | Switches navigation to relative URL (includes manual context usage). |
| tests/e2e/savedRequests.test.ts | Switches navigation to relative URL (includes manual context usage). |
| tests/e2e/savedKeypairs.test.ts | Switches navigation to relative URL (includes manual context usage). |
| tests/e2e/parseMuxedAccountPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/networkSelector.test.ts | Uses relative navigation for base page and BASE_URL for deep-link case. |
| tests/e2e/networkLimitsPage.test.ts | Uses BASE_URL for one deep-link and relative URL elsewhere. |
| tests/e2e/mock/localStorage.ts | Makes storageState origin/shareable URLs depend on process.env.PORT. |
| tests/e2e/introductionPage.test.ts | Switches navigation to relative URL (includes manual context usage). |
| tests/e2e/fundAccountPage.test.ts | Switches navigation to relative URLs. |
| tests/e2e/feeBumpPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/endpointsPage.test.ts | Uses relative navigation for most pages and BASE_URL for some deep-links. |
| tests/e2e/diffXdrsPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/createMuxedAccountPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/createAccountPage.test.ts | Switches navigation to relative URL. |
| tests/e2e/buildTransaction.test.ts | Switches navigation to relative URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Preview is available here: |
leighmcculloch
left a comment
There was a problem hiding this comment.
There's one comment from Copilot that's worth looking at; otherwise it looks good to me.
|
Something went wrong with PR preview build please check |
|
Preview is available here: |
localhost:3000so that I can run multiple repos in parallel, make updates, and able to pass tests.