Skip to content

Commit 8bfa7cd

Browse files
authored
Merge pull request #145 from hpehl/EAPQE-5470
[EAPQE-5470] Add support for MicroProfile LRA in the console
2 parents 7c85f3e + d710ace commit 8bfa7cd

4 files changed

Lines changed: 215 additions & 0 deletions

File tree

.github/workflows/manual-test-matrix-workflow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
"microprofile",
3737
"metrics",
3838
"micrometer",
39+
"microprofile-lra",
3940
"opentelemetry",
4041
"runtime",
4142
"security-manager",

.github/workflows/scheduled-run-all-tests-workflow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
"mail",
3232
"metrics",
3333
"micrometer",
34+
"microprofile-lra",
3435
"opentelemetry",
3536
"runtime",
3637
"security-manager",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
describe("TESTS: Configuration => Subsystem => MicroProfile LRA Coordinator", () => {
2+
const address = ["subsystem", "microprofile-lra-coordinator"];
3+
const configurationFormId = "model-browser-model-browser-root-form";
4+
5+
const serverAttr = {
6+
name: "server",
7+
customValue: "custom-server",
8+
expressionProperty: "lra.coordinator.server",
9+
expressionPropertyValue: "expression-server",
10+
expressionValue: "${lra.coordinator.server}",
11+
};
12+
13+
const hostAttr = {
14+
name: "host",
15+
customValue: "custom-host",
16+
expressionProperty: "lra.coordinator.host",
17+
expressionPropertyValue: "expression-host",
18+
expressionValue: "${lra.coordinator.host}",
19+
};
20+
21+
let managementEndpoint: string;
22+
23+
function navigateToLRACoordinatorPage() {
24+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
25+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
26+
}
27+
28+
before(function () {
29+
cy.startWildflyContainer().then((result) => {
30+
managementEndpoint = result as string;
31+
cy.addAddress(managementEndpoint, ["extension", "org.wildfly.extension.microprofile.lra-coordinator"], {});
32+
cy.addAddress(managementEndpoint, address, {});
33+
cy.addAddress(managementEndpoint, ["system-property", serverAttr.expressionProperty], {
34+
value: serverAttr.expressionPropertyValue,
35+
});
36+
cy.addAddress(managementEndpoint, ["system-property", hostAttr.expressionProperty], {
37+
value: hostAttr.expressionPropertyValue,
38+
});
39+
});
40+
});
41+
42+
after(() => {
43+
cy.task("stop:containers");
44+
});
45+
46+
it("Edit server", () => {
47+
navigateToLRACoordinatorPage();
48+
cy.editForm(configurationFormId);
49+
cy.text(configurationFormId, serverAttr.name, serverAttr.customValue);
50+
cy.saveForm(configurationFormId);
51+
cy.verifySuccess();
52+
cy.verifyAttribute(managementEndpoint, address, serverAttr.name, serverAttr.customValue);
53+
});
54+
55+
it("Edit host", () => {
56+
navigateToLRACoordinatorPage();
57+
cy.editForm(configurationFormId);
58+
cy.text(configurationFormId, hostAttr.name, hostAttr.customValue);
59+
cy.saveForm(configurationFormId);
60+
cy.verifySuccess();
61+
cy.verifyAttribute(managementEndpoint, address, hostAttr.name, hostAttr.customValue);
62+
});
63+
64+
it("Edit server with expression", () => {
65+
const selector = `input#${configurationFormId}-${serverAttr.name}-editing.form-control`;
66+
navigateToLRACoordinatorPage();
67+
cy.editForm(configurationFormId);
68+
cy.textExpression(configurationFormId, serverAttr.name, serverAttr.expressionValue, { selector });
69+
cy.saveForm(configurationFormId);
70+
cy.get(".toast-notifications-list-pf .alert").should("be.visible");
71+
cy.verifyAttributeAsExpression(managementEndpoint, address, serverAttr.name, serverAttr.expressionValue);
72+
});
73+
74+
it("Edit host with expression", () => {
75+
const selector = `input#${configurationFormId}-${hostAttr.name}-editing.form-control`;
76+
navigateToLRACoordinatorPage();
77+
cy.editForm(configurationFormId);
78+
cy.textExpression(configurationFormId, hostAttr.name, hostAttr.expressionValue, { selector });
79+
cy.saveForm(configurationFormId);
80+
cy.get(".toast-notifications-list-pf .alert").should("be.visible");
81+
cy.verifyAttributeAsExpression(managementEndpoint, address, hostAttr.name, hostAttr.expressionValue);
82+
});
83+
84+
it("Reset configuration", () => {
85+
navigateToLRACoordinatorPage();
86+
cy.get('#model-browser-model-browser-root-form-links > [data-toggle="tooltip"]');
87+
cy.resetForm(configurationFormId, managementEndpoint, address);
88+
});
89+
});
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
describe("TESTS: Configuration => Subsystem => MicroProfile LRA Participant", () => {
2+
const address = ["subsystem", "microprofile-lra-participant"];
3+
const configurationFormId = "model-browser-model-browser-root-form";
4+
5+
const coordinatorUrlAttr = {
6+
name: "lra-coordinator-url",
7+
customValue: "http://lra-coordinator:8080/lra-coordinator/lra-coordinator",
8+
expressionProperty: "lra.participant.coordinator.url",
9+
expressionPropertyValue: "http://expression-coordinator:8080/lra-coordinator/lra-coordinator",
10+
expressionValue: "${lra.participant.coordinator.url}",
11+
};
12+
13+
const proxyServerAttr = {
14+
name: "proxy-server",
15+
customValue: "custom-proxy-server",
16+
expressionProperty: "lra.participant.proxy.server",
17+
expressionPropertyValue: "expression-proxy-server",
18+
expressionValue: "${lra.participant.proxy.server}",
19+
};
20+
21+
const proxyHostAttr = {
22+
name: "proxy-host",
23+
customValue: "custom-proxy-host",
24+
expressionProperty: "lra.participant.proxy.host",
25+
expressionPropertyValue: "expression-proxy-host",
26+
expressionValue: "${lra.participant.proxy.host}",
27+
};
28+
29+
let managementEndpoint: string;
30+
31+
function navigateToLRAParticipantPage() {
32+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
33+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
34+
}
35+
36+
before(function () {
37+
cy.startWildflyContainer().then((result) => {
38+
managementEndpoint = result as string;
39+
cy.addAddress(managementEndpoint, ["extension", "org.wildfly.extension.microprofile.lra-participant"], {});
40+
cy.addAddress(managementEndpoint, address, {});
41+
cy.addAddress(managementEndpoint, ["system-property", coordinatorUrlAttr.expressionProperty], {
42+
value: coordinatorUrlAttr.expressionPropertyValue,
43+
});
44+
cy.addAddress(managementEndpoint, ["system-property", proxyServerAttr.expressionProperty], {
45+
value: proxyServerAttr.expressionPropertyValue,
46+
});
47+
cy.addAddress(managementEndpoint, ["system-property", proxyHostAttr.expressionProperty], {
48+
value: proxyHostAttr.expressionPropertyValue,
49+
});
50+
});
51+
});
52+
53+
after(() => {
54+
cy.task("stop:containers");
55+
});
56+
57+
it("Edit lra-coordinator-url", () => {
58+
navigateToLRAParticipantPage();
59+
cy.editForm(configurationFormId);
60+
cy.text(configurationFormId, coordinatorUrlAttr.name, coordinatorUrlAttr.customValue);
61+
cy.saveForm(configurationFormId);
62+
cy.verifySuccess();
63+
cy.verifyAttribute(managementEndpoint, address, coordinatorUrlAttr.name, coordinatorUrlAttr.customValue);
64+
});
65+
66+
it("Edit proxy-server", () => {
67+
navigateToLRAParticipantPage();
68+
cy.editForm(configurationFormId);
69+
cy.text(configurationFormId, proxyServerAttr.name, proxyServerAttr.customValue);
70+
cy.saveForm(configurationFormId);
71+
cy.verifySuccess();
72+
cy.verifyAttribute(managementEndpoint, address, proxyServerAttr.name, proxyServerAttr.customValue);
73+
});
74+
75+
it("Edit proxy-host", () => {
76+
navigateToLRAParticipantPage();
77+
cy.editForm(configurationFormId);
78+
cy.text(configurationFormId, proxyHostAttr.name, proxyHostAttr.customValue);
79+
cy.saveForm(configurationFormId);
80+
cy.verifySuccess();
81+
cy.verifyAttribute(managementEndpoint, address, proxyHostAttr.name, proxyHostAttr.customValue);
82+
});
83+
84+
it("Edit lra-coordinator-url with expression", () => {
85+
const selector = `input#${configurationFormId}-${coordinatorUrlAttr.name}-editing.form-control`;
86+
navigateToLRAParticipantPage();
87+
cy.editForm(configurationFormId);
88+
cy.textExpression(configurationFormId, coordinatorUrlAttr.name, coordinatorUrlAttr.expressionValue, { selector });
89+
cy.saveForm(configurationFormId);
90+
cy.get(".toast-notifications-list-pf .alert").should("be.visible");
91+
cy.verifyAttributeAsExpression(
92+
managementEndpoint,
93+
address,
94+
coordinatorUrlAttr.name,
95+
coordinatorUrlAttr.expressionValue,
96+
);
97+
});
98+
99+
it("Edit proxy-server with expression", () => {
100+
const selector = `input#${configurationFormId}-${proxyServerAttr.name}-editing.form-control`;
101+
navigateToLRAParticipantPage();
102+
cy.editForm(configurationFormId);
103+
cy.textExpression(configurationFormId, proxyServerAttr.name, proxyServerAttr.expressionValue, { selector });
104+
cy.saveForm(configurationFormId);
105+
cy.get(".toast-notifications-list-pf .alert").should("be.visible");
106+
cy.verifyAttributeAsExpression(managementEndpoint, address, proxyServerAttr.name, proxyServerAttr.expressionValue);
107+
});
108+
109+
it("Edit proxy-host with expression", () => {
110+
const selector = `input#${configurationFormId}-${proxyHostAttr.name}-editing.form-control`;
111+
navigateToLRAParticipantPage();
112+
cy.editForm(configurationFormId);
113+
cy.textExpression(configurationFormId, proxyHostAttr.name, proxyHostAttr.expressionValue, { selector });
114+
cy.saveForm(configurationFormId);
115+
cy.get(".toast-notifications-list-pf .alert").should("be.visible");
116+
cy.verifyAttributeAsExpression(managementEndpoint, address, proxyHostAttr.name, proxyHostAttr.expressionValue);
117+
});
118+
119+
it("Reset configuration", () => {
120+
navigateToLRAParticipantPage();
121+
cy.get('#model-browser-model-browser-root-form-links > [data-toggle="tooltip"]');
122+
cy.resetForm(configurationFormId, managementEndpoint, address);
123+
});
124+
});

0 commit comments

Comments
 (0)