Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
describe("TESTS: Configuration => Subsystem => Security => Settings => Global Settings", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
describe("TESTS: Configuration => Subsystem => Security => Settings => Global Settings", () => {
describe("TESTS: Configuration => Subsystem => Security => Settings => Other Settings", () => {

let managementEndpoint: string;

const address = ["subsystem", "elytron", "security-domain", "ApplicationDomain"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting const securityDomainToUpdate = "ApplicationDomain";


const navigation = {
sslButton: "#ssl-item",
securityDomainButton: "#elytron-security-domain-item",
securityDomainRealmsButton: "#hal-uid-5",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this random number changes between version, ID shouldn't be used

};

const realmsForm = {
id: "elytron-security-domain-realms-add",
addButton: "elytron-security-domain-realms-table",
principalTransformer: {
id: "#elytron-security-domain-realms-add-editing > div:nth-child(2)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's lot of repetions of #elytron-security-domain-realms-add-editing and nth-child should be avoided for clarity if possible. Consider change like this:

cy.text("resolve-expression-form", "app-name", "anotherApp");
cy.text("resolve-expression-form", "distinct-name", "anotherDistinctName");
cy.text("resolve-expression-form", "module-name", "anotherModule");
cy.text("resolve-expression-form", "uri", "anotherUri");

text: "Principal Transformer",
},
roleDecoder: {
id: "#elytron-security-domain-realms-add-editing > div:nth-child(3)",
name: "role-decoder",
text: "Role Decoder",
value: "groups-to-roles",
},
roleMapper: {
id: "#elytron-security-domain-realms-add-editing > div:nth-child(4)",
name: "role-mapper",
text: "Role Mapper",
value: "super-user-mapper",
},
realm: {
id: "#elytron-security-domain-realms-add-editing > div:nth-child(5)",
name: "realm",
text: "Realm",
value: "ManagementRealm",
},
expectedResult: { "role-decoder": "groups-to-roles", "role-mapper": "super-user-mapper", realm: "ManagementRealm" },
};

before(() => {
cy.startWildflyContainer().then((result) => {
managementEndpoint = result as string;
});
});

after(() => {
cy.task("stop:containers");
});

it("Add realm to Security Domain", () => {
cy.navigateTo(managementEndpoint, "elytron-other");
cy.get(navigation.sslButton).click();
cy.get(navigation.securityDomainButton).click();
cy.get(navigation.securityDomainRealmsButton).click();
cy.addInTable(realmsForm.addButton);
cy.get(realmsForm.principalTransformer.id)
.should("be.visible")
.should("contain.text", realmsForm.principalTransformer.text);
cy.get(realmsForm.roleDecoder.id).should("be.visible").should("contain.text", realmsForm.roleDecoder.text);
cy.get(realmsForm.roleMapper.id).should("be.visible").should("contain.text", realmsForm.roleMapper.text);
cy.get(realmsForm.realm.id).should("be.visible").should("contain.text", realmsForm.realm.text);
cy.text(realmsForm.id, realmsForm.roleDecoder.name, realmsForm.roleDecoder.value);
cy.text(realmsForm.id, realmsForm.roleMapper.name, realmsForm.roleMapper.value);
cy.text(realmsForm.id, realmsForm.realm.name, realmsForm.realm.value);
cy.confirmAddResourceWizard();
cy.verifySuccess();
cy.verifyListAttributeContains(managementEndpoint, address, "realms", realmsForm.expectedResult);
});
});
Loading