-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The test suite looks great!
No feedback on the content of the tests, except to say that in time (and in developer life this will be required), you may find it helpful to replace the production values by connecting instead to a test database of the same shape but containing gibberish content. For example, arbitrary tags like "socket", "shower" etc might change, so replacing these with test environment variables that are created and destroyed within the cycle of the test keep your tests independent from changes in production to content (where the content itself isn't important). An example of where content is important is something like "submit" on a submit button, or "Log in", etc (i.e. values that aren't kept in the database).
This is a neat little library for generating random content of different types - https://chancejs.com.
When running yarn test I currently get 33 failing tests and 45 passing - is this expected? I don't have any experience with Playwright but looks like it's not finding elements that it expected to find, but perhaps I'm running them incorrectly? Here is one representative error message I'm getting:
Error: locator.innerText: Page closed
=========================== logs ===========================
waiting for getByTestId('cities').locator('div').nth(1)
============================================================
14 | .locator('div')
15 | .nth(1)
> 16 | .innerText();
| ^
17 | [expectedName, expectedWorkplaces] = inputString.split('\n');
18 | await page.getByTestId('cities').locator('div').nth(1).click();
19 | await page.getByTestId('city-name').innerText();