Bird
0
0

Examine this Playwright test snippet:

medium📝 Debug Q6 of 15
Remix - Testing
Examine this Playwright test snippet:
await page.goto('https://example.com');
await page.click('#submit');
await expect(page.locator('#success')).toBeVisible;

What is the mistake causing this test to fail?
AMissing parentheses after toBeVisible to invoke the function
BIncorrect selector used for the submit button
Cpage.goto URL is invalid
DUsing await with expect is not allowed
Step-by-Step Solution
Solution:
  1. Step 1: Review the expect statement

    The method toBeVisible is a function and requires parentheses to be called.
  2. Step 2: Identify the error

    Code uses toBeVisible without parentheses, so the assertion is not executed.
  3. Final Answer:

    Missing parentheses after toBeVisible to invoke the function -> Option A
  4. Quick Check:

    Check method calls include parentheses [OK]
Quick Trick: Always call assertion methods with parentheses [OK]
Common Mistakes:
MISTAKES
  • Forgetting parentheses on assertion methods
  • Assuming selectors are incorrect without checking
  • Misusing await with expect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes