Playwright · Junior · Question 38 of 75

Which assertion checks that a button is disabled?

Show the answer

Correct answer: await expect(button).toBeDisabled()

Explanation

toBeDisabled and toBeEnabled check the real disabled state, including aria-disabled for some roles, instead of guessing from CSS classes.

Further reading

Problem with a question

Playwright · Junior · question 38

Test yourself

Take the Playwright · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz