test: do not depend on example.com in integration tests#3214
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR replaces hardcoded external dependencies on example.com with a local test server to make integration tests more reliable and avoid network failures. The changes implement a SimpleServer class and update test files to use the local server instead of external URLs.
Key changes:
- Created a SimpleServer fixture that serves a simple HTML page locally
- Replaced all
example.comURLs withserver.EMPTY_PAGEin test cases - Updated test function signatures to include the new
serverfixture
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Playwright.TestingHarnessTest/tests/baseTest.ts | Adds SimpleServer class and server fixture for local testing |
| src/Playwright.TestingHarnessTest/tests/xunit/basic.spec.ts | Updates proxy and context option tests to use local server |
| src/Playwright.TestingHarnessTest/tests/nunit/basic.spec.ts | Updates proxy and context option tests to use local server |
| src/Playwright.TestingHarnessTest/tests/mstest/basic.spec.ts | Updates proxy and context option tests to use local server |
Skn0tt
approved these changes
Jul 30, 2025
Member
Skn0tt
left a comment
There was a problem hiding this comment.
we're testing MSTest with Playwright Test? 🤯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/microsoft/playwright-dotnet/actions/runs/16623930634/job/47035091929?pr=3213#step:9:54
Saw it a couple of more times in the past.