page.waitForTimeout(500) — you’ll often see this line in older test suites. The problem: 500 ms is sometimes too short, sometimes too long. As a result the test passes sometimes and fails other times — a flaky test.
The correct fix: expect(locator).toBeVisible(). This assertion waits until the element is visible — based on real state, not an arbitrary number of milliseconds.
page is available. Remove the waitForTimeout line from the starter code and replace it with a visibility assertion using expect.