Skip to content

Commit

Permalink
Add cypress e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziosestito committed Apr 19, 2023
1 parent 8b572c1 commit 8c58164
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
67 changes: 67 additions & 0 deletions test/e2e/cypress/e2e/hana_scale_up_checks.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
if (Cypress.env('REAL_CLUSTER_TESTS')) {
context('HANA scale-up checks', () => {
const clusterID = 'd2522281-2c76-52dc-8500-10bdf2cc6664';

const PASSING = 'fill-jungle-green-500';
const WARNING = 'fill-yellow-500';
const CRITICAL = 'fill-red-500';

const expectedCheckResults = [
['00081D', PASSING],
['156F64', PASSING],
['15F7A8', PASSING],
['21FCA6', PASSING],
['24ABCB', PASSING],
['32CFC6', WARNING],
['33403D', PASSING],
['53D035', PASSING],
['6E9B82', PASSING],
['7E0221', PASSING],
['822E47', PASSING],
['845CC9', PASSING],
['A1244C', PASSING],
['C620DC', PASSING],
['D78671', PASSING],
['DA114A', WARNING],
['FB0E0D', PASSING],
['205AF7', PASSING],
['373DB8', CRITICAL],
['790926', WARNING],
['9FAAD0', PASSING],
['9FEFB0', PASSING],
['CAEFF1', PASSING],
['D028B9', PASSING],
['DC5429', PASSING],
['F50AF5', PASSING],
];

before(() => {
cy.visit(`/clusters/${clusterID}`);
cy.url().should('include', `/clusters/${clusterID}`);
});

describe('Run checks', () => {
it('should run checks with expected results', () => {
cy.get('button').contains('Settings').click();

cy.get('.tn-check-switch').click({ multiple: true });
cy.get('button').contains('Select Checks for Execution').click();
cy.get('button').contains('Back to Cluster Details').click();
cy.get('button').contains('Start Execution').click();

cy.get('table').each((_, index) => {
cy.get('table').eq(index).find('.tn-check-result-row').as('rows');

cy.get('@rows').each((_, index) => {
const [id, result] = expectedCheckResults[index];

cy.get('@rows').eq(index).as('row').contains(id);
cy.get('@row')
.find('[data-testid="eos-svg-component"]')
.should('have.class', result);
});
});
});
});
});
}
4 changes: 3 additions & 1 deletion test/e2e/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import './commands';
//

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

0 comments on commit 8c58164

Please sign in to comment.