[no-issue] Parallel run e2e and e2e common action refactoring (#4702)

This commit is contained in:
Eugenio Romano
2019-05-13 04:44:35 +02:00
committed by GitHub
parent a48bfc3714
commit 898e3b5a80
288 changed files with 8704 additions and 5130 deletions

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { browser, by, element } from 'protractor';
import { LoginPage, PaginationPage } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { LoginPage } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -28,10 +28,6 @@ import { FileModel } from '../../models/ACS/fileModel';
import { StringUtil } from '@alfresco/adf-testing';
import { Util } from '../../util/util';
import { ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
import { BreadCrumbDropdownPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage';
import { FolderModel } from '../../models/ACS/folderModel';
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
import { InfinitePaginationPage } from '../../pages/adf/core/infinitePaginationPage';
describe('Document List Component - Actions', () => {
@@ -40,11 +36,7 @@ describe('Document List Component - Actions', () => {
const navigationBarPage = new NavigationBarPage();
const contentListPage = contentServicesPage.getDocumentList();
const contentNodeSelector = new ContentNodeSelectorDialogPage();
const paginationPage = new PaginationPage();
const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
const breadCrumbPage = new BreadCrumbPage();
const uploadActions = new UploadActions();
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
const alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -75,7 +67,6 @@ describe('Document List Component - Actions', () => {
};
beforeAll(async (done) => {
acsUser = new AcsUserModel();
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
@@ -89,13 +80,13 @@ describe('Document List Component - Actions', () => {
fileNames = Util.generateSequenceFiles(1, nrOfFiles, files.base, files.extension);
await uploadActions.createEmptyFiles(alfrescoJsApi, fileNames, uploadedFolder.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.driver.sleep(10000);
await browser.driver.sleep(15000);
done();
});
beforeEach(async (done) => {
beforeEach((done) => {
navigationBarPage.clickContentServicesButton();
done();
});
@@ -215,147 +206,4 @@ describe('Document List Component - Actions', () => {
});
});
describe('Folder Actions - Copy and Move', () => {
const folderModel1 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel2 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel3 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel4 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel5 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel6 = new FolderModel({'name': StringUtil.generateRandomString()});
let folder1, folder2, folder3, folder4, folder5, folder6;
let folders;
const contentServicesUser = new AcsUserModel();
beforeAll(async (done) => {
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
await alfrescoJsApi.login(contentServicesUser.id, contentServicesUser.password);
folder1 = await uploadActions.createFolder(alfrescoJsApi, 'A' + folderModel1.name, '-my-');
folder2 = await uploadActions.createFolder(alfrescoJsApi, 'B' + folderModel2.name, '-my-');
folder3 = await uploadActions.createFolder(alfrescoJsApi, 'C' + folderModel3.name, '-my-');
folder4 = await uploadActions.createFolder(alfrescoJsApi, 'D' + folderModel4.name, '-my-');
folder5 = await uploadActions.createFolder(alfrescoJsApi, 'E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder(alfrescoJsApi, 'F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
done();
});
beforeEach(async (done) => {
loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage('5');
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();
done();
});
afterAll(async (done) => {
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFilesOrFolder(alfrescoJsApi, folder.entry.id);
});
done();
});
it('[C260132] Move action on folder with - Load more', () => {
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
contentServicesPage.doubleClickRow('F' + folderModel6.name);
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
breadCrumbDropdownPage.clickParentFolder();
breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
breadCrumbDropdownPage.choosePath(contentServicesUser.id);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
it('[C305051] Copy action on folder with - Load more', () => {
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
paginationPage.clickOnNextPage();
contentListPage.waitForTableBody();
contentServicesPage.doubleClickRow('F' + folderModel6.name);
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
});
});