[no-issue] refactor failing e2e (#3865)

* fix ps test

* fix import

* fix import

* fix ps

* fix hyperlink

* fix radio hiperlynk

* autorename for clashes

* notification fix

* convert userdialog to ts

* fix travis configuration

* fix download in folder

* convert contentservice page to ts

* convert setting and login to ts

* remove unused import

* fix login import

* fix login page

* fix chips

* fix import
speed up viewer test

* fix contentlist

* change id

* fix cs e2e

* fix search lint

* fix name issue
This commit is contained in:
Eugenio Romano
2018-10-11 14:22:44 +01:00
committed by GitHub
parent 29f28c7c82
commit 7fd905d92c
120 changed files with 2453 additions and 2985 deletions

View File

@@ -1,53 +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 AppNavigationBarPage = function () {
var tasksButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Tasks")).first();
var tagButton = element.all(by.css("[data-automation-id='Tag']"));
var processButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Process")).first();
var reportsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Reports")).first();
var settingsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Settings")).first();
var reportsButtonSelected = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div[aria-selected='true']", "Reports")).first();
this.clickTasksButton = function () {
Util.waitUntilElementIsVisible(tasksButton);
return tasksButton.click();
};
this.clickProcessButton = function () {
return processButton.click();
};
this.clickTagButton = function () {
return tagButton.click();
};
this.clickSettingsButton = function () {
return settingsButton.click();
};
this.clickReportsButton = function () {
Util.waitUntilElementIsVisible(reportsButton);
reportsButton.click();
return Util.waitUntilElementIsVisible(reportsButtonSelected);
};
};
module.exports = AppNavigationBarPage;

View File

@@ -0,0 +1,51 @@
/*!
* @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');
export class AppNavigationBarPage {
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
tagButton = element.all(by.css('[data-automation-id="Tag"]'));
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
clickTasksButton() {
Util.waitUntilElementIsVisible(this.tasksButton);
return this.tasksButton.click();
}
clickProcessButton() {
return this.processButton.click();
}
clickTagButton() {
return this.tagButton.click();
}
clickSettingsButton() {
return this.settingsButton.click();
}
clickReportsButton() {
Util.waitUntilElementIsVisible(this.reportsButton);
this.reportsButton.click();
return Util.waitUntilElementIsVisible(this.reportsButtonSelected);
}
}

View File

@@ -26,7 +26,6 @@ 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']"));

View File

@@ -1,108 +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 AppNavigationBarPage = require('./appNavigationBarPage');
var ProcessServicesPage = function(){
var apsAppsContainer = element(by.css("div[class='adf-app-listgrid ng-star-inserted']"));
var processServices = element(by.css("a[data-automation-id='Process Services']"));
var taskApp = element(by.css("mat-card[title='Task App']"));
var iconTypeLocator = by.css("mat-icon[class*='card-logo-icon']");
var descriptionLocator = by.css("mat-card-subtitle[class*='subtitle']");
var processInstanceList = element(by.css("adf-process-instance-list"));
/**
* Check Process Page Container is displayed
* @method checkApsContainer
*/
this.checkApsContainer = function(){
Util.waitUntilElementIsVisible(apsAppsContainer);
};
/**
* Go to Process Services Page
* @method goToProcessServices
* */
this.goToProcessServices = function() {
Util.waitUntilElementIsVisible(processServices);
processServices.click();
this.checkApsContainer();
return this;
};
/**
* Go to App
* @method goToApp
* */
this.goToApp = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
app.click();
return new AppNavigationBarPage();
};
/**
* Go to Task App
* @method goToTaskApp
* */
this.goToTaskApp = function() {
Util.waitUntilElementIsVisible(taskApp);
taskApp.click();
return new AppNavigationBarPage();
};
this.getAppIconType = function (applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
var iconType = app.element(iconTypeLocator);
Util.waitUntilElementIsVisible(iconType);
return iconType.getText();
};
this.getBackgroundColor = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
return app.getCssValue("background-color");
};
this.getDescription = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
Util.waitUntilElementIsVisible(app);
var description = app.element(descriptionLocator);
Util.waitUntilElementIsVisible(description);
return description.getText();
};
this.checkAppIsNotDisplayed = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
return Util.waitUntilElementIsNotOnPage(app);
};
this.checkAppIsDisplayed = function(applicationName) {
var app = element(by.css("mat-card[title='" + applicationName +"']"));
return Util.waitUntilElementIsVisible(app);
};
this.checkProcessListIsDisplayed = function() {
Util.waitUntilElementIsVisible(processInstanceList);
}
};
module.exports = ProcessServicesPage;

View File

@@ -0,0 +1,90 @@
/*!
* @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 { AppNavigationBarPage } from './appNavigationBarPage';
export class ProcessServicesPage {
apsAppsContainer = element(by.css('div[class="adf-app-listgrid ng-star-inserted"]'));
processServices = element(by.css('a[data-automation-id="Process Services"]'));
taskApp = element(by.css('mat-card[title="Task App"]'));
iconTypeLocator = by.css('mat-icon[class*="card-logo-icon"]');
descriptionLocator = by.css('mat-card-subtitle[class*="subtitle"]');
processInstanceList = element(by.css('adf-process-instance-list'));
checkApsContainer() {
Util.waitUntilElementIsVisible(this.apsAppsContainer);
}
goToProcessServices() {
Util.waitUntilElementIsVisible(this.processServices);
this.processServices.click();
this.checkApsContainer();
return this;
}
goToApp(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
app.click();
return new AppNavigationBarPage();
}
goToTaskApp() {
Util.waitUntilElementIsVisible(this.taskApp);
this.taskApp.click();
return new AppNavigationBarPage();
}
getAppIconType(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
let iconType = app.element(this.iconTypeLocator);
Util.waitUntilElementIsVisible(iconType);
return iconType.getText();
}
getBackgroundColor(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
return app.getCssValue('background-color');
}
getDescription(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
Util.waitUntilElementIsVisible(app);
let description = app.element(this.descriptionLocator);
Util.waitUntilElementIsVisible(description);
return description.getText();
}
checkAppIsNotDisplayed(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
return Util.waitUntilElementIsNotOnPage(app);
}
checkAppIsDisplayed(applicationName) {
let app = element(by.css('mat-card[title="' + applicationName + '"]'));
return Util.waitUntilElementIsVisible(app);
}
checkProcessListIsDisplayed() {
Util.waitUntilElementIsVisible(this.processInstanceList);
}
}

View File

@@ -16,11 +16,11 @@
*/
import { AppSettingsToggles } from './dialog/appSettingsToggles';
import { TabsPage } from '../material/tabsPage';
import Util = require('../../../util/util');
export class TaskDetailsPage {
appSettingsToggles = new AppSettingsToggles();
formNameField = element(by.css('span[data-automation-id*="formName"] span'));
assigneeField = element(by.css('span[data-automation-id*="assignee"] span'));
statusField = element(by.css('span[data-automation-id*="status"] span'));
@@ -33,14 +33,11 @@ export class TaskDetailsPage {
activitiesTitle = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div'));
commentField = element(by.id('comment-input'));
addCommentButton = element(by.css('[data-automation-id="comments-input-add"]'));
activityTab = element(by.cssContainingText('div[class*="mat-tab-label"]', 'Activity'));
detailsTab = element(by.cssContainingText('div[class*="mat-tab-label""]', 'Details'));
involvePeopleButton = element(by.css('div[class*="add-people"]'));
addPeopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
addInvolvedUserButton = element(by.css('button[id="add-people"] span'));
emailInvolvedUser = by.xpath('following-sibling::div[@class="people-email ng-star-inserted"]');
editActionInvolvedUser = by.xpath('following-sibling::div[@class="people-edit-label ng-star-inserted"]');
involvedUserPic = by.xpath('ancestor::div/ancestor::div/preceding-sibling::div//div[@class="adf-people-search-people-pic ng-star-inserted"]');
tadkDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
taskDetailsSection = element(by.css('div[data-automation-id="adf-tasks-details"]'));
taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
@@ -187,24 +184,14 @@ export class TaskDetailsPage {
}
selectActivityTab() {
Util.waitUntilElementIsVisible(this.activityTab);
activityTab.getAttribute('aria-selected').then((check) => {
if (check === 'false') {
this.activityTab.click();
expect(this.activityTab.getAttribute('aria-selected') === 'true');
}
});
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Activity');
return this;
}
selectDetailsTab() {
Util.waitUntilElementIsVisible(this.detailsTab);
detailsTab.getAttribute('aria-selected').then((check) => {
if (check === 'false') {
this.detailsTab.click();
expect(this.detailsTab.getAttribute('aria-selected') === 'true');
}
});
let tabsPage = new TabsPage;
tabsPage.clickTabByTitle('Details');
return this;
}
@@ -275,13 +262,13 @@ export class TaskDetailsPage {
}
getInvolvedUserEmail(user) {
let email = this.getRowsUser(user).element(emailInvolvedUser);
let email = this.getRowsUser(user).element(this.emailInvolvedUser);
Util.waitUntilElementIsVisible(email);
return email.getText();
}
getInvolvedUserEditAction(user) {
let edit = this.getRowsUser(user).element(editActionInvolvedUser);
let edit = this.getRowsUser(user).element(this.editActionInvolvedUser);
Util.waitUntilElementIsVisible(edit);
return edit.getText();
}
@@ -292,7 +279,7 @@ export class TaskDetailsPage {
}
appSettingsToggles() {
return this.appSettingsToggles;
return new AppSettingsToggles();
}
taskInfoDrawerIsDisplayed() {
@@ -346,12 +333,6 @@ export class TaskDetailsPage {
return this.peopleTitle.getText();
}
getInvolvedPeopleInitialImage(user) {
let pic = this.getRowsUser(user).element(this.involvedUserPic);
Util.waitUntilElementIsVisible(pic);
return pic.getText();
}
checkTaskDetails() {
Util.waitUntilElementIsVisible(this.taskDetailsSection);
return this.taskDetailsSection.getText();

View File

@@ -1,174 +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 StartTaskDialog = require('./dialog/startTaskDialog');
var FormFields = require('./formFields');
var TaskDetails = require('./taskDetailsPage');
var FiltersPage = require('./filtersPage');
var ChecklistDialog = require('./dialog/createChecklistDialog');
var TasksListPage = require('./tasksListPage');
var TasksPage = function () {
var createButton = element(by.css("button[data-automation-id='create-button'"));
var newTaskButton = element(by.css("button[data-automation-id='btn-start-task']"));
var addChecklistButton = element(by.css("button[class*='adf-add-to-checklist-button']"));
var rowByRowName = by.xpath("ancestor::mat-chip");
var checklistContainer = by.css("div[class*='checklist-menu']");
var taskTitle = "h2[class='activiti-task-details__header'] span";
var rows = by.css("div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[class*='adf-data-table-cell']");
var completeButtonNoForm = element(by.id("adf-no-form-complete-button"));
var checklistDialog = element(by.id("checklist-dialog"));
var checklistNoMessage = element(by.id("checklist-none-message"));
var numberOfChecklists = element(by.css("[data-automation-id='checklist-label'] mat-chip"));
this.createNewTask = function () {
this.createButtonIsDisplayed();
this.clickOnCreateButton();
this.newTaskButtonIsDisplayed();
newTaskButton.click();
return new StartTaskDialog();
};
this.clickOnNewTaskButton = function() {
Util.waitUntilElementIsClickable(newTaskButton);
newTaskButton.click();
return this;
};
this.createButtonIsDisplayed = function() {
Util.waitUntilElementIsVisible(createButton);
return this;
};
this.newTaskButtonIsDisplayed = function() {
Util.waitUntilElementIsVisible(newTaskButton);
return this;
};
this.clickOnCreateButton = function() {
Util.waitUntilElementIsClickable(createButton);
createButton.click();
return this;
};
this.formFields = function () {
return new FormFields();
};
this.taskDetails = function () {
return new TaskDetails();
};
this.filtersPage = function () {
return new FiltersPage();
};
this.tasksListPage = function () {
return new TasksListPage();
};
this.usingCheckListDialog = function () {
return new ChecklistDialog();
};
this.clickOnAddChecklistButton = function () {
Util.waitUntilElementIsClickable(addChecklistButton);
addChecklistButton.click();
return new ChecklistDialog();
};
this.getRowsName = function (name) {
var row = element(checklistContainer).element(by.cssContainingText("span", name));
Util.waitUntilElementIsVisible(row);
return row;
};
this.getChecklistByName = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsVisible(row);
return row;
};
this.checkChecklistIsDisplayed = function (checklist) {
Util.waitUntilElementIsVisible(this.getChecklistByName(checklist));
return this;
};
this.checkChecklistIsNotDisplayed = function (checklist) {
Util.waitUntilElementIsNotOnPage(element(checklistContainer).element(by.cssContainingText("span", checklist)));
return this;
};
this.checkTaskTitle = function(taskName) {
Util.waitUntilElementIsVisible(element(by.css(taskTitle)));
var title = element(by.cssContainingText(taskTitle, taskName));
Util.waitUntilElementIsVisible(title);
return this;
};
this.getAllDisplayedRows = function(){
return element.all(rows).count();
};
this.completeTaskNoForm = function () {
Util.waitUntilElementIsClickable(completeButtonNoForm);
completeButtonNoForm.click();
};
this.completeTaskNoFormNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(completeButtonNoForm);
return this;
};
this.checkChecklistDialogIsDisplayed = function () {
Util.waitUntilElementIsVisible(checklistDialog);
return this;
};
this.checkChecklistDialogIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(checklistDialog);
return this;
};
this.checkNoChecklistIsDisplayed = function () {
Util.waitUntilElementIsVisible(checklistNoMessage);
return this;
};
this.getNumberOfChecklists = function () {
Util.waitUntilElementIsVisible(numberOfChecklists);
return numberOfChecklists.getText();
};
this.removeChecklists = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsVisible(row.element(by.css('button')));
row.element(by.css('button')).click();
return this;
};
this.checkChecklistsRemoveButtonIsNotDisplayed = function (checklist) {
var row = this.getRowsName(checklist).element(rowByRowName);
Util.waitUntilElementIsNotOnPage(row.element(by.css('button')));
return this;
};
};
module.exports = TasksPage;

View File

@@ -0,0 +1,167 @@
/*!
* @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 StartTaskDialog = require('./dialog/startTaskDialog');
import FormFields = require('./formFields');
import { TaskDetailsPage } from './taskDetailsPage';
import FiltersPage = require('./filtersPage');
import ChecklistDialog = require('./dialog/createChecklistDialog');
import TasksListPage = require('./tasksListPage');
export class TasksPage {
createButton = element(by.css('button[data-automation-id="create-button"'));
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
addChecklistButton = element(by.css('button[class*="adf-add-to-checklist-button"]'));
rowByRowName = by.xpath('ancestor::mat-chip');
checklistContainer = by.css('div[class*="checklist-menu"]');
taskTitle = 'h2[class="activiti-task-details__header"] span';
rows = by.css('div[class*="adf-datatable-body"] div[class*="adf-datatable-row"] div[class*="adf-data-table-cell"]');
completeButtonNoForm = element(by.id('adf-no-form-complete-button'));
checklistDialog = element(by.id('checklist-dialog'));
checklistNoMessage = element(by.id('checklist-none-message'));
numberOfChecklists = element(by.css('[data-automation-id="checklist-label"] mat-chip'));
createNewTask() {
this.createButtonIsDisplayed();
this.clickOnCreateButton();
this.newTaskButtonIsDisplayed();
this.newTaskButton.click();
return new StartTaskDialog();
}
createButtonIsDisplayed() {
Util.waitUntilElementIsVisible(this.createButton);
return this;
}
newTaskButtonIsDisplayed() {
Util.waitUntilElementIsVisible(this.newTaskButton);
return this;
}
clickOnCreateButton() {
Util.waitUntilElementIsClickable(this.createButton);
this.createButton.click();
return this;
}
formFields() {
return new FormFields();
}
taskDetails() {
return new TaskDetailsPage();
}
filtersPage() {
return new FiltersPage();
}
tasksListPage() {
return new TasksListPage();
}
usingCheckListDialog() {
return new ChecklistDialog();
}
clickOnAddChecklistButton() {
Util.waitUntilElementIsClickable(this.addChecklistButton);
this.addChecklistButton.click();
return new ChecklistDialog();
}
getRowsName(name) {
let row = element(this.checklistContainer).element(by.cssContainingText('span', name));
Util.waitUntilElementIsVisible(row);
return row;
}
getChecklistByName(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsVisible(row);
return row;
}
checkChecklistIsDisplayed(checklist) {
Util.waitUntilElementIsVisible(this.getChecklistByName(checklist));
return this;
}
checkChecklistIsNotDisplayed(checklist) {
Util.waitUntilElementIsNotOnPage(element(this.checklistContainer).element(by.cssContainingText('span', checklist)));
return this;
}
checkTaskTitle(taskName) {
Util.waitUntilElementIsVisible(element(by.css(this.taskTitle)));
let title = element(by.cssContainingText(this.taskTitle, taskName));
Util.waitUntilElementIsVisible(title);
return this;
}
getAllDisplayedRows() {
return element.all(this.rows).count();
}
completeTaskNoForm() {
Util.waitUntilElementIsClickable(this.completeButtonNoForm);
this.completeButtonNoForm.click();
}
completeTaskNoFormNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.completeButtonNoForm);
return this;
}
checkChecklistDialogIsDisplayed() {
Util.waitUntilElementIsVisible(this.checklistDialog);
return this;
}
checkChecklistDialogIsNotDisplayed() {
Util.waitUntilElementIsNotOnPage(this.checklistDialog);
return this;
}
checkNoChecklistIsDisplayed() {
Util.waitUntilElementIsVisible(this.checklistNoMessage);
return this;
}
getNumberOfChecklists() {
Util.waitUntilElementIsVisible(this.numberOfChecklists);
return this.numberOfChecklists.getText();
}
removeChecklists(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsVisible(row.element(by.css('mat-icon')));
row.element(by.css('mat-icon')).click();
return this;
}
checkChecklistsRemoveButtonIsNotDisplayed(checklist) {
let row = this.getRowsName(checklist).element(this.rowByRowName);
Util.waitUntilElementIsNotOnPage(row.element(by.css('mat-icon')));
return this;
}
}

View File

@@ -1,59 +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 FormFields = require('../formFields');
var TestConfig = require('../../../../test.config');
var path = require('path');
var Util = require('../../../../util/util');
var remote = require('selenium-webdriver/remote');
var AttachFile = function () {
var formFields = new FormFields();
var uploadLocator = by.css("button[id='attachfile']");
var localStorageButton = element(by.css("input[id='attachfile']"));
var filesListLocator = by.css("div[id='adf-attach-widget-readonly-list']");
this.attachFile = function (fieldId, fileLocation) {
browser.setFileDetector(new remote.FileDetector());
var widget = formFields.getWidget(fieldId);
var uploadButton = widget.element(uploadLocator);
Util.waitUntilElementIsVisible(uploadButton);
uploadButton.click();
Util.waitUntilElementIsVisible(localStorageButton);
localStorageButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
return this;
};
this.checkFileIsAttached = function (fieldId, name) {
var widget = formFields.getWidget(fieldId);
var fileAttached = widget.element(filesListLocator).element(by.cssContainingText("mat-list-item span ", name));
Util.waitUntilElementIsVisible(fileAttached);
return this;
};
this.viewFile = function (name) {
var fileView = element(filesListLocator).element(by.cssContainingText("mat-list-item span ", name));
Util.waitUntilElementIsVisible(fileView);
fileView.click();
browser.actions().doubleClick(fileView).perform();
return this;
};
};
module.exports = AttachFile;

View File

@@ -1,33 +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 FormFields = require('../formFields');
var DisplayText = function () {
var formFields = new FormFields();
var labelLocator = by.css("div[class*='display-text-widget']");
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
};
module.exports = DisplayText;

View File

@@ -1,32 +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 FormFields = require('../formFields');
var Dropdown = function () {
var formFields = new FormFields();
var selectedOptionLocator = by.css("mat-select[id='dropdown'] span span");
this.getSelectedOptionText = function (fieldId) {
return formFields.getFieldText(fieldId, selectedOptionLocator);
};
};
module.exports = Dropdown;

View File

@@ -1,103 +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 FormFields = require('../formFields');
var Util = require('../../../../util/util');
var DynamicTable = function () {
var formFields = new FormFields();
var labelLocator = by.css("dynamic-table-widget div div");
var columnNameLocator = by.css("table[id*='dynamic-table'] th");
var addButton = element(by.id("label-add-row"));
var columnDateTime = element(by.id("columnDateTime"));
var columnDate = element(by.id("columnDate"));
var calendarHeader = element(by.css("div[class='mat-datetimepicker-calendar-header-date-time']"));
var calendarContent = element(by.css("div[class='mat-datetimepicker-calendar-content']"));
var saveButton = element(by.cssContainingText('button span', 'Save'));
var errorMessage = element(by.css('div[class="adf-error-text"]'));
var dateWidget = element(by.css('button[aria-label="Open calendar"]'));
var calendarNumber = element.all(by.css('td div'));
var tableRow = element.all(by.css('tbody tr'));
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
this.getColumnName = function (fieldId) {
return formFields.getFieldText(fieldId, columnNameLocator);
};
this.clickAddButton = function () {
Util.waitUntilElementIsVisible(addButton);
return addButton.click();
};
this.clickColumnDateTime = function () {
Util.waitUntilElementIsVisible(columnDateTime);
columnDateTime.click();
Util.waitUntilElementIsVisible(calendarHeader);
Util.waitUntilElementIsVisible(calendarContent);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
};
this.addRandomStringOnDateTime = function (randomText) {
Util.waitUntilElementIsVisible(columnDateTime);
columnDateTime.click();
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
columnDateTime.sendKeys(randomText);
columnDateTime.sendKeys(protractor.Key.ENTER);
return columnDateTime.getAttribute('value');
};
this.addRandomStringOnDate = function(randomText) {
Util.waitUntilElementIsVisible(columnDate);
columnDate.click();
return columnDate.sendKeys(randomText);
};
this.clickSaveButton = function () {
Util.waitUntilElementIsVisible(saveButton);
return saveButton.click();
};
this.checkErrorMessage = function () {
Util.waitUntilElementIsVisible(errorMessage);
return errorMessage.getText();
};
this.clickDateWidget = function () {
Util.waitUntilElementIsVisible(dateWidget);
return dateWidget.click();
};
this.getDateCalendarNumber = function (date) {
return calendarNumber.get(date).click();
};
this.getTableRow = function (rowNumber) {
return Util.waitUntilElementIsVisible(tableRow.get(rowNumber));
};
this.waitForCalendarToDisappear = function () {
Util.waitUntilElementIsNotVisible(calendarNumber);
};
};
module.exports = DynamicTable;

View File

@@ -0,0 +1,57 @@
/*!
* @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 FormFields = require('../formFields');
import TestConfig = require('../../../../test.config');
import path = require('path');
import Util = require('../../../../util/util');
import remote = require('selenium-webdriver/remote');
export class AttachFile {
formFields = new FormFields();
uploadLocator = by.css('button[id="attachfile"]');
localStorageButton = element(by.css('input[id="attachfile"]'));
filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
attachFile(fieldId, fileLocation) {
browser.setFileDetector(new remote.FileDetector());
let widget = this.formFields.getWidget(fieldId);
let uploadButton = widget.element(this.uploadLocator);
Util.waitUntilElementIsVisible(uploadButton);
uploadButton.click();
Util.waitUntilElementIsVisible(this.localStorageButton);
this.localStorageButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
return this;
}
checkFileIsAttached(fieldId, name) {
let widget = this.formFields.getWidget(fieldId);
let fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
Util.waitUntilElementIsVisible(fileAttached);
return this;
}
viewFile(name) {
let fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
Util.waitUntilElementIsVisible(fileView);
fileView.click();
browser.actions().doubleClick(fileView).perform();
return this;
}
}

View File

@@ -15,19 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var MultilineText = function () {
export class DisplayText {
var formFields = new FormFields();
formFields = new FormFields();
var valueLocator = by.css("textarea");
labelLocator = by.css('div[class*="display-text-widget"]');
this.getFieldValue = function (fieldId) {
return formFields.getFieldValue(fieldId, valueLocator);
};
};
module.exports = MultilineText;
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
}

View File

@@ -15,18 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var Header = function () {
export class DisplayValue {
var formFields = new FormFields();
formFields = new FormFields();
var labelLocator = by.css("span[id='container-header-label']");
labelLocator = by.css('span[class*="unknown-text"]');
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
};
module.exports = Header;
}

View File

@@ -15,18 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var Hyperlink = function () {
export class Dropdown {
var formFields = new FormFields();
formFields = new FormFields();
var fieldLocator = by.css("div[class='adf-hyperlink-widget '] a");
selectedOptionLocator = by.css('mat-select[id="dropdown"] span span');
this.getFieldText = function (fieldId) {
return formFields.getFieldText(fieldId, fieldLocator);
};
getSelectedOptionText(fieldId) {
return this.formFields.getFieldText(fieldId, this.selectedOptionLocator);
}
};
module.exports = Hyperlink;
}

View File

@@ -0,0 +1,99 @@
/*!
* @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 FormFields = require('../formFields');
import Util = require('../../../../util/util');
export class DynamicTable {
formFields = new FormFields();
labelLocator = by.css('dynamic-table-widget div div');
columnNameLocator = by.css('table[id*="dynamic-table"] th');
addButton = element(by.id('label-add-row'));
columnDateTime = element(by.id('columnDateTime'));
columnDate = element(by.id('columnDate'));
calendarHeader = element(by.css('div[class="mat-datetimepicker-calendar-header-date-time"]'));
calendarContent = element(by.css('div[class="mat-datetimepicker-calendar-content"]'));
saveButton = element(by.cssContainingText('button span', 'Save'));
errorMessage = element(by.css('div[class="adf-error-text"]'));
dateWidget = element(by.css('button[aria-label="Open calendar"]'));
calendarNumber = element.all(by.css('td div'));
tableRow = element.all(by.css('tbody tr'));
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
getColumnName(fieldId) {
return this.formFields.getFieldText(fieldId, this.columnNameLocator);
}
clickAddButton() {
Util.waitUntilElementIsVisible(this.addButton);
return this.addButton.click();
}
clickColumnDateTime() {
Util.waitUntilElementIsVisible(this.columnDateTime);
this.columnDateTime.click();
Util.waitUntilElementIsVisible(this.calendarHeader);
Util.waitUntilElementIsVisible(this.calendarContent);
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
addRandomStringOnDateTime(randomText) {
Util.waitUntilElementIsVisible(this.columnDateTime);
this.columnDateTime.click();
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
this.columnDateTime.sendKeys(randomText);
this.columnDateTime.sendKeys(protractor.Key.ENTER);
return this.columnDateTime.getAttribute('value');
}
addRandomStringOnDate(randomText) {
Util.waitUntilElementIsVisible(this.columnDate);
this.columnDate.click();
return this.columnDate.sendKeys(randomText);
}
clickSaveButton() {
Util.waitUntilElementIsVisible(this.saveButton);
return this.saveButton.click();
}
checkErrorMessage() {
Util.waitUntilElementIsVisible(this.errorMessage);
return this.errorMessage.getText();
}
clickDateWidget() {
Util.waitUntilElementIsVisible(this.dateWidget);
return this.dateWidget.click();
}
getDateCalendarNumber(date) {
return this.calendarNumber.get(date).click();
}
getTableRow(rowNumber) {
return Util.waitUntilElementIsVisible(this.tableRow.get(rowNumber));
}
waitForCalendarToDisappear() {
Util.waitUntilElementIsNotVisible(this.calendarNumber);
}
}

View File

@@ -15,20 +15,16 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
import FormFields = require('../formFields');
var DisplayValue = function () {
export class Header {
var formFields = new FormFields();
formFields = new FormFields();
var labelLocator = by.css("span[class*='unknown-text']");
this.getFieldLabel = function (fieldId) {
return formFields.getFieldLabel(fieldId, labelLocator);
};
};
module.exports = DisplayValue;
labelLocator = by.css('span[id="container-header-label"]');
getFieldLabel(fieldId) {
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
}
}

View File

@@ -0,0 +1,30 @@
/*!
* @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 FormFields = require('../formFields');
export class Hyperlink {
formFields = new FormFields();
fieldLocator = by.css('div[class="adf-hyperlink-widget "] a');
getFieldText(fieldId) {
return this.formFields.getFieldText(fieldId, this.fieldLocator);
}
}

View File

@@ -0,0 +1,30 @@
/*!
* @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 FormFields = require('../formFields');
export class MultilineText {
formFields = new FormFields();
valueLocator = by.css('textarea');
getFieldValue(fieldId) {
return this.formFields.getFieldValue(fieldId, this.valueLocator);
}
}

View File

@@ -15,20 +15,19 @@
* limitations under the License.
*/
var FormFields = require('../formFields');
var Util = require('../../../../util/util');
import FormFields = require('../formFields');
import Util = require('../../../../util/util');
var RadioButtons = function () {
export class RadioButtons {
var formFields = new FormFields();
formFields = new FormFields();
this.getSpecificOptionLabel = function (fieldId, optionNumber) {
var optionLocator = by.css("label[for*='radiobuttons-option_" + optionNumber + "'] div[class*='content']");
var option = formFields.getWidget(fieldId).element(optionLocator);
getSpecificOptionLabel(fieldId, optionNumber) {
let optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"] div[class*="content"]');
let option = this.formFields.getWidget(fieldId).element(optionLocator);
Util.waitUntilElementIsVisible(option);
return option.getText();
};
}
};
module.exports = RadioButtons;
}

View File

@@ -15,55 +15,52 @@
* limitations under the License.
*/
var MultilineText = require('./MultilineText');
var Header = require('./Header');
var DisplayText = require('./DisplayText');
var AttachFile = require('./AttachFile');
var DisplayValue = require('./DisplayValue');
var RadioButtons = require('./RadioButtons');
var Hyperlink = require('./Hyperlink');
var Dropdown = require('./Dropdown');
var DynamicTable = require('./DynamicTable');
import { MultilineText } from './multilineText';
import { Header } from './header';
import { DisplayText } from './displayText';
import { AttachFile } from './attachFile';
import { DisplayValue } from './displayValue';
import { RadioButtons } from './radioButtons';
import { Hyperlink } from './hyperlink';
import { Dropdown } from './dropdown';
import { DynamicTable } from './dynamicTable';
var Widget = function () {
export class Widget {
this.multilineTextWidget = function () {
multilineTextWidget() {
return new MultilineText();
};
}
this.headerWidget = function () {
headerWidget() {
return new Header();
};
}
this.displayTextWidget = function () {
displayTextWidget() {
return new DisplayText();
};
}
this.attachFileWidget = function () {
attachFileWidget() {
return new AttachFile();
};
}
this.displayValueWidget = function () {
displayValueWidget() {
return new DisplayValue();
};
}
this.radioWidget = function () {
radioWidget() {
return new RadioButtons();
};
}
this.hyperlink = function () {
hyperlink() {
return new Hyperlink();
};
}
this.dropdown = function () {
dropdown() {
return new Dropdown();
};
}
this.dynamicTable = function () {
dynamicTable() {
return new DynamicTable();
};
};
module.exports = Widget;
}
}