diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml index 4ec28981e5f1d..8b556802279a1 100644 --- a/.github/workflows/ci-e2e.yml +++ b/.github/workflows/ci-e2e.yml @@ -229,7 +229,6 @@ jobs: uses: cypress-io/github-action@v6 with: config-file: cypress.e2e.config.ts - config: retries=2 spec: ${{ matrix.chunk }} install: false # We were seeing suprising crashes in headless mode diff --git a/cypress.e2e.config.ts b/cypress.e2e.config.ts index 1b5344ee3bf99..d8023fa4de922 100644 --- a/cypress.e2e.config.ts +++ b/cypress.e2e.config.ts @@ -24,8 +24,8 @@ const checkFileDownloaded = async (filename: string, timeout: number, delayMs = export default defineConfig({ video: false, - defaultCommandTimeout: 20000, - requestTimeout: 8000, + defaultCommandTimeout: 40000, + requestTimeout: 16000, pageLoadTimeout: 80000, projectId: 'twojfp', viewportWidth: 1200, @@ -34,7 +34,7 @@ export default defineConfig({ // cypress default is 'top' this means sometimes the element is underneath the top navbar // not what a human would do... so, set it to center to avoid this weird behavior scrollBehavior: 'center', - retries: { runMode: 2 }, + retries: { runMode: 3 }, e2e: { // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. diff --git a/cypress/e2e/billing.cy.ts b/cypress/e2e/billing.cy.ts index a32b416abc39e..5b38d8e760d50 100644 --- a/cypress/e2e/billing.cy.ts +++ b/cypress/e2e/billing.cy.ts @@ -7,33 +7,39 @@ describe('Billing', () => { cy.visit('/organization/billing') }) - it('Show and submit unsubscribe survey', () => { - cy.intercept('/api/billing/deactivate?products=product_analytics', { - fixture: 'api/billing/billing-unsubscribed-product-analytics.json', - }).as('unsubscribeProductAnalytics') + it( + 'Show and submit unsubscribe survey', + { + retries: 4, + }, + () => { + cy.intercept('/api/billing/deactivate?products=product_analytics', { + fixture: 'api/billing/billing-unsubscribed-product-analytics.json', + }).as('unsubscribeProductAnalytics') - cy.get('[data-attr=more-button]').first().click() - cy.contains('.LemonButton', 'Unsubscribe').click() - cy.get('.LemonModal h3').should('contain', 'Unsubscribe from Product analytics') - cy.get('[data-attr=unsubscribe-reason-too-expensive]').click() - cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics') - cy.contains('.LemonModal .LemonButton', 'Unsubscribe').click() - - cy.window().then((win) => { - const events = (win as any)._cypress_posthog_captures - const matchingEvents = events.filter((event) => event.event === 'survey sent') - expect(matchingEvents.length).to.equal(1) - const matchingEvent = matchingEvents[0] - expect(matchingEvent.properties.$survey_id).to.equal(UNSUBSCRIBE_SURVEY_ID) - expect(matchingEvent.properties.$survey_response).to.equal('Product analytics') - expect(matchingEvent.properties.$survey_response_1).to.equal('product_analytics') - expect(matchingEvent.properties.$survey_response_2.length).to.equal(1) - expect(matchingEvent.properties.$survey_response_2[0]).to.equal('Too expensive') - }) - - cy.get('.LemonModal').should('not.exist') - cy.wait(['@unsubscribeProductAnalytics']) - }) + cy.get('[data-attr=more-button]').first().click() + cy.contains('.LemonButton', 'Unsubscribe').click() + cy.get('.LemonModal h3').should('contain', 'Unsubscribe from Product analytics') + cy.get('[data-attr=unsubscribe-reason-too-expensive]').click() + cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics') + cy.contains('.LemonModal .LemonButton', 'Unsubscribe').click() + + cy.window().then((win) => { + const events = (win as any)._cypress_posthog_captures + const matchingEvents = events.filter((event) => event.event === 'survey sent') + expect(matchingEvents.length).to.equal(1) + const matchingEvent = matchingEvents[0] + expect(matchingEvent.properties.$survey_id).to.equal(UNSUBSCRIBE_SURVEY_ID) + expect(matchingEvent.properties.$survey_response).to.equal('Product analytics') + expect(matchingEvent.properties.$survey_response_1).to.equal('product_analytics') + expect(matchingEvent.properties.$survey_response_2.length).to.equal(1) + expect(matchingEvent.properties.$survey_response_2[0]).to.equal('Too expensive') + }) + + cy.get('.LemonModal').should('not.exist') + cy.wait(['@unsubscribeProductAnalytics']) + } + ) it('Unsubscribe survey text area maintains unique state between product types', () => { cy.get('[data-attr=more-button]').first().click() diff --git a/cypress/e2e/dashboard-deletion.ts b/cypress/e2e/dashboard-deletion.cy.ts similarity index 100% rename from cypress/e2e/dashboard-deletion.ts rename to cypress/e2e/dashboard-deletion.cy.ts diff --git a/cypress/e2e/dashboard-duplication.ts b/cypress/e2e/dashboard-duplication.cy.ts similarity index 100% rename from cypress/e2e/dashboard-duplication.ts rename to cypress/e2e/dashboard-duplication.cy.ts diff --git a/cypress/e2e/insights-reload-query.ts b/cypress/e2e/insights-reload-query.cy.ts similarity index 92% rename from cypress/e2e/insights-reload-query.ts rename to cypress/e2e/insights-reload-query.cy.ts index 55685ae309fb8..134e1146d96c7 100644 --- a/cypress/e2e/insights-reload-query.ts +++ b/cypress/e2e/insights-reload-query.cy.ts @@ -5,12 +5,15 @@ describe('ReloadInsight component', () => { }) it('saves the query to the URL and localStorage, and reloads it when prompted', () => { + cy.intercept('POST', /api\/environments\/\d+\/query\//).as('loadNewQueryInsight') + // Visit the new insight creation page cy.visit('/insights/new') cy.wait(2000) cy.get('[data-attr="math-selector-0"]').click({ force: true }) + cy.wait('@loadNewQueryInsight') cy.get('[data-attr="math-dau-0"]').click({ force: true }) // Check that the 'draft-query' item is stored in localStorage diff --git a/cypress/e2e/notebooks-insights.ts b/cypress/e2e/notebooks-insights.cy.ts similarity index 100% rename from cypress/e2e/notebooks-insights.ts rename to cypress/e2e/notebooks-insights.cy.ts