From 7197e44a0ffd4f0feafb7d00a9422a1ed4343677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Wed, 15 Mar 2023 12:51:53 +0100 Subject: [PATCH] Fix flaky Cypress test in #4521 (#4522) --- .../core/volto-slate/28-table-block-slate-paste.js | 11 +++++++---- news/4522.bugfix | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 news/4522.bugfix diff --git a/cypress/tests/core/volto-slate/28-table-block-slate-paste.js b/cypress/tests/core/volto-slate/28-table-block-slate-paste.js index aafab9a82f..50b3b64627 100644 --- a/cypress/tests/core/volto-slate/28-table-block-slate-paste.js +++ b/cypress/tests/core/volto-slate/28-table-block-slate-paste.js @@ -4,6 +4,8 @@ describe('Block Tests: pasting content in table block', () => { beforeEach(slateBeforeEach); it('should paste text', function () { + cy.intercept('PATCH', '/**/my-page').as('save'); + // Paste cy.getTableSlate(true) .focus() @@ -17,13 +19,14 @@ describe('Block Tests: pasting content in table block', () => { // Save cy.toolbarSave(); + cy.wait('@save'); // View + cy.get('.celled.fixed.table thead tr th:first').contains( + 'Some Text from Clipboard', + ); cy.get( - '.celled.fixed.table thead tr th:first-child() [contenteditable="true"]', - ).contains('Some Text from Clipboard'); - cy.get( - '.celled.fixed.table tbody tr:nth-child(1) td:first-child() [contenteditable="true"]', + '.celled.fixed.table tbody tr:nth-child(1) td:first-child()', ).contains('Some Text from Clipboard'); }); diff --git a/news/4522.bugfix b/news/4522.bugfix new file mode 100644 index 0000000000..3fc94a0525 --- /dev/null +++ b/news/4522.bugfix @@ -0,0 +1 @@ +Fix flaky Cypress test introduced in #4521 @sneridagh