Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: tag flaky tests #6462

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 61 additions & 58 deletions packages/lexical-playground/__tests__/e2e/List.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1304,68 +1304,71 @@ test.describe.parallel('Nested List', () => {
);
});

test('can navigate and check/uncheck with keyboard', async ({
page,
isCollab,
}) => {
await focusEditor(page);
await toggleCheckList(page);
//
// [ ] a
// [ ] b
// [ ] c
// [ ] d
// [ ] e
// [ ] f
await page.keyboard.type('a');
await page.keyboard.press('Enter');
await page.keyboard.type('b');
await page.keyboard.press('Enter');
await click(page, '.toolbar-item.alignment');
await click(page, 'button:has-text("Indent")');
await page.keyboard.type('c');
await page.keyboard.press('Enter');
await click(page, '.toolbar-item.alignment');
await click(page, 'button:has-text("Indent")');
await page.keyboard.type('d');
await page.keyboard.press('Enter');
await page.keyboard.type('e');
await page.keyboard.press('Enter');
await page.keyboard.press('Backspace');
await page.keyboard.press('Backspace');
await page.keyboard.type('f');

const assertCheckCount = async (checkCount, uncheckCount) => {
const pageOrFrame = await (isCollab ? page.frame('left') : page);
await expect(
pageOrFrame.locator('li[role="checkbox"][aria-checked="true"]'),
).toHaveCount(checkCount);
await expect(
pageOrFrame.locator('li[role="checkbox"][aria-checked="false"]'),
).toHaveCount(uncheckCount);
};

await assertCheckCount(0, 6);

// Go back to select checkbox
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('Space');

await repeat(5, async () => {
await page.keyboard.press('ArrowUp', {delay: 50});
test(
'can navigate and check/uncheck with keyboard',
{
tag: '@flaky',
},
async ({page, isCollab}) => {
await focusEditor(page);
await toggleCheckList(page);
//
// [ ] a
// [ ] b
// [ ] c
// [ ] d
// [ ] e
// [ ] f
await page.keyboard.type('a');
await page.keyboard.press('Enter');
await page.keyboard.type('b');
await page.keyboard.press('Enter');
await click(page, '.toolbar-item.alignment');
await click(page, 'button:has-text("Indent")');
await page.keyboard.type('c');
await page.keyboard.press('Enter');
await click(page, '.toolbar-item.alignment');
await click(page, 'button:has-text("Indent")');
await page.keyboard.type('d');
await page.keyboard.press('Enter');
await page.keyboard.type('e');
await page.keyboard.press('Enter');
await page.keyboard.press('Backspace');
await page.keyboard.press('Backspace');
await page.keyboard.type('f');

const assertCheckCount = async (checkCount, uncheckCount) => {
const pageOrFrame = await (isCollab ? page.frame('left') : page);
await expect(
pageOrFrame.locator('li[role="checkbox"][aria-checked="true"]'),
).toHaveCount(checkCount);
await expect(
pageOrFrame.locator('li[role="checkbox"][aria-checked="false"]'),
).toHaveCount(uncheckCount);
};

await assertCheckCount(0, 6);

// Go back to select checkbox
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('Space');
});

await assertCheckCount(6, 0);
await repeat(5, async () => {
await page.keyboard.press('ArrowUp', {delay: 50});
await page.keyboard.press('Space');
});

await repeat(3, async () => {
await page.keyboard.press('ArrowDown', {delay: 50});
await page.keyboard.press('Space');
});
await assertCheckCount(6, 0);

await assertCheckCount(3, 3);
});
await repeat(3, async () => {
await page.keyboard.press('ArrowDown', {delay: 50});
await page.keyboard.press('Space');
});

await assertCheckCount(3, 3);
},
);

test('replaces existing element node', async ({page}) => {
// Create two quote blocks, select it and format to a list
Expand Down
42 changes: 24 additions & 18 deletions packages/lexical-playground/__tests__/e2e/Selection.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -480,25 +480,31 @@ test.describe.parallel('Selection', () => {
);
});

test('Can delete sibling elements forward', async ({page, isPlainText}) => {
test.skip(isPlainText);
test(
'Can delete sibling elements forward',
{
tag: '@flaky',
},
async ({page, isPlainText}) => {
test.skip(isPlainText);

await focusEditor(page);
await page.keyboard.press('Enter');
await page.keyboard.type('# Title');
await page.keyboard.press('ArrowUp');
await deleteForward(page);
await assertHTML(
page,
html`
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Title</span>
</h1>
`,
);
});
await focusEditor(page);
await page.keyboard.press('Enter');
await page.keyboard.type('# Title');
await page.keyboard.press('ArrowUp');
await deleteForward(page);
await assertHTML(
page,
html`
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Title</span>
</h1>
`,
);
},
);

test('Can adjust tripple click selection', async ({
page,
Expand Down
172 changes: 87 additions & 85 deletions packages/lexical-playground/__tests__/e2e/Tables.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -875,96 +875,98 @@ test.describe.parallel('Tables', () => {
);
});

test(`Can style text using Table selection`, async ({
page,
isPlainText,
isCollab,
}) => {
await initialize({isCollab, page});
test.skip(isPlainText);
test(
`Can style text using Table selection`,
{
tag: '@flaky',
},
async ({page, isPlainText, isCollab}) => {
await initialize({isCollab, page});
test.skip(isPlainText);

await focusEditor(page);
await insertTable(page, 2, 3);
await focusEditor(page);
await insertTable(page, 2, 3);

await fillTablePartiallyWithText(page);
await selectCellsFromTableCords(
page,
{x: 0, y: 0},
{x: 1, y: 1},
true,
false,
);
await fillTablePartiallyWithText(page);
await selectCellsFromTableCords(
page,
{x: 0, y: 0},
{x: 1, y: 1},
true,
false,
);

await clickSelectors(page, ['.bold', '.italic', '.underline']);
await clickSelectors(page, ['.bold', '.italic', '.underline']);

await selectFromAdditionalStylesDropdown(page, '.strikethrough');
await selectFromAdditionalStylesDropdown(page, '.strikethrough');

// Check that the character styles are applied.
await assertHTML(
page,
html`
<p><br /></p>
<table>
<tr>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">a</strong></p>
</th>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">bb</strong></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">d</strong></p>
</th>
<td
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">e</strong></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
html`
<p><br /></p>
<table>
<tr>
<th>
<p dir="ltr"><strong data-lexical-text="true">a</strong></p>
</th>
<th>
<p dir="ltr"><strong data-lexical-text="true">bb</strong></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th>
<p dir="ltr"><strong data-lexical-text="true">d</strong></p>
</th>
<td>
<p dir="ltr"><strong data-lexical-text="true">e</strong></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
{ignoreClasses: true},
);
});
// Check that the character styles are applied.
await assertHTML(
page,
html`
<p><br /></p>
<table>
<tr>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">a</strong></p>
</th>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">bb</strong></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">d</strong></p>
</th>
<td
style="background-color: rgb(172, 206, 247); caret-color: transparent">
<p dir="ltr"><strong data-lexical-text="true">e</strong></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
html`
<p><br /></p>
<table>
<tr>
<th>
<p dir="ltr"><strong data-lexical-text="true">a</strong></p>
</th>
<th>
<p dir="ltr"><strong data-lexical-text="true">bb</strong></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th>
<p dir="ltr"><strong data-lexical-text="true">d</strong></p>
</th>
<td>
<p dir="ltr"><strong data-lexical-text="true">e</strong></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
{ignoreClasses: true},
);
},
);

test(
`Can copy + paste (internal) using Table selection`,
Expand Down
Loading