mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3022] Create automated test for attachment list - processes (#3575)
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
var TestConfig = require('../../../test.config');
|
||||
var path = require('path');
|
||||
|
||||
var AttachmentListPage = function () {
|
||||
|
||||
var attachFileButton = element(by.css("input[type='file']"));
|
||||
|
||||
this.clickAttachFileButton = function (fileLocation) {
|
||||
Util.waitUntilElementIsVisible(attachFileButton);
|
||||
attachFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||
};
|
||||
|
||||
this.checkFileIsAttached = function (name) {
|
||||
var fileAttached = element.all(by.css('div[filename="'+name+'"]')).first();
|
||||
Util.waitUntilElementIsVisible(fileAttached);
|
||||
|
||||
};
|
||||
|
||||
this.checkAttachFileButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(attachFileButton);
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = AttachmentListPage;
|
101
e2e/pages/adf/process_services/attachmentListPage.ts
Normal file
101
e2e/pages/adf/process_services/attachmentListPage.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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 Util = require('../../../util/util');
|
||||
import TestConfig = require('../../../test.config');
|
||||
import path = require('path');
|
||||
|
||||
export class AttachmentListPage {
|
||||
|
||||
attachFileButton = element(by.css("input[type='file']"));
|
||||
buttonMenu = element(by.css("button[data-automation-id='action_menu_0']"));
|
||||
menuPanel = element(by.css("div[class*='mat-menu-panel'] div[class*='mat-menu-content']"));
|
||||
viewButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']"));
|
||||
removeButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']"));
|
||||
downloadButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']"));
|
||||
noContentContainer = element(by.css("div[class*='adf-no-content-container']"));
|
||||
|
||||
checkEmptyAttachmentList() {
|
||||
Util.waitUntilElementIsVisible(this.noContentContainer);
|
||||
}
|
||||
|
||||
clickAttachFileButton(fileLocation) {
|
||||
Util.waitUntilElementIsVisible(this.attachFileButton);
|
||||
this.attachFileButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||
}
|
||||
|
||||
checkFileIsAttached(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
Util.waitUntilElementIsVisible(fileAttached);
|
||||
}
|
||||
|
||||
checkAttachFileButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.attachFileButton);
|
||||
}
|
||||
|
||||
viewFile(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
Util.waitUntilElementIsVisible(fileAttached);
|
||||
fileAttached.click();
|
||||
Util.waitUntilElementIsVisible(this.buttonMenu);
|
||||
Util.waitUntilElementIsClickable(this.buttonMenu);
|
||||
this.buttonMenu.click();
|
||||
Util.waitUntilElementIsVisible(this.menuPanel);
|
||||
Util.waitUntilElementIsVisible(this.viewButton);
|
||||
this.viewButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
removeFile(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
fileAttached.click();
|
||||
Util.waitUntilElementIsVisible(this.buttonMenu);
|
||||
Util.waitUntilElementIsClickable(this.buttonMenu);
|
||||
this.buttonMenu.click();
|
||||
Util.waitUntilElementIsVisible(this.menuPanel);
|
||||
Util.waitUntilElementIsVisible(this.removeButton);
|
||||
this.removeButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
downloadFile(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
fileAttached.click();
|
||||
Util.waitUntilElementIsVisible(this.buttonMenu);
|
||||
Util.waitUntilElementIsClickable(this.buttonMenu);
|
||||
this.buttonMenu.click();
|
||||
Util.waitUntilElementIsVisible(this.menuPanel);
|
||||
Util.waitUntilElementIsVisible(this.downloadButton);
|
||||
this.downloadButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
doubleClickFile(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
Util.waitUntilElementIsVisible(fileAttached);
|
||||
Util.waitUntilElementIsClickable(fileAttached);
|
||||
fileAttached.click();
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
checkFileIsRemoved(name) {
|
||||
let fileAttached = element(by.css('div[filename="' + name + '"]'));
|
||||
Util.waitUntilElementIsNotVisible(fileAttached);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user