0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
posthog/cypress/integration/insights.js
Michael Matloka 69669adbb9
Enhance PropertyKeyInfo (#4235)
* Enhance PropertyKeyInfo

* Prepend "Initial " to $initial labels

* Add Brooklyn example for $geoip_ props

* Try improving E2E test quality
2021-05-07 02:26:42 +00:00

34 lines
1.5 KiB
JavaScript

// For tests related to trends please check trendsElements.js
describe('Insights', () => {
beforeEach(() => {
cy.visit('/insights')
})
it('Stickiness graph', () => {
cy.get('.ant-tabs-tab').contains('Stickiness').click()
cy.get('[data-attr=add-action-event-button]').click()
cy.get('[data-attr=trend-element-subject-1]').should('exist')
cy.get('[data-attr=trend-line-graph]').should('exist')
cy.get('[data-attr=add-breakdown-button]').should('not.exist') // Can't do breakdown on this graph
})
it('Lifecycle graph', () => {
cy.get('.ant-tabs-tab').contains('Lifecycle').click()
cy.get('[data-attr=trend-line-graph]').should('exist')
cy.get('[data-attr=add-breakdown-button]').should('not.exist') // Can't do breakdown on this graph
cy.get('[data-attr=add-action-event-button]').should('not.exist') // Can't add multiple series
})
it('Loads default filters correctly', () => {
cy.visit('/events') // Test that default params are set correctly even if the app doesn't start on insights
cy.reload()
cy.get('[data-attr=menu-item-insights]').click()
cy.get('[data-attr=trend-element-subject-0] span').should('contain', 'Pageview')
cy.get('[data-attr=trend-line-graph]').should('exist')
cy.contains('Add graph series').click()
cy.get('[data-attr=trend-element-subject-1]').should('exist')
cy.get('[data-attr=trend-line-graph]').should('exist')
})
})