2020-05-22 18:34:48 +02:00
|
|
|
describe('Funnels', () => {
|
|
|
|
beforeEach(() => {
|
2021-06-09 16:58:34 +02:00
|
|
|
// :TRICKY: Race condition populating the first dropdown in funnel
|
|
|
|
cy.get('[data-test-filters-loading]').should('not.exist')
|
2020-08-24 23:02:13 +02:00
|
|
|
cy.get('[data-attr=insight-funnels-tab]').click()
|
2020-09-18 15:26:12 +02:00
|
|
|
cy.wait(200)
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
|
|
|
|
2021-03-06 11:37:55 +01:00
|
|
|
it('Add only events to funnel', () => {
|
|
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
|
|
|
2021-07-02 00:58:15 +02:00
|
|
|
cy.get('[data-attr=save-funnel-button]').click() // `save-funnel-button` is actually calculate, keeping around to avoid losing data
|
2021-03-06 11:37:55 +01:00
|
|
|
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
|
|
})
|
|
|
|
|
2021-02-25 16:41:25 +01:00
|
|
|
it('Add 1 action to funnel and navigate to persons', () => {
|
2020-08-24 23:02:13 +02:00
|
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
|
|
cy.get('[data-attr=trend-element-subject-0]').click()
|
2020-11-24 18:28:44 +01:00
|
|
|
|
2021-02-08 18:34:27 +01:00
|
|
|
cy.wait(200)
|
2021-04-06 18:21:21 +02:00
|
|
|
cy.contains('HogFlix homepage view').click()
|
2020-07-29 17:51:49 +02:00
|
|
|
|
2020-08-24 23:02:13 +02:00
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
2020-07-29 17:51:49 +02:00
|
|
|
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
2021-02-25 16:41:25 +01:00
|
|
|
|
|
|
|
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')
|
|
|
|
})
|
2020-05-22 18:34:48 +02:00
|
|
|
})
|
|
|
|
|
2020-08-24 23:02:13 +02:00
|
|
|
it('Apply date filter to funnel', () => {
|
2020-05-22 18:34:48 +02:00
|
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
|
|
cy.get('[data-attr=trend-element-subject-0]').click()
|
2021-04-06 18:21:21 +02:00
|
|
|
cy.contains('HogFlix homepage view').click()
|
2020-09-18 15:26:12 +02:00
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
|
2020-08-24 23:02:13 +02:00
|
|
|
cy.get('[data-attr=date-filter]').click()
|
|
|
|
cy.contains('Last 30 days').click()
|
|
|
|
|
2020-09-01 15:19:15 +02:00
|
|
|
cy.get('[data-attr=date-filter]').click()
|
|
|
|
cy.contains('Last 30 days').click()
|
|
|
|
|
2020-05-22 18:34:48 +02:00
|
|
|
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()
|
2021-04-06 18:21:21 +02:00
|
|
|
cy.contains('HogFlix homepage view').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('[data-attr=add-action-event-button]').click()
|
|
|
|
cy.get('[data-attr=trend-element-subject-1]').click()
|
2021-04-06 18:21:21 +02:00
|
|
|
cy.contains('HogFlix paid').click()
|
2020-05-22 18:34:48 +02:00
|
|
|
|
|
|
|
cy.get('[data-attr=save-funnel-button]').click()
|
|
|
|
|
|
|
|
cy.get('[data-attr=funnel-viz]').should('exist')
|
|
|
|
})
|
|
|
|
})
|