Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
describe("TESTS: Configuration => Subsystem => OpenTelemetry", () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should be moved to microprofile tests.

Copy link
Copy Markdown
Collaborator Author

@kstekovi kstekovi Feb 16, 2026

Choose a reason for hiding this comment

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

I don't think this is good idea. I am follow the subsystems organization as in web console. There is no section for microprofile subsystems. All subsystems are on the same level.

Maybe you had on mind Microprofile telemetry subsystem to have in the microprofile tests. this make more sens to me. but still i would keep to keep the same organization level as in the web console. so even for this Microprofile telemetry subsystem i would like to create a new folder for its tests.

const address = ["subsystem", "opentelemetry"];
const configurationFormId = "model-browser-model-browser-root-form";

// Attribute names
const serviceName = "service-name";
const endpoint = "endpoint";
const exporterType = "exporter-type";
const spanProcessorType = "span-processor-type";
const batchDelay = "batch-delay";
const maxQueueSize = "max-queue-size";
const maxExportBatchSize = "max-export-batch-size";
const exportTimeout = "export-timeout";
const samplerType = "sampler-type";
const ratio = "ratio";

let managementEndpoint: string;

before(() => {
cy.startWildflyContainer({ configuration: "standalone-microprofile-insecure.xml" }).then((result) => {
managementEndpoint = result as string;
});
});

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

it("Edit service-name", () => {
const customServiceName = "my-otel-service";
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, serviceName, customServiceName);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, serviceName, customServiceName);
});

it("Edit endpoint", () => {
const customEndpoint = "http://otel-collector:4317";
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, endpoint, customEndpoint);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, endpoint, customEndpoint);
});

it("Edit endpoint with expression", () => {
const expressionValue = "${env.OTEL_ENDPOINT:http://localhost:4317}";
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.textExpression(configurationFormId, endpoint, expressionValue);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttributeAsExpression(managementEndpoint, address, endpoint, expressionValue);
});

it("Change exporter-type to jaeger", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, exporterType, "jaeger");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, exporterType, "jaeger");
});

it("Change exporter-type to otlp", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, exporterType, "otlp");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, exporterType, "otlp");
});

it("Change span-processor-type to simple", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, spanProcessorType, "simple");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, spanProcessorType, "simple");
});

it("Change span-processor-type to batch", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, spanProcessorType, "batch");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, spanProcessorType, "batch");
});

it("Edit batch-delay", () => {
const customBatchDelay = 10000;
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, batchDelay, customBatchDelay);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, batchDelay, customBatchDelay);
});

it("Edit max-queue-size", () => {
const customMaxQueueSize = 4096;
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, maxQueueSize, customMaxQueueSize);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, maxQueueSize, customMaxQueueSize);
});

it("Edit max-export-batch-size", () => {
const customMaxExportBatchSize = 1024;
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, maxExportBatchSize, customMaxExportBatchSize);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, maxExportBatchSize, customMaxExportBatchSize);
});

it("Edit export-timeout", () => {
const customExportTimeout = 60000;
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.text(configurationFormId, exportTimeout, customExportTimeout);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, exportTimeout, customExportTimeout);
});

it("Change sampler-type to on", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, samplerType, "on");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, samplerType, "on");
});

it("Change sampler-type to off", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, samplerType, "off");
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, samplerType, "off");
});

it("Change sampler-type to ratio and set ratio value", () => {
const ratioValue = 0.5;
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.editForm(configurationFormId);
cy.selectInDropdownMenu(configurationFormId, samplerType, "ratio");
cy.text(configurationFormId, ratio, ratioValue);
cy.saveForm(configurationFormId);
cy.verifySuccess();
cy.verifyAttribute(managementEndpoint, address, samplerType, "ratio");
cy.verifyAttribute(managementEndpoint, address, ratio, ratioValue);
});

it("Reset configuration", () => {
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
cy.resetForm(configurationFormId, managementEndpoint, address);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("TESTS: Update Manager => Channels", () => {
const isJbossEapChannelPrinted = ($items: JQuery<HTMLElement>): boolean => {
for (let i = 0; i < $items.length; i++) {
const text = $items[i].innerText.trim();
if (text.startsWith('JBoss EAP')) {
if (text.startsWith("JBoss EAP")) {
return true;
}
}
Expand All @@ -132,11 +132,11 @@ describe("TESTS: Update Manager => Channels", () => {
cy.navigateToUpdateManagerPage(managementEndpoint, ["update-manager", "updates"]);

// click on last printed revision (first revision in history)
cy.get('#update-manager-update ul li').last().click();
cy.get("#update-manager-update ul li").last().click();

// try to find EAP channel
cy.contains('li.list-group-item', 'Channel Versions')
.find('.value ul li')
cy.contains("li.list-group-item", "Channel Versions")
.find(".value ul li")
.should(($items) => {
expect(isJbossEapChannelPrinted($items), '"JBoss EAP" channel not printed').to.equal(true);
});
Expand All @@ -149,8 +149,8 @@ describe("TESTS: Update Manager => Channels", () => {
*/
it("Check channel version in runtimes", () => {
cy.navigateTo(managementEndpoint, "runtime;path=standalone-server-column~standalone-host-server");
cy.get('#standalone-server-column ul li').first().click();
cy.get('#channel-versions li .value').should(($items) => {
cy.get("#standalone-server-column ul li").first().click();
cy.get("#channel-versions li .value").should(($items) => {
expect(isJbossEapChannelPrinted($items), '"JBoss EAP" channel not printed').to.equal(true);
});
});
Expand Down
30 changes: 18 additions & 12 deletions packages/testsuite/cypress/support/containers-utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Cypress.Commands.add("startWildflyContainer", (options = { useNetworkHostMode: false }) => {
return cy.task(
"start:wildfly:container",
{
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
configuration: "standalone-insecure.xml",
useNetworkHostMode: options.useNetworkHostMode,
},
{ timeout: 240_000 },
);
});
Cypress.Commands.add(
"startWildflyContainer",
(options = { useNetworkHostMode: false, configuration: "standalone-insecure.xml" }) => {
return cy.task(
"start:wildfly:container",
{
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
configuration: options.configuration || "standalone-insecure.xml",
useNetworkHostMode: options.useNetworkHostMode,
},
{ timeout: 240_000 },
);
},
);

Cypress.Commands.add("startWildflyContainerSecured", () => {
return cy.task(
Expand Down Expand Up @@ -43,9 +46,12 @@ declare global {
* Start a Wildfly container. This command is executed in before method in most of the test cases/specifications.
* Unsecured management interface is used and web console doesn't require any authentication.
*
* @param options.useNetworkHostMode - Whether to use network host mode
* @param options.configuration - Configuration file to use (default: standalone-insecure.xml)
*
* @category Containers util
*/
startWildflyContainer(options?: { useNetworkHostMode?: boolean }): Chainable<unknown>;
startWildflyContainer(options?: { useNetworkHostMode?: boolean; configuration?: string }): Chainable<unknown>;
/**
* Start a Wildfly container wich is secured. This is not for a common use.
*
Expand Down