test(mobile): basic e2e tests (#8031)
fix AF-1289 1. tested on 'webkit' 2. a few baseline test cases
This commit is contained in:
15
tests/affine-mobile/e2e/utils.ts
Normal file
15
tests/affine-mobile/e2e/utils.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/* eslint-disable unicorn/prefer-dom-node-dataset */
|
||||
import { expect, type Page } from '@playwright/test';
|
||||
|
||||
export async function expandCollapsibleSection(page: Page, name: string) {
|
||||
const divider = page.locator(`[data-collapsible]:has-text("${name}")`);
|
||||
if ((await divider.getAttribute('data-collapsed')) === 'true') {
|
||||
await divider.click();
|
||||
}
|
||||
await expect(divider).toHaveAttribute('data-collapsed', 'false');
|
||||
const section = divider.locator(
|
||||
'~ [data-testid="collapsible-section-content"]'
|
||||
);
|
||||
await expect(section).toBeVisible();
|
||||
return section;
|
||||
}
|
||||
Reference in New Issue
Block a user