[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
+4 -1
View File
@@ -18,6 +18,7 @@
import { ApiService, BrowserActions, ErrorPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
import { ContentServicesPage } from './pages/content-services.page';
describe('Error Component', () => {
@@ -28,12 +29,14 @@ describe('Error Component', () => {
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const contentServicesPage = new ContentServicesPage();
beforeAll(async () => {
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await usersActions.createUser(acsUser);
await loginPage.login(acsUser.email, acsUser.password);
});
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
+5 -14
View File
@@ -74,7 +74,6 @@ describe('Enable infinite scrolling', () => {
emptyFolderModel = await uploadActions.createFolder('emptyFolder', '-my-');
await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
deleteUploaded = await uploadActions.createFolder('deleteFolder', '-my-');
await uploadActions.createEmptyFiles(deleteFileNames, deleteUploaded.entry.id);
@@ -86,11 +85,11 @@ describe('Enable infinite scrolling', () => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
});
it('[C260484] Should be possible to enable infinite scrolling', async () => {
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.openFolder(folderModel.name);
await contentServicesPage.enableInfiniteScrolling();
await infinitePaginationPage.clickLoadMoreButton();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
@@ -120,9 +119,7 @@ describe('Enable infinite scrolling', () => {
});
it('[C299201] Should use default pagination settings for infinite pagination', async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.openFolder(folderModel.name);
await contentServicesPage.enableInfiniteScrolling();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
@@ -138,10 +135,7 @@ describe('Enable infinite scrolling', () => {
it('[C299202] Should not display load more button when all the files are already displayed', async () => {
await LocalStorageUtil.setUserPreference('paginationSize', '30');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderModel.name);
await contentServicesPage.openFolder(folderModel.name);
await contentServicesPage.enableInfiniteScrolling();
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
@@ -150,10 +144,7 @@ describe('Enable infinite scrolling', () => {
});
it('[C299203] Should not display load more button when a folder is empty', async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(emptyFolderModel.entry.name);
await contentServicesPage.openFolder(emptyFolderModel.entry.name);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
});
+14 -5
View File
@@ -38,7 +38,12 @@ describe('Login component - SSO', () => {
it('[C261050] Should be possible login with SSO', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId);
browser.params.testConfig.appConfig.identityHost,
false,
true,
browser.params.testConfig.appConfig.oauth2.clientId,
browser.params.testConfig.appConfig.oauth2.redirectUriLogout);
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
});
@@ -49,18 +54,22 @@ describe('Login component - SSO', () => {
browser.params.testConfig.appConfig.identityHost,
true,
true,
browser.params.testConfig.appConfig.oauth2.clientId
);
browser.params.testConfig.appConfig.oauth2.clientId,
browser.params.testConfig.appConfig.oauth2.redirectUriLogout);
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
});
});
});
describe('Login component - SSO Grant type password (implicit flow false)', () => {
it('[C299158] Should be possible to login with SSO, with grant type password (Implicit Flow false)', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, false, browser.params.testConfig.appConfig.oauth2.clientId);
browser.params.testConfig.appConfig.identityHost,
false,
false,
browser.params.testConfig.appConfig.oauth2.clientId,
browser.params.testConfig.appConfig.oauth2.redirectUriLogout);
await loginPage.waitForElements();
+2 -4
View File
@@ -15,22 +15,20 @@
* limitations under the License.
*/
import { LoginPage, SettingsPage } from '@alfresco/adf-testing';
import { BrowserActions, LoginPage, SettingsPage } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../../core/pages/navigation-bar.page';
describe('Logout component - SSO', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
it('[C280665] Should be possible change the logout redirect URL', async () => {
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId, '/login');
await loginSSOPage.loginSSOIdentityService(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
await navigationBarPage.clickLogoutButton();
await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]');
await browser.sleep(2000);
+9 -5
View File
@@ -275,22 +275,26 @@ export class ContentServicesPage {
return BrowserActions.getText(this.recentFileIcon);
}
// @deprecated prefer waitTillContentLoaded
async checkDocumentListElementsAreDisplayed(): Promise<void> {
await this.checkAcsContainer();
await this.waitForTableBody();
}
// @deprecated prefer waitTillContentLoaded
async checkAcsContainer(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
}
// @deprecated prefer waitTillContentLoaded
async waitForTableBody(): Promise<void> {
await this.contentList.waitForTableBody();
await this.contentList.dataTablePage().waitTillContentLoaded();
}
async goToDocumentList(): Promise<void> {
const navigationBarPage = new NavigationBarPage();
await navigationBarPage.clickContentServicesButton();
await this.contentList.dataTablePage().waitTillContentLoaded();
}
async clickOnContentServices(): Promise<void> {
@@ -352,10 +356,9 @@ export class ContentServicesPage {
return this.checkListIsSortedByCreatedColumn(sortOrder);
}
async doubleClickRow(nodeName): Promise<void> {
Logger.log(`Open Folder ${nodeName}`);
async doubleClickRow(nodeName: string): Promise<void> {
Logger.log(`Open Folder/File ${nodeName}`);
await this.contentList.doubleClickRow(nodeName);
await this.contentList.dataTablePage().waitTillContentLoaded();
}
async selectRow(nodeName): Promise<void> {
@@ -405,6 +408,7 @@ export class ContentServicesPage {
async openFolder(folderName: string): Promise<void> {
await this.doubleClickRow(folderName);
await this.contentList.dataTablePage().waitTillContentLoaded();
}
async checkContentIsDisplayed(content): Promise<void> {
@@ -695,7 +699,7 @@ export class ContentServicesPage {
async selectItemWithCheckbox(itemName: string): Promise<void> {
const item = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
await BrowserVisibility.waitUntilElementIsVisible(item);
await BrowserActions.clickScript(item);
await BrowserActions.click(item);
}
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element, browser, protractor } from 'protractor';
import { by, element, protractor } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class CreateLibraryDialogPage {
@@ -47,7 +47,7 @@ export class CreateLibraryDialogPage {
}
async isDialogOpen(): Promise<any> {
return browser.isElementPresent(this.libraryDialog);
return BrowserVisibility.waitUntilElementIsVisible(this.libraryDialog);
}
async getTitle(): Promise<string> {
+4 -3
View File
@@ -15,7 +15,8 @@
* limitations under the License.
*/
import { browser, by, element, ElementFinder } from 'protractor';
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility } from '@alfresco/adf-testing';
export class IconsPage {
@@ -28,7 +29,7 @@ export class IconsPage {
}
async isCustomIconDisplayed(name: string) {
const present = await browser.isElementPresent(this.locateCustomIcon(name));
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
if (present) {
return this.locateCustomIcon(name).isDisplayed();
} else {
@@ -37,7 +38,7 @@ export class IconsPage {
}
async isLigatureIconDisplayed(name: string) {
const present = await browser.isElementPresent(this.locateLigatureIcon(name));
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateLigatureIcon(name));
if (present) {
return this.locateLigatureIcon(name).isDisplayed();
} else {
+18 -5
View File
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { AppListCloudPage, BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
import { AppListCloudPage, BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { browser, by, element, ElementFinder } from 'protractor';
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
@@ -35,8 +35,11 @@ export class NavigationBarPage {
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]'));
peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]'));
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
async clickNavigationBarItem(title: string): Promise<void> {
Logger.log(`clickNavigationBarItem ${title}`);
const menu = element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(menu);
@@ -63,8 +66,8 @@ export class NavigationBarPage {
}
async clickProcessCloudButton() {
await this.clickNavigationBarItem('Process Cloud');
await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer);
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Cloud'), this.linkMenuChildrenContainer);
}
async navigateToProcessServicesCloudPage(): Promise<AppListCloudPage> {
@@ -87,8 +90,12 @@ export class NavigationBarPage {
}
async clickProcessServicesButton() {
await this.clickNavigationBarItem('Process Services');
await BrowserVisibility.waitUntilElementIsVisible(this.linkMenuChildrenContainer);
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer);
}
private getMenuItem(title: string) {
return element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
}
async navigateToProcessServicesPage(): Promise<ProcessServicesPage> {
@@ -172,8 +179,14 @@ export class NavigationBarPage {
}
async clickLogoutButton(): Promise<void> {
Logger.log('Logout');
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.clickExecuteScript('.app-sidenav-link[adf-logout]');
try {
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
} catch (error) {
}
}
async clickThemeButton(): Promise<void> {
@@ -143,7 +143,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
await paginationPage.clickOnNextPage();
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.doubleClickRow(lastFolderResponse.entry.name);
await contentServicesPage.openFolder(lastFolderResponse.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFileInfo.name);
await viewerPage.viewFile(pngFileUploaded.entry.name);
@@ -88,7 +88,7 @@ describe('Viewer', () => {
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await viewerPage.viewFile(pngFileUploaded.entry.name);
@@ -15,8 +15,16 @@
* limitations under the License.
*/
import { browser } from 'protractor';
import { ApiService, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
import { browser, by, element, protractor } from 'protractor';
import {
ApiService,
BrowserActions,
LoginPage,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -102,7 +110,7 @@ describe('Content Services Viewer', () => {
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
});
});
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pdfFile.getId());
@@ -113,11 +121,9 @@ describe('Content Services Viewer', () => {
await uploadActions.deleteFileOrFolder(pptFile.getId());
await uploadActions.deleteFileOrFolder(unsupportedFile.getId());
await navigationBarPage.clickLogoutButton();
});
});
it('[C260038] Should display first page, toolbar and pagination when opening a .pdf file', async () => {
await contentServicesPage.checkAcsContainer();
await viewerPage.viewFile(pdfFile.name);
await viewerPage.checkZoomInButtonIsDisplayed();
@@ -369,7 +375,9 @@ describe('Content Services Viewer', () => {
});
it('[C269109] Should not be able to open thumbnail panel before the pdf is loaded', async () => {
await viewerPage.viewFile(pdfFile.name);
const fileView = element.all(by.css(`#document-list-container div[data-automation-id="${pdfFile.name}"]`)).first();
await BrowserActions.click(fileView);
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
await viewerPage.checkThumbnailsBtnIsDisabled();
-2
View File
@@ -68,8 +68,6 @@ describe('Viewer - properties', () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await viewerPage.viewFile(pngFile.name);
await viewerPage.clickLeftSidebarButton();