From c49dc9b161f00e86d9bd375f5e18b38ffad8358b Mon Sep 17 00:00:00 2001 From: Krystof Stekovic Date: Mon, 11 Aug 2025 14:58:49 +0200 Subject: [PATCH] [JBEAP-29211] Add filter to Configurable HTTP Server Mechanism Factory --- README.md | 6 ++ ...urable-http-server-mechanism-factory.cy.ts | 70 +++++++++++++++++++ .../test-configuration-update-channel.cy.ts | 2 +- .../testsuite/cypress/support/form-editing.ts | 2 +- 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 packages/testsuite/cypress/e2e/elytron/test-configuration-subsystem-elytron-configurable-http-server-mechanism-factory.cy.ts diff --git a/README.md b/README.md index 0974e1a11..7edb15ebd 100644 --- a/README.md +++ b/README.md @@ -54,15 +54,21 @@ npm run develop ``` - If you want to execute whole testsuite, navigate to `packages/testsuite` and from within that directory execute `npm test` + - It is also possible to run on specific browser by supplying `--browser` argument, e.g + ``` npm test -- --browser=chrome ``` + - It is also possible to reduce the amount of specs executed by passing `--specs` flag. This flag must be relative to the `packages/testsuite` directory and supports glob patterns, e.g to execute only `ejb` related tests, run + ``` npm test -- --specs="cypress/e2e/ejb/*.cy.ts" ``` + - If you wish to run the test suite against custom HAL or WildFly images, you can use `HAL_IMAGE` and `WILDFLY_IMAGE` environment variables to specify custom images, e.g + ``` HAL_IMAGE=quay.io/myorg/hal WILDFLY_IMAGE=quay.io/myorg/wildfly npm test ... ``` diff --git a/packages/testsuite/cypress/e2e/elytron/test-configuration-subsystem-elytron-configurable-http-server-mechanism-factory.cy.ts b/packages/testsuite/cypress/e2e/elytron/test-configuration-subsystem-elytron-configurable-http-server-mechanism-factory.cy.ts new file mode 100644 index 000000000..039399d86 --- /dev/null +++ b/packages/testsuite/cypress/e2e/elytron/test-configuration-subsystem-elytron-configurable-http-server-mechanism-factory.cy.ts @@ -0,0 +1,70 @@ +describe("TESTS: Configuration => Subsystem => Security => Settings => Factories / Transformers => HTTP Factories => Configurable HTTP Server Mechanism Factory", () => { + let managementEndpoint: string; + + const address = ["subsystem", "elytron", "configurable-http-server-mechanism-factory", "configurableHTTPserver"]; + + const httpServerMechanismFactory = "elytron-configurable-http-server-mechanism-factory"; + const httpServerMechanismFactoryFiltrs = httpServerMechanismFactory + "-filters"; + + const navigationMenu = { + httpFactoriesItem: "#http-factories-item", + configurableHTTPServer: "#" + httpServerMechanismFactory + "-item", + }; + + const factoryForm = { + id: httpServerMechanismFactory + "-add", + fieldName: { + name: "name", + value: "configurableHTTPserver", + }, + fieldFactory: { + name: "http-server-mechanism-factory", + value: "global", + }, + }; + + const filterForm = { + id: httpServerMechanismFactoryFiltrs + "-add", + fieldEnabled: { + id: "#" + httpServerMechanismFactoryFiltrs + "-add-editing > div:nth-child(2)", + text: "Enabling", + }, + fieldPatternFilter: { + name: "pattern-filter", + value: ".*", + }, + expectedResult: { enabling: true, "pattern-filter": ".*" }, + }; + + const filtrsButtonForConfigurableHttpServer = "#hal-uid-1"; + + before(() => { + cy.startWildflyContainer().then((result) => { + managementEndpoint = result as string; + }); + }); + + beforeEach(() => { + cy.navigateTo(managementEndpoint, "elytron-factories-transformers"); + }); + + after(() => { + cy.task("stop:containers"); + }); + + it("Add filter to Factory", () => { + cy.get(navigationMenu.httpFactoriesItem).click(); + cy.get(navigationMenu.configurableHTTPServer).click(); + cy.addInTable(httpServerMechanismFactory + "-table"); + cy.text(factoryForm.id, factoryForm.fieldName.name, factoryForm.fieldName.value); + cy.text(factoryForm.id, factoryForm.fieldFactory.name, factoryForm.fieldFactory.value); + cy.confirmAddResourceWizard(); + cy.get(filtrsButtonForConfigurableHttpServer).click(); + cy.addInTable(httpServerMechanismFactoryFiltrs + "-table"); + cy.get(filterForm.fieldEnabled.id).should("be.visible").should("contain.text", filterForm.fieldEnabled.text); + cy.text(filterForm.id, filterForm.fieldPatternFilter.name, filterForm.fieldPatternFilter.value); + cy.confirmAddResourceWizard(); + cy.verifySuccess(); + cy.verifyListAttributeContains(managementEndpoint, address, "filters", filterForm.expectedResult); + }); +}); diff --git a/packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts b/packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts index 519ce10d3..94d52ff4c 100644 --- a/packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts +++ b/packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts @@ -86,7 +86,7 @@ describe("TESTS: Update Manager => Channels", () => { it("Update url channel parameters", () => { cy.navigateToSpecificChannel(managementEndpoint, channels.url.name); cy.editForm(channelForm); - cy.get(".tm-tag-remove").click() + cy.get(".tm-tag-remove").click(); cy.formInput(channelForm, "repositories") .type(channels.updateUrl.repositories + "{enter}") .trigger("change"); diff --git a/packages/testsuite/cypress/support/form-editing.ts b/packages/testsuite/cypress/support/form-editing.ts index 61ac418bc..bf74a5db0 100644 --- a/packages/testsuite/cypress/support/form-editing.ts +++ b/packages/testsuite/cypress/support/form-editing.ts @@ -264,7 +264,7 @@ declare global { */ flip(formId: string, attributeName: string, value: boolean): Chainable; /** - * Set text value to form input. + * Set text value to form input. The ID of the form input is concatenated like: cy.get("#" + formId + "-" + attributeName + "-editing"); * @category Data inserting * * @param formId - The ID of section which contain form inputs.