|
| 1 | +describe("TESTS: Configuration => Subsystem => Security => Settings => Factories / Transformers => HTTP Factories => Configurable HTTP Server Mechanism Factory", () => { |
| 2 | + let managementEndpoint: string; |
| 3 | + |
| 4 | + const address = ["subsystem", "elytron", "configurable-http-server-mechanism-factory", "configurableHTTPserver"]; |
| 5 | + |
| 6 | + const httpServerMechanismFactory = "elytron-configurable-http-server-mechanism-factory"; |
| 7 | + const httpServerMechanismFactoryFiltrs = httpServerMechanismFactory + "-filters"; |
| 8 | + |
| 9 | + const navigationMenu = { |
| 10 | + httpFactoriesItem: "#http-factories-item", |
| 11 | + configurableHTTPServer: "#" + httpServerMechanismFactory + "-item", |
| 12 | + }; |
| 13 | + |
| 14 | + const factoryForm = { |
| 15 | + id: httpServerMechanismFactory + "-add", |
| 16 | + fieldName: { |
| 17 | + name: "name", |
| 18 | + value: "configurableHTTPserver", |
| 19 | + }, |
| 20 | + fieldFactory: { |
| 21 | + name: "http-server-mechanism-factory", |
| 22 | + value: "global", |
| 23 | + }, |
| 24 | + }; |
| 25 | + |
| 26 | + const filterForm = { |
| 27 | + id: httpServerMechanismFactoryFiltrs + "-add", |
| 28 | + fieldEnabled: { |
| 29 | + id: "#" + httpServerMechanismFactoryFiltrs + "-add-editing > div:nth-child(2)", |
| 30 | + text: "Enabling", |
| 31 | + }, |
| 32 | + fieldPatternFilter: { |
| 33 | + name: "pattern-filter", |
| 34 | + value: ".*", |
| 35 | + }, |
| 36 | + expectedResult: { enabling: true, "pattern-filter": ".*" }, |
| 37 | + }; |
| 38 | + |
| 39 | + const filtrsButtonForConfigurableHttpServer = "#hal-uid-1"; |
| 40 | + |
| 41 | + before(() => { |
| 42 | + cy.startWildflyContainer().then((result) => { |
| 43 | + managementEndpoint = result as string; |
| 44 | + }); |
| 45 | + }); |
| 46 | + |
| 47 | + beforeEach(() => { |
| 48 | + cy.navigateTo(managementEndpoint, "elytron-factories-transformers"); |
| 49 | + }); |
| 50 | + |
| 51 | + after(() => { |
| 52 | + cy.task("stop:containers"); |
| 53 | + }); |
| 54 | + |
| 55 | + it("Add filter to Factory", () => { |
| 56 | + cy.get(navigationMenu.httpFactoriesItem).click(); |
| 57 | + cy.get(navigationMenu.configurableHTTPServer).click(); |
| 58 | + cy.addInTable(httpServerMechanismFactory + "-table"); |
| 59 | + cy.text(factoryForm.id, factoryForm.fieldName.name, factoryForm.fieldName.value); |
| 60 | + cy.text(factoryForm.id, factoryForm.fieldFactory.name, factoryForm.fieldFactory.value); |
| 61 | + cy.confirmAddResourceWizard(); |
| 62 | + cy.get(filtrsButtonForConfigurableHttpServer).click(); |
| 63 | + cy.addInTable(httpServerMechanismFactoryFiltrs + "-table"); |
| 64 | + cy.get(filterForm.fieldEnabled.id).should("be.visible").should("contain.text", filterForm.fieldEnabled.text); |
| 65 | + cy.text(filterForm.id, filterForm.fieldPatternFilter.name, filterForm.fieldPatternFilter.value); |
| 66 | + cy.confirmAddResourceWizard(); |
| 67 | + cy.verifySuccess(); |
| 68 | + cy.verifyListAttributeContains(managementEndpoint, address, "filters", filterForm.expectedResult); |
| 69 | + }); |
| 70 | +}); |
0 commit comments