diff --git a/cypress/e2e/openworld/load.spec.js b/cypress/e2e/openworld/load.spec.js index d73bafe40..7819d0810 100644 --- a/cypress/e2e/openworld/load.spec.js +++ b/cypress/e2e/openworld/load.spec.js @@ -1,6 +1,7 @@ describe('Maps', () => { ['poe', 'vallis'].forEach((ow) => { beforeEach(() => { + cy.setupIntercepts(); cy.visit(`http://localhost:3000/${ow}/map`); cy.wait(1000); }); @@ -18,6 +19,7 @@ describe('Maps', () => { describe('Fish', () => { ['poe', 'vallis', 'deimos'].forEach((ow) => { beforeEach(() => { + cy.setupIntercepts(); cy.visit(`http://localhost:3000/${ow}/fish`); cy.wait(1000); }); diff --git a/cypress/e2e/synthesis/load.spec.js b/cypress/e2e/synthesis/load.spec.js index 18ed73d0f..8cad79a16 100644 --- a/cypress/e2e/synthesis/load.spec.js +++ b/cypress/e2e/synthesis/load.spec.js @@ -1,5 +1,6 @@ describe('Synthesis', () => { beforeEach(() => { + cy.setupIntercepts(); cy.visit(`http://localhost:3000/synthesis`); cy.wait(1000); }); diff --git a/cypress/e2e/timers/load.spec.js b/cypress/e2e/timers/load.spec.js index 627ffdd9e..69d6b53de 100644 --- a/cypress/e2e/timers/load.spec.js +++ b/cypress/e2e/timers/load.spec.js @@ -1,5 +1,6 @@ describe('Timers', () => { beforeEach(() => { + cy.setupIntercepts(); cy.intercept('https://api.warframestat.us/pc/?language=en').as('wsRequest'); cy.visit('http://localhost:3000/'); cy.wait('@wsRequest'); @@ -20,7 +21,6 @@ describe('Timers', () => { cy.get('@selectionButtons').eq(3).should('have.text', 'All'); cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => { - // eslint-disable-next-line no-undef fissures = Cypress.dom.wrap($el); cy.get('@fissures') .find('.list-group .list-group-item') @@ -34,7 +34,6 @@ describe('Timers', () => { cy.get('@selectionButtons').eq(2).click(); cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => { - // eslint-disable-next-line no-undef const steelFissures = Cypress.dom.wrap($el); cy.get('@fissures') .should('have.length', steelFissures.length + 2) @@ -48,7 +47,6 @@ describe('Timers', () => { cy.get('@selectionButtons').eq(2).click(); cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => { - // eslint-disable-next-line no-undef const stormFissures = Cypress.dom.wrap($el); cy.get('@fissures') .should('have.length', stormFissures.length + 2) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index e69de29bb..6144ea301 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -0,0 +1,14 @@ +Cypress.Commands.add('setupIntercepts', () => { + cy.intercept('https://sentry.io/*', { log: false }); + cy.intercept( + { + url: 'https://www.warframe.com/repos/weeklyRivensPC.json', + method: 'GET', + }, + { + headers: { + 'Access-Control-Allow-Origin': '*', + }, + } + ); +}); diff --git a/package.json b/package.json index 586831085..549641268 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "lint": "eslint --ignore-path .gitignore .", "lint:fix": "eslint --ignore-path .gitignore . --fix", "prepare": "husky install", - "test": "cypress run --config-file=cypress.config.js" + "test": "cypress run --config-file=cypress.config.js", + "test:debug": "cypress open --config-file=cypress.config.js" }, "lint-staged": { "*.{js,vue}": "eslint --cache", diff --git a/store/cache.js b/store/cache.js index df76fa6d0..4e40e033b 100644 --- a/store/cache.js +++ b/store/cache.js @@ -22,7 +22,7 @@ export const state = () => ({ export const actions = { async updateRivens({ commit, rootGetters }) { const res = await fetch( - `https://n9e5v4d8.ssl.hwcdn.net/repos/weeklyRivens${rootGetters['worldstate/platform'].toUpperCase()}.json` + `https://www.warframe.com/repos/weeklyRivens${rootGetters['worldstate/platform'].toUpperCase()}.json` ); const raw = await res.text(); if (!(raw && raw.length)) return;