From e09a5f3adf755d4b1a96932c43906afaa40b4523 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 14 Apr 2023 09:57:56 +0100 Subject: [PATCH] Assert that the Rich Text document is ready before continuing with Cypress tests (#12612) GitOrigin-RevId: fb0755200366e1129ee86ba9a439210ffe64e205 --- .../components/codemirror-editor-visual-list.spec.tsx | 3 +++ .../components/codemirror-editor-visual-toolbar.spec.tsx | 3 +++ .../source-editor/components/codemirror-editor-visual.spec.tsx | 3 +++ 3 files changed, 9 insertions(+) diff --git a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-list.spec.tsx b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-list.spec.tsx index d3b8b4c50b..19cfe7679c 100644 --- a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-list.spec.tsx +++ b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-list.spec.tsx @@ -20,6 +20,9 @@ const mountEditor = (content: string) => { ) + + // wait for the content to be parsed and revealed + cy.get('.cm-content').should('have.css', 'opacity', '1') } describe(' lists in Rich Text mode', function () { diff --git a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-toolbar.spec.tsx b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-toolbar.spec.tsx index afe9525044..5b666c19ff 100644 --- a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-toolbar.spec.tsx +++ b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual-toolbar.spec.tsx @@ -32,6 +32,9 @@ const mountEditor = (content: string) => { ) + + // wait for the content to be parsed and revealed + cy.get('.cm-content').should('have.css', 'opacity', '1') } describe(' toolbar in Rich Text mode', function () { diff --git a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual.spec.tsx b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual.spec.tsx index 90e791f734..d137ab73e3 100644 --- a/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual.spec.tsx +++ b/services/web/test/frontend/features/source-editor/components/codemirror-editor-visual.spec.tsx @@ -34,6 +34,9 @@ describe(' in Rich Text mode', function () { ) + // wait for the content to be parsed and revealed + cy.get('.cm-content').should('have.css', 'opacity', '1') + cy.get('.cm-line').eq(0).click().as('first-line') cy.get('.cm-line').eq(1).as('second-line') cy.get('.cm-line').eq(2).as('third-line')