Skip to content

Commit

Permalink
Add e2e check execution buttons in details for host and cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Jul 4, 2024
1 parent 05bcb43 commit d0c22dd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 11 additions & 1 deletion test/e2e/cypress/e2e/hana_cluster_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ context('HANA cluster details', () => {
});

describe('Check Execution', () => {
it('should forbid check execution when the correct user abilities are missing', () => {
it('should forbid check execution when the correct user abilities are missing in details and settings', () => {
cy.get('@user').then((user) => {
cy.createUserWithAbilities(user, []);
cy.login(user.username, password);
Expand All @@ -358,6 +358,16 @@ context('HANA cluster details', () => {
cy.contains('span', 'You are not authorized for this action').should(
'be.visible'
);

cy.visit(`/clusters/${availableHanaCluster.id}`);

cy.contains('button', 'Start Execution').should('be.disabled');

cy.contains('button', 'Start Execution').click({ force: true });

cy.contains('span', 'You are not authorized for this action').should(
'be.visible'
);
});

it('should enable check execution button when the correct user abilities are present', () => {
Expand Down
11 changes: 10 additions & 1 deletion test/e2e/cypress/e2e/host_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ context('Host Details', () => {
});

describe('Check Execution', () => {
it('should forbid check execution when the correct user abilities are not present', () => {
it('should forbid check execution when the correct user abilities are not present in both settings and details', () => {
cy.get('@user').then((user) => {
cy.createUserWithAbilities(user, []);
cy.login(user.username, password);
Expand All @@ -503,6 +503,15 @@ context('Host Details', () => {

cy.contains('button', 'Start Execution').click({ force: true });

cy.contains('span', 'You are not authorized for this action').should(
'be.visible'
);
cy.visit(`/hosts/${selectedHost.agentId}`);

cy.contains('button', 'Start Execution').should('be.disabled');

cy.contains('button', 'Start Execution').click({ force: true });

cy.contains('span', 'You are not authorized for this action').should(
'be.visible'
);
Expand Down

0 comments on commit d0c22dd

Please sign in to comment.