0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 03:26:38 +01:00
posthog/cypress/integration/trends_sessions.js

51 lines
1.6 KiB
JavaScript
Raw Normal View History

describe('Trends sessions', () => {
beforeEach(() => {
// given
cy.visit('/')
cy.contains('Sessions').click()
})
it('Navigate from distributed sessions to /trends', () => {
cy.get('[data-attr=sessions-filter]').click()
cy.get('[data-attr=sessions-filter-distribution]').click()
cy.get('[data-attr=trend-table-graph]').should('exist')
cy.contains('Actions & Events').click()
cy.get('[data-attr=trend-line-graph] canvas').should('exist')
})
it('Sessions exists', () => {
// then
cy.get('[data-attr=trend-line-graph]').should('exist')
})
it('Apply 1 overall filter', () => {
cy.get('[data-attr=new-prop-filter-trends-sessions]').click()
cy.get('[data-attr=prop-filter-event-1]').click()
cy.get('[data-attr=prop-val]').click()
cy.get('[data-attr=prop-val-0]').click()
cy.get('[data-attr=trend-line-graph]').should('exist')
})
it('Apply table filter', () => {
cy.get('[data-attr=chart-filter]').click()
cy.contains('Table').click()
cy.get('[data-attr=trend-table-graph]').should('exist')
})
it('Apply date filter', () => {
cy.get('[data-attr=date-filter]').click()
cy.contains('Last 30 days').click()
cy.get('[data-attr=trend-line-graph]').should('exist')
})
it('Save to dashboard', () => {
cy.get('[data-attr=save-to-dashboard-button]').click()
cy.contains('Add panel to dashboard').click()
cy.wait(700) // not ideal but toast has a delay render
cy.get('[data-attr=success-toast]').should('exist')
})
})