Skip to content

Commit

Permalink
Refactor code to enable browser testing using Playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorwalton committed Mar 1, 2024
1 parent c21807f commit d788f70
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backend/app/reporting/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
)
async def main(session: AsyncSession = Depends(get_db)):
await verify_license_key(session)
# async with async_playwright() as p:
# for browser_type in [p.chromium, p.firefox, p.webkit]:
# browser = await browser_type.launch()
# page = await browser.new_page()
# await page.goto('http://playwright.dev')
# await page.screenshot(path=f'example-{browser_type.name}.png')
# await browser.close()
async with async_playwright() as p:
for browser_type in [p.chromium, p.firefox, p.webkit]:
browser = await browser_type.launch()
page = await browser.new_page()
await page.goto('http://playwright.dev')
await page.screenshot(path=f'example-{browser_type.name}.png')
await browser.close()
return {"message": "Report generated"}

0 comments on commit d788f70

Please sign in to comment.