diff --git a/server-ce/test/editor.spec.ts b/server-ce/test/editor.spec.ts index d12a55427e..648c55a907 100644 --- a/server-ce/test/editor.spec.ts +++ b/server-ce/test/editor.spec.ts @@ -149,10 +149,10 @@ describe('editor', () => { openFile(fileName, 'static') cy.log('reject changes') - cy.findByText('Review').click() + cy.contains('.toolbar-item', 'Review').click() cy.get('.cm-content').should('not.contain.text', oldContent) - cy.findByText('Reject').click({ force: true }) - cy.findByText('Review').click() + cy.findByText('Reject change').click({ force: true }) + cy.contains('.toolbar-item', 'Review').click() cy.log('recompile to force flush') recompile() @@ -205,10 +205,10 @@ describe('editor', () => { openFile(fileName, 'static') cy.log('reject changes') - cy.findByText('Review').click() + cy.contains('.toolbar-item', 'Review').click() cy.get('.cm-content').should('not.contain.text', oldContent) - cy.findAllByText('Reject').first().click({ force: true }) - cy.findByText('Review').click() + cy.findAllByText('Reject change').first().click({ force: true }) + cy.contains('.toolbar-item', 'Review').click() cy.log('recompile to force flush') recompile() diff --git a/server-ce/test/helpers/compile.ts b/server-ce/test/helpers/compile.ts index 066fc4f9d3..9f0c9e4150 100644 --- a/server-ce/test/helpers/compile.ts +++ b/server-ce/test/helpers/compile.ts @@ -24,7 +24,7 @@ export function prepareWaitForNextCompileSlot() { queueReset() triggerCompile() cy.log('Wait for compile to finish') - cy.findByText('Recompile') + cy.findByText('Recompile').should('be.visible') }) } function recompile() { diff --git a/server-ce/test/helpers/project.ts b/server-ce/test/helpers/project.ts index 15f801634f..3b43e3d959 100644 --- a/server-ce/test/helpers/project.ts +++ b/server-ce/test/helpers/project.ts @@ -212,11 +212,11 @@ export function createNewFile() { export function toggleTrackChanges(state: boolean) { cy.findByText('Review').click() - cy.get('.rp-tc-state-collapse').then(el => { - // TODO: simplify this in the frontend? - if (el.hasClass('rp-tc-state-collapse-on')) { - // make track-changes switches visible - cy.get('.rp-tc-state-collapse').click() + cy.get('.track-changes-menu-button').then(el => { + // when the menu is expanded renders the `expand_more` icon, + // and the `chevron_right` icon when it's collapsed + if (!el.text().includes('expand_more')) { + el.click() } }) @@ -241,5 +241,5 @@ export function toggleTrackChanges(state: boolean) { cy.wait(alias) }) }) - cy.findByText('Review').click() + cy.contains('.toolbar-item', 'Review').click() }