mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1929] Attach Folder APS1 E2E (#5606)
* [AAE-1929] Attach Folder APS1 E2E * * updated selector * * wait for spinner * * wait for spinner
This commit is contained in:
120
e2e/process-services/attach-folder.e2e.ts
Normal file
120
e2e/process-services/attach-folder.e2e.ts
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
ApplicationService,
|
||||||
|
ContentNodeSelectorDialogPage,
|
||||||
|
IntegrationService,
|
||||||
|
LoginPage,
|
||||||
|
Widget
|
||||||
|
} from '@alfresco/adf-testing';
|
||||||
|
import { TasksPage } from '../pages/adf/process-services/tasks.page';
|
||||||
|
import { browser } from 'protractor';
|
||||||
|
import { NavigationBarPage } from '../pages/adf/navigation-bar.page';
|
||||||
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||||
|
import { UsersActions } from '../actions/users.actions';
|
||||||
|
import { User } from '../models/APS/user';
|
||||||
|
import CONSTANTS = require('../util/constants');
|
||||||
|
|
||||||
|
describe('Attach Folder', () => {
|
||||||
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
|
provider: 'ALL',
|
||||||
|
hostEcm: browser.params.testConfig.adf_acs.host,
|
||||||
|
hostBpm: browser.params.testConfig.adf_aps.host
|
||||||
|
});
|
||||||
|
const integrationService = new IntegrationService(this.alfrescoJsApi);
|
||||||
|
const applicationService = new ApplicationService(this.alfrescoJsApi);
|
||||||
|
|
||||||
|
const users = new UsersActions();
|
||||||
|
const loginPage = new LoginPage();
|
||||||
|
const widget = new Widget();
|
||||||
|
const taskPage = new TasksPage();
|
||||||
|
const navigationBarPage = new NavigationBarPage();
|
||||||
|
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||||
|
|
||||||
|
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||||
|
const meetingNotes = 'Meeting Notes';
|
||||||
|
const { adminEmail, adminPassword } = browser.params.testConfig.adf;
|
||||||
|
let user: User;
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await this.alfrescoJsApi.login(adminEmail, adminPassword);
|
||||||
|
user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||||
|
const acsUser = { ...user, id: user.email }; delete acsUser.type; delete acsUser.tenantId;
|
||||||
|
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||||
|
|
||||||
|
const repository = {
|
||||||
|
name: 'adf dev',
|
||||||
|
tenantId: user.tenantId,
|
||||||
|
alfrescoTenantId: '',
|
||||||
|
repositoryUrl: `${browser.params.testConfig.adf_acs.host}/alfresco`,
|
||||||
|
shareUrl: `${browser.params.testConfig.adf_acs.host}/share`,
|
||||||
|
version: '4.2',
|
||||||
|
useShareConnector: false
|
||||||
|
};
|
||||||
|
|
||||||
|
await integrationService.addCSIntegration(repository);
|
||||||
|
await this.alfrescoJsApi.login(user.email, user.password);
|
||||||
|
await applicationService.importPublishDeployApp(app.file_path);
|
||||||
|
await loginPage.loginToAllUsingUserModel(user);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
await this.alfrescoJsApi.login(adminEmail, adminPassword);
|
||||||
|
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C246534] Attach folder - ACS', async () => {
|
||||||
|
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||||
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||||
|
await taskPage.createTask({ name: 'Attach folder', formName: app.UPLOAD_FOLDER_FORM_CS.formName });
|
||||||
|
|
||||||
|
const contentFileWidget = widget.attachFolderWidget();
|
||||||
|
await contentFileWidget.clickWidget(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||||
|
|
||||||
|
await contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
|
||||||
|
await contentNodeSelector.typeIntoNodeSelectorSearchField(user.email);
|
||||||
|
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(user.email);
|
||||||
|
await contentNodeSelector.clickContentNodeSelectorResult(user.email);
|
||||||
|
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||||
|
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||||
|
|
||||||
|
await contentNodeSelector.typeIntoNodeSelectorSearchField(meetingNotes);
|
||||||
|
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(meetingNotes);
|
||||||
|
await contentNodeSelector.clickContentNodeSelectorResult(meetingNotes);
|
||||||
|
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||||
|
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||||
|
|
||||||
|
await contentNodeSelector.clickCancelButton();
|
||||||
|
await widget.attachFolderWidget().checkFolderIsNotAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, user.email);
|
||||||
|
|
||||||
|
await contentFileWidget.clickWidget(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id);
|
||||||
|
await contentNodeSelector.checkDialogIsDisplayed();
|
||||||
|
|
||||||
|
await contentNodeSelector.typeIntoNodeSelectorSearchField(user.email);
|
||||||
|
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(user.email);
|
||||||
|
await contentNodeSelector.clickContentNodeSelectorResult(user.email);
|
||||||
|
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||||
|
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||||
|
|
||||||
|
await contentNodeSelector.clickMoveCopyButton();
|
||||||
|
await widget.attachFolderWidget().checkFolderIsAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, user.email);
|
||||||
|
await widget.attachFolderWidget().removeFolder(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, user.email);
|
||||||
|
await widget.attachFolderWidget().checkFolderIsNotAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, user.email);
|
||||||
|
});
|
||||||
|
});
|
Binary file not shown.
@@ -391,6 +391,13 @@ exports.Files = {
|
|||||||
searchTerm: 'One',
|
searchTerm: 'One',
|
||||||
result: [ '123456789 - Customer Number One' ]
|
result: [ '123456789 - Customer Number One' ]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
UPLOAD_FOLDER_FORM_CS: {
|
||||||
|
formName: "upload-folder-cs",
|
||||||
|
FIELD: {
|
||||||
|
widget_id: 'attachfolder',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
47
lib/testing/src/lib/core/actions/APS/integration.service.ts
Normal file
47
lib/testing/src/lib/core/actions/APS/integration.service.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
|
export interface IntegrationType {
|
||||||
|
name: string;
|
||||||
|
tenantId: number;
|
||||||
|
alfrescoTenantId: string;
|
||||||
|
repositoryUrl: string;
|
||||||
|
shareUrl: string;
|
||||||
|
version: string;
|
||||||
|
useShareConnector: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class IntegrationService {
|
||||||
|
api: AlfrescoApi;
|
||||||
|
|
||||||
|
constructor(api: AlfrescoApi) {
|
||||||
|
this.api = api;
|
||||||
|
}
|
||||||
|
|
||||||
|
addCSIntegration(body: IntegrationType): Promise<any> {
|
||||||
|
return this.api.activiti.integrationAccountApi.apiClient.callApi('app/rest/integration/alfresco', 'POST',
|
||||||
|
{}, {}, {}, {}, body, [], [], Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
authenticateRepositary(id: number, body: { username: string, password: string }): Promise<any> {
|
||||||
|
return this.api.activiti.integrationAccountApi.apiClient.callApi(`app/rest/integration/alfresco/${id}/account`, 'POST',
|
||||||
|
{}, {}, {}, body, {}, [], []);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -17,3 +17,4 @@
|
|||||||
|
|
||||||
export * from './applications.service';
|
export * from './applications.service';
|
||||||
export * from './models.service';
|
export * from './models.service';
|
||||||
|
export * from './integration.service';
|
||||||
|
@@ -0,0 +1,58 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as remote from 'selenium-webdriver/remote';
|
||||||
|
import { browser, by, element } from 'protractor';
|
||||||
|
import { FormFields } from '../form-fields';
|
||||||
|
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
|
||||||
|
|
||||||
|
export class AttachFolderWidgetPage {
|
||||||
|
|
||||||
|
formFields: FormFields = new FormFields();
|
||||||
|
foldersListLocator = by.css('.adf-attach-folder-result');
|
||||||
|
|
||||||
|
async clickWidget(fieldId: string): Promise<void> {
|
||||||
|
browser.setFileDetector(new remote.FileDetector());
|
||||||
|
const widget = await this.formFields.getWidget(fieldId).element(by.css(`button[id="folder-${fieldId}-button"]`));
|
||||||
|
await BrowserActions.click(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
async checkFolderIsAttached(fieldId, name): Promise<void> {
|
||||||
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
|
const folderAttached = widget.element(this.foldersListLocator).element(by.cssContainingText('span', name));
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(folderAttached);
|
||||||
|
}
|
||||||
|
|
||||||
|
async checkFolderIsNotAttached(fieldId, name): Promise<void> {
|
||||||
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
|
const folderAttached = widget.element(this.foldersListLocator).element(by.cssContainingText('span', name));
|
||||||
|
await BrowserVisibility.waitUntilElementIsNotPresent(folderAttached);
|
||||||
|
}
|
||||||
|
|
||||||
|
async attachFileWidgetDisplayed(id: string): Promise<void> {
|
||||||
|
const locator = element(by.css(id ? id : '#attachfolder'));
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||||
|
}
|
||||||
|
|
||||||
|
async removeFolder(fieldId: string, name: string): Promise<void> {
|
||||||
|
await this.checkFolderIsAttached(fieldId, name);
|
||||||
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
|
const folderToBeRemoved = widget.element(this.foldersListLocator).element(by.css(`[id="folder-${fieldId}-remove"]`));
|
||||||
|
await BrowserActions.click(folderToBeRemoved);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -36,6 +36,7 @@ import { TabPage } from './tab.page';
|
|||||||
import { DocumentWidgetPage } from './document-widget.page';
|
import { DocumentWidgetPage } from './document-widget.page';
|
||||||
import { GroupWidgetPage } from './group-widget.page';
|
import { GroupWidgetPage } from './group-widget.page';
|
||||||
import { TypeaheadWidgetPage } from './typeahead-widget.page';
|
import { TypeaheadWidgetPage } from './typeahead-widget.page';
|
||||||
|
import { AttachFolderWidgetPage } from './attach-folder-widget.page';
|
||||||
|
|
||||||
export class Widget {
|
export class Widget {
|
||||||
|
|
||||||
@@ -55,6 +56,10 @@ export class Widget {
|
|||||||
return new AttachFileWidgetPage();
|
return new AttachFileWidgetPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attachFolderWidget(): AttachFolderWidgetPage {
|
||||||
|
return new AttachFolderWidgetPage();
|
||||||
|
}
|
||||||
|
|
||||||
displayValueWidget(): DisplayValueWidgetPage {
|
displayValueWidget(): DisplayValueWidgetPage {
|
||||||
return new DisplayValueWidgetPage();
|
return new DisplayValueWidgetPage();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user