diff --git a/cypress/integration/clients_test.spec.ts b/cypress/integration/clients_test.spec.ts index 3b3169717b..0844406fe4 100644 --- a/cypress/integration/clients_test.spec.ts +++ b/cypress/integration/clients_test.spec.ts @@ -188,6 +188,16 @@ describe("Clients test", function () { .goToServiceAccountTab() .checkRoles(["manage-account", "offline_access", "uma_authorization"]); }); + + it("assign", () => { + listingPage.goToItemDetails(serviceAccountName); + serviceAccountTab + .goToServiceAccountTab() + .clickAssignRole(false) + .selectRow("create-realm") + .clickAssign(); + masthead.checkNotificationMessage("Role mapping updated"); + }); }); describe("Keys tab test", () => { diff --git a/cypress/support/pages/admin_console/manage/RoleMappingTab.ts b/cypress/support/pages/admin_console/manage/RoleMappingTab.ts index 30bf1f2b74..4c01c2916b 100644 --- a/cypress/support/pages/admin_console/manage/RoleMappingTab.ts +++ b/cypress/support/pages/admin_console/manage/RoleMappingTab.ts @@ -2,7 +2,8 @@ const expect = chai.expect; export default class RoleMappingTab { private tab = "#pf-tab-serviceAccount-serviceAccount"; private scopeTab = "scopeTab"; - private assignRole = "no-roles-for-this-client-empty-action"; + private assignEmptyRole = "no-roles-for-this-client-empty-action"; + private assignRole = "assignRole"; private unAssign = "unAssignRole"; private assign = "assign"; private hide = "#hideInheritedRoles"; @@ -19,8 +20,8 @@ export default class RoleMappingTab { return this; } - clickAssignRole() { - cy.getId(this.assignRole).click(); + clickAssignRole(notEmpty = true) { + cy.getId(notEmpty ? this.assignEmptyRole : this.assignRole).click(); return this; }