[ADF-5235] Facet fix and improve search test (#6122)

* improve search test

* fix

* fix

* fix

* changes

* modify

* logout public URL

* improve stability some e2e

* fx lint

* fix

* fix

* improve

* fix

* improve

* fix

* fix

* fix

* fix [skip ci]

* fix

* some fix [skip ci]

* fix

* fix lint

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* convert C291893 in manual test case in testrail

* fix

* fix
This commit is contained in:
Eugenio Romano
2020-09-21 09:35:01 +01:00
committed by GitHub
parent 9c427b3142
commit 46ccda68b3
111 changed files with 987 additions and 604 deletions

View File

@@ -102,7 +102,7 @@ describe('Search Filters', () => {
await loginPage.login(acsUser.email, acsUser.password);
await browser.sleep(15000); // wait search index previous file/folder uploaded
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
jsonFile = SearchConfiguration.getConfiguration();
});
@@ -123,6 +123,7 @@ describe('Search Filters', () => {
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter(fileUploaded.entry.name);
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkSearchFiltersIsDisplayed();
@@ -175,51 +176,21 @@ describe('Search Filters', () => {
});
});
it('[C291802] Should be able to filter facet fields with "Contains"', async () => {
await navigationBarPage.clickContentServicesButton();
jsonFile['filterWithContains'] = true;
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.tableIsLoaded();
await searchFiltersPage.creatorCheckListFiltersPage().searchInFilter('dminis');
await searchFiltersPage.creatorCheckListFiltersPage().checkCheckListOptionIsDisplayed('Administrator');
});
it('[C291980] Should group search facets under specified labels', async () => {
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed();
await searchFiltersPage.checkTypeFacetQueryGroupIsDisplayed();
await searchFiltersPage.checkSizeFacetQueryGroupIsDisplayed();
});
it('[C291981] Should group search facets under the default label, by default', async () => {
await navigationBarPage.clickContentServicesButton();
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.tableIsLoaded();
await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed();
await expect(await searchFiltersPage.isTypeFacetQueryGroupPresent()).toBe(false);
await expect(await searchFiltersPage.isSizeFacetQueryGroupPresent()).toBe(false);
});
it('[C297509] Should display search intervals under specified labels from config', async () => {
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkFacetIntervalsByCreatedIsDisplayed();
await searchFiltersPage.checkFacetIntervalsByCreatedIsExpanded();
@@ -240,9 +211,9 @@ describe('Search Filters', () => {
await searchBarPage.checkSearchIconIsVisible();
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter(fileTypeTxt1.entry.name);
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkSearchFiltersIsDisplayed();
await searchResults.tableIsLoaded();
await searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name);
await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (1)');
await searchFiltersPage.checkFileTypeFacetLabelIsNotDisplayed('JPEG Image');
@@ -251,27 +222,59 @@ describe('Search Filters', () => {
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter(fileNamePrefix);
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkSearchFiltersIsDisplayed();
await searchResults.tableIsLoaded();
await searchResults.checkContentIsDisplayed(fileTypeTxt1.entry.name);
await searchResults.checkContentIsDisplayed(fileTypeTxt2.entry.name);
await searchResults.checkContentIsDisplayed(fileTypeJpg.entry.name);
await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('Plain Text (2)');
await searchFiltersPage.checkFileTypeFacetLabelIsDisplayed('JPEG Image (1)');
});
});
it('[C299124] Should be able to parse escaped empty spaced labels inside facetFields', async () => {
await navigationBarPage.clickContentServicesButton();
describe('Change config', () => {
jsonFile.facetFields.fields[0].label = 'My File Types';
jsonFile.facetFields.fields[1].label = 'My File Sizes';
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
it('[C291802] Should be able to filter facet fields with "Contains"', async () => {
await navigationBarPage.clickContentServicesButton();
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
jsonFile['filterWithContains'] = true;
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchResults.tableIsLoaded();
await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Types');
await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Sizes');
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.creatorCheckListFiltersPage().searchInFilter('dminis');
await searchFiltersPage.creatorCheckListFiltersPage().checkCheckListOptionIsDisplayed('Administrator');
});
it('[C291981] Should group search facets under the default label, by default', async () => {
await navigationBarPage.clickContentServicesButton();
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkDefaultFacetQueryGroupIsDisplayed();
await expect(await searchFiltersPage.isTypeFacetQueryGroupPresent()).toBe(false);
await expect(await searchFiltersPage.isSizeFacetQueryGroupPresent()).toBe(false);
});
it('[C299124] Should be able to parse escaped empty spaced labels inside facetFields', async () => {
await navigationBarPage.clickContentServicesButton();
jsonFile.facetFields.fields[0].label = 'My File Types';
jsonFile.facetFields.fields[1].label = 'My File Sizes';
await LocalStorageUtil.setConfigField('search', JSON.stringify(jsonFile));
await searchBarPage.clickOnSearchIcon();
await searchBarPage.enterTextAndPressEnter('*');
await searchResults.dataTable.waitTillContentLoaded();
await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Types');
await searchFiltersPage.checkCustomFacetFieldLabelIsDisplayed('My File Sizes');
});
});
});