2020-05-22 18:34:48 +02:00
|
|
|
describe('Funnels', () => {
|
|
|
|
beforeEach(() => {
|
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-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)
|
2020-11-24 18:28:44 +01:00
|
|
|
// Double click: https://www.cypress.io/blog/2019/01/22/when-can-the-test-click/
|
2020-12-03 10:59:11 +01:00
|
|
|
cy.contains('HogFlix homepage view').click().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()
|
2020-12-03 10:59:11 +01:00
|
|
|
cy.contains('HogFlix homepage view').click().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()
|
2020-12-03 10:59:11 +01:00
|
|
|
cy.contains('HogFlix homepage view').click().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()
|
2020-12-03 10:59:11 +01:00
|
|
|
cy.contains('HogFlix paid').click().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')
|
|
|
|
})
|
|
|
|
})
|