Skip to content

Commit

Permalink
more cypress fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Dec 22, 2023
1 parent aa5d99d commit 770e9d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions cypress/productAnalytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export const insight = {

cy.get('[data-attr="insight-save-button"]').click() // Save the insight
cy.url().should('not.include', '/new') // wait for insight to complete and update URL
cy.get('[data-attr="edit-prop-name"]').click({ force: true }) // Rename insight, out of view, must force
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()
},
addInsightToDashboard: (dashboardName: string, options: { visitAfterAdding: boolean }): void => {
cy.intercept('PATCH', /api\/projects\/\d+\/insights\/\d+\/.*/).as('patchInsight')
Expand Down Expand Up @@ -155,17 +155,18 @@ export const dashboards = {
createDashboardFromDefaultTemplate: (dashboardName: string): void => {
cy.get('[data-attr="new-dashboard"]').click()
cy.get('[data-attr="create-dashboard-from-template"]').click()
cy.get('[data-attr="dashboard-name"]').contains('Product analytics').should('exist')
cy.get('[data-attr="dashboard-name"] button').click()
cy.get('[data-attr="dashboard-name"] input').clear().type(dashboardName).blur()
cy.get('[data-attr="top-bar-name"]').contains('Product analytics').should('exist')
cy.get('[data-attr="top-bar-name"] button').click()
cy.get('[data-attr="top-bar-name"] input').clear().type(dashboardName).blur()
cy.contains(dashboardName).should('exist')
},
createAndGoToEmptyDashboard: (dashboardName: string): void => {
cy.get('[data-attr="new-dashboard"]').click()
cy.get('[data-attr="create-dashboard-blank"]').click()
cy.get('[data-attr="dashboard-name"]').should('exist')
cy.get('[data-attr="dashboard-name"] button').click()
cy.get('[data-attr="dashboard-name"] input').clear().type(dashboardName).blur()
cy.get('[data-attr="top-bar-name"]').should('exist')
cy.get('[data-attr="top-bar-name"] button').click()
cy.get('[data-attr="top-bar-name"] input').clear().type(dashboardName)
cy.get('[data-attr="top-bar-name"] [title="Save"]').click()
cy.contains(dashboardName).should('exist')
},
visitDashboard: (dashboardName: string): void => {
Expand All @@ -185,10 +186,10 @@ export const dashboard = {
cy.get('[data-attr=toast-close-button]').click({ multiple: true })

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('h1.page-title').should('have.text', insightName)
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()
cy.get('[data-attr="top-bar-name"]').should('have.text', insightName)
}

cy.get('[data-attr=insight-save-button]').contains('Save & add to dashboard').click()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation-3000/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function Here({ breadcrumb }: HereProps): JSX.Element {
const { tentativelyRename, finishRenaming } = useActions(breadcrumbsLogic)

return (
<h1 className="TopBar3000__here">
<h1 className="TopBar3000__here" data-attr="top-bar-name">
{breadcrumb.name == null ? (
<LemonSkeleton className="w-40 h-4" />
) : breadcrumb.onRename ? (
Expand Down

0 comments on commit 770e9d0

Please sign in to comment.