Skip to content

Commit c79dbe6

Browse files
committed
[JBEAP-29210] Add realm to Security Domain
1 parent f246dce commit c79dbe6

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
describe("TESTS: Configuration => Subsystem => Security => Settings => Global Settings", () => {
2+
let managementEndpoint: string;
3+
4+
const address = ["subsystem", "elytron", "security-domain", "ApplicationDomain"];
5+
6+
const navigation = {
7+
sslButton: "#ssl-item",
8+
securityDomainButton: "#elytron-security-domain-item",
9+
securityDomainRealmsButton: "#hal-uid-5",
10+
};
11+
12+
const realmsForm = {
13+
id: "elytron-security-domain-realms-add",
14+
addButton: "elytron-security-domain-realms-table",
15+
principalTransformer: {
16+
id: "#elytron-security-domain-realms-add-editing > div:nth-child(2)",
17+
text: "Principal Transformer",
18+
},
19+
roleDecoder: {
20+
id: "#elytron-security-domain-realms-add-editing > div:nth-child(3)",
21+
name: "role-decoder",
22+
text: "Role Decoder",
23+
value: "groups-to-roles",
24+
},
25+
roleMapper: {
26+
id: "#elytron-security-domain-realms-add-editing > div:nth-child(4)",
27+
name: "role-mapper",
28+
text: "Role Mapper",
29+
value: "super-user-mapper",
30+
},
31+
realm: {
32+
id: "#elytron-security-domain-realms-add-editing > div:nth-child(5)",
33+
name: "realm",
34+
text: "Realm",
35+
value: "ManagementRealm",
36+
},
37+
expectedResult: { "role-decoder": "groups-to-roles", "role-mapper": "super-user-mapper", realm: "ManagementRealm" },
38+
};
39+
40+
before(() => {
41+
cy.startWildflyContainer().then((result) => {
42+
managementEndpoint = result as string;
43+
});
44+
});
45+
46+
after(() => {
47+
cy.task("stop:containers");
48+
});
49+
50+
it("Add realm to Security Domain", () => {
51+
cy.navigateTo(managementEndpoint, "elytron-other");
52+
cy.get(navigation.sslButton).click();
53+
cy.get(navigation.securityDomainButton).click();
54+
cy.get(navigation.securityDomainRealmsButton).click();
55+
cy.addInTable(realmsForm.addButton);
56+
cy.get(realmsForm.principalTransformer.id)
57+
.should("be.visible")
58+
.should("contain.text", realmsForm.principalTransformer.text);
59+
cy.get(realmsForm.roleDecoder.id).should("be.visible").should("contain.text", realmsForm.roleDecoder.text);
60+
cy.get(realmsForm.roleMapper.id).should("be.visible").should("contain.text", realmsForm.roleMapper.text);
61+
cy.get(realmsForm.realm.id).should("be.visible").should("contain.text", realmsForm.realm.text);
62+
cy.text(realmsForm.id, realmsForm.roleDecoder.name, realmsForm.roleDecoder.value);
63+
cy.text(realmsForm.id, realmsForm.roleMapper.name, realmsForm.roleMapper.value);
64+
cy.text(realmsForm.id, realmsForm.realm.name, realmsForm.realm.value);
65+
cy.confirmAddResourceWizard();
66+
cy.verifySuccess();
67+
cy.verifyListAttributeContains(managementEndpoint, address, "realms", realmsForm.expectedResult);
68+
});
69+
});

0 commit comments

Comments
 (0)