mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 09:14:46 +01:00
ef2b6acda0
* simplify cypress nav menu clicks * clean unused annotations code * don't blank all cohorts when deleting one * add data-test-filters-loading to better target loading indicators in tests
70 lines
2.2 KiB
JavaScript
70 lines
2.2 KiB
JavaScript
describe('Funnels', () => {
|
|
beforeEach(() => {
|
|
// :TRICKY: Race condition populating the first dropdown in funnel
|
|
cy.get('[data-test-filters-loading]').should('not.exist')
|
|
cy.get('[data-attr=insight-funnels-tab]').click()
|
|
cy.wait(200)
|
|
})
|
|
|
|
it('Add only events to funnel', () => {
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
})
|
|
|
|
it('Add 1 action to funnel and navigate to persons', () => {
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
cy.get('[data-attr=trend-element-subject-0]').click()
|
|
|
|
cy.wait(200)
|
|
cy.contains('HogFlix homepage view').click()
|
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
|
|
cy.get('[data-attr="funnel-person"] a')
|
|
.filter(':contains("@")')
|
|
.first()
|
|
.then(($match) => {
|
|
const email = $match.text()
|
|
|
|
cy.wrap($match).click()
|
|
|
|
cy.url().should('include', '/person/')
|
|
cy.contains(email).should('exist')
|
|
})
|
|
})
|
|
|
|
it('Apply date filter to funnel', () => {
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
cy.get('[data-attr=trend-element-subject-0]').click()
|
|
cy.contains('HogFlix homepage view').click()
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
|
|
|
cy.get('[data-attr=date-filter]').click()
|
|
cy.contains('Last 30 days').click()
|
|
|
|
cy.get('[data-attr=date-filter]').click()
|
|
cy.contains('Last 30 days').click()
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
})
|
|
|
|
it('Add 2 actions to funnel', () => {
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
cy.get('[data-attr=trend-element-subject-0]').click()
|
|
cy.contains('HogFlix homepage view').click()
|
|
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
cy.get('[data-attr=trend-element-subject-1]').click()
|
|
cy.contains('HogFlix paid').click()
|
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
})
|
|
})
|