Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions __checks__/22create-react-app.check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* To learn more about Playwright Test visit:
* https://www.checklyhq.com/docs/browser-checks/playwright-test/
* https://playwright.dev/docs/writing-tests
*/

const { expect, test } = require("@playwright/test")

test("wait for a new page to load and screenshot it", async ({ page }) => {
// Change checklyhq.com to your site's URL,
// or, even better, define a ENVIRONMENT_URL environment variable
// to reuse it across your browser checks
await page.goto(process.env.ENVIRONMENT_URL || "https://www.checklyhq.com/")

// Locate the Pricing link
const pricingLink = page.locator("nav >> text='Pricing'")

// Attach an event listener to wait for a page navigation
// and click the link
await Promise.all([page.waitForNavigation(), pricingLink.click()])

// Test that you're on the correct page
await expect(page).toHaveURL(/pricing/)

// Take a screenshot of the current page
await page.screenshot({ path: "screenshot.jpg" })
})