Skip to content

Commit

Permalink
test(cypress): Fix flaky page template test
Browse files Browse the repository at this point in the history
Wait for the API call to rename the page before continuing.

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- committed Jul 24, 2023
1 parent 8ffbc4a commit 66fbc3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cypress/e2e/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ describe('Page', function() {
cy.get('#titleform input.title')
.should('not.have.attr', 'disabled')
cy.get('#titleform input.title')
.type('{selectAll}New page from Template{enter}')
.clear()
cy.intercept('PUT', '**/_api/*/_pages/parent/*/page/*').as('renamePage')
cy.get('#titleform input.title')

Check failure on line 108 in cypress/e2e/pages.spec.js

View workflow job for this annotation

GitHub Actions / eslint

It is unsafe to chain further commands that rely on the subject after this command. It is best to split the chain, chaining again from `cy.` in a next command line
.type('New page from Template')
.blur()
cy.wait('@renamePage')
// Flaky on stable25
if (Cypress.env('ncVersion') !== 'stable25') {
cy.getEditor(Cypress.config('defaultCommandTimeout') * 2)
Expand Down

0 comments on commit 66fbc3b

Please sign in to comment.