Skip to content
Open
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
```
Expand Down
Original file line number Diff line number Diff line change
@@ -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)",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try avoiding nth-child method for clarity

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would like but here it nonstandard check to verify the text. The element itself doesn't have any specific ID to be able use as a selector.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we use something like here:

text: "Enabling",
},
fieldPatternFilter: {
name: "pattern-filter",
value: ".*",
},
expectedResult: { enabling: true, "pattern-filter": ".*" },
};

const filtrsButtonForConfigurableHttpServer = "#hal-uid-1";
Copy link
Collaborator

Choose a reason for hiding this comment

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

this random number changes between version, ID shouldn't be used

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the ID. Or do you mean something else?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, the ID suffix is random number and shouldnt be relied on


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);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't disagree with this changes, but it's unnecessarily increasing changed files/PR size here

cy.formInput(channelForm, "repositories")
.type(channels.updateUrl.repositories + "{enter}")
.trigger("change");
Expand Down
2 changes: 1 addition & 1 deletion packages/testsuite/cypress/support/form-editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ declare global {
*/
flip(formId: string, attributeName: string, value: boolean): Chainable<void>;
/**
* 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.
Expand Down