Udemy Playwright: Web Automation Testing From Zero to Hero: Difference between revisions

Jump to navigation Jump to search
m
Line 477: Line 477:


=== Dailog Boxes ===
=== Dailog Boxes ===
<nowiki>test("Dialog box", async ({ page }) => {
  await page.getByText("Tables & Data").click()
  await page.locator(".menu-item").getByText("Smart Table").click()
  page.on("dialog", (dialog) => {
    expect(dialog.message()).toEqual("Are you sure you want to delete?")
    dialog.accept()
  })
  const email = "mdo@gmail.com"
  await page
    .getByRole("table")
    .locator("tr", { hasText: email })
    .locator(".nb-trash")
    .click()
  await expect(page.locator("table tr").first()).not.toHaveText(email)
})</nowiki>
=== Web Tables ===
=== Web Tables ===
=== Date Picker ===
=== Date Picker ===
=== Sliders ===
=== Sliders ===
=== Drag & Drop with iFrames ===
=== Drag & Drop with iFrames ===

Navigation menu