Udemy Playwright: Web Automation Testing From Zero to Hero: Difference between revisions
Jump to navigation
Jump to search
Udemy Playwright: Web Automation Testing From Zero to Hero (view source)
Revision as of 04:51, 24 May 2024
, 24 May→Tooltips
m (→Tooltips) |
|||
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 === |