diff --git a/.github/workflows/manual-test-matrix-workflow.yaml b/.github/workflows/manual-test-matrix-workflow.yaml index d4bf84582..b42d68d22 100644 --- a/.github/workflows/manual-test-matrix-workflow.yaml +++ b/.github/workflows/manual-test-matrix-workflow.yaml @@ -36,6 +36,7 @@ jobs: "microprofile", "metrics", "micrometer", + "microprofile-lra", "opentelemetry", "runtime", "security-manager", diff --git a/.github/workflows/scheduled-run-all-tests-workflow.yaml b/.github/workflows/scheduled-run-all-tests-workflow.yaml index 44ac25119..36a4f253e 100644 --- a/.github/workflows/scheduled-run-all-tests-workflow.yaml +++ b/.github/workflows/scheduled-run-all-tests-workflow.yaml @@ -31,6 +31,7 @@ jobs: "mail", "metrics", "micrometer", + "microprofile-lra", "opentelemetry", "runtime", "security-manager", diff --git a/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-coordinator.cy.ts b/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-coordinator.cy.ts new file mode 100644 index 000000000..0f91477c9 --- /dev/null +++ b/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-coordinator.cy.ts @@ -0,0 +1,90 @@ +describe("TESTS: Configuration => Subsystem => MicroProfile LRA Coordinator", () => { + const address = ["subsystem", "microprofile-lra-coordinator"]; + const configurationFormId = "model-browser-model-browser-root-form"; + + const serverAttr = { + name: "server", + customValue: "custom-server", + expressionProperty: "lra.coordinator.server", + expressionPropertyValue: "expression-server", + expressionValue: "${lra.coordinator.server}", + }; + + const hostAttr = { + name: "host", + customValue: "custom-host", + expressionProperty: "lra.coordinator.host", + expressionPropertyValue: "expression-host", + expressionValue: "${lra.coordinator.host}", + }; + + let managementEndpoint: string; + + function navigateToLRACoordinatorPage() { + cy.navigateToGenericSubsystemPage(managementEndpoint, address); + cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click(); + } + + before(function () { + cy.startWildflyContainer().then((result) => { + managementEndpoint = result as string; + cy.skipIf(cy.isEAP(managementEndpoint), this); + cy.addAddress(managementEndpoint, ["extension", "org.wildfly.extension.microprofile.lra-coordinator"], {}); + cy.addAddress(managementEndpoint, address, {}); + cy.addAddress(managementEndpoint, ["system-property", serverAttr.expressionProperty], { + value: serverAttr.expressionPropertyValue, + }); + cy.addAddress(managementEndpoint, ["system-property", hostAttr.expressionProperty], { + value: hostAttr.expressionPropertyValue, + }); + }); + }); + + after(() => { + cy.task("stop:containers"); + }); + + it("Edit server", () => { + navigateToLRACoordinatorPage(); + cy.editForm(configurationFormId); + cy.text(configurationFormId, serverAttr.name, serverAttr.customValue); + cy.saveForm(configurationFormId); + cy.verifySuccess(); + cy.verifyAttribute(managementEndpoint, address, serverAttr.name, serverAttr.customValue); + }); + + it("Edit host", () => { + navigateToLRACoordinatorPage(); + cy.editForm(configurationFormId); + cy.text(configurationFormId, hostAttr.name, hostAttr.customValue); + cy.saveForm(configurationFormId); + cy.verifySuccess(); + cy.verifyAttribute(managementEndpoint, address, hostAttr.name, hostAttr.customValue); + }); + + it("Edit server with expression", () => { + const selector = `input#${configurationFormId}-${serverAttr.name}-editing.form-control`; + navigateToLRACoordinatorPage(); + cy.editForm(configurationFormId); + cy.textExpression(configurationFormId, serverAttr.name, serverAttr.expressionValue, { selector }); + cy.saveForm(configurationFormId); + cy.get(".toast-notifications-list-pf .alert").should("be.visible"); + cy.verifyAttributeAsExpression(managementEndpoint, address, serverAttr.name, serverAttr.expressionValue); + }); + + it("Edit host with expression", () => { + const selector = `input#${configurationFormId}-${hostAttr.name}-editing.form-control`; + navigateToLRACoordinatorPage(); + cy.editForm(configurationFormId); + cy.textExpression(configurationFormId, hostAttr.name, hostAttr.expressionValue, { selector }); + cy.saveForm(configurationFormId); + cy.get(".toast-notifications-list-pf .alert").should("be.visible"); + cy.verifyAttributeAsExpression(managementEndpoint, address, hostAttr.name, hostAttr.expressionValue); + }); + + it("Reset configuration", () => { + navigateToLRACoordinatorPage(); + cy.get('#model-browser-model-browser-root-form-links > [data-toggle="tooltip"]'); + cy.resetForm(configurationFormId, managementEndpoint, address); + }); +}); diff --git a/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-participant.cy.ts b/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-participant.cy.ts new file mode 100644 index 000000000..b1cf5a91c --- /dev/null +++ b/packages/testsuite/cypress/e2e/microprofile-lra/test-configuration-subsystem-microprofile-lra-participant.cy.ts @@ -0,0 +1,125 @@ +describe("TESTS: Configuration => Subsystem => MicroProfile LRA Participant", () => { + const address = ["subsystem", "microprofile-lra-participant"]; + const configurationFormId = "model-browser-model-browser-root-form"; + + const coordinatorUrlAttr = { + name: "lra-coordinator-url", + customValue: "http://lra-coordinator:8080/lra-coordinator/lra-coordinator", + expressionProperty: "lra.participant.coordinator.url", + expressionPropertyValue: "http://expression-coordinator:8080/lra-coordinator/lra-coordinator", + expressionValue: "${lra.participant.coordinator.url}", + }; + + const proxyServerAttr = { + name: "proxy-server", + customValue: "custom-proxy-server", + expressionProperty: "lra.participant.proxy.server", + expressionPropertyValue: "expression-proxy-server", + expressionValue: "${lra.participant.proxy.server}", + }; + + const proxyHostAttr = { + name: "proxy-host", + customValue: "custom-proxy-host", + expressionProperty: "lra.participant.proxy.host", + expressionPropertyValue: "expression-proxy-host", + expressionValue: "${lra.participant.proxy.host}", + }; + + let managementEndpoint: string; + + function navigateToLRAParticipantPage() { + cy.navigateToGenericSubsystemPage(managementEndpoint, address); + cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click(); + } + + before(function () { + cy.startWildflyContainer().then((result) => { + managementEndpoint = result as string; + cy.skipIf(cy.isEAP(managementEndpoint), this); + cy.addAddress(managementEndpoint, ["extension", "org.wildfly.extension.microprofile.lra-participant"], {}); + cy.addAddress(managementEndpoint, address, {}); + cy.addAddress(managementEndpoint, ["system-property", coordinatorUrlAttr.expressionProperty], { + value: coordinatorUrlAttr.expressionPropertyValue, + }); + cy.addAddress(managementEndpoint, ["system-property", proxyServerAttr.expressionProperty], { + value: proxyServerAttr.expressionPropertyValue, + }); + cy.addAddress(managementEndpoint, ["system-property", proxyHostAttr.expressionProperty], { + value: proxyHostAttr.expressionPropertyValue, + }); + }); + }); + + after(() => { + cy.task("stop:containers"); + }); + + it("Edit lra-coordinator-url", () => { + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.text(configurationFormId, coordinatorUrlAttr.name, coordinatorUrlAttr.customValue); + cy.saveForm(configurationFormId); + cy.verifySuccess(); + cy.verifyAttribute(managementEndpoint, address, coordinatorUrlAttr.name, coordinatorUrlAttr.customValue); + }); + + it("Edit proxy-server", () => { + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.text(configurationFormId, proxyServerAttr.name, proxyServerAttr.customValue); + cy.saveForm(configurationFormId); + cy.verifySuccess(); + cy.verifyAttribute(managementEndpoint, address, proxyServerAttr.name, proxyServerAttr.customValue); + }); + + it("Edit proxy-host", () => { + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.text(configurationFormId, proxyHostAttr.name, proxyHostAttr.customValue); + cy.saveForm(configurationFormId); + cy.verifySuccess(); + cy.verifyAttribute(managementEndpoint, address, proxyHostAttr.name, proxyHostAttr.customValue); + }); + + it("Edit lra-coordinator-url with expression", () => { + const selector = `input#${configurationFormId}-${coordinatorUrlAttr.name}-editing.form-control`; + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.textExpression(configurationFormId, coordinatorUrlAttr.name, coordinatorUrlAttr.expressionValue, { selector }); + cy.saveForm(configurationFormId); + cy.get(".toast-notifications-list-pf .alert").should("be.visible"); + cy.verifyAttributeAsExpression( + managementEndpoint, + address, + coordinatorUrlAttr.name, + coordinatorUrlAttr.expressionValue, + ); + }); + + it("Edit proxy-server with expression", () => { + const selector = `input#${configurationFormId}-${proxyServerAttr.name}-editing.form-control`; + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.textExpression(configurationFormId, proxyServerAttr.name, proxyServerAttr.expressionValue, { selector }); + cy.saveForm(configurationFormId); + cy.get(".toast-notifications-list-pf .alert").should("be.visible"); + cy.verifyAttributeAsExpression(managementEndpoint, address, proxyServerAttr.name, proxyServerAttr.expressionValue); + }); + + it("Edit proxy-host with expression", () => { + const selector = `input#${configurationFormId}-${proxyHostAttr.name}-editing.form-control`; + navigateToLRAParticipantPage(); + cy.editForm(configurationFormId); + cy.textExpression(configurationFormId, proxyHostAttr.name, proxyHostAttr.expressionValue, { selector }); + cy.saveForm(configurationFormId); + cy.get(".toast-notifications-list-pf .alert").should("be.visible"); + cy.verifyAttributeAsExpression(managementEndpoint, address, proxyHostAttr.name, proxyHostAttr.expressionValue); + }); + + it("Reset configuration", () => { + navigateToLRAParticipantPage(); + cy.get('#model-browser-model-browser-root-form-links > [data-toggle="tooltip"]'); + cy.resetForm(configurationFormId, managementEndpoint, address); + }); +});