mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Test improve (#6146)
* fix * fix datatable wait method * slow down isEmpty check * fix * fix * fix
This commit is contained in:
@@ -141,7 +141,7 @@ describe('Favorite directive', () => {
|
||||
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
|
||||
|
||||
await navigationBarPage.clickTrashcanButton();
|
||||
await trashcanPage.waitForTableBody();
|
||||
await trashcanPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1);
|
||||
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
|
||||
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
|
||||
|
||||
@@ -92,6 +92,10 @@ export class LoginShellPage {
|
||||
return BrowserActions.getText(this.loginError);
|
||||
}
|
||||
|
||||
async checkLoginErrorIsDisplayed(loginError: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasText(this.loginError, loginError);
|
||||
}
|
||||
|
||||
async checkLoginImgURL(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoImg);
|
||||
return this.logoImg.getAttribute('src');
|
||||
|
||||
@@ -55,7 +55,7 @@ export class NotificationDemoPage {
|
||||
}
|
||||
|
||||
async waitForSnackBarToClose(): Promise<void> {
|
||||
await this.snackbarPage.waitForSnackBarToClose();
|
||||
await this.snackbarPage.waitForSnackBarToClose(15000);
|
||||
}
|
||||
|
||||
async enterMessageField(text: string): Promise<void> {
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('Settings component', () => {
|
||||
await loginPage.enterUsername(browser.params.testConfig.admin.email);
|
||||
await loginPage.enterPassword(browser.params.testConfig.admin.password);
|
||||
await loginPage.clickSignInButton();
|
||||
await expect(await loginPage.getLoginError()).toMatch(loginError);
|
||||
await loginPage.checkLoginErrorIsDisplayed(loginError);
|
||||
});
|
||||
|
||||
it('[C291952] Should not be able to sign in with invalid Process Services Url', async () => {
|
||||
@@ -93,7 +93,7 @@ describe('Settings component', () => {
|
||||
await loginPage.enterUsername(browser.params.testConfig.admin.email);
|
||||
await loginPage.enterPassword(browser.params.testConfig.admin.password);
|
||||
await loginPage.clickSignInButton();
|
||||
await expect(await loginPage.getLoginError()).toMatch(loginError);
|
||||
await loginPage.checkLoginErrorIsDisplayed(loginError);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
});
|
||||
|
||||
describe('Edit task filters and task list properties - filter properties', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
|
||||
@@ -259,23 +259,34 @@ describe('Start Task - Custom App', () => {
|
||||
it('[C286404] Navigate using page field', async () => {
|
||||
currentPage = 1;
|
||||
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
|
||||
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await taskListSinglePage.typePage(currentPage);
|
||||
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
|
||||
|
||||
await paginationPage.checkPageSelectorIsDisplayed();
|
||||
|
||||
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
|
||||
});
|
||||
|
||||
currentPage++;
|
||||
|
||||
await taskListSinglePage.typePage(currentPage);
|
||||
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
|
||||
|
||||
await paginationPage.checkPageSelectorIsDisplayed();
|
||||
|
||||
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
|
||||
});
|
||||
@@ -283,9 +294,12 @@ describe('Start Task - Custom App', () => {
|
||||
currentPage++;
|
||||
await taskListSinglePage.typePage(currentPage);
|
||||
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
|
||||
|
||||
await paginationPage.checkPageSelectorIsDisplayed();
|
||||
|
||||
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
|
||||
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
|
||||
@@ -294,10 +308,14 @@ describe('Start Task - Custom App', () => {
|
||||
currentPage++;
|
||||
await taskListSinglePage.typePage(currentPage);
|
||||
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
|
||||
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
|
||||
|
||||
await paginationPage.checkPageSelectorIsDisplayed();
|
||||
|
||||
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
BrowserActions,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
@@ -83,7 +82,10 @@ describe('Search Checklist Component', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickContentServicesButton();
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/search;q=${randomName}`);
|
||||
await searchBarPage.checkSearchIconIsVisible();
|
||||
await searchBarPage.clickOnSearchIcon();
|
||||
await searchBarPage.enterTextAndPressEnter(randomName);
|
||||
await searchResults.dataTable.waitTillContentLoaded();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
Reference in New Issue
Block a user