Playwright

Assert checked and enabled state

Easy30 pts
  • toBeChecked
  • toBeDisabled
  • State Assertions
  • Negation
Practice app · Profile Settings

A settings page for clicking, typing, reading text/attributes/CSS and element state.

Test URL
/lab/playwright-assert-checked-and-enabled-state

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Verify the checked state of a checkbox and the disabled state of a button.

Your Task

  1. 1Navigate to the profile settings page at TEST_URL.
  2. 2Assert that the notifications checkbox (#notifications-toggle) is checked.
  3. 3Assert that the delete account button (#disabled-button) is disabled.
  4. 4Uncheck the notifications checkbox (#notifications-toggle) and assert that it is no longer checked.

Validation Checks

  • Profile settings page is loaded at TEST_URL
  • Notifications checkbox (#notifications-toggle) verified checked
  • Delete account button (#disabled-button) verified disabled
  • Notifications checkbox (#notifications-toggle) verified unchecked after toggling
  • At least 3 assertions pass

Playwright · Playwright Practice Track · Assertions