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 #6405

Merged
merged 1 commit into from
Jul 17, 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
260 changes: 132 additions & 128 deletions packages/lexical-playground/__tests__/e2e/Tables.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -966,145 +966,149 @@ test.describe.parallel('Tables', () => {
);
});

test(`Can copy + paste (internal) using Table selection`, async ({
page,
isPlainText,
isCollab,
}) => {
await initialize({isCollab, page});
test.skip(isPlainText);
test(
`Can copy + paste (internal) 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,
);

const clipboard = await copyToClipboard(page);
const clipboard = await copyToClipboard(page);

// For some reason you need to click the paragraph twice for this to pass
// on Collab Firefox.
await click(page, 'div.ContentEditable__root > p:first-of-type');
await click(page, 'div.ContentEditable__root > p:first-of-type');
// For some reason you need to click the paragraph twice for this to pass
// on Collab Firefox.
await click(page, 'div.ContentEditable__root > p:first-of-type');
await click(page, 'div.ContentEditable__root > p:first-of-type');

await pasteFromClipboard(page, clipboard);
await pasteFromClipboard(page, clipboard);

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

test(`Can clear text using Table selection`, async ({
page,
isPlainText,
isCollab,
}) => {
await initialize({isCollab, page});
test.skip(isPlainText);
test(
`Can clear 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 page.keyboard.press('Backspace');
await page.keyboard.press('Backspace');

// Check that the text was cleared.
await assertHTML(
page,
html`
<p><br /></p>
<table>
<tr>
<th>
<p><br /></p>
</th>
<th>
<p><br /></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th>
<p><br /></p>
</th>
<td>
<p><br /></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
undefined,
{ignoreClasses: true},
);
});
// Check that the text was cleared.
await assertHTML(
page,
html`
<p><br /></p>
<table>
<tr>
<th>
<p><br /></p>
</th>
<th>
<p><br /></p>
</th>
<th>
<p dir="ltr"><span data-lexical-text="true">cc</span></p>
</th>
</tr>
<tr>
<th>
<p><br /></p>
</th>
<td>
<p><br /></p>
</td>
<td>
<p dir="ltr"><span data-lexical-text="true">f</span></p>
</td>
</tr>
</table>
<p><br /></p>
`,
undefined,
{ignoreClasses: true},
);
},
);

test(`Range Selection is corrected when it contains a partial Table.`, async ({
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,41 @@ import {

test.describe('Regression test #4872', () => {
test.beforeEach(({isCollab, page}) => initialize({isCollab, page}));
test('merging two full rows does not break table selection', async ({
page,
isPlainText,
isCollab,
}) => {
test.skip(isPlainText);
test(
'merging two full rows does not break table selection',
{
tag: '@flaky',
},
async ({page, isPlainText, isCollab}) => {
test.skip(isPlainText);

await focusEditor(page);
await focusEditor(page);

await insertTable(page, 5, 5);
await insertTable(page, 5, 5);

await click(page, '.PlaygroundEditorTheme__tableCell');
await selectCellsFromTableCords(
page,
{x: 0, y: 1},
{x: 4, y: 2},
true,
false,
);
await click(page, '.PlaygroundEditorTheme__tableCell');
await selectCellsFromTableCords(
page,
{x: 0, y: 1},
{x: 4, y: 2},
true,
false,
);

await mergeTableCells(page);
await mergeTableCells(page);

await selectCellsFromTableCords(
page,
{x: 1, y: 4},
{x: 2, y: 4},
false,
false,
);
await selectCellsFromTableCords(
page,
{x: 1, y: 4},
{x: 2, y: 4},
false,
false,
);

await assertTableSelectionCoordinates(page, {
anchor: {x: 1, y: 4},
focus: {x: 2, y: 4},
});
});
await assertTableSelectionCoordinates(page, {
anchor: {x: 1, y: 4},
focus: {x: 2, y: 4},
});
},
);
});
Loading