0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/cypress/integration/people.js
Karl-Aksel Puulmann f6df41afaa
Retention page (#1073)
* Retention query v0

* First iteration of endpoint

* Return dates labels as well

* Fix the order of result building

* Improve query for retention.

Instead of trying to figure out the "first date", it instead:
1. Figures out what dates every user does events on (WITH query)
2. Then for every date/'first' date combo counts users.

I doubt this is the efficient way to do things but seems to return the
right results.

We now also include time range filter with the query.

* Add empty views for retention

* Add logic for loading data for retention table

* Get a table rendering for retention

* 11 days over 10

This results in a more pretty table

* Remove raw column

* Use correct relative timeframe

* Add spec for retention feature

Note it's currently failing because of missing functionality

* Use query combining for retention queries

* Color cells in retention table

Background color baseline was picked based on already used colors in
css.

Text color switches when crossing a handpicked threshold for legibility.

* Open submenu when navigating to retention

* Add e2e test for retention route

* Add subheader for retention

* Try make mypy happy
2020-06-24 21:13:56 +02:00

28 lines
744 B
JavaScript

describe('People', () => {
beforeEach(() => {
cy.get('[data-attr=menu-item-people]').click()
})
it('People loaded', () => {
cy.get('h1').should('contain', 'Users')
})
it('Go to new cohort from people screen', () => {
cy.get('[data-attr=create-cohort]').click()
cy.get('span').should('contain', 'New Cohort')
})
it('All people route works', () => {
cy.get('[data-attr=menu-item-cohorts]').click()
cy.get('[data-attr=menu-item-all-people]').click()
cy.get('h1').should('contain', 'Users')
})
it('Retention route works', () => {
cy.get('[data-attr=menu-item-retention]').click()
cy.get('h1').should('contain', 'Retention')
})
})