diff --git a/cypress/e2e/before-onboarding.cy.ts b/cypress/e2e/before-onboarding.cy.ts index bb07feab9d9ed..277656c9c4144 100644 --- a/cypress/e2e/before-onboarding.cy.ts +++ b/cypress/e2e/before-onboarding.cy.ts @@ -1,4 +1,13 @@ describe('Before Onboarding', () => { + beforeEach(() => { + cy.request({ + method: 'PATCH', + url: '/api/projects/1/', + body: { completed_snippet_onboarding: false }, + headers: { Authorization: 'Bearer e2e_demo_api_key' }, + }) + }) + it('Navigate to /products when a product has not been set up', () => { cy.visit('/project/1/data-management/events') diff --git a/cypress/e2e/onboarding.cy.ts b/cypress/e2e/onboarding.cy.ts index 56cb23bc45b70..19b7749265c4f 100644 --- a/cypress/e2e/onboarding.cy.ts +++ b/cypress/e2e/onboarding.cy.ts @@ -1,4 +1,3 @@ -import { urls } from 'scenes/urls' import { decideResponse } from '../fixtures/api/decide' describe('Onboarding', () => { diff --git a/cypress/fixtures/api/users/user-enterprise.json b/cypress/fixtures/api/user-enterprise.json similarity index 100% rename from cypress/fixtures/api/users/user-enterprise.json rename to cypress/fixtures/api/user-enterprise.json diff --git a/cypress/fixtures/api/users/user-before-onboarding.json b/cypress/fixtures/api/users/user-before-onboarding.json deleted file mode 100644 index bfdbe2737fc7a..0000000000000 --- a/cypress/fixtures/api/users/user-before-onboarding.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "id": "01788ed8-6d2d-0000-ccdb-d8e17589b1ea", - "distinct_id": "kOyAmTq2McfCD5XvqwjKf8m6GVecm9uN0L0ypEoRN50", - "first_name": "Jane", - "email": "test@posthog.com", - "email_opt_in": true, - "anonymize_data": false, - "toolbar_mode": "toolbar", - "has_password": true, - "is_staff": false, - "is_impersonated": false, - "team": { - "id": 1, - "uuid": "01787e47-55d7-0000-6976-b893a03aaba8", - "organization": "01787e47-5558-0000-bae1-6bc513b42abe", - "api_token": "dtrwW0uEC7LwVx64RmZmqog_XjU0nXWuEK1d1ZpjteQ", - "name": "Hogflix Demo App", - "completed_snippet_onboarding": false, - "has_completed_onboarding_for": {}, - "ingested_event": false, - "is_demo": false, - "timezone": "UTC" - }, - "organization": { - "id": "01787e47-5558-0000-bae1-6bc513b42abe", - "name": "Hogflix Movies", - "created_at": "2021-03-29T13:58:27.416616Z", - "updated_at": "2021-03-29T13:58:57.067131Z", - "membership_level": 15, - "plugins_access_level": 9, - "teams": [ - { - "id": 1, - "uuid": "01787e47-55d7-0000-6976-b893a03aaba8", - "organization": "01787e47-5558-0000-bae1-6bc513b42abe", - "api_token": "dtrwW0uEC7LwVx64RmZmqog_XjU0nXWuEK1d1ZpjteQ", - "name": "Hogflix Demo App", - "completed_snippet_onboarding": false, - "has_completed_onboarding_for": {}, - "ingested_event": false, - "is_demo": false, - "timezone": "UTC" - } - ], - "available_features": [] - }, - "organizations": [{ "id": "01787e47-5558-0000-bae1-6bc513b42abe", "name": "Hogflix Movies" }] -} diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 780ec46c1e2c9..43a6aa641726a 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -47,16 +47,14 @@ beforeEach(() => { ) if (Cypress.spec.name.includes('Premium')) { - cy.intercept('/api/users/@me/', { fixture: 'api/users/user-enterprise' }) + cy.intercept('/api/users/@me/', { fixture: 'api/user-enterprise' }) cy.request('POST', '/api/login/', { email: 'test@posthog.com', password: '12345678', }) cy.visit('/?no-preloaded-app-context=true') - } else if (Cypress.spec.name.includes('before-onboarding')) { - cy.intercept('/api/users/@me/', { fixture: 'api/users/user-before-onboarding' }) - + } else if (Cypress.spec.name.includes('before')) { cy.request('POST', '/api/login/', { email: 'test@posthog.com', password: '12345678',