Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EAPQE-2915][EAPQE-2914] Integrate OpenTelemetry with the MP Reactive Messaging AMQP & Kafka connector Web UI tests #121

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/manual-test-matrix-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
"jpa",
"jsf",
"mail",
"microprofile",
"metrics",
"runtime",
"security-manager",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
describe("TESTS: Configuration => Subsystem => Undertow => Global settings", () => {
let managementEndpoint: string;

// workaround for JBEAP-28819 - form id is not the base for edit btn id ad so on.
function editFormJBEAP28819(formId: string) {
const editButton = "#" + formId + ' a.clickable[data-operation="edit"]';
const formIdWithSingleDash = formId.replace(/-+/g, "-")
cy.get(`#${formIdWithSingleDash}-editing`).should("not.be.visible");
cy.get(editButton).click();
// Workaround - JBEAP-25005,JBEAP-25046 - the form is sometimes not loaded in time and Cypress is not able to recover
// from such state and click the button. Waiting does not help, but multiple manual checks for the visibility
// of the button do. Note that the button is clicked just one time (probably) once visible.
for (let reClickTry = 0; reClickTry < 5; reClickTry++) {
cy.get(editButton).then(($button) => {
if ($button.is(":visible")) {
cy.get(editButton).click();
}
});
}
// workaround - end
cy.get(`#${formIdWithSingleDash}-editing`).should("be.visible");
}

const mpRmSrSelectors = {
otelTracing: "#model-browser-root___opentelemetry-tracing",
config: "#model-browser-root___opentelemetry-tracing___config",
}

const configForm = {
id: "model-browser-model-browser-root---opentelemetry-tracing---config-form",
idNoDash: "model-browser-model-browser-root-opentelemetry-tracing-config-form",
amqpConnector: "amqp-connector",
kafkaConnector: "kafka-connector",
};

const verifyAddress = ["subsystem", "microprofile-reactive-messaging-smallrye", "opentelemetry-tracing", "config"]

before(() => {
cy.startWildflyContainer()
.then((result) => {
managementEndpoint = result as string;
})
.then(() => {
cy.executeInWildflyContainer(
`"/extension=org.wildfly.extension.microprofile.reactive-streams-operators-smallrye:add(),
/extension=org.wildfly.extension.microprofile.reactive-messaging-smallrye:add(),
/extension=org.wildfly.extension.microprofile.telemetry:add(),
/extension=org.wildfly.extension.opentelemetry:add(),
/subsystem=microprofile-reactive-streams-operators-smallrye:add(),
/subsystem=microprofile-reactive-messaging-smallrye:add(),
/subsystem=opentelemetry:add(),
/subsystem=microprofile-telemetry:add(),
/subsystem=microprofile-reactive-messaging-smallrye/opentelemetry-tracing=config:add(),
reload"`
);
});
});

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

beforeEach(() => {
cy.navigateTo(managementEndpoint, "generic-subsystem;address=%255C0subsystem%255C2microprofile-reactive-messaging-smallrye");
// the form takes a brief moment to initialize
cy.wait(200);
cy.get(mpRmSrSelectors.otelTracing).dblclick();
cy.get(mpRmSrSelectors.config).click();
});

it("Set AMQP to undefined", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.amqpConnector, "");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"amqp-connector",
"NEVER"
);
});

it("Set AMQP to NEVER", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.amqpConnector, "NEVER");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"amqp-connector",
"NEVER"
);
});

it("Set AMQP to OFF", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.amqpConnector, "OFF");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"amqp-connector",
"OFF"
);
});

it("Set AMQP to ON", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.amqpConnector, "ON");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"amqp-connector",
"ON"
);
});

it("Set AMQP to ALWAYS", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.amqpConnector, "ALWAYS");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"amqp-connector",
"ALWAYS"
);
});

it("Set Kafka to undefined", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.kafkaConnector, "");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"kafka-connector",
"NEVER"
);
});

it("Set Kafka to NEVER", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.kafkaConnector, "NEVER");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"kafka-connector",
"NEVER"
);
});

it("Set Kafka to OFF", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.kafkaConnector, "OFF");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"kafka-connector",
"OFF"
);
});

it("Set Kafka to ON", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.kafkaConnector, "ON");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"kafka-connector",
"ON"
);
});

it("Set Kafka to ALWAYS", () => {
editFormJBEAP28819(configForm.id);
cy.selectInDropdownMenu(configForm.idNoDash, configForm.kafkaConnector, "ALWAYS");
cy.saveForm(configForm.idNoDash);
cy.verifyAttribute(
managementEndpoint,
verifyAddress,
"kafka-connector",
"ALWAYS"
);
});
});
6 changes: 5 additions & 1 deletion packages/testsuite/cypress/support/form-editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ Cypress.Commands.add("selectInDropdownMenuOnPage", (elementId, value) => {
cy.get(`button[data-id="${elementId}"]`)
.parent()
.within(() => {
cy.get(`a.dropdown-item`).contains(value).click();
if (value == "") {
cy.get(`a.dropdown-item:has(span:empty)`).click();
} else {
cy.get(`a.dropdown-item`).contains(value).click();
}
});
});

Expand Down
8 changes: 5 additions & 3 deletions packages/testsuite/cypress/support/verification-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ Cypress.Commands.add("verifyUserRole", (expectedRoleName) => {
});

Cypress.Commands.add("closeAllPopUpNotifications", () => {
cy.get(".alert.alert-dismissable").each(($popupNotification) => {
$popupNotification.find(".close").trigger("click");
});
if (Cypress.$(".alert.alert-dismissable").length > 0) {
cy.get(".alert.alert-dismissable").each(($popupNotification) => {
$popupNotification.find(".close").trigger("click");
});
}
});

export {};
Expand Down
Loading