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

Jump to navigation Jump to search
m
Line 497: Line 497:


=== Web Tables ===
=== Web Tables ===
Part 1
<nowiki>
test("Web Table", async ({ page }) => {
  await page.getByText("Tables & Data").click()
  await page.locator(".menu-item").getByText("Smart Table").click()
  // 1 locate a row by a unique value
  const targetRow = page.getByRole("row", { name: "twitter@outlook.com" })
  await targetRow.locator(".nb-edit").click()
  await page.locator("input-editor").getByPlaceholder("Age").clear()
  await page.locator("input-editor").getByPlaceholder("Age").fill("35")
  await page.locator(".nb-checkmark").click()
  // 2 get a row by a value in specific column
  await page.locator(".ng2-smart-pagination-nav").getByText("2").click()
  const targetRowById = page.getByRole('row', {name:'11'}).filter({has: page.locator('td').nth(1).getByText('11')})
  await targetRowById.locator('.nb-edit').click()
  await page.locator("input-editor").getByPlaceholder("E-mail").clear()
  await page.locator("input-editor").getByPlaceholder("E-Mail").fill("test@test.com")
  await page.locator(".nb-checkmark").click()
  await expect(targetRowById.locator('td').nth(5)).toHaveText('test@test.com')
})</nowiki>
=== Date Picker ===
=== Date Picker ===
=== Sliders ===
=== Sliders ===
=== Drag & Drop with iFrames ===
=== Drag & Drop with iFrames ===

Navigation menu