Skip to content

Commit

Permalink
chore: flaky e2e (#9772)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Nov 19, 2024
1 parent 026b836 commit 5eec7e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions projects/demo-playwright/tests/kit/tiles/tiles.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ test.describe('Tiles', () => {
await tuiGoto(page, `${DemoRoute.Tiles}#vertical`);

const example = new TuiDocumentationPagePO(page).getExample('#vertical');
const first = example.locator('tui-tile').first();
const last = example.locator('tui-tile').last();
const drag = example.locator('tui-tile').first();
const drop = example.locator('tui-tile').last();

await expect(example).toHaveScreenshot('01-tiles-drag-and-drop.png');

await first.dragTo(last);
await page.waitForTimeout(300);
// Dragging manually (dragTo is flaky method)
await drag.hover();
await page.mouse.down();
await drop.hover();
await page.mouse.up();

await expect(example).toHaveScreenshot('02-tiles-drag-and-drop.png');
});
Expand Down
1 change: 1 addition & 0 deletions projects/demo-playwright/tests/kit/tree/tree.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test.describe('Tree', () => {
await example.locator('button.programmatic').nth(0).click();
await example.locator('button.programmatic').nth(1).click();
await example.locator('button.programmatic').nth(2).click();
await page.click('body'); // (flaky) clear focus from programmatic button

await expect(example).toHaveScreenshot('01-programmatic-control.png');
});
Expand Down

0 comments on commit 5eec7e4

Please sign in to comment.