Skip to content

Commit

Permalink
Load initial state only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed May 16, 2024
1 parent 1d5656d commit 92a1f80
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 43 deletions.
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/about.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getValue } from '../support/common';

describe('User account page', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/about');
cy.url().should('include', '/about');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/clusters_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const clusterTags = {

context('Clusters Overview', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/clusters');
cy.url().should('include', '/clusters');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/databases_overview.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context('Databases Overview', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/databases');
cy.url().should('include', '/databases');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/hana_cluster_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ context('HANA cluster details', () => {
const catalog = catalogFactory.build();

before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.intercept(lastExecutionURL, {
body: lastExecution,
}).as('lastExecution');
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/hana_database_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {

context('HANA database details', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit(`/databases/${selectedDatabase.Id}`);
cy.url().should('include', `/databases/${selectedDatabase.Id}`);
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/home.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context('Homepage', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/');
cy.url().should('include', '/');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/host_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {

context('Host Details', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.task('startAgentHeartbeat', [selectedHost.agentId]);
cy.visit('/hosts');

Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/hosts_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const availableHosts1stPage = availableHosts.slice(0, 10);

context('Hosts Overview', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/hosts');
cy.url().should('include', '/hosts');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/sap_system_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {

context('SAP system details', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit(`/sap_systems/${selectedSystem.Id}`);
cy.url().should('include', `/sap_systems/${selectedSystem.Id}`);
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/sap_systems_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {

context('SAP Systems Overview', () => {
before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit('/sap_systems');
cy.url().should('include', '/sap_systems');
});
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cypress/e2e/saptune_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('Saptune Details page', () => {
const saptuneStagingStatusSelector = ':nth-child(11)';

before(() => {
cy.loadScenario('healthy-27-node-SAP-cluster');
cy.visit(`hosts/${hostID}/saptune`);
});

Expand Down
40 changes: 0 additions & 40 deletions test/e2e/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@ Cypress.Commands.add('apiLogin', () => {
});
});

Cypress.Commands.add('acceptEula', () => {
apiLogin().then(({ accessToken }) => {
cy.request({
url: '/api/v1/accept_eula',
method: 'POST',
auth: {
bearer: accessToken,
},
body: {},
});
});
});

Cypress.Commands.add('updateApiKeyExpiration', (apiKeyExpiration) => {
apiLogin().then(({ accessToken }) => {
Expand Down Expand Up @@ -177,34 +165,6 @@ Cypress.Commands.add('resetFilterSelection', (filterName) => {
});
});

Cypress.Commands.add('setMockRunnerExpectedResult', (result) => {
const [webAPIHost, webAPIPort] = [
Cypress.env('web_api_host'),
Cypress.env('web_api_port'),
];

const requestResultBody = JSON.stringify({
expected_results: result,
});

const headers = {
'Content-Type': 'application/json;charset=UTF-8',
};

apiLogin().then(({ accessToken }) => {
const url = `http://${webAPIHost}:${webAPIPort}/api/mockrunner/expected_result`;
cy.request({
method: 'POST',
url: url,
body: requestResultBody,
headers: headers,
auth: {
bearer: accessToken,
},
});
});
});

Cypress.Commands.add('requestChecksExecution', (clusterId) => {
const [webAPIHost, webAPIPort] = [
Cypress.env('web_api_host'),
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@ import './commands';
//

before(() => {
if (!Cypress.env('REAL_CLUSTER_TESTS')) {
cy.loadScenario('healthy-27-node-SAP-cluster');
}
cy.initiateSession();
});

0 comments on commit 92a1f80

Please sign in to comment.