|
@ -3,14 +3,17 @@ import subprocess |
|
|
from playwright.sync_api import Playwright, sync_playwright |
|
|
from playwright.sync_api import Playwright, sync_playwright |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Run playwright codegen to generate the code below, copy paste the sections in run() |
|
|
def run(playwright: Playwright) -> None: |
|
|
def run(playwright: Playwright) -> None: |
|
|
browser = playwright.chromium.launch(headless=False) |
|
|
browser = playwright.chromium.launch(headless=False) |
|
|
|
|
|
# Update the viewport manually |
|
|
context = browser.new_context(viewport={"width": 960, "height": 1080}) |
|
|
context = browser.new_context(viewport={"width": 960, "height": 1080}) |
|
|
page = context.new_page() |
|
|
page = context.new_page() |
|
|
page.goto("http://localhost:8000/docs") |
|
|
page.goto("http://localhost:8000/docs") |
|
|
page.get_by_role("button", name="Item-Input").click() |
|
|
page.get_by_role("button", name="Item-Input").click() |
|
|
page.get_by_role("button", name="Item-Output").click() |
|
|
page.get_by_role("button", name="Item-Output").click() |
|
|
page.set_viewport_size({"width": 960, "height": 820}) |
|
|
page.set_viewport_size({"width": 960, "height": 820}) |
|
|
|
|
|
# Manually add the screenshot |
|
|
page.screenshot( |
|
|
page.screenshot( |
|
|
path="docs/en/docs/img/tutorial/separate-openapi-schemas/image04.png" |
|
|
path="docs/en/docs/img/tutorial/separate-openapi-schemas/image04.png" |
|
|
) |
|
|
) |
|
|