| 1945 | } |
| 1946 | |
| 1947 | export async function assertNoConsoleErrors(browser: Playwright) { |
| 1948 | const logs = await browser.log() |
| 1949 | const warningsAndErrors = logs.filter((log) => { |
| 1950 | return ( |
| 1951 | log.source === 'warning' || |
| 1952 | (log.source === 'error' && |
| 1953 | // These are expected when we visit 404 pages. |
| 1954 | !log.message.startsWith( |
| 1955 | 'Failed to load resource: the server responded with a status of 404' |
| 1956 | )) |
| 1957 | ) |
| 1958 | }) |
| 1959 | |
| 1960 | expect(warningsAndErrors).toEqual([]) |
| 1961 | } |
| 1962 | |
| 1963 | export async function getHighlightedDiffLines( |
| 1964 | browser: Playwright |