mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
docs(chrome-extensions): update test fixture grammar (#17770)
This commit is contained in:
parent
253e3d2814
commit
e2b5fc4f88
@ -97,7 +97,7 @@ with sync_playwright() as playwright:
|
||||
|
||||
## Testing
|
||||
|
||||
To have the extension loaded when running tests you can use a test fixture to set the context. You can also dynamically retrieve the extension id and use it that to load and test the popup page for example.
|
||||
To have the extension loaded when running tests you can use a test fixture to set the context. You can also dynamically retrieve the extension id and use it to load and test the popup page for example.
|
||||
|
||||
```ts
|
||||
import { test as base, expect, BrowserContext } from "@playwright/test";
|
||||
@ -201,4 +201,4 @@ def test_example_test(page: Page) -> None:
|
||||
def test_popup_page(page: Page, extension_id: str) -> None:
|
||||
page.goto(f"chrome-extension://{extension_id}/popup.html")
|
||||
expect(page.locator("body")).to_have_text("my-extension popup")
|
||||
```
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user