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 03:05, 24 May 2024
, 24 May→Radio Buttons
m (→Input Fields) |
m (→Radio Buttons) |
||
Line 379: | Line 379: | ||
=== Radio Buttons === | === Radio Buttons === | ||
<nowiki> | |||
//await usingTheGridForm.getByLabel('Option 1').check({force:true}) | |||
await usingTheGridForm | |||
.getByRole("radio", { name: "Option 1" }) | |||
.check({ force: true }) | |||
const radioStatus = await usingTheGridForm | |||
.getByRole("radio", { name: "Option 1" }) | |||
.isChecked() | |||
expect(radioStatus).toBeTruthy() | |||
await expect( | |||
usingTheGridForm.getByRole("radio", { name: "Option 1" }) | |||
).toBeChecked() | |||
await usingTheGridForm | |||
.getByRole("radio", { name: "Option 2" }) | |||
.check({ force: true }) | |||
expect( | |||
await usingTheGridForm | |||
.getByRole("radio", { name: "Option 1" }) | |||
.isChecked() | |||
).toBeFalsy() | |||
expect( | |||
await usingTheGridForm | |||
.getByRole("radio", { name: "Option 2" }) | |||
.isChecked() | |||
).toBeTruthy()</nowiki> | |||
=== Checkboxes === | === Checkboxes === | ||
=== Lists & Dropdowns === | === Lists & Dropdowns === |