mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
include attach file test (#6102)
* include attach file test * fix * fix * fix * fix
This commit is contained in:
@@ -93,6 +93,8 @@ describe('Enable infinite scrolling', () => {
|
||||
await contentServicesPage.doubleClickRow(folderModel.name);
|
||||
await contentServicesPage.enableInfiniteScrolling();
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||
|
||||
for (let i = 0; i < nrOfFiles; i++) {
|
||||
await contentServicesPage.checkContentIsDisplayed(fileNames[i]);
|
||||
}
|
||||
@@ -102,6 +104,8 @@ describe('Enable infinite scrolling', () => {
|
||||
await contentServicesPage.openFolder(deleteUploaded.entry.name);
|
||||
await contentServicesPage.enableInfiniteScrolling();
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||
|
||||
for (let i = 0; i < nrOfDeletedFiles; i++) {
|
||||
await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
|
||||
}
|
||||
@@ -121,15 +125,14 @@ describe('Enable infinite scrolling', () => {
|
||||
await contentServicesPage.doubleClickRow(folderModel.name);
|
||||
|
||||
await contentServicesPage.enableInfiniteScrolling();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
|
||||
await infinitePaginationPage.clickLoadMoreButton();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||
|
||||
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
});
|
||||
|
||||
it('[C299202] Should not display load more button when all the files are already displayed', async () => {
|
||||
|
@@ -15,7 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DropActions, BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, TogglePage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import {
|
||||
DropActions,
|
||||
BrowserActions,
|
||||
BrowserVisibility,
|
||||
DateUtil,
|
||||
DocumentListPage,
|
||||
TogglePage,
|
||||
DropdownPage,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||
@@ -344,6 +353,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async doubleClickRow(nodeName): Promise<void> {
|
||||
Logger.log(`Open Folder ${nodeName}`);
|
||||
await this.contentList.doubleClickRow(nodeName);
|
||||
await this.contentList.dataTablePage().waitTillContentLoaded();
|
||||
}
|
||||
@@ -648,9 +658,11 @@ export class ContentServicesPage {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.multiSelectToggle);
|
||||
}
|
||||
|
||||
async multiSelectToggleIsEnabled(): Promise<boolean> {
|
||||
return this.multiSelectToggle.isEnabled();
|
||||
}
|
||||
|
||||
async clickSelectAllCheckbox(): Promise<void> {
|
||||
await BrowserActions.click(this.selectAllCheckbox);
|
||||
}
|
||||
|
@@ -103,6 +103,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
@@ -111,7 +112,6 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
@@ -135,6 +135,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
|
||||
await paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
|
@@ -46,7 +46,8 @@ describe('Attach File - Content service', () => {
|
||||
|
||||
const apiServiceExternal = new ApiService({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_external_acs.host
|
||||
hostEcm: browser.params.testConfig.adf_external_acs.host,
|
||||
authType: 'BASIC'
|
||||
});
|
||||
const usersActionsExternal = new UsersActions(apiServiceExternal);
|
||||
|
||||
@@ -81,8 +82,16 @@ describe('Attach File - Content service', () => {
|
||||
await apiServiceExternal.login(email, password);
|
||||
await usersActionsExternal.createUser(user);
|
||||
|
||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[0], host: browser.params.testConfig.appConfig.ecmHost });
|
||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[1], host: browser.params.testConfig.adf_external_acs.host });
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
|
||||
await apiService.getInstance().login(user.email, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
@@ -115,6 +124,8 @@ describe('Attach File - Content service', () => {
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||
|
||||
await contentNodeSelector.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
|
@@ -136,6 +136,7 @@ exports.config = {
|
||||
'--no-sandbox',
|
||||
'--disable-web-security',
|
||||
'--disable-browser-side-navigation',
|
||||
'-allow-running-insecure-content',
|
||||
...(BROWSER_RUN === true ? [] : ['--headless'])]
|
||||
}
|
||||
},
|
||||
|
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"C362240": "Include once ADF starts using ACS 7 , https://issues.alfresco.com/jira/browse/ADF-5182",
|
||||
"C362241": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182",
|
||||
"C291980": "Facet not working",
|
||||
"C291981": "Facet not working",
|
||||
"C299200": "Facet not working",
|
||||
"C297509": "Facet not working",
|
||||
"C291980": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||
"C291981": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||
"C299200": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||
"C297509": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||
"C277751": "setting problem APS not basic",
|
||||
"C277752": "setting problem APS not basic",
|
||||
"C277753": "setting problem APS not basic",
|
||||
@@ -13,12 +13,7 @@
|
||||
"C279932": "login problem APS not basic",
|
||||
"C279931": "login problem APS not basic",
|
||||
"C279930": "login problem APS not basic",
|
||||
"C315268": "Attach file issue",
|
||||
"C246522": "Attach file issue",
|
||||
"C299040": "Attach file issue",
|
||||
"C286516": "Attach file issue",
|
||||
"C246534": "Attach file issue",
|
||||
"C279886": "Attach file issue",
|
||||
"C246534": "https://issues.alfresco.com/jira/browse/ADF-5236",
|
||||
"C291893": "flaky test"
|
||||
}
|
||||
|
||||
|
@@ -151,6 +151,7 @@ export class ContentNodeSelectorDialogPage {
|
||||
|
||||
async searchAndSelectResult(searchText: string, name: string) {
|
||||
await this.typeIntoNodeSelectorSearchField(searchText);
|
||||
await this.contentListPage().dataTablePage().waitTillContentLoaded();
|
||||
try {
|
||||
await this.contentListPage().dataTablePage().checkRowContentIsDisplayed(name);
|
||||
} catch (e) {
|
||||
|
@@ -300,6 +300,29 @@ export class DataTableComponentPage {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Logger.log('wait first element is present');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
|
||||
} catch (error) {
|
||||
Logger.log('Possible empty page');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async waitTillContentLoadedInfinitePagination(): Promise<void> {
|
||||
await browser.sleep(500);
|
||||
|
||||
if (element(by.tagName('mat-progress-bar')).isPresent()) {
|
||||
Logger.log('wait datatable loading spinner disappear');
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-bar')));
|
||||
} else {
|
||||
try {
|
||||
Logger.log('wait datatable loading spinner is present');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-bar')));
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Logger.log('wait first element is present');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Locator, by, element } from 'protractor';
|
||||
import { Locator, by, element, browser } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
import { Logger } from '../utils/logger';
|
||||
@@ -47,6 +47,7 @@ export class PaginationPage {
|
||||
await BrowserActions.click(itemsPerPage);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
|
||||
Logger.log('Select page size ', numberOfItem);
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async checkPageSelectorIsNotDisplayed(): Promise<void> {
|
||||
@@ -82,8 +83,8 @@ export class PaginationPage {
|
||||
}
|
||||
|
||||
async clickOnNextPage(): Promise<void> {
|
||||
return BrowserActions.click(this.nextPageButton);
|
||||
Logger.log('Next page');
|
||||
return BrowserActions.click(this.nextPageButton);
|
||||
}
|
||||
|
||||
async clickOnPageDropdown(): Promise<void> {
|
||||
|
Reference in New Issue
Block a user