Playwright

Lesson 15 of 17

Quiz ยท 10 min

Quiz, Playwright basics

Check what you know

This quiz has ten questions. The questions come from lessons 2 to 14. You need 70 percent to pass, and you can try again.

Read each question slowly. Many wrong answers look right if you read quickly.

Question 1 of 10

Which locator does Playwright recommend as the first choice for a button?

Question 2 of 10

A locator matches three elements. Your test calls click() on it. What happens?

Question 3 of 10

What is wrong with this test?

await page.goto('/');
const count = await page.getByTestId('todo-item').count();
expect(count).toBe(3);
Question 4 of 10

Why is await page.waitForTimeout(2000) a poor way to wait for a page?

Question 5 of 10

Your test passes on the normal app, and it also passes on a copy of the app that has a bug. What does this tell you?

Question 6 of 10

Every test in a group starts with await page.goto('/login'). Where should you put this line?

Question 7 of 10

What does route.fulfill({ status: 500 }) do?

Question 8 of 10

You call page.waitForResponse(...) after the click that sends the request. What is the risk?

Question 9 of 10

Which of these belong in a page object? Pick all that apply.

Choose all answers that apply.

Question 10 of 10

In a fixture, what runs at the moment that the fixture calls await use(value)?

Answer every question to check.