Writing out the page contents in Playwright
I recently had a problem with a failing Playwright test that only happened when running in Docker. The test that was failing was: let locator = page.locator('a[href="/login"].nav-link'); await locator.click(); await expect(page).toHaveTitle(/Log in/); The test clicks the link to go to /login and then checks that the next page's title contains the text "Log in". Not an especially complicated test, so I was quite surprised when it failed claiming that the title was blank. To work… continue reading.