Created
July 22, 2026 12:03
-
-
Save cb109/eaef09a4969469ac5b94ccb836183285 to your computer and use it in GitHub Desktop.
Tell pytest-playwright to run Chrome with --disable-web-security for end-to-end testing
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
| @pytest.fixture(scope="session") | |
| def browser(launch_browser): | |
| browser = launch_browser( | |
| # Tell playwright to disable CORS etc. in Chrome, so our webpack | |
| # dev-server domain can talk to our pytest live_server.url API | |
| # domain. | |
| args=["--disable-web-security"], | |
| ) | |
| yield browser | |
| browser.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment