mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3330] Create automated tests for Uploader component (#3581)
* Upload button e2e * improve test organization * add dev option in test run * Create desktop.ini * upload component automation final step * remove fdescribe * ignore downloads folder * exclude pagination
This commit is contained in:
committed by
Eugenio Romano
parent
ee8151d50d
commit
fcaa033a57
@@ -1,382 +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 Page = require('astrolabe').Page;
|
||||
var Util = require('../../../util/util');
|
||||
|
||||
/**
|
||||
* Provides activiti
|
||||
* @module pages
|
||||
* @submodule share
|
||||
* @class pages.share.LoginPage
|
||||
*/
|
||||
module.exports = Page.create({
|
||||
|
||||
/**
|
||||
* Provides the task App
|
||||
* @property taskApp
|
||||
* @type protractor.Element
|
||||
*/
|
||||
taskApp: {
|
||||
get: function () {
|
||||
return element(by.cssContainingText("h1[class*='mdl-card__title-text']", "Task App"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* clicks the activiti option
|
||||
* @property clickActiviti
|
||||
* */
|
||||
clickActiviti: {
|
||||
value: function() {
|
||||
var activitiButton = element(by.css("a[data-automation-id='activiti']"));
|
||||
Util.waitUntilElementIsVisible(activitiButton);
|
||||
activitiButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides the wait required for the page
|
||||
* @property waitForElements
|
||||
* @type protractor.Element
|
||||
* */
|
||||
waitForElements: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.taskApp);
|
||||
Util.waitUntilElementIsVisible(element(by.css("i[class='material-icons']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fills the username input
|
||||
* @method enterUsername
|
||||
* @param {String} username
|
||||
*/
|
||||
enterUsername: {
|
||||
value: function (username) {
|
||||
Util.waitUntilElementIsVisible(this.txtUsername);
|
||||
this.txtUsername.clear();
|
||||
this.txtUsername.sendKeys(username);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fills the password input
|
||||
* @method enterPassword
|
||||
* @param {String} password
|
||||
*/
|
||||
enterPassword: {
|
||||
value: function (password) {
|
||||
Util.waitUntilElementIsVisible(this.txtPassword);
|
||||
this.txtPassword.clear();
|
||||
this.txtPassword.sendKeys(password);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Logs into adf
|
||||
* @method login
|
||||
* @param {String} username, {String} password
|
||||
*/
|
||||
login: {
|
||||
value: function (username, password) {
|
||||
this.waitForElements();
|
||||
this.enterUsername(username);
|
||||
this.enterPassword(password);
|
||||
Util.waitUntilElementIsVisible(element(by.css("ol[data-automation-id='breadcrumb']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Logs out
|
||||
* @method logout
|
||||
*/
|
||||
logout: {
|
||||
value: function () {
|
||||
var menuButton = element(by.css("button[data-automation-id='right-action-menu']"));
|
||||
var logoutOption = element(by.cssContainingText("li[class*='mdl-menu__item'] > label", "Logout"));
|
||||
|
||||
Util.waitUntilElementIsVisible(menuButton);
|
||||
menuButton.click();
|
||||
Util.waitUntilElementIsVisible(logoutOption);
|
||||
logoutOption.click();
|
||||
this.waitForElements();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable ECM
|
||||
* @method enableECM
|
||||
*/
|
||||
enableECM: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.ecmSwitch);
|
||||
this.ecmSwitch.click();
|
||||
Util.waitUntilElementIsVisible(element(by.css("label[class*='is-checked'][for='switch1']")));
|
||||
|
||||
element(by.css("label[class*='is-checked'][for='switch2']")).isPresent().then(function(check) {
|
||||
if(check) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers*='ALL']")));
|
||||
}
|
||||
else {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers='ECM']")));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable ECM
|
||||
* @method enableECM
|
||||
*/
|
||||
disableECM: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.ecmSwitch);
|
||||
this.ecmSwitch.click();
|
||||
|
||||
element(by.css("label[class*='is-checked'][for='switch2']")).isPresent().then(function(check) {
|
||||
if(check) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers*='BPM']")));
|
||||
}
|
||||
else {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers='']")));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable BPM
|
||||
* @method enableBPM
|
||||
*/
|
||||
enableBPM: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.bpmSwitch);
|
||||
this.bpmSwitch.click();
|
||||
Util.waitUntilElementIsVisible(element(by.css("label[class*='is-checked'][for='switch2']")));
|
||||
|
||||
element(by.css("label[class*='is-checked'][for='switch1']")).isPresent().then(function(check) {
|
||||
if(check) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers*='ALL']")));
|
||||
}
|
||||
else {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers='BPM']")));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable BPM
|
||||
* @method enableBPM
|
||||
*/
|
||||
disableBPM: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.bpmSwitch);
|
||||
this.bpmSwitch.click();
|
||||
|
||||
element(by.css("label[class*='is-checked'][for='switch1']")).isPresent().then(function(check) {
|
||||
if(check) {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers*='ECM']")));
|
||||
}
|
||||
else {
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-providers='']")));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable CSRF
|
||||
* @method enableBPM
|
||||
*/
|
||||
enableCSRF: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.csrfSwitch);
|
||||
this.csrfSwitch.click();
|
||||
Util.waitUntilElementIsVisible(element(by.css("label[class*='is-checked'][for='switch3']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable BPM
|
||||
* @method enableBPM
|
||||
*/
|
||||
disableBPM: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.bpmSwitch);
|
||||
this.bpmSwitch.click();
|
||||
Util.waitUntilElementIsVisible(element(by.css("alfresco-login[ng-reflect-disable-csrf='true']")));
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* clears the username input
|
||||
* @method clearUsername
|
||||
*/
|
||||
clearUsername: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.txtUsername);
|
||||
this.txtUsername.clear();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check username tooltip
|
||||
* @method checkUsernameTooltip
|
||||
* @param {String} message
|
||||
*/
|
||||
checkUsernameTooltip: {
|
||||
value: function (message) {
|
||||
Util.waitUntilElementIsPresent(element(by.css("span[data-automation-id='username-error']")));
|
||||
Util.waitUntilElementIsPresent(element(by.cssContainingText("span[data-automation-id='username-error']"), message));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check username tooltip not visible
|
||||
* @method checkUsernameTooltipNotVisible
|
||||
*/
|
||||
checkUsernameTooltipNotVisible: {
|
||||
value: function () {
|
||||
var error = "span[data-automation-id='username-error']";
|
||||
Util.waitUntilElementIsNotVisible(element(by.css(error)));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check sign in button disabled
|
||||
* @method checkSignInButtonIsDisabled
|
||||
*/
|
||||
checkSignInButtonIsDisabled: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("button[data-automation-id='login-button'][ng-reflect-disabled='true']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check sign in button enabled
|
||||
* @method checkSignInButtonIsEnabled
|
||||
*/
|
||||
checkSignInButtonIsEnabled: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsNotVisible(element(by.css("button[data-automation-id='login-button'][ng-reflect-disabled='true']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click sign in button
|
||||
* @method clickSignInButton
|
||||
*/
|
||||
clickSignInButton: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(this.signInButton);
|
||||
this.signInButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check login error
|
||||
* @method checkLoginError
|
||||
* * @param {String} message
|
||||
*/
|
||||
checkLoginError: {
|
||||
value: function (message) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("div[data-automation-id='login-error']", message)));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check password is hidden
|
||||
* @method checkPasswordIsHidden
|
||||
*/
|
||||
checkPasswordIsHidden: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("input[data-automation-id='password'][type='password']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click show password
|
||||
* @method showPassword
|
||||
*/
|
||||
showPassword: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("i[data-automation-id='show_password']")));
|
||||
element(by.css("i[data-automation-id='show_password']")).click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Click hide password
|
||||
* @method hidePassword
|
||||
*/
|
||||
hidePassword: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("i[data-automation-id='hide_password']")));
|
||||
element(by.css("i[data-automation-id='hide_password']")).click();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check password is shown
|
||||
* @method checkPasswordIsShown
|
||||
* @param {String} password
|
||||
*/
|
||||
checkPasswordIsShown: {
|
||||
value: function (password) {
|
||||
var passwordText = element(by.css("input[data-automation-id='password']"));
|
||||
|
||||
passwordText.getAttribute('value').then(function (text) {
|
||||
expect(passwordText.getAttribute('value')).toEqual(password);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check 'Remember' is displayed
|
||||
* @method checkRememberIsDisplayed
|
||||
*/
|
||||
checkRememberIsDisplayed: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("span[id='login-remember']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check 'Need Help' is displayed
|
||||
* @method checkNeedHelpIsDisplayed
|
||||
*/
|
||||
checkNeedHelpIsDisplayed: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='login-action-help']")));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check 'Register' is displayed
|
||||
* @method checkRegisterDisplayed
|
||||
*/
|
||||
checkRegisterDisplayed: {
|
||||
value: function () {
|
||||
Util.waitUntilElementIsVisible(element(by.css("div[id='login-action-register']")));
|
||||
}
|
||||
},
|
||||
});
|
@@ -21,7 +21,7 @@ var CreateFolderDialog = require('./dialog/createFolderDialog');
|
||||
var path = require('path');
|
||||
var TestConfig = require('../../test.config');
|
||||
|
||||
var ContentServicesPage = function (){
|
||||
var ContentServicesPage = function () {
|
||||
|
||||
var contentList = new ContentList();
|
||||
var createFolderDialog = new CreateFolderDialog();
|
||||
@@ -40,17 +40,18 @@ var ContentServicesPage = function (){
|
||||
var contentServicesURL = TestConfig.adf.url + TestConfig.adf.port + "/files";
|
||||
var loadMoreButton = element(by.css("button[data-automation-id='adf-infinite-pagination-button']"));
|
||||
var emptyPagination = element(by.css("adf-pagination[class*='adf-pagination__empty']"));
|
||||
var dragAndDrop = element(by.css("adf-upload-drag-area div"));
|
||||
|
||||
/**
|
||||
* Check Document List is displayed
|
||||
* @method checkAcsContainer
|
||||
*/
|
||||
this.checkAcsContainer = function (){
|
||||
this.checkAcsContainer = function () {
|
||||
Util.waitUntilElementIsVisible(uploadBorder);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.waitForTableBody = function (){
|
||||
this.waitForTableBody = function () {
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
@@ -58,14 +59,14 @@ var ContentServicesPage = function (){
|
||||
* Go to Document List Page
|
||||
* @method goToDocumentList
|
||||
* */
|
||||
this.goToDocumentList = function() {
|
||||
this.goToDocumentList = function () {
|
||||
Util.waitUntilElementIsVisible(contentServices);
|
||||
Util.waitUntilElementIsClickable(contentServices);
|
||||
contentServices.click();
|
||||
this.checkAcsContainer();
|
||||
};
|
||||
|
||||
this.navigateToDocumentList = function() {
|
||||
this.navigateToDocumentList = function () {
|
||||
browser.driver.get(contentServicesURL);
|
||||
this.checkAcsContainer();
|
||||
};
|
||||
@@ -74,7 +75,7 @@ var ContentServicesPage = function (){
|
||||
return contentList.getAllDisplayedRows();
|
||||
};
|
||||
|
||||
this.currentFolderName = function() {
|
||||
this.currentFolderName = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
Util.waitUntilElementIsVisible(currentFolder);
|
||||
currentFolder.getText().then(function (result) {
|
||||
@@ -88,7 +89,7 @@ var ContentServicesPage = function (){
|
||||
};
|
||||
|
||||
this.getBreadcrumbTooltip = function (content) {
|
||||
return element(by.css("nav[data-automation-id='breadcrumb'] div[title='" +content +"']")).getAttribute('title');
|
||||
return element(by.css("nav[data-automation-id='breadcrumb'] div[title='" + content + "']")).getAttribute('title');
|
||||
};
|
||||
|
||||
this.getAllRowsNameColumn = function () {
|
||||
@@ -130,7 +131,7 @@ var ContentServicesPage = function (){
|
||||
this.sortAndCheckListIsOrderedByName = function (sortOrder) {
|
||||
this.sortByName(sortOrder);
|
||||
var deferred = protractor.promise.defer();
|
||||
contentList.checkListIsOrderedByNameColumn(sortOrder).then(function(result) {
|
||||
contentList.checkListIsOrderedByNameColumn(sortOrder).then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
@@ -145,7 +146,7 @@ var ContentServicesPage = function (){
|
||||
this.sortAndCheckListIsOrderedByAuthor = function (sortOrder) {
|
||||
this.sortByAuthor(sortOrder);
|
||||
var deferred = protractor.promise.defer();
|
||||
contentList.checkListIsOrderedByAuthorColumn(sortOrder).then(function(result) {
|
||||
contentList.checkListIsOrderedByAuthorColumn(sortOrder).then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
@@ -160,7 +161,7 @@ var ContentServicesPage = function (){
|
||||
this.sortAndCheckListIsOrderedByCreated = function (sortOrder) {
|
||||
this.sortByCreated(sortOrder);
|
||||
var deferred = protractor.promise.defer();
|
||||
contentList.checkListIsOrderedByCreatedColumn(sortOrder).then(function(result) {
|
||||
contentList.checkListIsOrderedByCreatedColumn(sortOrder).then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
@@ -195,7 +196,7 @@ var ContentServicesPage = function (){
|
||||
};
|
||||
|
||||
this.checkContentsAreDisplayed = function (content) {
|
||||
for( i=0; i < content.length; i++) {
|
||||
for (i = 0; i < content.length; i++) {
|
||||
this.checkContentIsDisplayed(content[i]);
|
||||
}
|
||||
return this;
|
||||
@@ -207,7 +208,7 @@ var ContentServicesPage = function (){
|
||||
};
|
||||
|
||||
this.checkContentsAreNotDisplayed = function (content) {
|
||||
for( i=0; i < content.length; i++) {
|
||||
for (i = 0; i < content.length; i++) {
|
||||
this.checkContentIsNotDisplayed(content[i]);
|
||||
}
|
||||
return this;
|
||||
@@ -220,7 +221,7 @@ var ContentServicesPage = function (){
|
||||
|
||||
this.navigateToFolderViaBreadcrumbs = function (folder) {
|
||||
contentList.tableIsLoaded();
|
||||
var breadcrumb = element(by.css("a[data-automation-id='breadcrumb_"+ folder +"']"));
|
||||
var breadcrumb = element(by.css("a[data-automation-id='breadcrumb_" + folder + "']"));
|
||||
Util.waitUntilElementIsVisible(breadcrumb);
|
||||
breadcrumb.click();
|
||||
contentList.tableIsLoaded();
|
||||
@@ -232,7 +233,7 @@ var ContentServicesPage = function (){
|
||||
return activeBreadcrumb.getAttribute("title");
|
||||
};
|
||||
|
||||
this.getCurrentFolderID = function() {
|
||||
this.getCurrentFolderID = function () {
|
||||
Util.waitUntilElementIsVisible(folderID);
|
||||
return folderID.getText();
|
||||
};
|
||||
@@ -252,9 +253,10 @@ var ContentServicesPage = function (){
|
||||
this.uploadMultipleFile = function (files) {
|
||||
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
|
||||
var allFiles = path.resolve(path.join(TestConfig.main.rootPath, files[0]));
|
||||
for(var i =1; i< files.length; i++) {
|
||||
for (var i = 1; i < files.length; i++) {
|
||||
allFiles = allFiles + "\n" + path.resolve(path.join(TestConfig.main.rootPath, files[i]));
|
||||
};
|
||||
}
|
||||
;
|
||||
uploadMultipleFileButton.sendKeys(allFiles);
|
||||
Util.waitUntilElementIsVisible(uploadMultipleFileButton);
|
||||
return this;
|
||||
@@ -282,11 +284,15 @@ var ContentServicesPage = function (){
|
||||
return uploadFolderButton.getAttribute("title");
|
||||
};
|
||||
|
||||
this.checkUploadButton = function () {
|
||||
Util.waitUntilElementIsVisible(uploadFileButton);
|
||||
Util.waitUntilElementIsClickable(uploadFileButton);
|
||||
return this;
|
||||
};
|
||||
this.checkUploadButton = function () {
|
||||
Util.waitUntilElementIsVisible(uploadFileButton);
|
||||
Util.waitUntilElementIsClickable(uploadFileButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.uploadButtonIsEnabled = function () {
|
||||
return uploadFileButton.isEnabled()
|
||||
};
|
||||
|
||||
this.deleteContent = function (content) {
|
||||
contentList.deleteContent(content);
|
||||
@@ -294,17 +300,18 @@ var ContentServicesPage = function (){
|
||||
};
|
||||
|
||||
this.deleteContents = function (content) {
|
||||
for( i=0; i<content.length; i++) {
|
||||
for (i = 0; i < content.length; i++) {
|
||||
this.deleteContent(content[i]);
|
||||
this.checkContentIsNotDisplayed(content[i]);
|
||||
};
|
||||
}
|
||||
;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getErrorMessage = function() {
|
||||
this.getErrorMessage = function () {
|
||||
Util.waitUntilElementIsVisible(errorSnackBar);
|
||||
var deferred = protractor.promise.defer();
|
||||
errorSnackBar.getText().then( function (text) {
|
||||
errorSnackBar.getText().then(function (text) {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
@@ -328,10 +335,14 @@ var ContentServicesPage = function (){
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkPaginationIsNotDisplayed = function (){
|
||||
this.checkPaginationIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(emptyPagination);
|
||||
};
|
||||
|
||||
this.checkDandDIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(dragAndDrop);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
module.exports = ContentServicesPage;
|
||||
|
@@ -277,7 +277,7 @@ var ContentList = function () {
|
||||
};
|
||||
|
||||
this.checkContentIsNotDisplayed = function (content) {
|
||||
Util.waitUntilElementIsNotVisible(element(by.css("span[title='" + content + "']")));
|
||||
Util.waitUntilElementIsNotVisible(element(by.css("adf-document-list span[title='" + content + "']")));
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@@ -25,6 +25,7 @@ var UploadDialog = function () {
|
||||
var minimizedDialog = element(by.css("div[class*='upload-dialog--minimized']"));
|
||||
var uploadedStatusIcon = by.css("mat-icon[class*='status--done']");
|
||||
var cancelledStatusIcon = by.css("div[class*='status--cancelled']");
|
||||
var errorStatusIcon = by.css("div[class*='status--error']");
|
||||
var cancelWhileUploadingIcon = by.css("mat-icon[class*='adf-file-uploading-row__action adf-file-uploading-row__action--cancel']");
|
||||
var rowByRowName = by.xpath("ancestor::adf-file-uploading-list-row");
|
||||
var title = element(by.css("span[class*='upload-dialog__title']"));
|
||||
@@ -78,6 +79,11 @@ var UploadDialog = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.fileIsError = function (content) {
|
||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(errorStatusIcon));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.filesAreUploaded = function (content) {
|
||||
for (i=0; i<content.length; i++) {
|
||||
this.fileIsUploaded(content[i]);
|
||||
|
@@ -27,6 +27,7 @@ var UploadToggles = function () {
|
||||
var versioningToggle = element(by.cssContainingText("span[class*='toggle-content']", "Enable versioning"));
|
||||
var extensionAcceptedField = element(by.css("input[data-automation-id='accepted-files-type']"));
|
||||
var maxSizeField = element(by.css("input[data-automation-id='max-files-size']"));
|
||||
var disableUploadCheckbox = element(by.css("[id='adf-disable-upload']"));
|
||||
|
||||
this.enableMultipleFileUpload = function () {
|
||||
this.enableToggle(multipleFileUploadToggle);
|
||||
@@ -78,6 +79,10 @@ var UploadToggles = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickCheckboxDisableUpload = function () {
|
||||
return disableUploadCheckbox.click();
|
||||
};
|
||||
|
||||
this.enableToggle = function (toggle) {
|
||||
Util.waitUntilElementIsVisible(toggle);
|
||||
Util.waitUntilElementIsPresent(toggle);
|
||||
|
@@ -19,7 +19,7 @@ var Util = require('../../util/util');
|
||||
var TestConfig = require('../../test.config');
|
||||
var AdfSettingsPage = require('./settingsPage');
|
||||
|
||||
var LoginPage = function (){
|
||||
var LoginPage = function () {
|
||||
|
||||
var loginURL = TestConfig.adf.url + TestConfig.adf.port + "/login";
|
||||
var txtUsername = element(by.css("input[id='username']"));
|
||||
@@ -48,13 +48,13 @@ var LoginPage = function (){
|
||||
* @property waitForElements
|
||||
* @type protractor.Element
|
||||
* */
|
||||
this.waitForElements = function (){
|
||||
this.waitForElements = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
|
||||
Util.waitUntilElementIsVisible(txtUsername).then(()=>{
|
||||
Util.waitUntilElementIsVisible(txtPassword).then(()=>{
|
||||
Util.waitUntilElementIsVisible(txtUsername).then(() => {
|
||||
Util.waitUntilElementIsVisible(txtPassword).then(() => {
|
||||
deferred.fulfill();
|
||||
},()=>{
|
||||
}, () => {
|
||||
deferred.rejected();
|
||||
})
|
||||
});
|
||||
@@ -68,7 +68,7 @@ var LoginPage = function (){
|
||||
* @method enterUsername
|
||||
* @param {String} username
|
||||
*/
|
||||
this.enterUsername = function (username){
|
||||
this.enterUsername = function (username) {
|
||||
Util.waitUntilElementIsVisible(txtUsername);
|
||||
txtUsername.sendKeys('');
|
||||
txtUsername.clear();
|
||||
@@ -81,7 +81,7 @@ var LoginPage = function (){
|
||||
* @method enterPassword
|
||||
* @param {String} password
|
||||
*/
|
||||
this.enterPassword = function (password){
|
||||
this.enterPassword = function (password) {
|
||||
Util.waitUntilElementIsVisible(txtPassword);
|
||||
browser.driver.sleep(500);
|
||||
txtPassword.clear();
|
||||
@@ -93,7 +93,7 @@ var LoginPage = function (){
|
||||
* @method clearUsername
|
||||
* @param {String} username
|
||||
*/
|
||||
this.clearUsername = function(){
|
||||
this.clearUsername = function () {
|
||||
Util.waitUntilElementIsVisible(txtUsername);
|
||||
txtUsername.click().clear();
|
||||
};
|
||||
@@ -103,12 +103,12 @@ var LoginPage = function (){
|
||||
* @method clearPassword
|
||||
* @param {String} password
|
||||
*/
|
||||
this.clearPassword = function (){
|
||||
this.clearPassword = function () {
|
||||
Util.waitUntilElementIsVisible(txtPassword);
|
||||
txtPassword.getAttribute('value').then(function (value){
|
||||
txtPassword.getAttribute('value').then(function (value) {
|
||||
for (var i = value.length; i >= 0; i--) {
|
||||
txtPassword.sendKeys(protractor.Key.BACK_SPACE);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -117,7 +117,7 @@ var LoginPage = function (){
|
||||
* @method checkUsernameTooltip
|
||||
* @param {String} message
|
||||
*/
|
||||
this.checkUsernameTooltip = function (message){
|
||||
this.checkUsernameTooltip = function (message) {
|
||||
Util.waitUntilElementIsVisible(usernameTooltip);
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ var LoginPage = function (){
|
||||
* @method checkPasswordTooltip
|
||||
* @param {String} message
|
||||
*/
|
||||
this.checkPasswordTooltip = function (message){
|
||||
this.checkPasswordTooltip = function (message) {
|
||||
Util.waitUntilElementIsVisible(passwordTooltip);
|
||||
};
|
||||
|
||||
@@ -135,7 +135,7 @@ var LoginPage = function (){
|
||||
* @method checkLoginError
|
||||
* @param {String} message
|
||||
*/
|
||||
this.checkLoginError = function (message){
|
||||
this.checkLoginError = function (message) {
|
||||
Util.waitUntilElementIsVisible(loginTooltip);
|
||||
expect(loginTooltip.getText()).toEqual(message);
|
||||
};
|
||||
@@ -144,23 +144,23 @@ var LoginPage = function (){
|
||||
* checks username field is inactive
|
||||
* @method checkUsernameInactive
|
||||
*/
|
||||
this.checkUsernameInactive = function (){
|
||||
this.checkUsernameInactive = function () {
|
||||
Util.waitUntilElementIsVisible(usernameInactive);
|
||||
},
|
||||
|
||||
/**
|
||||
* checks password field is inactive
|
||||
* @method checkPasswordInactive
|
||||
*/
|
||||
this.checkPasswordInactive = function (){
|
||||
Util.waitUntilElementIsVisible(passwordInactive);
|
||||
};
|
||||
/**
|
||||
* checks password field is inactive
|
||||
* @method checkPasswordInactive
|
||||
*/
|
||||
this.checkPasswordInactive = function () {
|
||||
Util.waitUntilElementIsVisible(passwordInactive);
|
||||
};
|
||||
|
||||
/**
|
||||
* checks username field is highlighted
|
||||
* @method checkUsernameHighlighted
|
||||
*/
|
||||
this.checkUsernameHighlighted = function (){
|
||||
this.checkUsernameHighlighted = function () {
|
||||
adfLogo.click();
|
||||
Util.waitUntilElementIsVisible(usernameHighlighted);
|
||||
};
|
||||
@@ -169,7 +169,7 @@ var LoginPage = function (){
|
||||
* checks password field is highlighted
|
||||
* @method checkPasswordHighlighted
|
||||
*/
|
||||
this.checkPasswordHighlighted = function (){
|
||||
this.checkPasswordHighlighted = function () {
|
||||
adfLogo.click();
|
||||
Util.waitUntilElementIsVisible(passwordHighlighted);
|
||||
};
|
||||
@@ -178,7 +178,7 @@ var LoginPage = function (){
|
||||
* check Username tooltip is not visible
|
||||
* @method checkUsernameTooltipIsNotVisible
|
||||
*/
|
||||
this.checkUsernameTooltipIsNotVisible = function (){
|
||||
this.checkUsernameTooltipIsNotVisible = function () {
|
||||
Util.waitUntilElementIsNotVisible(usernameTooltip);
|
||||
};
|
||||
|
||||
@@ -186,7 +186,7 @@ var LoginPage = function (){
|
||||
* checks password tooltip is not visible
|
||||
* @method checkPasswordTooltipIsNotVisible
|
||||
*/
|
||||
this.checkPasswordTooltipIsNotVisible = function (){
|
||||
this.checkPasswordTooltipIsNotVisible = function () {
|
||||
Util.waitUntilElementIsNotVisible(passwordTooltip);
|
||||
};
|
||||
|
||||
@@ -194,7 +194,7 @@ var LoginPage = function (){
|
||||
* checks sign in button is enabled
|
||||
* @method checkSignInButtonIsEnabled
|
||||
*/
|
||||
this.checkSignInButtonIsEnabled = function (){
|
||||
this.checkSignInButtonIsEnabled = function () {
|
||||
Util.waitUntilElementIsVisible(signInButton);
|
||||
expect(signInButton.isEnabled()).toBe(true);
|
||||
};
|
||||
@@ -203,7 +203,7 @@ var LoginPage = function (){
|
||||
* Logs into adf using default host config
|
||||
* @method defaultLogin
|
||||
*/
|
||||
this.defaultLogin = function (){
|
||||
this.defaultLogin = function () {
|
||||
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
|
||||
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
};
|
||||
@@ -212,7 +212,7 @@ var LoginPage = function (){
|
||||
* Logs into adf using userModel
|
||||
* @method loginUsingUserModel
|
||||
*/
|
||||
this.loginUsingUserModel = function (userModel){
|
||||
this.loginUsingUserModel = function (userModel) {
|
||||
browser.driver.get(TestConfig.adf.url + TestConfig.adf.login);
|
||||
this.waitForElements();
|
||||
this.login(userModel.getId(), userModel.getPassword());
|
||||
@@ -222,14 +222,14 @@ var LoginPage = function (){
|
||||
* Logs into ADF using userModel - only Process Services enabled
|
||||
* @method loginUsingUserModel
|
||||
*/
|
||||
this.loginToProcessServicesUsingUserModel = function (userModel){
|
||||
this.loginToProcessServicesUsingUserModel = function (userModel) {
|
||||
adfSettingsPage.setProviderBpm();
|
||||
this.waitForElements();
|
||||
this.login(userModel.email, userModel.password);
|
||||
};
|
||||
|
||||
|
||||
this.loginToProcessServicesUsingDefaultUser = function (){
|
||||
this.loginToProcessServicesUsingDefaultUser = function () {
|
||||
adfSettingsPage.setProviderBpm();
|
||||
this.waitForElements();
|
||||
this.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
@@ -242,19 +242,26 @@ var LoginPage = function (){
|
||||
this.login(userModel.getId(), userModel.getPassword());
|
||||
};
|
||||
|
||||
this.loginToContentServices = function (username, password) {
|
||||
adfSettingsPage.setProviderEcm();
|
||||
this.waitForElements();
|
||||
|
||||
this.login(username, password);
|
||||
};
|
||||
|
||||
/**
|
||||
* Go to adf login page
|
||||
* @method goToLoginPage
|
||||
*/
|
||||
this.goToLoginPage = function (){
|
||||
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port+'/login');
|
||||
};
|
||||
this.goToLoginPage = function () {
|
||||
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
|
||||
};
|
||||
|
||||
/**
|
||||
* checks sign in button is disabled
|
||||
* @method checkSignInButtonIsDisabled
|
||||
*/
|
||||
this.checkSignInButtonIsDisabled = function (){
|
||||
this.checkSignInButtonIsDisabled = function () {
|
||||
Util.waitUntilElementIsVisible(signInButton);
|
||||
expect(signInButton.isEnabled()).toBe(false);
|
||||
};
|
||||
@@ -263,7 +270,7 @@ var LoginPage = function (){
|
||||
* clicks the sign in button
|
||||
* @method clickSignInButton
|
||||
*/
|
||||
this.clickSignInButton = function (){
|
||||
this.clickSignInButton = function () {
|
||||
Util.waitUntilElementIsVisible(signInButton);
|
||||
signInButton.click();
|
||||
};
|
||||
@@ -272,12 +279,12 @@ var LoginPage = function (){
|
||||
* clicks icon to show password
|
||||
* @method showPassword
|
||||
*/
|
||||
this.showPassword = function (){
|
||||
this.showPassword = function () {
|
||||
Util.waitUntilElementIsVisible(showPassword);
|
||||
showPassword.click();
|
||||
};
|
||||
|
||||
this.getShowPasswordIconColor = function (){
|
||||
this.getShowPasswordIconColor = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
|
||||
Util.waitUntilElementIsVisible(showPassword);
|
||||
@@ -288,7 +295,7 @@ var LoginPage = function (){
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getSignInButtonColor = function (){
|
||||
this.getSignInButtonColor = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
|
||||
Util.waitUntilElementIsVisible(signInButton);
|
||||
@@ -299,7 +306,7 @@ var LoginPage = function (){
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.getBackgroundColor = function (){
|
||||
this.getBackgroundColor = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
|
||||
Util.waitUntilElementIsVisible(cardBackground);
|
||||
@@ -314,7 +321,7 @@ var LoginPage = function (){
|
||||
* clicks icon to hide password
|
||||
* @method hidePassword
|
||||
*/
|
||||
this.hidePassword = function (){
|
||||
this.hidePassword = function () {
|
||||
Util.waitUntilElementIsVisible(hidePassword);
|
||||
hidePassword.click();
|
||||
};
|
||||
@@ -324,7 +331,7 @@ var LoginPage = function (){
|
||||
* @method checkPasswordIsShown
|
||||
* @param password
|
||||
*/
|
||||
this.checkPasswordIsShown = function (password){
|
||||
this.checkPasswordIsShown = function (password) {
|
||||
txtPassword.getAttribute('value').then(function (text) {
|
||||
expect(text).toEqual(password);
|
||||
});
|
||||
@@ -334,7 +341,7 @@ var LoginPage = function (){
|
||||
* checks if password is hidden
|
||||
* @method checkPasswordIsHidden
|
||||
*/
|
||||
this.checkPasswordIsHidden = function (){
|
||||
this.checkPasswordIsHidden = function () {
|
||||
Util.waitUntilElementIsVisible(txtPassword);
|
||||
};
|
||||
|
||||
@@ -342,7 +349,7 @@ var LoginPage = function (){
|
||||
* checks 'Remember me' is displayed
|
||||
* @method checkRememberIsDisplayed
|
||||
*/
|
||||
this.checkRememberIsDisplayed = function (){
|
||||
this.checkRememberIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(rememberMe);
|
||||
};
|
||||
|
||||
@@ -350,7 +357,7 @@ var LoginPage = function (){
|
||||
* checks 'Remember me' is not displayed
|
||||
* @method checkRememberIsNotDisplayed
|
||||
*/
|
||||
this.checkRememberIsNotDisplayed = function (){
|
||||
this.checkRememberIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(rememberMe);
|
||||
};
|
||||
|
||||
@@ -358,7 +365,7 @@ var LoginPage = function (){
|
||||
* checks 'Need help' is Displayed
|
||||
* @method checkNeedHelpIsDisplayed
|
||||
*/
|
||||
this.checkNeedHelpIsDisplayed = function (){
|
||||
this.checkNeedHelpIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(needHelp);
|
||||
};
|
||||
|
||||
@@ -366,7 +373,7 @@ var LoginPage = function (){
|
||||
* checks 'Need Help' is not displayed
|
||||
* @method checkNeedHelpIsNotDisplayed
|
||||
*/
|
||||
this.checkNeedHelpIsNotDisplayed = function (){
|
||||
this.checkNeedHelpIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(needHelp);
|
||||
};
|
||||
|
||||
@@ -374,7 +381,7 @@ var LoginPage = function (){
|
||||
* checks 'Register' is displayed
|
||||
* @method checkRegisterDisplayed
|
||||
*/
|
||||
this.checkRegisterDisplayed = function (){
|
||||
this.checkRegisterDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(register);
|
||||
};
|
||||
|
||||
@@ -382,7 +389,7 @@ var LoginPage = function (){
|
||||
* checks 'Register' is not displayed
|
||||
* @method checkRegisterIsNotDisplayed
|
||||
*/
|
||||
this.checkRegisterIsNotDisplayed = function (){
|
||||
this.checkRegisterIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(register);
|
||||
};
|
||||
|
||||
@@ -390,10 +397,10 @@ var LoginPage = function (){
|
||||
* enables footer switch
|
||||
* @method enableFooter
|
||||
*/
|
||||
this.enableFooter = function (){
|
||||
this.enableFooter = function () {
|
||||
Util.waitUntilElementIsVisible(footerSwitch);
|
||||
footerSwitch.getAttribute('class').then(function (check) {
|
||||
if (check === 'mat-slide-toggle mat-primary'){
|
||||
if (check === 'mat-slide-toggle mat-primary') {
|
||||
footerSwitch.click();
|
||||
expect(footerSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary mat-checked');
|
||||
}
|
||||
@@ -404,10 +411,10 @@ var LoginPage = function (){
|
||||
* disables footer switch
|
||||
* @method disableFooter
|
||||
*/
|
||||
this.disableFooter = function (){
|
||||
this.disableFooter = function () {
|
||||
Util.waitUntilElementIsVisible(footerSwitch);
|
||||
footerSwitch.getAttribute('class').then(function (check) {
|
||||
if (check ==='mat-slide-toggle mat-primary mat-checked'){
|
||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||
footerSwitch.click();
|
||||
expect(footerSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||
}
|
||||
|
28
e2e/pages/adf/notificationPage.js
Normal file
28
e2e/pages/adf/notificationPage.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @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 NotificationPage = function () {
|
||||
|
||||
this.checkNotifyContains = function (message) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText('simple-snack-bar', message)));
|
||||
return this;
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = NotificationPage;
|
Reference in New Issue
Block a user