mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 14:31:30 +03:00
26 lines
812 B
TypeScript
26 lines
812 B
TypeScript
import { Page } from '@playwright/test';
|
|
|
|
async function openDebugPanel(page: Page) {
|
|
const isOpen = (await page.locator('[data-testid="debug-panel"]')?.getAttribute('open')) === '';
|
|
|
|
if (!isOpen) {
|
|
await page.getByText('Debug').click();
|
|
await page.getByTestId('debug-panel').and(page.locator('[open]')).waitFor();
|
|
}
|
|
}
|
|
|
|
async function closeDebugPanel(page: Page) {
|
|
const isOpen = (await page.getByTestId('debug-panel')?.getAttribute('open')) === '';
|
|
if (isOpen) {
|
|
await page.getByText('Debug').click();
|
|
await page.getByTestId('debug-panel').and(page.locator(':not([open])')).waitFor();
|
|
}
|
|
}
|
|
|
|
export function getUtils(page: Page) {
|
|
return {
|
|
openDebugPanel: () => openDebugPanel(page),
|
|
closeDebugPane: () => closeDebugPanel(page)
|
|
};
|
|
}
|