Testing · Middle · Question 1 of 75
What is the difference between findBy… and waitFor?
- ✓Correct answer:
findBywaits for one element to appear;waitForretries any callback until it stops throwing - 2
waitForis for elements,findByfor network requests - 3
findBywaits forever,waitForhas a timeout
Explanation
findByRole(...) is literally waitFor(() => getByRole(...)). Use findBy to wait for an element and waitFor for other assertions.