Skip to content

Commit

Permalink
ui-tests additional screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
sgauruseu committed Oct 22, 2024
1 parent 9f0ca4c commit 67cac8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 6 additions & 5 deletions testing/page_objects/archive/archive.filter.panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ class ArchiveFilterPanel extends Page {
}
}

waitForOpened() {
return this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout);
async waitForOpened() {
await this.waitForElementDisplayed(XPATH.container, appConst.mediumTimeout);
await this.pause(500);
}

waitForShowResultsButtonDisplayed() {
Expand Down Expand Up @@ -137,7 +138,7 @@ class ArchiveFilterPanel extends Page {
return await this.waitForElementDisplayed(XPATH.container + lib.FILTER_PANEL.dependenciesSection, timeout)
} catch (err) {
let screenshot = await this.saveScreenshotUniqueName('err_load_dependencies_section');
throw new Error("Filter Panel: Dependencies section should be visible! screenshot: " + screenshot + ' ' + err);
throw new Error(`Filter Panel: Dependencies section should be visible! screenshot:${screenshot} ` + err);
}
}

Expand Down Expand Up @@ -207,7 +208,7 @@ class ArchiveFilterPanel extends Page {
await this.clickOnElement(selector);
return await this.pause(1200);
} catch (err) {
await this.saveScreenshot(appConst.generateRandomName("err_click_on_aggregation"));
await this.saveScreenshotUniqueName("err_click_on_aggregation");
throw new Error("Error when click on the aggregation checkbox: " + err);
}
}
Expand Down Expand Up @@ -293,7 +294,7 @@ class ArchiveFilterPanel extends Page {
await this.clickOnElement(okButton);
await this.pause(300);
} catch (err) {
let screenshot = await this.saveScreenshot('err_filter_owner');
let screenshot = await this.saveScreenshotUniqueName('err_filter_owner');
throw new Error(`Error when selecting an option in Owner Selector, screenshot ; ${screenshot} ` + err);
}
}
Expand Down
5 changes: 5 additions & 0 deletions testing/specs/archive.restore.content.dependant.items.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ describe('archive.restore.content.dependant.items.spec: tests for archive/restor
await archiveBrowsePanel.clickOnSearchButton();
await archiveFilterPanel.waitForOpened();
// 2. Verify the number in 'hits'
await studioUtils.saveScreenshot('issue_arch_filter_panel_hits');
let hitsCounter1 = await archiveFilterPanel.getTextInHitsCounter();
assert.equal(hitsCounter1, '12 hits', 'Expected hits counter should be displayed');
// 3. Click on 'Executable' checkbox:
await archiveFilterPanel.clickOnCheckboxInContentTypesBlock('Executable');
await studioUtils.saveScreenshot('issue_arch_filter_panel_hits_2');
let result = await archiveBrowsePanel.getDisplayNamesInGrid();
assert.equal(result.length, 4, 'Four items should be present in the grid');
// 4. Verify that number in 'hits' is updated
Expand All @@ -79,6 +81,7 @@ describe('archive.restore.content.dependant.items.spec: tests for archive/restor
// 5. Click on 'Clear' button:
await archiveFilterPanel.clickOnClearButton();
await archiveFilterPanel.waitForClearLinkNotDisplayed();
await studioUtils.saveScreenshot('issue_arch_filter_panel_hits_3');
let result2 = await archiveBrowsePanel.getDisplayNamesInGrid();
assert.equal(result2.length, 1, 'Grid returns to the initial state');
assert.equal(result2[0], FOLDER_DISPLAY_NAME, 'Expected item should be present in the grid');
Expand Down Expand Up @@ -127,6 +130,7 @@ describe('archive.restore.content.dependant.items.spec: tests for archive/restor
assert.equal(filteredItem[0], TEST_DISPLAY_NAME, 'One item should be present in the filtered grid');
// 6. Click on 'Clear' button:
await archiveFilterPanel.clickOnClearButton();
await studioUtils.saveScreenshot('issue_clear_button_pressed');
// 7. Verify that grid returns to the initial state:
let result = await archiveBrowsePanel.getDisplayNamesInGrid();
assert.equal(result.length, 1, 'One item should be present in the filtered grid');
Expand Down Expand Up @@ -159,6 +163,7 @@ describe('archive.restore.content.dependant.items.spec: tests for archive/restor
await confirmValueDialog.clickOnConfirmButton();
// 6. Verify the notification message
let message = await archiveBrowsePanel.waitForNotificationMessage();
await studioUtils.saveScreenshot('issue_restore_confirmed');
assert.equal(message, '12 items are restored', 'Expected notification message should appear');
let hitsCounter = await archiveFilterPanel.getTextInHitsCounter();
assert.equal(hitsCounter, '0 hits', 'Expected hits counter should be displayed');
Expand Down

0 comments on commit 67cac8b

Please sign in to comment.