mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4697] attach content to processcloudtaskform using upload widget (#4882)
* automated upload local and content file from task from upload widget. * automated upload local and content file from task from upload widget. * reverting the git ignore change * updated the app with the new process definition using the form with upload widgets * Save error screenshot * creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud * creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud * removed the wait till clickable, as not relevant here. * Update process-services-cloud-e2e.sh
This commit is contained in:
committed by
Eugenio Romano
parent
0d6140be77
commit
4d0c98d753
@@ -65,6 +65,14 @@ export class ContentNodeSelectorDialogPage {
|
||||
return BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
checkCancelButtonIsEnabled() {
|
||||
return this.cancelButton.isEnabled();
|
||||
}
|
||||
|
||||
checkCopyMoveButtonIsEnabled() {
|
||||
return this.moveCopyButton.isEnabled();
|
||||
}
|
||||
|
||||
checkMoveCopyButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||
}
|
||||
|
@@ -329,6 +329,19 @@ export class DataTableComponentPage {
|
||||
BrowserActions.click(resultElement);
|
||||
}
|
||||
|
||||
checkRowContentIsDisplayed(content) {
|
||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
doubleClickRowByContent(name) {
|
||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
|
||||
BrowserActions.click(resultElement);
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
getCopyContentTooltip() {
|
||||
return BrowserActions.getText(this.copyColumnTooltip);
|
||||
}
|
||||
|
@@ -0,0 +1,94 @@
|
||||
/*!
|
||||
* @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 { FormFields } from '../formFields';
|
||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||
import * as remote from 'selenium-webdriver/remote';
|
||||
import { element, by, browser, ElementFinder } from 'protractor';
|
||||
|
||||
export class AttachFileWidgetCloud {
|
||||
|
||||
widget: ElementFinder;
|
||||
constructor(fieldId: string) {
|
||||
this.widget = this.formFields.getWidget(fieldId);
|
||||
}
|
||||
|
||||
formFields = new FormFields();
|
||||
contentButton = element(by.css('button[id="attach-Alfresco Content"]'));
|
||||
filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
|
||||
|
||||
attachLocalFile(fileLocation: string) {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
const uploadButton = this.widget.element(by.css(`a input`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(uploadButton);
|
||||
uploadButton.sendKeys(browser.params.rootPath + '/e2e' + fileLocation);
|
||||
BrowserVisibility.waitUntilElementIsVisible(uploadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickAttachContentFile(fileId: string) {
|
||||
const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
|
||||
BrowserActions.click(uploadButton);
|
||||
BrowserActions.click(this.contentButton);
|
||||
|
||||
}
|
||||
|
||||
checkUploadContentButtonIsDisplayed(fileId: string) {
|
||||
const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(uploadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUploadContentButtonIsNotDisplayed(fileId: string) {
|
||||
const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(uploadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFileIsAttached(name) {
|
||||
const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFileIsNotAttached(name) {
|
||||
const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(fileAttached);
|
||||
return this;
|
||||
}
|
||||
|
||||
async getFileId(name: string) {
|
||||
const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||
const fileId = await fileAttached.getAttribute('id');
|
||||
return fileId;
|
||||
}
|
||||
|
||||
async removeFile(fileName: string) {
|
||||
const fileId = await this.getFileId(fileName);
|
||||
const deleteButton = this.widget.element(by.css(`button[id='${fileId}-remove']`));
|
||||
BrowserActions.click(deleteButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
viewFile(name) {
|
||||
const fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||
BrowserActions.click(fileView);
|
||||
browser.actions().doubleClick(fileView).perform();
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -33,6 +33,7 @@ import { AmountWidget } from './amountWidget';
|
||||
import { ContainerWidget } from './containerWidget';
|
||||
import { PeopleWidget } from './peopleWidget';
|
||||
import { DocumentWidget } from './documentWidget';
|
||||
import { AttachFileWidgetCloud } from './attachFileWidgetCloud';
|
||||
|
||||
export class Widget {
|
||||
|
||||
@@ -52,6 +53,10 @@ export class Widget {
|
||||
return new AttachFileWidget();
|
||||
}
|
||||
|
||||
attachFileWidgetCloud(fieldId: string) {
|
||||
return new AttachFileWidgetCloud(fieldId);
|
||||
}
|
||||
|
||||
displayValueWidget() {
|
||||
return new DisplayValueWidget();
|
||||
}
|
||||
|
@@ -169,6 +169,23 @@ export class SettingsPage {
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
async setProviderEcmBpmSso(contentServicesURL: string, processServiceURL, authHost, identityHost, clientId: string, silentLogin = true, implicitFlow = true) {
|
||||
await this.goToSettingsPage();
|
||||
this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
|
||||
this.clickSsoRadioButton();
|
||||
this.setClientId(clientId);
|
||||
this.setContentServicesURL(contentServicesURL);
|
||||
this.setProcessServicesURL(processServiceURL);
|
||||
this.setAuthHost(authHost);
|
||||
this.setIdentityHost(identityHost);
|
||||
this.setSilentLogin(silentLogin);
|
||||
this.setImplicitFlow(implicitFlow);
|
||||
await this.clickApply();
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
async setLogoutUrl(logoutUrl) {
|
||||
BrowserVisibility.waitUntilElementIsPresent(this.logoutUrlText);
|
||||
this.logoutUrlText.clear();
|
||||
|
@@ -54,6 +54,11 @@ export class TaskFormCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
clickReleaseButton() {
|
||||
BrowserActions.click(this.releaseButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
formFields() {
|
||||
return new FormFields();
|
||||
}
|
||||
|
@@ -79,6 +79,10 @@ export class TaskListCloudComponentPage {
|
||||
return this.dataTable.selectRow(column.name, taskName);
|
||||
}
|
||||
|
||||
selectRowByTaskId(taskId: string) {
|
||||
return this.dataTable.selectRow(column.id, taskId);
|
||||
}
|
||||
|
||||
getRow(taskName) {
|
||||
return this.dataTable.getCellElementByValue(column.name, taskName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user