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);
|
await uploadActions.createEmptyFiles(this.alfrescoJsApi, adminFileNames, newFolderModelUploaded.entry.id);
|
||||||
|
|
||||||
|
browser.driver.sleep(12000);
|
||||||
|
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
@@ -195,7 +197,7 @@ describe('Search component - Search Page', () => {
|
|||||||
searchResultPage.checkNoResultMessageIsDisplayed();
|
searchResultPage.checkNoResultMessageIsDisplayed();
|
||||||
});
|
});
|
||||||
|
|
||||||
xit('[C272803] Sort content ascending by name.', () => {
|
it('[C272803] Sort content ascending by name.', () => {
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
|
|
||||||
searchDialog
|
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();
|
contentServicesPage.goToDocumentList();
|
||||||
|
|
||||||
searchDialog.checkSearchBarIsNotVisible()
|
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();
|
contentServicesPage.goToDocumentList();
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.active.base);
|
.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();
|
contentServicesPage.goToDocumentList();
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.active.base);
|
.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();
|
contentServicesPage.goToDocumentList();
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.active.base);
|
.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();
|
contentServicesPage.goToDocumentList();
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.active.base);
|
.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();
|
contentServicesPage.goToDocumentList();
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
||||||
searchResultPage.checkContentIsDisplayed(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);
|
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFile);
|
||||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||||
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
.enterTextAndPressEnter(search.no_permission.noPermFile);
|
||||||
@@ -284,9 +286,8 @@ describe('Search component - Search Page', () => {
|
|||||||
searchDialog.enterTextAndPressEnter(search.no_permission.noPermFolder);
|
searchDialog.enterTextAndPressEnter(search.no_permission.noPermFolder);
|
||||||
|
|
||||||
searchResultPage.checkContentIsDisplayed(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.checkContentIsDisplayed(search.no_permission.noPermFolder);
|
||||||
searchResultPage.closeActionButton();
|
|
||||||
|
|
||||||
searchDialog.checkSearchBarIsNotVisible()
|
searchDialog.checkSearchBarIsNotVisible()
|
||||||
.checkSearchIconIsVisible()
|
.checkSearchIconIsVisible()
|
||||||
|
@@ -82,6 +82,13 @@ var ContentList = function () {
|
|||||||
deleteContent.click();
|
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.metadataContent = function (content) {
|
||||||
this.clickOnActionMenu(content);
|
this.clickOnActionMenu(content);
|
||||||
this.waitForContentOptions();
|
this.waitForContentOptions();
|
||||||
|
@@ -70,6 +70,11 @@ var SearchResultsPage = function () {
|
|||||||
contentList.deleteContent(content);
|
contentList.deleteContent(content);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.checkDeleteIsDisabled = function(content) {
|
||||||
|
contentList.checkDeleteIsDisabled(content);
|
||||||
|
this.closeActionButton();
|
||||||
|
};
|
||||||
|
|
||||||
this.copyContent = function(content) {
|
this.copyContent = function(content) {
|
||||||
contentList.copyContent(content);
|
contentList.copyContent(content);
|
||||||
};
|
};
|
||||||
@@ -95,16 +100,26 @@ var SearchResultsPage = function () {
|
|||||||
*/
|
*/
|
||||||
this.sortBy = function (sortOrder, option) {
|
this.sortBy = function (sortOrder, option) {
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(sortingArrow);
|
let selectedSortingOption = element(by.css("adf-sorting-picker div[class='mat-select-value'] span span"));
|
||||||
sortingArrow.click();
|
|
||||||
|
|
||||||
element.all(sortDropdownLocator).each(function(element) {
|
Util.waitUntilElementIsVisible(selectedSortingOption);
|
||||||
element.getText().then(function(text) {
|
|
||||||
if (text === option) {
|
selectedSortingOption.getText().then((selectedOption) => {
|
||||||
element.click();
|
|
||||||
}
|
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);
|
this.sortByOrder(sortOrder);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user