Skip to content

Commit

Permalink
ci: riven url, cypress intercepts
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Dec 9, 2023
1 parent 1af543d commit 9bfac46
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cypress/e2e/openworld/load.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
describe('Maps', () => {
['poe', 'vallis'].forEach((ow) => {
beforeEach(() => {
cy.setupIntercepts();
cy.visit(`http://localhost:3000/${ow}/map`);
cy.wait(1000);
});
Expand All @@ -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);
});
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/synthesis/load.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe('Synthesis', () => {
beforeEach(() => {
cy.setupIntercepts();
cy.visit(`http://localhost:3000/synthesis`);
cy.wait(1000);
});
Expand Down
4 changes: 1 addition & 3 deletions cypress/e2e/timers/load.spec.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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')
Expand All @@ -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)
Expand All @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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': '*',
},
}
);
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion store/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9bfac46

Please sign in to comment.