From 3e863e3f036291fa4a45f40405d14a84e505447c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 10 Oct 2023 10:07:29 +0200 Subject: [PATCH 1/2] test(cypress): enable check for editor in stable25 Fixes #933. Fixed by #929. Signed-off-by: Max --- cypress/e2e/pages.spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/pages.spec.js b/cypress/e2e/pages.spec.js index aec8456cd..a8da1fde1 100644 --- a/cypress/e2e/pages.spec.js +++ b/cypress/e2e/pages.spec.js @@ -123,12 +123,9 @@ describe('Page', function() { cy.get('#titleform input.title') .blur() cy.wait('@renamePage') - // Flaky on stable25 - if (Cypress.env('ncVersion') !== 'stable25') { - cy.getEditor(Cypress.config('defaultCommandTimeout') * 2) - .should('be.visible') - .contains('This is going to be our template.') - } + cy.getEditor(Cypress.config('defaultCommandTimeout') * 2) + .should('be.visible') + .contains('This is going to be our template.') cy.get('.app-content-list-item').eq(1) .should('contain', 'New page from Template') }) From 6d115f098481182f1c5c6505c02d23892329cef9 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 10 Oct 2023 10:54:38 +0200 Subject: [PATCH 2/2] test(cy): make toc test retriable Seed the page once to avoid having multiple pages and a conflict. Signed-off-by: Max --- cypress/e2e/page-details.spec.js | 4 ++-- cypress/support/commands.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/page-details.spec.js b/cypress/e2e/page-details.spec.js index d2ef78e38..6a6660c09 100644 --- a/cypress/e2e/page-details.spec.js +++ b/cypress/e2e/page-details.spec.js @@ -30,6 +30,8 @@ describe('Page details', function() { cy.deleteAndSeedCollective('Our Garden') cy.seedPage('Day 1', '', 'Readme.md') cy.seedPageContent('Our Garden/Day 2.md', 'A test string with Day 2 in the middle and a [link to Day 1](/index.php/apps/collectives/Our%20Garden/Day%201).') + cy.seedPage('TableOfContents', '', 'Readme.md') + cy.seedPageContent('Our Garden/TableOfContents.md', '## Second-Level Heading') }) beforeEach(function() { @@ -40,8 +42,6 @@ describe('Page details', function() { describe('Display table of contents', function() { it('Allows to display/close TOC and switch page modes in between', function() { - cy.seedPage('TableOfContents', '', 'Readme.md') - cy.seedPageContent('Our Garden/TableOfContents.md', '## Second-Level Heading') cy.visit('/apps/collectives/Our%20Garden/TableOfContents') cy.get('#titleform .action-item__menutoggle') .click() diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 6a5718eff..9d6c74cdd 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -360,3 +360,11 @@ Cypress.Commands.add('seedCircleMember', (name, userId, type = 1, level) => { } }) }) + +/** + * Fail the test on the initial run to check if retries work + */ +Cypress.Commands.add('testRetry', () => { + cy.wrap(cy.state('test').currentRetry()) + .should('be.equal', 2) +})