Skip to content

Commit

Permalink
chore: flaky editor (#1603)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Nov 26, 2024
1 parent 76997da commit 9639459
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/demo-playwright/tests/font.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test.describe('Font', () => {
await page.keyboard.press('Enter');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Font-01.png');

Expand All @@ -35,6 +36,7 @@ test.describe('Font', () => {
await page.keyboard.press('Enter');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Font-02.png');

Expand All @@ -47,6 +49,7 @@ test.describe('Font', () => {
await page.keyboard.press('Enter');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Font-03.png');

Expand All @@ -59,6 +62,7 @@ test.describe('Font', () => {
await page.keyboard.press('Enter');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Font-04.png');

Expand All @@ -71,6 +75,7 @@ test.describe('Font', () => {
await page.keyboard.press('Enter');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Font-05.png');
});
Expand Down
6 changes: 6 additions & 0 deletions projects/demo-playwright/tests/toolbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ test.describe('Toolbar', () => {
await tuiGoto(page, '/custom-tool/paste-emoji#custom-tool');

await page.locator('[contenteditable]').nth(0).focus();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-05.png');

await page.locator('[automation-id="smiles-tool__button"]').click();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-06.png');

await page.locator('.smile').nth(0).click();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-07.png');

Expand All @@ -66,10 +69,12 @@ test.describe('Toolbar', () => {
await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-08.png');

await page.locator('[automation-id="smiles-tool__button"]').click();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-09.png');

await page.locator('.smile').nth(2).click();
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-10.png');
});
Expand Down Expand Up @@ -112,6 +117,7 @@ test.describe('Toolbar', () => {
await page.locator('[contenteditable]').nth(0).focus();
await page.keyboard.press('Meta+A');
await page.keyboard.press('Backspace');
await page.waitForTimeout(300);

await expect(page.locator('tui-editor')).toHaveScreenshot('Toolbar-13.png');

Expand Down

0 comments on commit 9639459

Please sign in to comment.