mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3786] Automated tests for Search Sorting (#4046)
This commit is contained in:
committed by
Eugenio Romano
parent
478b299960
commit
8d9cd54163
@@ -211,7 +211,7 @@ describe('Search Date Range Filter', () => {
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
configEditor.enterConfiguration(JSON.stringify(jsonFile));
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.clickOnSearchIcon().enterTextAndPressEnter('*');
|
||||
|
@@ -157,7 +157,7 @@ describe('Search Number Range Filter', () => {
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
configEditor.enterConfiguration(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
@@ -177,7 +177,7 @@ describe('Search Number Range Filter', () => {
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
configEditor.enterConfiguration(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
@@ -199,7 +199,7 @@ describe('Search Number Range Filter', () => {
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
configEditor.enterConfiguration(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
@@ -221,7 +221,7 @@ describe('Search Number Range Filter', () => {
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
configEditor.enterConfiguration(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)).clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
|
351
e2e/search/components/search-sorting-picker.e2e.ts
Normal file
351
e2e/search/components/search-sorting-picker.e2e.ts
Normal file
@@ -0,0 +1,351 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { SearchDialog } from '../../pages/adf/dialog/searchDialog';
|
||||
import { SearchResultsPage } from '../../pages/adf/searchResultsPage';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||
import { SearchFiltersPage } from '../../pages/adf/searchFiltersPage';
|
||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||
import { NodeActions } from '../../actions/ACS/node.actions';
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { browser } from 'protractor';
|
||||
import resources = require('../../util/resources');
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { SearchSortingPickerPage } from '../../pages/adf/content_services/search/components/search-sortingPicker.page';
|
||||
|
||||
describe('Search Sorting Picker', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const searchDialog = new SearchDialog();
|
||||
const searchFilters = new SearchFiltersPage();
|
||||
const searchResults = new SearchResultsPage();
|
||||
const navigationBar = new NavigationBarPage();
|
||||
const configEditor = new ConfigEditorPage();
|
||||
const searchSortingPicker = new SearchSortingPickerPage();
|
||||
const contentServices = new ContentServicesPage();
|
||||
const nodeActions = new NodeActions();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
|
||||
const pngAModel = {
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
};
|
||||
|
||||
const pngDModel = {
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_D.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_D.file_location
|
||||
};
|
||||
|
||||
let pngA, pngD;
|
||||
const uploadActions = new UploadActions();
|
||||
const search = '_png_file.png';
|
||||
let jsonFile;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
pngA = await uploadActions.uploadFile(this.alfrescoJsApi, pngAModel.location, pngAModel.name, '-my-');
|
||||
await browser.driver.sleep(3000);
|
||||
pngD = await uploadActions.uploadFile(this.alfrescoJsApi, pngDModel.location, pngDModel.name, '-my-');
|
||||
await browser.driver.sleep(12000);
|
||||
|
||||
loginPage.loginToContentServices(acsUser.id, acsUser.password);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngA.entry.id);
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngD.entry.id);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.get(TestConfig.adf.url);
|
||||
done();
|
||||
});
|
||||
|
||||
it(`[C277269] Should see the "sort by" option when search results are displayed in search results page`, () => {
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed();
|
||||
});
|
||||
|
||||
it(`[C277270] Should see the icon for ASC and DESC sort when search results are displayed in the search results page`, () => {
|
||||
searchSortingPicker.checkOrderArrowIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C277271] Should be able to add a custom search sorter in the "sort by" option', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options.push({ 'key': 'Modifier', 'label': 'Modifier', 'type': 'FIELD', 'field': 'cm:modifier', 'ascending': true });
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.clickSortingSelector()
|
||||
.checkOptionsDropdownIsDisplayed()
|
||||
.checkOptionIsDisplayed('Modifier');
|
||||
});
|
||||
|
||||
it('[C277272] Should be able to exclude a standard search sorter from the sorting option', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
let removedOption = jsonFile.sorting.options.splice(0, 1);
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.clickSortingSelector()
|
||||
.checkOptionsDropdownIsDisplayed()
|
||||
.checkOptionIsNotDisplayed(removedOption[0].label);
|
||||
});
|
||||
|
||||
it('[C277273] Should be able to set a default order for a search sorting option', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options[0].ascending = false;
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.clickSortingSelector()
|
||||
.checkOptionIsDisplayed('Name')
|
||||
.clickSortingOption('Name');
|
||||
expect(searchSortingPicker.checkOrderArrowIsDownward()).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277280] Should be able to sort the search results by "Name" ASC', () => {
|
||||
searchFilters.checkSearchFiltersIsDisplayed();
|
||||
searchFilters.creatorCheckListFiltersPage().filterBy(`${acsUser.firstName} ${acsUser.lastName}`);
|
||||
expect(searchResults.sortAndCheckListIsOrderedByName(true)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277281] Should be able to sort the search results by "Name" DESC', () => {
|
||||
searchFilters.checkSearchFiltersIsDisplayed();
|
||||
searchFilters.creatorCheckListFiltersPage().filterBy(`${acsUser.firstName} ${acsUser.lastName}`);
|
||||
expect(searchResults.sortAndCheckListIsOrderedByName(false)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277282] Should be able to sort the search results by "Author" ASC', () => {
|
||||
expect(searchResults.sortAndCheckListIsOrderedByAuthor(this.alfrescoJsApi, true)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277283] Should be able to sort the search results by "Author" DESC', () => {
|
||||
expect(searchResults.sortAndCheckListIsOrderedByAuthor(this.alfrescoJsApi, false)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277284] Should be able to sort the search results by "Modifier" ASC', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options.push({ 'key': 'Modifier', 'label': 'Modifier', 'type': 'FIELD', 'field': 'cm:modifier', 'ascending': true });
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.sortBy(true, 'Modifier');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
let idList = await contentServices.getElementsDisplayedId();
|
||||
let numberOfElements = await contentServices.numberOfResultsDisplayed();
|
||||
|
||||
let nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements);
|
||||
let modifierList = [];
|
||||
for (let i = 0; i < nodeList.length; i++) {
|
||||
modifierList.push(nodeList[i].entry.modifiedByUser.id);
|
||||
}
|
||||
expect(contentServices.checkElementsSortedAsc(modifierList)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277285] Should be able to sort the search results by "Modifier" DESC', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options.push({ 'key': 'Modifier', 'label': 'Modifier', 'type': 'FIELD', 'field': 'cm:modifier', 'ascending': true });
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.sortBy(false, 'Modifier');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
let idList = await contentServices.getElementsDisplayedId();
|
||||
let numberOfElements = await contentServices.numberOfResultsDisplayed();
|
||||
|
||||
let nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements);
|
||||
let modifierList = [];
|
||||
for (let i = 0; i < nodeList.length; i++) {
|
||||
modifierList.push(nodeList[i].entry.modifiedByUser.id);
|
||||
}
|
||||
expect(contentServices.checkElementsSortedDesc(modifierList)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277286] Should be able to sort the search results by "Created Date" ASC', () => {
|
||||
expect(searchResults.sortAndCheckListIsOrderedByCreated(true)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277287] Should be able to sort the search results by "Created Date" DESC', () => {
|
||||
expect(searchResults.sortAndCheckListIsOrderedByCreated(false)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277288] Should be able to sort the search results by "Modified Date" ASC', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options.push({ 'key': 'Modified Date', 'label': 'Modified Date', 'type': 'FIELD', 'field': 'cm:modified', 'ascending': true });
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.sortBy(true, 'Modified Date');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
let idList = await contentServices.getElementsDisplayedId();
|
||||
let numberOfElements = await contentServices.numberOfResultsDisplayed();
|
||||
|
||||
let nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements);
|
||||
let modifiedDateList = [];
|
||||
for (let i = 0; i < nodeList.length; i++) {
|
||||
modifiedDateList.push(new Date(nodeList[i].entry.modifiedAt));
|
||||
}
|
||||
expect(contentServices.checkElementsSortedAsc(modifiedDateList)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277289] Should be able to sort the search results by "Modified Date" DESC', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.options.push({ 'key': 'Modified Date', 'label': 'Modified Date', 'type': 'FIELD', 'field': 'cm:modified', 'ascending': true });
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed()
|
||||
.sortBy(false, 'Modified Date');
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
let idList = await contentServices.getElementsDisplayedId();
|
||||
let numberOfElements = await contentServices.numberOfResultsDisplayed();
|
||||
|
||||
let nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements);
|
||||
let modifiedDateList = [];
|
||||
for (let i = 0; i < nodeList.length; i++) {
|
||||
modifiedDateList.push(new Date(nodeList[i].entry.modifiedAt));
|
||||
}
|
||||
expect(contentServices.checkElementsSortedAsc(modifiedDateList)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C277290] Should be able to sort the search results by "Size" ASC', () => {
|
||||
searchResults.sortBySize(true);
|
||||
expect(searchResults.checkListIsOrderedBySizeAsc()).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277291] Should be able to sort the search results by "Size" DESC', () => {
|
||||
searchResults.sortBySize(false);
|
||||
expect(searchResults.checkListIsOrderedBySizeDesc()).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277301] Should be able to change default sorting option for the search results', () => {
|
||||
let searchConfiguration = new SearchConfiguration();
|
||||
jsonFile = searchConfiguration.getConfiguration();
|
||||
navigationBar.clickConfigEditorButton();
|
||||
configEditor.clickSearchConfiguration();
|
||||
configEditor.clickClearButton();
|
||||
jsonFile.sorting.defaults[0] = { 'key': 'Size', 'label': 'Size', 'type': 'FIELD', 'field': 'content.size', 'ascending': true };
|
||||
configEditor.enterBigConfigurationText(JSON.stringify(jsonFile));
|
||||
configEditor.clickSaveButton();
|
||||
|
||||
searchDialog.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search);
|
||||
|
||||
searchSortingPicker.checkSortingSelectorIsDisplayed();
|
||||
expect(searchResults.checkListIsOrderedBySizeAsc()).toBe(true);
|
||||
});
|
||||
});
|
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { browser, protractor } from 'protractor';
|
||||
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { SearchDialog } from '../pages/adf/dialog/searchDialog';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
import { FilePreviewPage } from '../pages/adf/filePreviewPage';
|
||||
import { SearchResultsPage } from '../pages/adf/searchResultsPage';
|
||||
import { SearchFiltersPage } from '../../pages/adf/searchFiltersPage';
|
||||
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
@@ -34,7 +33,7 @@ import { Util } from '../util/util';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
||||
xdescribe('Search component - Search Bar', () => {
|
||||
describe('Search component - Search Bar', () => {
|
||||
|
||||
let search = {
|
||||
inactive: {
|
||||
@@ -50,7 +49,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
let searchDialog = new SearchDialog();
|
||||
let searchResultPage = new SearchResultsPage();
|
||||
let filePreviewPage = new FilePreviewPage();
|
||||
const searchFilters = new SearchFiltersPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
||||
@@ -91,9 +89,9 @@ xdescribe('Search component - Search Bar', () => {
|
||||
let firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
|
||||
Object.assign(firstFileModel, firstFileUploaded.entry);
|
||||
|
||||
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, firstFolderModel.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, secondFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.uploadFolder(this.alfrescoJsApi, thirdFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, firstFolderModel.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, secondFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, thirdFolder.name, '-my-'));
|
||||
|
||||
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
|
||||
|
||||
@@ -113,8 +111,9 @@ xdescribe('Search component - Search Bar', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
afterEach(async (done) => {
|
||||
await browser.get(TestConfig.adf.url);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272798] Search bar should be visible', () => {
|
||||
@@ -127,8 +126,9 @@ xdescribe('Search component - Search Bar', () => {
|
||||
.checkSearchBarIsVisible()
|
||||
.checkSearchIconIsVisible();
|
||||
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.checkSearchBarIsNotVisible()
|
||||
.checkSearchIconIsVisible();
|
||||
});
|
||||
@@ -138,13 +138,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterText(firstFolderModel.shortName);
|
||||
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.checkSearchBarIsNotVisible()
|
||||
.checkSearchIconIsVisible();
|
||||
|
||||
contentServicesPage.checkAcsContainer();
|
||||
});
|
||||
|
||||
it('[C260255] Should display message when searching for an inexistent file', () => {
|
||||
@@ -154,9 +147,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
.checkNoResultMessageIsNotDisplayed()
|
||||
.enterText(search.inactive.name)
|
||||
.checkNoResultMessageIsDisplayed();
|
||||
|
||||
searchDialog.clearText();
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
});
|
||||
|
||||
it('[C260256] Should display file/folder in search suggestion when typing first characters', () => {
|
||||
@@ -172,7 +162,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
expect(searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
|
||||
|
||||
searchDialog.clearText();
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
|
||||
searchDialog.clickOnSearchIcon().enterText(firstFileModel.shortName);
|
||||
searchDialog.resultTableContainsRow(firstFileModel.name);
|
||||
@@ -181,9 +170,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
expect(searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
|
||||
|
||||
expect(searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
|
||||
|
||||
searchDialog.clearText();
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
});
|
||||
|
||||
it('[C272800] Should display file/folder in search suggestion when typing name', () => {
|
||||
@@ -199,7 +185,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
expect(searchDialog.getSpecificRowsCompleteName(firstFolderModel.name)).toEqual(firstFolderModel.name);
|
||||
|
||||
searchDialog.clearText();
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
|
||||
searchDialog.clickOnSearchIcon().enterText(firstFileModel.name);
|
||||
searchDialog.resultTableContainsRow(firstFileModel.name);
|
||||
@@ -207,9 +192,6 @@ xdescribe('Search component - Search Bar', () => {
|
||||
expect(searchDialog.getSpecificRowsHighlightName(firstFileModel.name)).toEqual(firstFileModel.name);
|
||||
expect(searchDialog.getSpecificRowsAuthor(firstFileModel.name)).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
|
||||
expect(searchDialog.getSpecificRowsCompleteName(firstFileModel.name)).toEqual(firstFileModel.name);
|
||||
|
||||
searchDialog.clearText();
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
});
|
||||
|
||||
it('[C260257] Should display content when clicking on folder from search suggestions', () => {
|
||||
@@ -221,14 +203,8 @@ xdescribe('Search component - Search Bar', () => {
|
||||
searchDialog.resultTableContainsRow(firstFolderModel.name);
|
||||
searchDialog.clickOnSpecificRow(firstFolderModel.name);
|
||||
|
||||
contentServicesPage
|
||||
.checkAcsContainer()
|
||||
.waitForTableBody();
|
||||
|
||||
expect(contentServicesPage.currentFolderName()).toEqual(firstFolderModel.name);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
searchDialog
|
||||
.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
@@ -280,7 +256,7 @@ xdescribe('Search component - Search Bar', () => {
|
||||
.enterText(secondFolder.shortName)
|
||||
.pressDownArrowAndEnter();
|
||||
|
||||
contentServicesPage.checkAcsContainer();
|
||||
searchResultPage.tableIsLoaded();
|
||||
expect(contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
|
||||
});
|
||||
|
||||
|
@@ -86,8 +86,8 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
await uploadActions.uploadFolder(this.alfrescoJsApi, emptyFolderModel.name, '-my-');
|
||||
let newFolderModelUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, newFolderModel.name, '-my-');
|
||||
await uploadActions.createFolder(this.alfrescoJsApi, emptyFolderModel.name, '-my-');
|
||||
let newFolderModelUploaded = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-');
|
||||
|
||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, newFolderModelUploaded.entry.id);
|
||||
|
||||
@@ -97,7 +97,7 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, adminFileNames, newFolderModelUploaded.entry.id);
|
||||
|
||||
browser.driver.sleep(12000);
|
||||
browser.driver.sleep(15000);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
@@ -181,15 +181,18 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
describe('Sorting', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272803] Should be able to sort results by name (Ascending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByName(true).then((result) => {
|
||||
@@ -198,9 +201,6 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
|
||||
it('[C272804] Should be able to sort results by name (Descending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByName(false).then((result) => {
|
||||
@@ -209,32 +209,23 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
|
||||
it('[C272805] Should be able to sort results by author (Ascending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
|
||||
searchResultPage.sortAndCheckListIsOrderedByAuthor(true).then((result) => {
|
||||
searchResultPage.sortAndCheckListIsOrderedByAuthor(this.alfrescoJsApi, true).then((result) => {
|
||||
expect(result).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C272806] Should be able to sort results by author (Descending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByAuthor(false).then((result) => {
|
||||
searchResultPage.sortAndCheckListIsOrderedByAuthor(this.alfrescoJsApi, false).then((result) => {
|
||||
expect(result).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C272807] Should be able to sort results by date (Ascending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByCreated(true).then((result) => {
|
||||
@@ -243,9 +234,6 @@ describe('Search component - Search Page', () => {
|
||||
});
|
||||
|
||||
it('[C260260] Should be able to sort results by date (Descending)', () => {
|
||||
searchDialog
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByCreated(false).then((result) => {
|
||||
|
Reference in New Issue
Block a user