mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[AAE-1936] Attach File E2E APS1 (#5623)
* [AAE-1936] Attach File E2E APS1 * * minor changes * * fix title
This commit is contained in:
parent
f5c08f041e
commit
fde037498f
211
e2e/process-services/attach-file-content-service.e2e.ts
Normal file
211
e2e/process-services/attach-file-content-service.e2e.ts
Normal file
@ -0,0 +1,211 @@
|
||||
/*!
|
||||
* @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 {
|
||||
ApplicationsUtil,
|
||||
ContentNodeSelectorDialogPage,
|
||||
ExternalNodeSelectorDialogPage,
|
||||
IntegrationService,
|
||||
LoginPage,
|
||||
UploadActions,
|
||||
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 File - Content service', () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ALL',
|
||||
hostEcm: browser.params.testConfig.adf_acs.host,
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
this.alfrescoJsApiExternal = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const widget = new Widget();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const externalNodeSelector = new ExternalNodeSelectorDialogPage();
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||
const { adminEmail, adminPassword } = browser.params.testConfig.adf;
|
||||
|
||||
const pdfFileOne = {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
location: browser.params.testConfig.main.rootPath + browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_location
|
||||
};
|
||||
|
||||
const pdfFileTwo = {
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_location
|
||||
};
|
||||
|
||||
const externalFile = 'Project Overview.ppt';
|
||||
const csIntegrations = ['adf dev', 'adf master'];
|
||||
let user: User;
|
||||
|
||||
beforeAll(async () => {
|
||||
const integrationService = new IntegrationService(this.alfrescoJsApi);
|
||||
const applicationService = new ApplicationsUtil(this.alfrescoJsApi);
|
||||
const uploadActions = new UploadActions(this.alfrescoJsApi);
|
||||
const users = new UsersActions();
|
||||
|
||||
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);
|
||||
await this.alfrescoJsApiExternal.login(adminEmail, adminPassword);
|
||||
await this.alfrescoJsApiExternal.core.peopleApi.addPerson(acsUser);
|
||||
|
||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[0], host: browser.params.testConfig.adf_acs.host });
|
||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: csIntegrations[1], host: browser.params.testConfig.adf_external_acs.host });
|
||||
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await this.alfrescoJsApi.login(adminEmail, adminPassword);
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach( async () => {
|
||||
await loginPage.loginToAllUsingUserModel(user);
|
||||
});
|
||||
|
||||
afterEach( async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
it('[C315268] Attach file - Able to upload more than one file (both ACS and local)', async () => {
|
||||
const name = 'Attach local and acs file';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.name);
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
});
|
||||
|
||||
it('[C246522] Attach file - Local file', async () => {
|
||||
const name = 'Attach local file';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.location);
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileOne.name);
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
});
|
||||
|
||||
it('[C299040] Should display the login screen right, when user has access to 2 alfresco repositiories', async () => {
|
||||
const name = 'Attach file';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[1]);
|
||||
|
||||
await expect(await externalNodeSelector.getTitle()).toEqual(`Please log in for ${browser.params.testConfig.adf_external_acs.host}`);
|
||||
await externalNodeSelector.login(user.email, user.password);
|
||||
|
||||
await externalNodeSelector.checkDialogIsDisplayed();
|
||||
await externalNodeSelector.searchAndSelectResult(externalFile, externalFile);
|
||||
await externalNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
});
|
||||
|
||||
it('[C286516] Able to upload a file when user has more than two alfresco repositories', async () => {
|
||||
const name = 'Attach file - multiple repo';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.createTask({ name, formName: app.UPLOAD_FILE_FORM_CS.formName });
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[0]);
|
||||
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
await contentNodeSelector.searchAndSelectResult(pdfFileTwo.name, pdfFileTwo.name);
|
||||
await contentNodeSelector.clickMoveCopyButton();
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
|
||||
await widget.attachFileWidget().clickUploadButton(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id);
|
||||
await widget.attachFileWidget().selectUploadSource(csIntegrations[1]);
|
||||
|
||||
await expect(await externalNodeSelector.getTitle()).toEqual(`Please log in for ${browser.params.testConfig.adf_external_acs.host}`);
|
||||
await externalNodeSelector.login(user.email, user.password);
|
||||
|
||||
await externalNodeSelector.checkDialogIsDisplayed();
|
||||
await externalNodeSelector.searchAndSelectResult(externalFile, externalFile);
|
||||
await externalNodeSelector.clickMoveCopyButton();
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().removeFileEnabled()).toBe(true);
|
||||
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, pdfFileTwo.name);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
|
||||
await widget.attachFileWidget().checkFileIsAttached(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(app.UPLOAD_FILE_FORM_CS.FIELD.widget_id, externalFile);
|
||||
await expect(await widget.attachFileWidget().viewFileEnabled()).toBe(false);
|
||||
await expect(await widget.attachFileWidget().downloadFileEnabled()).toBe(true);
|
||||
});
|
||||
});
|
@ -23,8 +23,15 @@ 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';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
const users = new UsersActions();
|
||||
const applicationService = new ApplicationsUtil(this.alfrescoJsApi);
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
@ -32,41 +39,26 @@ describe('Start Task - Task App', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let processUserModel;
|
||||
let user: User;
|
||||
const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
|
||||
const pdfFile = new FileModel({ 'name': browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name });
|
||||
const wordFile = new FileModel({
|
||||
name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name,
|
||||
location: browser.params.testConfig.main.rootPath + browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location
|
||||
});
|
||||
const appFields = app.form_fields;
|
||||
|
||||
beforeAll(async () => {
|
||||
const users = new UsersActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
|
||||
const applicationService = new ApplicationsUtil(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
|
||||
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C274690] Should be able to open a file attached to a start form', async () => {
|
||||
@ -88,4 +80,21 @@ describe('Start Task - Task App', () => {
|
||||
await viewerPage.clickCloseButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('View file');
|
||||
});
|
||||
|
||||
it('[C260418] Uploading single file form', async () => {
|
||||
const name = 'View Doc file';
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.createTask({ name, formName: app.formName });
|
||||
|
||||
await widget.attachFileWidget().attachFile(appFields.attachFile_id, wordFile.location);
|
||||
await widget.attachFileWidget().checkUploadIsNotVisible(appFields.attachFile_id);
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, wordFile.name);
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
await widget.attachFileWidget().checkUploadIsNotVisible(appFields.attachFile_id);
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, wordFile.name);
|
||||
});
|
||||
});
|
||||
|
@ -56,18 +56,8 @@ describe('Attach Folder', () => {
|
||||
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);
|
||||
await integrationService.addCSIntegration({ tenantId: user.tenantId, name: 'adf dev', host: browser.params.testConfig.adf_acs });
|
||||
|
||||
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);
|
||||
@ -88,15 +78,11 @@ describe('Attach Folder', () => {
|
||||
|
||||
await contentNodeSelector.checkDialogIsDisplayed();
|
||||
|
||||
await contentNodeSelector.typeIntoNodeSelectorSearchField(user.email);
|
||||
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(user.email);
|
||||
await contentNodeSelector.clickContentNodeSelectorResult(user.email);
|
||||
await contentNodeSelector.searchAndSelectResult(user.email, 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 contentNodeSelector.searchAndSelectResult(meetingNotes, meetingNotes);
|
||||
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
|
||||
|
||||
@ -106,9 +92,7 @@ describe('Attach Folder', () => {
|
||||
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 contentNodeSelector.searchAndSelectResult(user.email, user.email);
|
||||
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
|
||||
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
|
||||
|
||||
|
@ -83,7 +83,7 @@ describe('Attach widget - File', () => {
|
||||
});
|
||||
|
||||
it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => {
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu();
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().checkAttachFileOptionsActiveForm();
|
||||
|
||||
await widget.attachFileWidget().viewAttachedFile();
|
||||
@ -91,11 +91,11 @@ describe('Attach widget - File', () => {
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu();
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().downloadFile();
|
||||
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu();
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().removeAttachedFile();
|
||||
await widget.attachFileWidget().attachFileWidgetDisplayed();
|
||||
});
|
||||
@ -109,7 +109,7 @@ describe('Attach widget - File', () => {
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu();
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().checkAttachFileOptionsCompletedForm();
|
||||
|
||||
await widget.attachFileWidget().viewAttachedFile();
|
||||
@ -117,7 +117,7 @@ describe('Attach widget - File', () => {
|
||||
await viewerPage.checkCloseButtonIsDisplayed();
|
||||
await viewerPage.clickCloseButton();
|
||||
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu();
|
||||
await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name);
|
||||
await widget.attachFileWidget().downloadFile();
|
||||
await FileBrowserUtil.isFileDownloaded(pdfFile.name);
|
||||
});
|
||||
|
Binary file not shown.
@ -31,6 +31,8 @@ const SCREENSHOT_URL = process.env.SCREENSHOT_URL || process.env.URL_HOST_ADF;
|
||||
const SCREENSHOT_PASSWORD = process.env.SCREENSHOT_PASSWORD || process.env.PASSWORD_ADF;
|
||||
const SCREENSHOT_USERNAME = process.env.SCREENSHOT_USERNAME || process.env.USERNAME_ADF;
|
||||
|
||||
const EXTERNAL_ACS_HOST = process.env.EXTERNAL_ACS_HOST;
|
||||
|
||||
const appConfig = {
|
||||
"bpmHost": BPM_HOST,
|
||||
"identityHost": IDENTITY_HOST,
|
||||
@ -196,6 +198,34 @@ module.exports = {
|
||||
clientIdSso: "alfresco",
|
||||
},
|
||||
|
||||
adf_external_acs: {
|
||||
/**
|
||||
* The protocol where the app runs.
|
||||
* @config main.protocol {String}
|
||||
*/
|
||||
protocol: "http",
|
||||
|
||||
/**
|
||||
* The protocol where the app runs.
|
||||
* @config main.protocol {String}
|
||||
*/
|
||||
host: EXTERNAL_ACS_HOST,
|
||||
|
||||
/**
|
||||
* The port where the app runs.
|
||||
* @config main.port {String}
|
||||
*/
|
||||
port: "",
|
||||
|
||||
/**
|
||||
* The ECM API context required for calls
|
||||
* @config adf.ACSAPIContextRoot {String}
|
||||
*/
|
||||
apiContextRoot: "/alfresco/api/-default-/public",
|
||||
|
||||
clientIdSso: "alfresco",
|
||||
},
|
||||
|
||||
adf_aps: {
|
||||
/**
|
||||
* The protocol where the app runs.
|
||||
|
@ -398,6 +398,13 @@ exports.Files = {
|
||||
FIELD: {
|
||||
widget_id: 'attachfolder',
|
||||
}
|
||||
},
|
||||
|
||||
UPLOAD_FILE_FORM_CS: {
|
||||
formName: "Upload multiple files",
|
||||
FIELD: {
|
||||
widget_id: 'attachfile',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -129,6 +129,11 @@ export class ContentNodeSelectorDialogPage {
|
||||
await this.clickMoveCopyButton();
|
||||
}
|
||||
|
||||
async searchAndSelectResult(searchText: string, name: string) {
|
||||
await this.typeIntoNodeSelectorSearchField(searchText);
|
||||
await this.clickContentNodeSelectorResult(name);
|
||||
}
|
||||
|
||||
contentListPage(): DocumentListPage {
|
||||
return this.contentList;
|
||||
}
|
||||
|
@ -17,16 +17,6 @@
|
||||
|
||||
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;
|
||||
|
||||
@ -34,14 +24,22 @@ export class IntegrationService {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
addCSIntegration(body: IntegrationType): Promise<any> {
|
||||
addCSIntegration({ name, tenantId, host }): Promise<any> {
|
||||
const repository = {
|
||||
name,
|
||||
tenantId,
|
||||
alfrescoTenantId: '',
|
||||
repositoryUrl: `${host}/alfresco`,
|
||||
shareUrl: `${host}/share`,
|
||||
version: '4.2',
|
||||
useShareConnector: false
|
||||
};
|
||||
return this.api.activiti.integrationAccountApi.apiClient.callApi('app/rest/integration/alfresco', 'POST',
|
||||
{}, {}, {}, {}, body, [], [], Object);
|
||||
{}, {}, {}, {}, repository, [], [], Object);
|
||||
}
|
||||
|
||||
authenticateRepositary(id: number, body: { username: string, password: string }): Promise<any> {
|
||||
authenticateRepository(id: number, body: { username: string, password: string }): Promise<any> {
|
||||
return this.api.activiti.integrationAccountApi.apiClient.callApi(`app/rest/integration/alfresco/${id}/account`, 'POST',
|
||||
{}, {}, {}, body, {}, [], []);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,8 +58,14 @@ export class AttachFileWidgetPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachFileWidget);
|
||||
}
|
||||
|
||||
async toggleAttachedFileMenu(): Promise<void> {
|
||||
await BrowserActions.click(this.attachedFileMenu);
|
||||
async toggleAttachedFileMenu(fieldId: string, fileName: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const widget = await this.formFields.getWidget(fieldId);
|
||||
const fileAttached = await widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', fileName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||
const id = await fileAttached.getAttribute('id');
|
||||
const optionMenu = widget.element(by.css(`button[id='${id}-option-menu']`));
|
||||
await BrowserActions.click(optionMenu);
|
||||
}
|
||||
|
||||
async checkAttachFileOptionsActiveForm(): Promise <void> {
|
||||
@ -87,4 +93,36 @@ export class AttachFileWidgetPage {
|
||||
async removeAttachedFile(): Promise<void> {
|
||||
await BrowserActions.click(this.removeFileOptionButton);
|
||||
}
|
||||
|
||||
async viewFileEnabled(): Promise<boolean> {
|
||||
return this.viewFileOptionButton.isEnabled();
|
||||
}
|
||||
|
||||
async downloadFileEnabled(): Promise<boolean> {
|
||||
return this.downloadFileOptionButton.isEnabled();
|
||||
}
|
||||
|
||||
async removeFileEnabled(): Promise<boolean> {
|
||||
return this.removeFileOptionButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkUploadIsNotVisible(fieldId): Promise<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
const widget = await this.formFields.getWidget(fieldId);
|
||||
const uploadButton = await widget.element(this.uploadLocator);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton);
|
||||
}
|
||||
|
||||
async selectUploadSource(name: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
|
||||
await BrowserActions.click(element(by.css(`button[id="attach-${name}"]`)));
|
||||
}
|
||||
|
||||
async clickUploadButton(fieldId): Promise<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const widget = await this.formFields.getWidget(fieldId);
|
||||
const uploadButton = await widget.element(this.uploadLocator);
|
||||
await BrowserActions.click(uploadButton);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
/*!
|
||||
* @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 { by, element, ElementFinder } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { ContentNodeSelectorDialogPage } from '../../content-services/dialog/content-node-selector-dialog.page';
|
||||
import { DocumentListPage } from '../../content-services/pages/document-list.page';
|
||||
|
||||
export class ExternalNodeSelectorDialogPage extends ContentNodeSelectorDialogPage {
|
||||
txtUsername: ElementFinder = element(by.css('input[id="username"]'));
|
||||
txtPassword: ElementFinder = element(by.css('input[id="password"]'));
|
||||
loginElement: ElementFinder = element(by.css('[data-automation-id="attach-file-dialog-actions-login"]'));
|
||||
title: ElementFinder = element(by.css('[data-automation-id="content-node-selector-title"]'));
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.dialog = element(by.css(`adf-content-node-selector-panel`));
|
||||
this.contentList = new DocumentListPage(this.dialog);
|
||||
this.dataTable = this.contentList.dataTablePage();
|
||||
this.header = this.dialog.element(by.css(`header[data-automation-id='content-node-selector-title']`));
|
||||
this.searchInputElement = this.dialog.element(by.css(`input[data-automation-id='content-node-selector-search-input']`));
|
||||
this.selectedRow = this.dialog.element(by.css(`adf-datatable-row[class*="adf-is-selected"]`));
|
||||
this.moveCopyButton = element(by.css(`button[data-automation-id="attach-file-dialog-actions-choose"]`));
|
||||
}
|
||||
|
||||
async getTitle(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.title);
|
||||
return this.title.getText();
|
||||
}
|
||||
|
||||
async clickLoginButton() {
|
||||
await BrowserActions.click(this.loginElement);
|
||||
}
|
||||
|
||||
async enterUsername(username): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.txtUsername, username);
|
||||
}
|
||||
|
||||
async enterPassword(password): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
async waitForLogInDialog(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.title);
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.txtUsername);
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.txtPassword);
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.loginElement);
|
||||
}
|
||||
|
||||
async login(username, password): Promise<void> {
|
||||
await this.waitForLogInDialog();
|
||||
await this.enterUsername(username);
|
||||
await this.enterPassword(password);
|
||||
await this.clickLoginButton();
|
||||
}
|
||||
}
|
@ -24,3 +24,4 @@ export * from './task-filters.page';
|
||||
export * from './process-instance-tasks.page';
|
||||
export * from './start-process.page';
|
||||
export * from './select-apps-dialog.page';
|
||||
export * from './external-node-selector-dialog.page';
|
||||
|
@ -58,6 +58,14 @@ export interface TestConfiguration {
|
||||
clientIdSso: string;
|
||||
};
|
||||
|
||||
adf_external_acs: {
|
||||
protocol: string;
|
||||
host: string;
|
||||
port: string;
|
||||
apiContextRoot: string;
|
||||
clientIdSso: string;
|
||||
};
|
||||
|
||||
adf_aps: {
|
||||
protocol: string;
|
||||
host: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user