mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fixing tests for Search Page (#3759)
This commit is contained in:
committed by
Eugenio Romano
parent
49a3749167
commit
89cf47318f
@@ -95,6 +95,8 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, adminFileNames, newFolderModelUploaded.entry.id);
|
||||
|
||||
browser.driver.sleep(12000);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
@@ -195,7 +197,7 @@ describe('Search component - Search Page', () => {
|
||||
searchResultPage.checkNoResultMessageIsDisplayed();
|
||||
});
|
||||
|
||||
xit('[C272803] Sort content ascending by name.', () => {
|
||||
it('[C272803] Sort content ascending by name.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
searchDialog
|
||||
@@ -209,7 +211,7 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C272804] Sort content descending by name.', () => {
|
||||
it('[C272804] Sort content descending by name.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
searchDialog.checkSearchBarIsNotVisible()
|
||||
@@ -223,7 +225,7 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C272805] Sort content ascending by author.', () => {
|
||||
it('[C272805] Sort content ascending by author.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
@@ -233,7 +235,7 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C272806] Sort content descending by author.', () => {
|
||||
it('[C272806] Sort content descending by author.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
@@ -243,7 +245,7 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C272807] Sort content ascending by created date.', () => {
|
||||
it('[C272807] Sort content ascending by created date.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
@@ -253,7 +255,7 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C260260] Sort content descending by created date.', () => {
|
||||
it('[C260260] Sort content descending by created date.', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
@@ -263,12 +265,12 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('[C260262] Try to delete a file without rights from the Search Results Page', () => {
|
||||
it('[C260262] Try to delete a file without rights from the Search Results Page', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFile);
|
||||
searchResultPage.deleteContent(search.no_permission.noPermFile);
|
||||
searchResultPage.checkDeleteIsDisabled(search.no_permission.noPermFile);
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFile);
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
||||
@@ -284,9 +286,8 @@ describe('Search component - Search Page', () => {
|
||||
searchDialog.enterTextAndPressEnter(search.no_permission.noPermFolder);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
|
||||
searchResultPage.deleteContent(search.no_permission.noPermFolder);
|
||||
searchResultPage.checkDeleteIsDisabled(search.no_permission.noPermFolder);
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
|
||||
searchResultPage.closeActionButton();
|
||||
|
||||
searchDialog.checkSearchBarIsNotVisible()
|
||||
.checkSearchIconIsVisible()
|
||||
|
@@ -82,6 +82,13 @@ var ContentList = function () {
|
||||
deleteContent.click();
|
||||
};
|
||||
|
||||
this.checkDeleteIsDisabled = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
let disabledDelete = element(by.css("button[data-automation-id*='DELETE'][disabled='true']"));
|
||||
Util.waitUntilElementIsVisible(disabledDelete);
|
||||
};
|
||||
|
||||
this.metadataContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
|
@@ -70,6 +70,11 @@ var SearchResultsPage = function () {
|
||||
contentList.deleteContent(content);
|
||||
};
|
||||
|
||||
this.checkDeleteIsDisabled = function(content) {
|
||||
contentList.checkDeleteIsDisabled(content);
|
||||
this.closeActionButton();
|
||||
};
|
||||
|
||||
this.copyContent = function(content) {
|
||||
contentList.copyContent(content);
|
||||
};
|
||||
@@ -95,16 +100,26 @@ var SearchResultsPage = function () {
|
||||
*/
|
||||
this.sortBy = function (sortOrder, option) {
|
||||
|
||||
Util.waitUntilElementIsVisible(sortingArrow);
|
||||
sortingArrow.click();
|
||||
let selectedSortingOption = element(by.css("adf-sorting-picker div[class='mat-select-value'] span span"));
|
||||
|
||||
element.all(sortDropdownLocator).each(function(element) {
|
||||
element.getText().then(function(text) {
|
||||
if (text === option) {
|
||||
element.click();
|
||||
}
|
||||
});
|
||||
});
|
||||
Util.waitUntilElementIsVisible(selectedSortingOption);
|
||||
|
||||
selectedSortingOption.getText().then((selectedOption) => {
|
||||
|
||||
if(selectedOption !== option)
|
||||
{
|
||||
Util.waitUntilElementIsVisible(sortingArrow);
|
||||
sortingArrow.click();
|
||||
|
||||
element.all(sortDropdownLocator).each(function(element) {
|
||||
element.getText().then(function(text) {
|
||||
if (text === option) {
|
||||
element.click();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.sortByOrder(sortOrder);
|
||||
};
|
||||
|
Reference in New Issue
Block a user