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
Expand Up @@ -36,7 +36,7 @@ describe("TESTS: Configuration => Subsystem => EJB => Services => Identity", ()
cy.navigateTo(managementEndpoint, "ejb3-configuration");
cy.get("#ejb3-service-item").click();
cy.get("#ejb3-service-identity-item").click();
cy.editForm(configurationFormId);
cy.editForm(configurationFormId, { waitForData: false });
cy.formInput(configurationFormId, "outflow-security-domains")
.clear()
.type(`${securityDomainToUpdate}{enter}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe("TESTS: Configuration => Subsystem => EJB => State Management => Cache"
cy.get("#ejb3-state-item").click();
cy.get("#ejb3-cache-item").click();
cy.selectInTable(cacheTableId, caches.update.name);
cy.editForm(configurationFormId);
cy.editForm(configurationFormId, { waitForData: false });
cy.formInput(configurationFormId, "aliases").clear().type("another-alias{enter}").trigger("change");
cy.saveForm(configurationFormId);
cy.verifySuccess();
Expand All @@ -112,7 +112,7 @@ describe("TESTS: Configuration => Subsystem => EJB => State Management => Cache"
cy.get("#ejb3-state-item").click();
cy.get("#ejb3-cache-item").click();
cy.selectInTable(cacheTableId, caches.update.name);
cy.editForm(configurationFormId);
cy.editForm(configurationFormId, { waitForData: false });
cy.text(configurationFormId, "passivation-store", passivations.update.name);
cy.saveForm(configurationFormId);
cy.verifySuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("TESTS: Configuration => Subsystem => Security => Settings => Factories
cy.get("#http-factories-item").click();
cy.get("#elytron-provider-http-server-mechanism-factory-item").click();
cy.selectInTable(providerHttpServerMechanismFactoryTableId, providerHttpServiceMechanismFactories.update.name);
cy.editForm(configurationFormId);
cy.editForm(configurationFormId, { waitForData: false });
cy.text(configurationFormId, "providers", "pl-to-update");
cy.saveForm(configurationFormId);
cy.verifySuccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("TESTS: Configuration => Subsystem => Security => Settings => Factories
serviceLoaderHttpServerMechanismFactoryTableId,
serviceLoaderHttpServiceMechanismFactories.update.name,
);
cy.editForm(configurationFormId);
cy.editForm(configurationFormId, { waitForData: false });
cy.text(configurationFormId, "module", "sample");
cy.saveForm(configurationFormId);
cy.verifySuccess();
Expand Down
8 changes: 6 additions & 2 deletions packages/testsuite/cypress/support/form-editing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Cypress.Commands.add("editForm", (formId) => {
Cypress.Commands.add("editForm", (formId, { waitForData = true } = {}) => {
const editButton = "#" + formId + ' a.clickable[data-operation="edit"]';
if (waitForData) {
// Wait for form data to load: find readonly spans without "empty" CSS class and with actual text content
cy.get(`#${formId}-readonly`).find("span[id$='-readonly']:not(.empty):not(:empty)").should("exist");
}
cy.get(`#${formId}-editing`).should("not.be.visible");
cy.get(editButton).click();
// Workaround - JBEAP-25005,JBEAP-25046 - the form is sometimes not loaded in time and Cypress is not able to recover
Expand Down Expand Up @@ -189,7 +193,7 @@ declare global {
*
* @param formId - The ID of section which need to be edit.
*/
editForm(formId: string): Chainable<void>;
editForm(formId: string, options?: { waitForData?: boolean }): Chainable<void>;
/**
* Click on "Save" button to save current data in form.
* @category Form Editing
Expand Down
Loading