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.doubleClickRow(folderModel.name);
|
||||||
await contentServicesPage.enableInfiniteScrolling();
|
await contentServicesPage.enableInfiniteScrolling();
|
||||||
await infinitePaginationPage.clickLoadMoreButton();
|
await infinitePaginationPage.clickLoadMoreButton();
|
||||||
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||||
|
|
||||||
for (let i = 0; i < nrOfFiles; i++) {
|
for (let i = 0; i < nrOfFiles; i++) {
|
||||||
await contentServicesPage.checkContentIsDisplayed(fileNames[i]);
|
await contentServicesPage.checkContentIsDisplayed(fileNames[i]);
|
||||||
}
|
}
|
||||||
@@ -102,6 +104,8 @@ describe('Enable infinite scrolling', () => {
|
|||||||
await contentServicesPage.openFolder(deleteUploaded.entry.name);
|
await contentServicesPage.openFolder(deleteUploaded.entry.name);
|
||||||
await contentServicesPage.enableInfiniteScrolling();
|
await contentServicesPage.enableInfiniteScrolling();
|
||||||
await infinitePaginationPage.clickLoadMoreButton();
|
await infinitePaginationPage.clickLoadMoreButton();
|
||||||
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||||
|
|
||||||
for (let i = 0; i < nrOfDeletedFiles; i++) {
|
for (let i = 0; i < nrOfDeletedFiles; i++) {
|
||||||
await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
|
await contentServicesPage.checkContentIsDisplayed(deleteFileNames[i]);
|
||||||
}
|
}
|
||||||
@@ -121,15 +125,14 @@ describe('Enable infinite scrolling', () => {
|
|||||||
await contentServicesPage.doubleClickRow(folderModel.name);
|
await contentServicesPage.doubleClickRow(folderModel.name);
|
||||||
|
|
||||||
await contentServicesPage.enableInfiniteScrolling();
|
await contentServicesPage.enableInfiniteScrolling();
|
||||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||||
|
|
||||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
|
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(pageSize);
|
||||||
await infinitePaginationPage.clickLoadMoreButton();
|
await infinitePaginationPage.clickLoadMoreButton();
|
||||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoadedInfinitePagination();
|
||||||
|
|
||||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
|
||||||
|
|
||||||
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
|
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 () => {
|
it('[C299202] Should not display load more button when all the files are already displayed', async () => {
|
||||||
|
@@ -15,7 +15,16 @@
|
|||||||
* limitations under the License.
|
* 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 { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||||
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||||
@@ -344,6 +353,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async doubleClickRow(nodeName): Promise<void> {
|
async doubleClickRow(nodeName): Promise<void> {
|
||||||
|
Logger.log(`Open Folder ${nodeName}`);
|
||||||
await this.contentList.doubleClickRow(nodeName);
|
await this.contentList.doubleClickRow(nodeName);
|
||||||
await this.contentList.dataTablePage().waitTillContentLoaded();
|
await this.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
}
|
}
|
||||||
@@ -648,9 +658,11 @@ export class ContentServicesPage {
|
|||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
await BrowserActions.click(this.multiSelectToggle);
|
await BrowserActions.click(this.multiSelectToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
async multiSelectToggleIsEnabled(): Promise<boolean> {
|
async multiSelectToggleIsEnabled(): Promise<boolean> {
|
||||||
return this.multiSelectToggle.isEnabled();
|
return this.multiSelectToggle.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickSelectAllCheckbox(): Promise<void> {
|
async clickSelectAllCheckbox(): Promise<void> {
|
||||||
await BrowserActions.click(this.selectAllCheckbox);
|
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 paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||||
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
|
|
||||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
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 expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||||
|
|
||||||
await paginationPage.clickOnNextPage();
|
await paginationPage.clickOnNextPage();
|
||||||
|
|
||||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
|
|
||||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
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 paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||||
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
await contentServicesPage.checkDocumentListElementsAreDisplayed();
|
||||||
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
|
|
||||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||||
|
@@ -46,11 +46,12 @@ describe('Attach File - Content service', () => {
|
|||||||
|
|
||||||
const apiServiceExternal = new ApiService({
|
const apiServiceExternal = new ApiService({
|
||||||
provider: 'ECM',
|
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);
|
const usersActionsExternal = new UsersActions(apiServiceExternal);
|
||||||
|
|
||||||
const apiService = new ApiService({ provider: 'ALL'});
|
const apiService = new ApiService({ provider: 'ALL' });
|
||||||
const integrationService = new IntegrationService(apiService);
|
const integrationService = new IntegrationService(apiService);
|
||||||
const applicationService = new ApplicationsUtil(apiService);
|
const applicationService = new ApplicationsUtil(apiService);
|
||||||
const uploadActions = new UploadActions(apiService);
|
const uploadActions = new UploadActions(apiService);
|
||||||
@@ -81,8 +82,16 @@ describe('Attach File - Content service', () => {
|
|||||||
await apiServiceExternal.login(email, password);
|
await apiServiceExternal.login(email, password);
|
||||||
await usersActionsExternal.createUser(user);
|
await usersActionsExternal.createUser(user);
|
||||||
|
|
||||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[0], host: browser.params.testConfig.appConfig.ecmHost });
|
await integrationService.addCSIntegration({
|
||||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[1], host: browser.params.testConfig.adf_external_acs.host });
|
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 apiService.getInstance().login(user.email, user.password);
|
||||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||||
@@ -94,11 +103,11 @@ describe('Attach File - Content service', () => {
|
|||||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach( async () => {
|
beforeEach(async () => {
|
||||||
await loginPage.login(user.email, user.password);
|
await loginPage.login(user.email, user.password);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach( async () => {
|
afterEach(async () => {
|
||||||
await navigationBarPage.clickLogoutButton();
|
await navigationBarPage.clickLogoutButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -115,6 +124,8 @@ describe('Attach File - Content service', () => {
|
|||||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||||
|
|
||||||
|
await contentNodeSelector.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
|
|
||||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||||
await contentNodeSelector.clickMoveCopyButton();
|
await contentNodeSelector.clickMoveCopyButton();
|
||||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||||
|
@@ -136,6 +136,7 @@ exports.config = {
|
|||||||
'--no-sandbox',
|
'--no-sandbox',
|
||||||
'--disable-web-security',
|
'--disable-web-security',
|
||||||
'--disable-browser-side-navigation',
|
'--disable-browser-side-navigation',
|
||||||
|
'-allow-running-insecure-content',
|
||||||
...(BROWSER_RUN === true ? [] : ['--headless'])]
|
...(BROWSER_RUN === true ? [] : ['--headless'])]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"C362240": "Include once ADF starts using ACS 7 , https://issues.alfresco.com/jira/browse/ADF-5182",
|
"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",
|
"C362241": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182",
|
||||||
"C291980": "Facet not working",
|
"C291980": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||||
"C291981": "Facet not working",
|
"C291981": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||||
"C299200": "Facet not working",
|
"C299200": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||||
"C297509": "Facet not working",
|
"C297509": "https://issues.alfresco.com/jira/browse/ADF-5235",
|
||||||
"C277751": "setting problem APS not basic",
|
"C277751": "setting problem APS not basic",
|
||||||
"C277752": "setting problem APS not basic",
|
"C277752": "setting problem APS not basic",
|
||||||
"C277753": "setting problem APS not basic",
|
"C277753": "setting problem APS not basic",
|
||||||
@@ -13,12 +13,7 @@
|
|||||||
"C279932": "login problem APS not basic",
|
"C279932": "login problem APS not basic",
|
||||||
"C279931": "login problem APS not basic",
|
"C279931": "login problem APS not basic",
|
||||||
"C279930": "login problem APS not basic",
|
"C279930": "login problem APS not basic",
|
||||||
"C315268": "Attach file issue",
|
"C246534": "https://issues.alfresco.com/jira/browse/ADF-5236",
|
||||||
"C246522": "Attach file issue",
|
|
||||||
"C299040": "Attach file issue",
|
|
||||||
"C286516": "Attach file issue",
|
|
||||||
"C246534": "Attach file issue",
|
|
||||||
"C279886": "Attach file issue",
|
|
||||||
"C291893": "flaky test"
|
"C291893": "flaky test"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -151,6 +151,7 @@ export class ContentNodeSelectorDialogPage {
|
|||||||
|
|
||||||
async searchAndSelectResult(searchText: string, name: string) {
|
async searchAndSelectResult(searchText: string, name: string) {
|
||||||
await this.typeIntoNodeSelectorSearchField(searchText);
|
await this.typeIntoNodeSelectorSearchField(searchText);
|
||||||
|
await this.contentListPage().dataTablePage().waitTillContentLoaded();
|
||||||
try {
|
try {
|
||||||
await this.contentListPage().dataTablePage().checkRowContentIsDisplayed(name);
|
await this.contentListPage().dataTablePage().checkRowContentIsDisplayed(name);
|
||||||
} catch (e) {
|
} 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 {
|
try {
|
||||||
Logger.log('wait first element is present');
|
Logger.log('wait first element is present');
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000);
|
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, by, element } from 'protractor';
|
import { Locator, by, element, browser } from 'protractor';
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
import { Logger } from '../utils/logger';
|
import { Logger } from '../utils/logger';
|
||||||
@@ -47,6 +47,7 @@ export class PaginationPage {
|
|||||||
await BrowserActions.click(itemsPerPage);
|
await BrowserActions.click(itemsPerPage);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
|
||||||
Logger.log('Select page size ', numberOfItem);
|
Logger.log('Select page size ', numberOfItem);
|
||||||
|
await browser.sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkPageSelectorIsNotDisplayed(): Promise<void> {
|
async checkPageSelectorIsNotDisplayed(): Promise<void> {
|
||||||
@@ -82,8 +83,8 @@ export class PaginationPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickOnNextPage(): Promise<void> {
|
async clickOnNextPage(): Promise<void> {
|
||||||
return BrowserActions.click(this.nextPageButton);
|
|
||||||
Logger.log('Next page');
|
Logger.log('Next page');
|
||||||
|
return BrowserActions.click(this.nextPageButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnPageDropdown(): Promise<void> {
|
async clickOnPageDropdown(): Promise<void> {
|
||||||
|
Reference in New Issue
Block a user