Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FAT-12945: test added * FAT-12945: delete method updated * FAT-12946: test added * FAT-12945: replaced user accordion method * reverted user accordion method * FAT-12945: updated methods * FAT-12945: removed unused step * updated user acc method * methods updated * timeout added * reverted all updates
- Loading branch information
1 parent
9876876
commit 5d332d6
Showing
5 changed files
with
176 additions
and
1 deletion.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
cypress/e2e/eureka/authorization-roles/delete-empty-role.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import Users from '../../../support/fragments/users/users'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import AuthorizationRoles from '../../../support/fragments/settings/authorization-roles/authorizationRoles'; | ||
|
||
describe('Eureka', () => { | ||
describe('Settings', () => { | ||
describe('Authorization roles', () => { | ||
const testData = { | ||
roleName: `Auto Role C446119 ${getRandomPostfix()}`, | ||
roleDescription: `Description C446119 ${getRandomPostfix()}`, | ||
}; | ||
|
||
before('Create role, user', () => { | ||
cy.createTempUser([]).then((createdUserProperties) => { | ||
testData.user = createdUserProperties; | ||
cy.createAuthorizationRoleApi(testData.roleName, testData.roleDescription).then( | ||
(role) => { | ||
testData.roleId = role.id; | ||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.settingsAuthorizationRoles, | ||
waiter: AuthorizationRoles.waitContentLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
}); | ||
|
||
after('Delete role, user', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.user.userId); | ||
cy.deleteAuthorizationRoleApi(testData.roleId, true); | ||
}); | ||
|
||
it( | ||
'C446119 Delete a role without capabilities and users (eureka)', | ||
{ tags: ['smoke', 'eureka', 'eurekaPhase1'] }, | ||
() => { | ||
AuthorizationRoles.searchRole(testData.roleName); | ||
AuthorizationRoles.clickOnRoleName(testData.roleName); | ||
AuthorizationRoles.checkCapabilitiesAccordionCounter('0'); | ||
AuthorizationRoles.checkCapabilitySetsAccordionCounter('0'); | ||
AuthorizationRoles.checkUsersAccordion(); | ||
AuthorizationRoles.clickDeleteRole(); | ||
AuthorizationRoles.cancelDeleteRole(testData.roleName); | ||
AuthorizationRoles.clickDeleteRole(); | ||
AuthorizationRoles.confirmDeleteRole(testData.roleName); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import Users from '../../../support/fragments/users/users'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import AuthorizationRoles from '../../../support/fragments/settings/authorization-roles/authorizationRoles'; | ||
|
||
describe('Eureka', () => { | ||
describe('Settings', () => { | ||
describe('Authorization roles', () => { | ||
const testData = { | ||
roleName: `Auto Role C446120 ${getRandomPostfix()}`, | ||
roleDescription: `Description C446120 ${getRandomPostfix()}`, | ||
}; | ||
|
||
before('Create role, user', () => { | ||
cy.createTempUser([]).then((createdUserProperties) => { | ||
testData.user = createdUserProperties; | ||
cy.createAuthorizationRoleApi(testData.roleName, testData.roleDescription).then( | ||
(role) => { | ||
testData.roleId = role.id; | ||
cy.getCapabilitiesApi(10).then((capabs) => { | ||
cy.getCapabilitySetsApi(3).then((capabSets) => { | ||
cy.getUserRoleIdByNameApi(testData.roleName).then((roleId) => { | ||
testData.roleId = roleId; | ||
cy.addCapabilitiesToNewRoleApi( | ||
roleId, | ||
capabs.map((capab) => capab.id), | ||
); | ||
cy.addCapabilitySetsToNewRoleApi( | ||
roleId, | ||
capabSets.map((capab) => capab.id), | ||
); | ||
cy.addRolesToNewUserApi(createdUserProperties.userId, [roleId]); | ||
}); | ||
}); | ||
}); | ||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.settingsAuthorizationRoles, | ||
waiter: AuthorizationRoles.waitContentLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
}); | ||
|
||
after('Delete role, user', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.user.userId); | ||
cy.deleteAuthorizationRoleApi(testData.roleId, true); | ||
}); | ||
|
||
it( | ||
'C446120 Delete a role with capabilities and users assigned (eureka)', | ||
{ tags: ['smoke', 'eureka', 'eurekaPhase1'] }, | ||
() => { | ||
AuthorizationRoles.searchRole(testData.roleName); | ||
AuthorizationRoles.clickOnRoleName(testData.roleName); | ||
AuthorizationRoles.checkCapabilitiesAccordionCounter('10'); | ||
AuthorizationRoles.checkCapabilitySetsAccordionCounter('3'); | ||
AuthorizationRoles.checkUsersAccordion(1); | ||
AuthorizationRoles.clickDeleteRole(); | ||
AuthorizationRoles.cancelDeleteRole(testData.roleName); | ||
AuthorizationRoles.clickDeleteRole(); | ||
AuthorizationRoles.confirmDeleteRole(testData.roleName); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters