Skip to content

Instantly share code, notes, and snippets.

@cb109
Created July 22, 2026 12:03
Show Gist options
  • Select an option

  • Save cb109/eaef09a4969469ac5b94ccb836183285 to your computer and use it in GitHub Desktop.

Select an option

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
@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