Skip to content

Commit

Permalink
fix for failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sgauruseu committed Jan 23, 2025
1 parent 4bcea32 commit ba90b7c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion testing/libs/test.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ module.exports = {
await this.findAndSelectItem(displayName);
await browsePanel.waitForEditButtonEnabled();
await browsePanel.clickOnEditButton();
return await roleWizard.waitForLoaded();
await roleWizard.waitForLoaded();
await roleWizard.pause(500);
} catch (err) {
throw new Error("Error when open the role: " + err);
}
Expand Down
3 changes: 2 additions & 1 deletion testing/page_objects/browsepanel/userbrowse.panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class UserBrowsePanel extends Page {

async waitForDeleteButtonEnabled() {
try {
await this.waitForElementEnabled(this.deleteButton, appConst.mediumTimeout)
await this.waitForElementEnabled(this.deleteButton, appConst.mediumTimeout);
await this.pause(400);
} catch (err) {
let screenshot = await this.saveScreenshotUniqueName('err_delete_button_not_enabled');
throw new Error(`Delete button is not enabled ! Screenshot: ${screenshot} ` + err);
Expand Down
9 changes: 6 additions & 3 deletions testing/page_objects/confirmation.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ class ConfirmationDialog extends Page {
return this.clickOnElement(this.noButton);
}

waitForDialogLoaded() {
return this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout).catch(err => {
async waitForDialogLoaded() {
try {
return await this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout);
} catch (err) {
let screenshot = await this.saveScreenshotUniqueName('err_confirmation_dialog');
throw new Error("Confirmation dialog was not loaded! " + err);
})
}
}

isDialogLoaded() {
Expand Down
1 change: 1 addition & 0 deletions testing/tests/role.wizard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('Role Wizard and Statistics Panel spec', function () {
await userBrowsePanel.clickOnNewButton();
await roleWizard.waitForLoaded();
await roleWizard.typeData(TEST_ROLE);
await roleWizard.pause(1000);
await roleWizard.waitAndClickOnSave();
// Verify the notification message:
let actualMessage = await roleWizard.waitForNotificationMessage();
Expand Down
1 change: 1 addition & 0 deletions testing/tests/user.delete.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe("user.delete.spec:User - confirm and delete it in the wizard and in the
await testUtils.clickOnSystemOpenUserWizard();
await userWizard.typeData(TEST_USER);
await userWizard.waitAndClickOnSave();
await userWizard.waitForNotificationMessage();
// 2. click on Delete and confirm:
await userWizard.clickOnDelete();
await testUtils.confirmDelete();
Expand Down
2 changes: 1 addition & 1 deletion testing/tests/wizard.toolbar.shortcut.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe(`wizard.toolbar.shortcut.spec, wizard's toolbar shortcut specification`
// 2. Group's data has been typed:
await groupWizard.typeDisplayName(TEST_GROUP.displayName);
await groupWizard.waitForSaveButtonEnabled();
await groupWizard.pause(500);
await groupWizard.pause(1000);
// 3. keyboard shortcut to save button has been pressed:
await groupWizard.hotKeySave();
await testUtils.saveScreenshot('group_shortcut_save');
Expand Down

0 comments on commit ba90b7c

Please sign in to comment.