diff --git a/cypress/e2e/insights.cy.ts b/cypress/e2e/insights.cy.ts index 80b1c06c4398e..8d86aac188164 100644 --- a/cypress/e2e/insights.cy.ts +++ b/cypress/e2e/insights.cy.ts @@ -33,32 +33,31 @@ describe('Insights', () => { const startingName = randomString('starting-value-') const editedName = randomString('edited-value-') createInsight(startingName) - cy.get('[data-attr="insight-name"]').should('contain', startingName) + cy.get('[data-attr="top-bar-name"]').should('contain', startingName) - cy.get('[data-attr="insight-name"] [data-attr="edit-prop-name"]').click() - cy.get('[data-attr="insight-name"] input').type(editedName) - cy.get('[data-attr="insight-name"] [title="Save"]').click() + cy.get('[data-attr="top-bar-name"] button').click() + cy.get('[data-attr="top-bar-name"] input').clear().type(editedName) + cy.get('[data-attr="top-bar-name"] [title="Save"]').click() - cy.get('[data-attr="insight-name"]').should('contain', editedName) + cy.get('[data-attr="top-bar-name"]').should('contain', editedName) savedInsights.checkInsightIsInListView(editedName) }) it('Can undo a change of insight name', () => { createInsight('starting value') - cy.get('[data-attr="insight-name"]').should('contain', 'starting value') + cy.get('[data-attr="top-bar-name"]').should('contain', 'starting value') - cy.get('[data-attr="insight-name"]').scrollIntoView() - cy.get('[data-attr="insight-name"] [data-attr="edit-prop-name"]').click({ force: true }) - cy.get('[data-attr="insight-name"] input').type('edited value') - cy.get('[data-attr="insight-name"] [title="Save"]').click() + cy.get('[data-attr="top-bar-name"] button').click({ force: true }) + cy.get('[data-attr="top-bar-name"] input').clear().type('edited value') + cy.get('[data-attr="top-bar-name"] [title="Save"]').click() - cy.get('[data-attr="insight-name"]').should('contain', 'edited value') + cy.get('[data-attr="top-bar-name"]').should('contain', 'edited value') cy.get('[data-attr="edit-insight-undo"]').click() - cy.get('[data-attr="insight-name"]').should('not.contain', 'edited value') - cy.get('[data-attr="insight-name"]').should('contain', 'starting value') + cy.get('[data-attr="top-bar-name"]').should('not.contain', 'edited value') + cy.get('[data-attr="top-bar-name"]').should('contain', 'starting value') savedInsights.checkInsightIsInListView('starting value') }) diff --git a/cypress/productAnalytics/index.ts b/cypress/productAnalytics/index.ts index fb6a2e3f029f7..cf66883033a53 100644 --- a/cypress/productAnalytics/index.ts +++ b/cypress/productAnalytics/index.ts @@ -64,9 +64,9 @@ export const insight = { }, editName: (insightName: string): void => { if (insightName) { - cy.get('[data-attr="insight-name"] [data-attr="edit-prop-name"]').click() - cy.get('[data-attr="insight-name"] input').type(insightName) - cy.get('[data-attr="insight-name"] [title="Save"]').click() + cy.get('[data-attr="top-bar-name"] button').click() + cy.get('[data-attr="top-bar-name"] input').clear().type(insightName) + cy.get('[data-attr="top-bar-name"] [title="Save"]').click() } }, save: (): void => {