[ADF-3401] Filter facets are not reseted when updating the search query (#4425)

* C299200 automated

* Test package version

* Save the head of development into a tmp file (this will avoid error in case of rebase meanwhile the pipeline is running)
Remove the -gnu in the wrong position

* Update test-e2e-lib.sh

* Print adf version on each step

* Print adf version on each step

* Add console log and skip install on the unit test demo shell

* Remove the print dependendy
This commit is contained in:
gmandakini
2019-03-13 10:39:55 +00:00
committed by Eugenio Romano
parent 3136580bba
commit fca9e51c16
6 changed files with 103 additions and 32 deletions

View File

@@ -148,6 +148,7 @@ export class SearchFiltersPage {
this.searchCategoriesPage.clickFilterHeader(this.fileSizeFilter);
return this;
}
checkFileSizeFilterIsCollapsed() {
this.searchCategoriesPage.checkFilterIsCollapsed(this.fileSizeFilter);
return this;
@@ -280,4 +281,15 @@ export class SearchFiltersPage {
this.searchCategoriesPage.clickFilterHeader(this.facetIntervalsByModified);
return this;
}
checkFileTypeFacetLabelIsDisplayed(fileType) {
Util.waitUntilElementIsVisible(this.fileTypeFilter.element(by.cssContainingText('.adf-facet-label', fileType)));
return this;
}
checkFileTypeFacetLabelIsNotDisplayed(fileType) {
Util.waitUntilElementIsNotVisible(this.fileTypeFilter.element(by.cssContainingText('.adf-facet-label', fileType)));
return this;
}
}

View File

@@ -51,6 +51,10 @@ describe('Search Filters', () => {
let acsUser = new AcsUserModel();
let filename = Util.generateRandomString(16);
let fileNamePrefix = Util.generateRandomString(5);
let uniqueFileName1 = fileNamePrefix + Util.generateRandomString(5);
let uniqueFileName2 = fileNamePrefix + Util.generateRandomString(5);
let uniqueFileName3 = fileNamePrefix + Util.generateRandomString(5);
let fileModel = new FileModel({
'name': filename, 'shortName': filename.substring(0, 8)
@@ -61,7 +65,22 @@ describe('Search Filters', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let fileUploaded, fileTypePng;
let txtFileModel1 = new FileModel({
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location,
'name': `${uniqueFileName1}.txt`
});
let jpgFileModel = new FileModel({
'location': resources.Files.ADF_DOCUMENTS.JPG.file_location,
'name': `${uniqueFileName2}.jpg`
});
let txtFileModel2 = new FileModel({
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location,
'name': `${uniqueFileName3}.txt`
});
let fileUploaded, fileTypePng, fileTypeTxt1, fileTypeJpg, fileTypeTxt2;
let filter = { type: 'TYPE-PNG Image' };
@@ -84,6 +103,12 @@ describe('Search Filters', () => {
fileTypePng = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
fileTypeTxt1 = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel1.location, txtFileModel1.name, '-my-');
fileTypeJpg = await uploadActions.uploadFile(this.alfrescoJsApi, jpgFileModel.location, jpgFileModel.name, '-my-');
fileTypeTxt2 = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel2.location, txtFileModel2.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.driver.sleep(30000); // wait search index previous file/folder uploaded
@@ -102,6 +127,9 @@ describe('Search Filters', () => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileUploaded.entry.id);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTypePng.entry.id);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTypeTxt1.entry.id);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTypeTxt2.entry.id);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, fileTypeJpg.entry.id);
done();
});
@@ -225,6 +253,26 @@ describe('Search Filters', () => {
.checkFacetIntervalsByModifiedIsExpanded();
});
it('[C299200] Should reset the filters facet with search query', () => {
searchDialog.enterTextAndPressEnter(fileTypeTxt1.entry.name);
searchFiltersPage.checkSearchFiltersIsDisplayed();
searchResults.tableIsLoaded();
searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name);
searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (1)');
searchFiltersPage.checkFileTypeFacetLabelIsNotDisplayed('JPEG Image');
searchDialog.enterTextAndPressEnter(fileNamePrefix);
searchFiltersPage.checkSearchFiltersIsDisplayed();
searchResults.tableIsLoaded();
searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name);
searchResults.checkContentIsDisplayed(fileTypeTxt2.entry.name);
searchResults.checkContentIsDisplayed(fileTypeJpg.entry.name);
searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (2)');
searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('JPEG Image (1)');
});
it('[C299124] Should be able to parse escaped empty spaced labels inside facetFields', () => {
navigationBar.clickConfigEditorButton();
configEditor.clickSearchConfiguration();