(browser: Playwright)
| 982 | * Success implies {@link waitForRedbox}. |
| 983 | */ |
| 984 | export async function openRedbox(browser: Playwright): Promise<void> { |
| 985 | const redbox = browser.locateRedbox() |
| 986 | if (await redbox.isVisible()) { |
| 987 | const error = new Error( |
| 988 | 'Redbox is already open. Use `waitForRedbox` instead.' |
| 989 | ) |
| 990 | Error.captureStackTrace(error, openRedbox) |
| 991 | throw error |
| 992 | } |
| 993 | |
| 994 | try { |
| 995 | await browser.waitForElementByCss('[data-issues]').click() |
| 996 | } catch (cause) { |
| 997 | const error = new Error('Redbox did not open.') |
| 998 | Error.captureStackTrace(error, openRedbox) |
| 999 | throw error |
| 1000 | } |
| 1001 | await waitForRedbox(browser) |
| 1002 | } |
| 1003 | |
| 1004 | export async function toggleDevToolsIndicatorPopover( |
| 1005 | browser: Playwright |
no test coverage detected