From a9fee3a575032d4116592bbc4c90a92225cb8fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Mart=C3=ADnez=20Vega?= Date: Wed, 6 Jan 2021 13:23:30 -0600 Subject: [PATCH] Replace route2 to intercept command in Cypress tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rodolfo Martínez Vega --- provider-ui/cypress.json | 3 +-- provider-ui/cypress/integration/provider-ui_spec.js | 2 +- ui/cypress.json | 3 +-- ui/cypress/integration/e2e/userpreference_spec.js | 10 +++++----- .../integration/integration/userpreference_spec.js | 6 +++--- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/provider-ui/cypress.json b/provider-ui/cypress.json index 1864dd4df71..399eea2e5c2 100644 --- a/provider-ui/cypress.json +++ b/provider-ui/cypress.json @@ -1,4 +1,3 @@ { - "baseUrl": "http://localhost:3001", - "experimentalNetworkStubbing": true + "baseUrl": "http://localhost:3001" } diff --git a/provider-ui/cypress/integration/provider-ui_spec.js b/provider-ui/cypress/integration/provider-ui_spec.js index a57313d0bed..83d9f86ce34 100644 --- a/provider-ui/cypress/integration/provider-ui_spec.js +++ b/provider-ui/cypress/integration/provider-ui_spec.js @@ -1,6 +1,6 @@ describe('Provider UI', () => { beforeEach(() => { - cy.route2('GET', '/api/providers', { fixture: 'providers.json' }).as('getProviders') + cy.intercept('GET', '/api/providers', { fixture: 'providers.json' }).as('getProviders') cy.visit('/') cy.wait('@getProviders') }) diff --git a/ui/cypress.json b/ui/cypress.json index ec88271ccd4..17ef242e711 100644 --- a/ui/cypress.json +++ b/ui/cypress.json @@ -1,4 +1,3 @@ { - "baseUrl": "http://localhost:3000", - "experimentalNetworkStubbing": true + "baseUrl": "http://localhost:3000" } diff --git a/ui/cypress/integration/e2e/userpreference_spec.js b/ui/cypress/integration/e2e/userpreference_spec.js index 0c16ac44cc6..87fa069d7c5 100644 --- a/ui/cypress/integration/e2e/userpreference_spec.js +++ b/ui/cypress/integration/e2e/userpreference_spec.js @@ -1,7 +1,7 @@ describe('User Preferences', () => { describe('Analytics and Improvement Program', () => { beforeEach(() => { - cy.route2('GET', '/api/user/stats').as('getUserStats') + cy.intercept('GET', '/api/user/stats').as('getUserStats') cy.selectProviderNone() @@ -11,7 +11,7 @@ describe('User Preferences', () => { }) it('deactivates "Send Anonymous Usage Statistics"', () => { - cy.route2('POST', '/api/user/stats').as('postUserStats') + cy.intercept('POST', '/api/user/stats').as('postUserStats') cy.get('[data-cy="UsageStatsPreference"]').click() cy.wait('@postUserStats') @@ -19,7 +19,7 @@ describe('User Preferences', () => { }) it('activates "Send Anonymous Usage Statistics"', () => { - cy.route2('POST', '/api/user/stats').as('postUserStats') + cy.intercept('POST', '/api/user/stats').as('postUserStats') cy.get('[data-cy="UsageStatsPreference"]').click() cy.wait('@postUserStats') @@ -27,7 +27,7 @@ describe('User Preferences', () => { }) it('deactivates "Send Anonymous Performance Results"', () => { - cy.route2('POST', '/api/user/stats').as('postUserStats') + cy.intercept('POST', '/api/user/stats').as('postUserStats') cy.get('[data-cy="PerfResultPreference"]').click() cy.wait('@postUserStats') @@ -35,7 +35,7 @@ describe('User Preferences', () => { }) it('activates "Send Anonymous Performance Results"', () => { - cy.route2('POST', '/api/user/stats').as('postUserStats') + cy.intercept('POST', '/api/user/stats').as('postUserStats') cy.get('[data-cy="PerfResultPreference"]').click() cy.wait('@postUserStats') diff --git a/ui/cypress/integration/integration/userpreference_spec.js b/ui/cypress/integration/integration/userpreference_spec.js index 0a0444fab53..851e78e8f82 100644 --- a/ui/cypress/integration/integration/userpreference_spec.js +++ b/ui/cypress/integration/integration/userpreference_spec.js @@ -1,7 +1,7 @@ describe('User Preferences', () => { describe('Analytics and Improvement Program', () => { beforeEach(() => { - cy.route2('GET', '/api/user/stats', { fixture: 'stats.json' }).as('getUserStats') + cy.intercept('GET', '/api/user/stats', { fixture: 'stats.json' }).as('getUserStats') cy.visit('/user/preferences') cy.get('.MuiFormLabel-root').should('have.text', 'Analytics and Improvement Program') @@ -9,7 +9,7 @@ describe('User Preferences', () => { }) it('deactivates "Send Anonymous Usage Statistics"', () => { - cy.route2('POST', '/api/user/stats', { fixture: 'stats.json' }).as('postUserStats') + cy.intercept('POST', '/api/user/stats', { fixture: 'stats.json' }).as('postUserStats') cy.get('[data-cy="UsageStatsPreference"]').click() cy.wait('@postUserStats') @@ -17,7 +17,7 @@ describe('User Preferences', () => { }) it('deactivates "Send Anonymous Performance Results"', () => { - cy.route2('POST', '/api/user/stats', { fixture: 'stats.json' }).as('postUserStats') + cy.intercept('POST', '/api/user/stats', { fixture: 'stats.json' }).as('postUserStats') cy.get('[data-cy="PerfResultPreference"]').click() cy.wait('@postUserStats')