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

Jump to navigation Jump to search
m
Line 463: Line 463:


=== Tooltips ===
=== Tooltips ===
To see the tooltip you may need to go to the dev tools, sources tab, and press F8 (on windows) to pause the debugger whilst showing the tooltip. This will now allow you to investigate the frozen DOM.
<nowiki>
test("tooltip", async ({ page }) => {
  await page.getByText("Modal & Overlays").click()
  await page.locator(".menu-item").getByText("Tooltip").click()
  const toolTipCard = page.locator("nb-card", { hasText: "Tooltip Placements" })
  await toolTipCard.locator("button", { hasText: "TOP" }).hover()
  page.getByRole('tooltip')  // only works if the tooltip role was added to the element
  const tooltip = await page.locator('nb-tooltip').textContent()
  expect(tooltip).toEqual('This is a tooltip')
})</nowiki>
=== Dailog Boxes ===
=== Dailog Boxes ===
=== Web Tables ===
=== Web Tables ===

Navigation menu