IKivan-kozenko -aqa
Try yourself as a QA tester
Back to topic

Quiz

Migrating from Testing Library

Check yourself

  1. 1.In React Testing Library you use await screen.findByText('Welcome') to wait for async text to appear. What's the direct Playwright equivalent?
  2. 2.In Testing Library, within(orderRow).getByRole('button', { name: 'Cancel' }) scopes a query to inside an element. What's the Playwright equivalent?
  3. 3.Testing Library's render(<SignInForm />) is synchronous. What's the key difference when using Playwright Component Testing's mount()?
  4. 4.Testing Library uses await waitForElementToBeRemoved(() => queryByText('Loading...')). What's the Playwright equivalent?
  5. 5.Testing Library uses await user.type(emailInput, 'john@example.com'). What's the equivalent in Playwright?
  6. 6.Testing Library: expect(el).toBeInTheDocument(). What's the Playwright equivalent for checking an element is present and visible?
  7. 7.Testing Library uses const { rerender } = render(<Counter count={1} />) and then rerender(<Counter count={2} />). What's the Playwright component testing equivalent for re-rendering with new props?
  8. 8.Your RTL test uses expect(button).toBeDisabled(). What's the direct Playwright assertion?