0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
posthog/cypress/integration/trends_sessions.js
Tim Glaser 720a6f2bc5
Fix moving from sessions to trends (#1039)
* Fix moving from sessions to trends

* Clear results as a response to an action

Co-authored-by: Marius Andra <marius.andra@gmail.com>
2020-06-19 19:08:53 +02:00

51 lines
1.6 KiB
JavaScript

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(500) // not ideal but toast has a delay render
cy.get('[data-attr=success-toast]').should('exist')
})
})