Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Cypress Tests for Onboarding Flow #20676

Merged
merged 53 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9d78dad
wip
Feb 29, 2024
a6763a6
iteration 1
Mar 2, 2024
bec0c8b
some small fixes
Mar 2, 2024
6bb8c5c
update
Mar 8, 2024
3422c6e
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 8, 2024
f71d915
fix up product intro page test
Mar 8, 2024
de9281a
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 8, 2024
79eaa8a
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 9, 2024
414d2c6
rebase on main, fix a type issue
Mar 11, 2024
4315b48
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 11, 2024
700dee1
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 11, 2024
99cf6c1
remove console log
Mar 12, 2024
eac7c1e
remove extraneous file
Mar 12, 2024
442ccb3
fix tests again...
Mar 13, 2024
238b36c
Merge branch 'master' into by/onboarding-cypress
xrdt Mar 13, 2024
50cdb29
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
721e5c4
more test tweaks
Mar 13, 2024
2140361
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
0382f25
yet another set of fixeds
Mar 13, 2024
0472e86
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
8153238
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 13, 2024
34a582f
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
7c4d389
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 13, 2024
c105362
one more test tweak
Mar 14, 2024
3cd15a8
Merge remote-tracking branch 'origin/master' into by/onboarding-cypress
Mar 14, 2024
b28824f
fix(admin): follow up for org page performance improvements (#20912)
thmsobrmlr Mar 14, 2024
e40142f
feat: Add clickhouse migration to create a dictionary (#20665)
tomasfarias Mar 14, 2024
0524021
fix: picking embedding input samples (#20913)
daibhin Mar 14, 2024
2ffbb1b
fix: Split healthcheck to separate nginx unit app (#20917)
frankh Mar 14, 2024
9049fd2
chore: BillingProduct cleanup (#20910)
daibhin Mar 14, 2024
42edec7
fix: show names on frontend (#20918)
daibhin Mar 14, 2024
b192cb9
fix(experiment): revert default goal back to Trends (#20921)
jurajmajerik Mar 14, 2024
176da5d
Add missing healthcheck routes to app (#20923)
frankh Mar 14, 2024
1840482
chore: Add context to deployment messages (#20911)
danielxnj Mar 14, 2024
354cf47
chore(environments): Add migration to backfill projects (#20887)
Twixes Mar 14, 2024
f4c9bef
refactor(style): do not use star imports for locals (#20915)
thmsobrmlr Mar 14, 2024
32e423d
feat(sentry): enable sampling via http header (#20916)
thmsobrmlr Mar 14, 2024
114ce39
fix: Add missing underscore to healthcheck routes (#20926)
frankh Mar 14, 2024
19e49f7
chore(deps): Update posthog-js to 1.115.0 (#20924)
posthog-bot Mar 14, 2024
00bef66
fix(toolbar): Keep flags in sync (#20927)
neilkakkar Mar 14, 2024
47a4297
fix: some typos in summary settings (#20925)
pauldambra Mar 14, 2024
e198211
fix: custom player inspector events should respect mini filters (#20929)
pauldambra Mar 14, 2024
f550541
fix: don't show billing step on self-hosted (#20931)
raquelmsmith Mar 14, 2024
7164789
chore: improve onboarding spacing consistency (#20838)
zlwaterfield Mar 14, 2024
011781a
fix: flappy snapshot (#20930)
raquelmsmith Mar 14, 2024
c8764f6
fix storybook
Mar 18, 2024
118a884
Merge remote-tracking branch 'origin/master' into by/onboarding-cypress
Mar 18, 2024
8c442f8
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 19, 2024
a2b89fd
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 19, 2024
fd653b1
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 19, 2024
1ede0b6
Merge branch 'master' into by/onboarding-cypress
xrdt Mar 19, 2024
d12e651
fix some tests
Mar 19, 2024
e880147
another round of fixes
Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/e2e/billingv2.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Billing', () => {

cy.get('[data-attr=more-button]').first().click()
cy.contains('.LemonButton', 'Unsubscribe').click()
cy.get('.LemonModal h3').should('contain', 'Why are you unsubscribing from Product analytics + data stack?')
cy.get('.LemonModal h3').should('contain', 'Why are you unsubscribing from Product analytics?')
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics')
cy.contains('.LemonModal .LemonButton', 'Unsubscribe').click()

Expand All @@ -35,7 +35,7 @@ describe('Billing', () => {
it('Unsubscribe survey text area maintains unique state between product types', () => {
cy.get('[data-attr=more-button]').first().click()
cy.contains('.LemonButton', 'Unsubscribe').click()
cy.get('.LemonModal h3').should('contain', 'Why are you unsubscribing from Product analytics + data stack?')
cy.get('.LemonModal h3').should('contain', 'Why are you unsubscribing from Product analytics?')

cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics')
cy.contains('.LemonModal .LemonButton', 'Cancel').click()
Expand Down
153 changes: 145 additions & 8 deletions cypress/e2e/onboarding.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { decideResponse } from '../fixtures/api/decide'

describe('Onboarding', () => {
beforeEach(() => {
cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2-unsubscribed.json' })

cy.intercept('**/decide/*', (req) =>
req.reply(
decideResponse({
Expand All @@ -21,22 +23,157 @@ describe('Onboarding', () => {
// Confirm product intro is not included as the first step in the upper right breadcrumbs
cy.get('[data-attr=onboarding-breadcrumbs] > :first-child > * span').should('not.contain', 'Product Intro')

// Navigate to the product intro page by clicking the left side bar
cy.get('[data-attr=menu-item-replay').click()
cy.window().then((win) => {
win.POSTHOG_APP_CONTEXT.current_team.has_completed_onboarding_for = {}
})

cy.get('[data-attr=menu-item-savedinsights]').click()

// Confirm we're on the product_intro page
cy.get('[data-attr=top-bar-name] > span').contains('Product intro')

// Go back to /products
cy.get('[data-attr=start-onboarding]').should('be.visible')
cy.get('[data-attr=skip-onboarding]').should('not.exist')
})

it('Step through PA onboarding', () => {
cy.visit('/products')

// Again get started on product analytics onboarding
// Get started on product analytics onboarding
cy.get('[data-attr=product_analytics-onboarding-card]').click()

// Navigate to the product intro page by changing the url
cy.visit(urls.onboarding('session_replay', 'product_intro'))
// Installation should be complete
cy.get('svg.LemonIcon.text-success').should('exist')
cy.get('svg.LemonIcon.text-success').parent().should('contain', 'Installation complete')

// Confirm we're on the product intro page
cy.get('[data-attr=top-bar-name] > span').contains('Product intro')
// Continue to configuration step
cy.get('[data-attr=sdk-continue]').click()

// Confirm the appropriate breadcrumb is highlighted
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(3) > * span').should('contain', 'Configure')
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(3) > * span').should('not.have.css', 'text-muted')

// Continue to plans
cy.get('[data-attr=onboarding-continue]').click()

// Verify pricing table visible
cy.get('.BillingHero').should('be.visible')
cy.get('table.PlanComparison').should('be.visible')

// Confirm buttons on pricing comparison
cy.get('[data-attr=upgrade-Paid] .LemonButton__content').should('have.text', 'Subscribe')
cy.get('[data-attr=upgrade-Free] .LemonButton__content').should('have.text', 'Current plan')

// Continue
cy.get('[data-attr=onboarding-skip-button]').click()

// Click back to Install step
cy.get('[data-attr=onboarding-breadcrumbs] > :first-child > * span').click()

// Continue through to finish
cy.get('[data-attr=sdk-continue]').click()
cy.get('[data-attr=onboarding-continue]').click()
cy.get('[data-attr=onboarding-skip-button]').click()
cy.get('[data-attr=onboarding-continue]').click()

// Confirm we're on the insights list page
cy.url().should('contain', 'project/1/insights')

cy.visit('/onboarding/product_analytics?step=product_intro')

// Should see both an option to skip onboarding and an option to see the sdk instructions
cy.get('[data-attr=skip-onboarding]').should('be.visible')
cy.get('[data-attr=start-onboarding-sdk]').should('be.visible')

cy.get('[data-attr=skip-onboarding]').first().click()
cy.url().should('contain', 'project/1/insights')

cy.visit('/onboarding/product_analytics?step=product_intro')
cy.get('[data-attr=start-onboarding-sdk]').first().click()
cy.url().should('contain', 'project/1/onboarding/product_analytics?step=install')

cy.visit('/products')
cy.get('[data-attr=return-to-product_analytics] > svg').click()
cy.url().should('contain', 'project/1/insights')
})

it('Step through SR onboarding', () => {
cy.visit('/products')
cy.get('[data-attr=session_replay-onboarding-card]').click()

// Installation should be complete
cy.get('svg.LemonIcon.text-success').should('exist')
cy.get('svg.LemonIcon.text-success').parent().should('contain', 'Installation complete')
// Continue to configuration step
cy.get('[data-attr=sdk-continue]').click()
// Continue to plans
cy.get('[data-attr=onboarding-continue]').click()
// Verify pricing table visible
cy.get('.BillingHero').should('be.visible')
cy.get('table.PlanComparison').should('be.visible')
// Confirm buttons on pricing comparison
cy.get('[data-attr=upgrade-Paid] .LemonButton__content').should('have.text', 'Subscribe')
cy.get('[data-attr=upgrade-Free] .LemonButton__content').should('have.text', 'Current plan')
// Continue through to finish
cy.get('[data-attr=onboarding-skip-button]').click()
cy.get('[data-attr=onboarding-continue]').click()
// Confirm we're on the recordings list page
cy.url().should('contain', 'project/1/replay/recent')
cy.visit('/onboarding/session_replay?step=product_intro')
cy.get('[data-attr=skip-onboarding]').should('be.visible')
cy.get('[data-attr=start-onboarding-sdk]').should('not.exist')
})

it('Step through FF onboarding', () => {
cy.visit('/onboarding/feature_flags?step=product_intro')
cy.get('[data-attr=start-onboarding-sdk]').first().click()
cy.get('[data-attr=sdk-continue]').click()

// Confirm the appropriate breadcrumb is highlighted
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(5) > * span').should('contain', 'Plans')
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(3) > * span').should('not.have.css', 'text-muted')

cy.get('[data-attr=onboarding-skip-button]').click()
cy.get('[data-attr=onboarding-continue]').click()

cy.url().should('contain', '/feature_flags')

cy.visit('/onboarding/feature_flags?step=product_intro')

cy.get('[data-attr=skip-onboarding]').should('be.visible')
cy.get('[data-attr=start-onboarding-sdk]').should('be.visible')

cy.get('[data-attr=skip-onboarding]').first().click()
})

it('Step through Surveys onboarding', () => {
cy.visit('/onboarding/surveys?step=product_intro')
cy.get('[data-attr=skip-onboarding]').should('be.visible')
cy.get('[data-attr=start-onboarding-sdk]').should('not.exist')
cy.get('[data-attr=skip-onboarding]').first().click()
cy.url().should('contain', 'survey_templates')

cy.visit('/products')
cy.get('[data-attr=surveys-onboarding-card]').click()
// Installation should be complete
cy.get('svg.LemonIcon.text-success').should('exist')
cy.get('svg.LemonIcon.text-success').parent().should('contain', 'Installation complete')

// Continue to configuration step
cy.get('[data-attr=sdk-continue]').click()

// Verify pricing table visible
cy.get('.BillingHero').should('be.visible')
cy.get('table.PlanComparison').should('be.visible')

// Confirm buttons on pricing comparison
cy.get('[data-attr=upgrade-Paid] .LemonButton__content').should('have.text', 'Subscribe')
cy.get('[data-attr=upgrade-Free] .LemonButton__content').should('have.text', 'Current plan')

// Continue
cy.get('[data-attr=onboarding-skip-button]').click()
cy.get('[data-attr=onboarding-continue]').click()

cy.url().should('contain', '/survey_templates')
})
})
Loading
Loading