Playwright Assertions: toHaveAttribute
await expect(locator).toHaveAttribute(name, value) asserts an HTML attribute's value.
Task:
- Navigate to
https://testkru.com/Elements/TextFields - Assert the last name field has attribute
placeholderwith value "Enter your last name..." - Assert the disabled field has attribute
disabledwith value "" - Print confirmation after each
Expected output:
Placeholder assertion: PASS Disabled assertion: PASS
TestKru