Skip to content

Commit 92d7b6d

Browse files
Merge pull request #19671 from timvandermeij/integration-tests-signature-intermittent
Fix the "Signature Editor Basic operations must check copy and paste" integration test
2 parents e738566 + 2a4f970 commit 92d7b6d

1 file changed

Lines changed: 38 additions & 39 deletions

File tree

test/integration/signature_editor_spec.mjs

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -339,45 +339,44 @@ describe("Signature Editor", () => {
339339
});
340340

341341
it("must check copy and paste", async () => {
342-
await Promise.all(
343-
pages.map(async ([browserName, page]) => {
344-
await switchToSignature(page);
345-
await page.click("#editorSignatureAddSignature");
346-
347-
await page.waitForSelector("#addSignatureDialog", {
348-
visible: true,
349-
});
350-
await page.type("#addSignatureTypeInput", "Hello");
351-
await page.waitForSelector(`${addButtonSelector}:not(:disabled)`);
352-
await page.click("#addSignatureAddButton");
353-
354-
const editorSelector = getEditorSelector(0);
355-
await page.waitForSelector(editorSelector, { visible: true });
356-
const originalRect = await getRect(page, editorSelector);
357-
const originalDescription = await page.$eval(
358-
`${editorSelector} .altText.editDescription`,
359-
el => el.title
360-
);
361-
362-
await copy(page);
363-
await paste(page);
364-
365-
const pastedEditorSelector = getEditorSelector(1);
366-
await page.waitForSelector(pastedEditorSelector, { visible: true });
367-
const pastedRect = await getRect(page, pastedEditorSelector);
368-
const pastedDescription = await page.$eval(
369-
`${pastedEditorSelector} .altText.editDescription`,
370-
el => el.title
371-
);
372-
373-
expect(pastedRect)
374-
.withContext(`In ${browserName}`)
375-
.not.toEqual(originalRect);
376-
expect(pastedDescription)
377-
.withContext(`In ${browserName}`)
378-
.toEqual(originalDescription);
379-
})
380-
);
342+
// Run sequentially to avoid clipboard issues.
343+
for (const [browserName, page] of pages) {
344+
await switchToSignature(page);
345+
await page.click("#editorSignatureAddSignature");
346+
347+
await page.waitForSelector("#addSignatureDialog", {
348+
visible: true,
349+
});
350+
await page.type("#addSignatureTypeInput", "Hello");
351+
await page.waitForSelector(`${addButtonSelector}:not(:disabled)`);
352+
await page.click("#addSignatureAddButton");
353+
354+
const editorSelector = getEditorSelector(0);
355+
await page.waitForSelector(editorSelector, { visible: true });
356+
const originalRect = await getRect(page, editorSelector);
357+
const originalDescription = await page.$eval(
358+
`${editorSelector} .altText.editDescription`,
359+
el => el.title
360+
);
361+
362+
await copy(page);
363+
await paste(page);
364+
365+
const pastedEditorSelector = getEditorSelector(1);
366+
await page.waitForSelector(pastedEditorSelector, { visible: true });
367+
const pastedRect = await getRect(page, pastedEditorSelector);
368+
const pastedDescription = await page.$eval(
369+
`${pastedEditorSelector} .altText.editDescription`,
370+
el => el.title
371+
);
372+
373+
expect(pastedRect)
374+
.withContext(`In ${browserName}`)
375+
.not.toEqual(originalRect);
376+
expect(pastedDescription)
377+
.withContext(`In ${browserName}`)
378+
.toEqual(originalDescription);
379+
}
381380
});
382381
});
383382

0 commit comments

Comments
 (0)