2023-09-18 15:00:03 +02:00
|
|
|
import { urls } from 'scenes/urls'
|
2024-07-09 11:59:53 +02:00
|
|
|
|
2023-09-18 15:00:03 +02:00
|
|
|
import { insight } from '../productAnalytics'
|
|
|
|
|
|
|
|
const hogQLQuery = `select event,
|
|
|
|
count()
|
|
|
|
from events
|
|
|
|
group by event,
|
|
|
|
properties.$browser,
|
|
|
|
person.properties.email
|
|
|
|
order by count() desc
|
|
|
|
limit 2`
|
|
|
|
|
|
|
|
// For tests related to trends please check trendsElements.js
|
|
|
|
describe('Insights', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.visit(urls.insightNew())
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('navigation', () => {
|
|
|
|
describe('opening a new insight directly', () => {
|
|
|
|
it('can open a new trends insight', () => {
|
|
|
|
insight.newInsight('TRENDS')
|
2023-11-15 17:47:05 +01:00
|
|
|
cy.get('.TrendsInsight canvas').should('exist')
|
2023-09-18 15:00:03 +02:00
|
|
|
cy.get('tr').should('have.length.gte', 2)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('can open a new funnels insight', () => {
|
|
|
|
insight.newInsight('FUNNELS')
|
|
|
|
cy.get('.funnels-empty-state__title').should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it.skip('can open a new retention insight', () => {
|
|
|
|
insight.newInsight('RETENTION')
|
|
|
|
cy.get('.RetentionContainer canvas').should('exist')
|
|
|
|
cy.get('.RetentionTable__Tab').should('have.length', 66)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('can open a new paths insight', () => {
|
|
|
|
insight.newInsight('PATHS')
|
|
|
|
cy.get('.Paths g').should('have.length.gte', 5) // not a fixed value unfortunately
|
|
|
|
})
|
|
|
|
|
|
|
|
it('can open a new stickiness insight', () => {
|
|
|
|
insight.newInsight('STICKINESS')
|
2023-11-15 17:47:05 +01:00
|
|
|
cy.get('.TrendsInsight canvas').should('exist')
|
2023-09-18 15:00:03 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('can open a new lifecycle insight', () => {
|
|
|
|
insight.newInsight('LIFECYCLE')
|
2023-11-15 17:47:05 +01:00
|
|
|
cy.get('.TrendsInsight canvas').should('exist')
|
2023-09-18 15:00:03 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('can open a new SQL insight', () => {
|
|
|
|
insight.newInsight('SQL')
|
|
|
|
insight.updateQueryEditorText(hogQLQuery, 'hogql-query-editor')
|
|
|
|
cy.get('[data-attr="hogql-query-editor"]').should('exist')
|
2024-08-12 15:46:22 +02:00
|
|
|
cy.get('tr.DataVizRow').should('have.length.gte', 2)
|
2023-09-18 15:00:03 +02:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|