Skip to content

Commit c49dc9b

Browse files
committed
[JBEAP-29211] Add filter to Configurable HTTP Server Mechanism Factory
1 parent ee20c23 commit c49dc9b

4 files changed

Lines changed: 78 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,21 @@ npm run develop
5454
```
5555

5656
- If you want to execute whole testsuite, navigate to `packages/testsuite` and from within that directory execute `npm test`
57+
5758
- It is also possible to run on specific browser by supplying `--browser` argument, e.g
59+
5860
```
5961
npm test -- --browser=chrome
6062
```
63+
6164
- 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
65+
6266
```
6367
npm test -- --specs="cypress/e2e/ejb/*.cy.ts"
6468
```
69+
6570
- 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
71+
6672
```
6773
HAL_IMAGE=quay.io/myorg/hal WILDFLY_IMAGE=quay.io/myorg/wildfly npm test ...
6874
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
});

packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("TESTS: Update Manager => Channels", () => {
8686
it("Update url channel parameters", () => {
8787
cy.navigateToSpecificChannel(managementEndpoint, channels.url.name);
8888
cy.editForm(channelForm);
89-
cy.get(".tm-tag-remove").click()
89+
cy.get(".tm-tag-remove").click();
9090
cy.formInput(channelForm, "repositories")
9191
.type(channels.updateUrl.repositories + "{enter}")
9292
.trigger("change");

packages/testsuite/cypress/support/form-editing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ declare global {
264264
*/
265265
flip(formId: string, attributeName: string, value: boolean): Chainable<void>;
266266
/**
267-
* Set text value to form input.
267+
* Set text value to form input. The ID of the form input is concatenated like: cy.get("#" + formId + "-" + attributeName + "-editing");
268268
* @category Data inserting
269269
*
270270
* @param formId - The ID of section which contain form inputs.

0 commit comments

Comments
 (0)