mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
Fix E2E tests. Add Playwright (#698)
This commit is contained in:
11
test/utils/safeClick.ts
Normal file
11
test/utils/safeClick.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Frame } from "playwright";
|
||||
|
||||
export async function safeClick(page: Frame, selector: string): Promise<void> {
|
||||
// TODO: Remove. Playwright does this for you... mostly.
|
||||
// But our knockout+react setup sometimes leaves dom nodes detached and even playwright can't recover.
|
||||
// Resource tree is particually bad.
|
||||
// Ideally this should only be added as a last resort
|
||||
await page.waitForSelector(selector);
|
||||
await page.waitForTimeout(5000);
|
||||
await page.click(selector);
|
||||
}
|
||||
Reference in New Issue
Block a user