Skip to content

Commit

Permalink
Adding unit test for standard user role
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Martín <manuel.martin@suse.com>
  • Loading branch information
mmartin24 committed May 14, 2024
1 parent 58e87c2 commit 7b3f6ce
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cypress/e2e/unit-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ describe('Cypress Library e2e tests', () => {
cypressLib.deleteUser('mytestuserwithrole');
});

it('Check createUser/deleteUser function with "Standard User" role', () => {
cy.login();
cypressLib.burgerMenuToggle();
// Given that Standard User is checked by default, no need to add role
cy.createUser('mytestuserwithrole', 'mytestpassword');
// Log out with admin role and login with "Standard User" role to check
// "Standard User" does not have some options available and has some others
cy.logout();
cy.login('mytestuserwithrole', 'mytestpassword');
cypressLib.burgerMenuToggle();
cy.contains('Continue Delivery').should('not.exist');
cy.contains('Extensions').should('not.exist');
cy.contains('Cluster Management').should('exist');
// Log out as user and login back as admin to delete created user
cy.logout();
cy.login();
cypressLib.burgerMenuToggle();
cypressLib.deleteUser('mytestuserwithrole');
});

it('Check enableExtensionSupport function with rancher repo activated', () => {
cy.login();
cypressLib.burgerMenuToggle();
Expand Down

0 comments on commit 7b3f6ce

Please sign in to comment.