mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3671] Add automation tests for Form Widgets (#3911)
* [ADF-3617] Fix bugs in Task Details Page controller * [ADF-3617] Fix bugs in Task Page controller * [ADF-3617] Separate in different describes automation tests * [ADF-3671] start working on e2e form tests * [ADF-3671] improved checks for form widgets * [ADF-3671] start adding multiline text widget tsts * [ADF-3671] added test for multiline and some improvements * [ADF-3671] Add e2e tests for Dropdown, Date, Checkbox widgets * [ADF-3671] Add e2e test for radio, number, hyperlink widgets * [ADF-3671] Add automation tests for Form Widgets * [ADF-3671] Update usage of Dropdown Widget * [ADF-3671] Fix fileModel file and rename widget controles * [ADF-3671] Rename Widget Controllers * [ADF-3671] Remove unused imports and fix dynamic table e2e test * [ADF-3671] Fix spell errors * [ADF-3671] Fix people, date time, attach widget * [ADF-3671] Fix Form People widget tests * [ADF-3671] Rebase and remove unused variables
This commit is contained in:
committed by
Eugenio Romano
parent
9599b84a84
commit
ee7af9d797
104
e2e/process-services/widgets/amount_widget.e2e.ts
Normal file
104
e2e/process-services/widgets/amount_widget.e2e.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Amount Widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.AMOUNT;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C274703] General, advanced, Amount and Visibility properties', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.amount_input_id);
|
||||
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
expect(widget.amountWidget().getAmountFieldLabel(app.FIELD.amount_input_id)).toContain('Amount');
|
||||
expect(widget.amountWidget().getPlaceholder(app.FIELD.amount_input_id)).toContain('Type amount');
|
||||
expect(widget.amountWidget().getAmountFieldCurrency(app.FIELD.amount_input_id)).toBe('$');
|
||||
|
||||
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
|
||||
expect(widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
|
||||
expect(widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 6);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
});
|
85
e2e/process-services/widgets/attach_folder_widget.e2e.ts
Normal file
85
e2e/process-services/widgets/attach_folder_widget.e2e.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Attach Folder widget', () => {
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276745] Attach folder widget - Visibility', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.upload_button_id);
|
||||
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
});
|
||||
});
|
92
e2e/process-services/widgets/checkbox_widget.e2e.ts
Normal file
92
e2e/process-services/widgets/checkbox_widget.e2e.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Checkbox Widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.CHECKBOX;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C268554] Checkbox widget - General settings', () => {
|
||||
taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, 2);
|
||||
expect(widget.checkboxWidget().getCheckboxLabel()).toContain(app.FIELD.checkbox_label);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_input_id);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C272812] Checkbox widget - Visibility settings', () => {
|
||||
widget.checkboxWidget().isCheckboxHidden(app.FIELD.checkbox_field_id);
|
||||
taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, 2);
|
||||
widget.checkboxWidget().isCheckboxDisplayed(app.FIELD.checkbox_field_id);
|
||||
});
|
||||
});
|
108
e2e/process-services/widgets/date_time_widget.e2e.ts
Normal file
108
e2e/process-services/widgets/date_time_widget.e2e.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Date and time widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.DATETIME;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('C268818] Date and time widget - General properties', () => {
|
||||
expect(widget.dateTimeWidget().getDateTimeLabel(app.FIELD.date_time_input)).toContain('Date');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
|
||||
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_input);
|
||||
widget.dateTimeWidget().selectDay('10');
|
||||
widget.dateTimeWidget().selectHour('8');
|
||||
widget.dateTimeWidget().selectMinute('30');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
|
||||
expect(widget.dateTimeWidget().getPlaceholder(app.FIELD.date_time_between_input)).toBe('Choose anything...');
|
||||
});
|
||||
|
||||
it('[C268819] Date and time widget - Advanced properties', () => {
|
||||
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
|
||||
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
|
||||
widget.dateTimeWidget().closeDataTimeWidget();
|
||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
|
||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
|
||||
});
|
||||
});
|
96
e2e/process-services/widgets/date_widget.e2e.ts
Normal file
96
e2e/process-services/widgets/date_widget.e2e.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Date widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.DATE;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C268814] Date Widget - General Properties', () => {
|
||||
expect(widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_input);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C277234] Date widget - Advanced properties', () => {
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
|
||||
widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
|
||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
|
||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
|
||||
});
|
||||
});
|
83
e2e/process-services/widgets/document_template_widget.e2e.ts
Normal file
83
e2e/process-services/widgets/document_template_widget.e2e.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Document Template widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.FILE_FORM_ADF;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, app.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260406] should check that the template contains assigned file ', () => {
|
||||
expect(widget.containerWidget().getFieldText(app.form_fields.container_id))
|
||||
.toEqual(app.attached_file);
|
||||
});
|
||||
});
|
100
e2e/process-services/widgets/dropdown_widget.e2e.ts
Normal file
100
e2e/process-services/widgets/dropdown_widget.e2e.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Dropdown widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.DROPDOWN;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C269051] General and Options properties', () => {
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
|
||||
widget.dropdown().selectOption('Happy');
|
||||
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Happy');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
|
||||
widget.dropdown().selectOption('Choose one');
|
||||
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Choose one');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
|
||||
widget.dropdown().selectOption('Sad');
|
||||
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Sad');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C269052] Dropdown menu - Visibility', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.dropdown_visible);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.dropdown_visible);
|
||||
});
|
||||
});
|
167
e2e/process-services/widgets/dynamic_table_widget.e2e.ts
Normal file
167
e2e/process-services/widgets/dynamic_table_widget.e2e.ts
Normal 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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Dynamic Table widget ', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
|
||||
describe('with date widget', () => {
|
||||
let app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276729] Dynamic table widget - Visiblity', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.dynamic_table_age_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.dynamic_table_age_id);
|
||||
});
|
||||
|
||||
it('[C279349] Dynamic table with Datetime', () => {
|
||||
widget.dynamicTable().clickAddButton();
|
||||
widget.dateTimeWidget().openDatepicker(app.FIELD.dataTime_input_id);
|
||||
widget.dateTimeWidget().selectDay('10');
|
||||
widget.dateTimeWidget().selectHour('8');
|
||||
widget.dateTimeWidget().selectMinute('30');
|
||||
widget.dateTimeWidget().clearDateTimeInput(app.FIELD.dataTime_input_id);
|
||||
|
||||
widget.dynamicTable().clickSaveButton();
|
||||
widget.dynamicTable().getTableRow(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with date widget', () => {
|
||||
|
||||
let app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE_USERS;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260407] should check Dynamic Table widget', () => {
|
||||
|
||||
widget.dynamicTable().clickAddRow();
|
||||
widget.dynamicTable().setDatatableInput('User1');
|
||||
widget.dynamicTable().clickSaveButton();
|
||||
expect(widget.dynamicTable().getTableRowText(0)).toEqual('User1');
|
||||
|
||||
widget.dynamicTable().clickTableRow(0);
|
||||
widget.dynamicTable().clickEditButton();
|
||||
widget.dynamicTable().setDatatableInput('User2');
|
||||
widget.dynamicTable().clickCancelButton();
|
||||
expect(widget.dynamicTable().getTableRowText(0)).toEqual('User1');
|
||||
|
||||
widget.dynamicTable().clickEditButton();
|
||||
widget.dynamicTable().setDatatableInput('User2');
|
||||
widget.dynamicTable().clickSaveButton();
|
||||
expect(widget.dynamicTable().getTableRowText(0)).toEqual('User2');
|
||||
|
||||
widget.dynamicTable().clickAddRow();
|
||||
widget.dynamicTable().setDatatableInput('User3');
|
||||
widget.dynamicTable().clickCancelButton();
|
||||
widget.dynamicTable().checkTableRowIsNotVisible(1);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
87
e2e/process-services/widgets/header_widget.e2e.ts
Normal file
87
e2e/process-services/widgets/header_widget.e2e.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Header widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.HEADER;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276737] Header widget - general and visibility properties', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.header_id);
|
||||
|
||||
expect(widget.headerWidget().getFieldLabel(app.FIELD.header_id)).toBe('Header');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
});
|
87
e2e/process-services/widgets/hyperlink_widget.e2e.ts
Normal file
87
e2e/process-services/widgets/hyperlink_widget.e2e.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Hyperlink widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.HYPERLINK;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C276728] Hyperlink widget - Visibility', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.hyperlink_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.hyperlink_id);
|
||||
|
||||
expect(widget.hyperlink().getFieldLabel(app.FIELD.hyperlink_id)).toBe('Hyperlink');
|
||||
expect(widget.hyperlink().getFieldText(app.FIELD.hyperlink_id)).toBe('https://www.google.com/');
|
||||
});
|
||||
});
|
112
e2e/process-services/widgets/multi_line_widget.e2e.ts
Normal file
112
e2e/process-services/widgets/multi_line_widget.e2e.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Multi-line Widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C268182] Multi-line Text Widget - General Properties', async () => {
|
||||
let label = widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);
|
||||
expect(label).toBe('multiSimple*');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
let placeHolder = widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple);
|
||||
expect(placeHolder).toBe('Type something...');
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C268184] Multi-line Text Widget - Advanced Properties - Min and Max', async () => {
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'A');
|
||||
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toBe('Enter at least 4 characters');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAAAAAAAAA');
|
||||
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toBe('Enter no more than 10 characters');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('[C268184] Multi-line Text Widget - Advanced Properties - Regex Pattern property', async () => {
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, '3');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiRegexp)).toBe('Enter a different value');
|
||||
widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, 'TE');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C268232] Multi-line Text Widget - Visibility properties', async () => {
|
||||
widget.textWidget().isWidgetNotVisible(app.FIELD.multiVisible);
|
||||
widget.textWidget().setValue(app.FIELD.showMultiHidden, '1');
|
||||
widget.textWidget().isWidgetVisible(app.FIELD.multiVisible);
|
||||
});
|
||||
});
|
109
e2e/process-services/widgets/number_widget.e2e.ts
Normal file
109
e2e/process-services/widgets/number_widget.e2e.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Number widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.NUMBER;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C269111] Number Widget - General Properties', () => {
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
expect(widget.numberWidget().getNumberFieldLabel(app.FIELD.number_general)).toContain('Number General');
|
||||
expect(widget.numberWidget().getPlaceholder(app.FIELD.number_general)).toContain('Type a number');
|
||||
|
||||
widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C274702] Number Widget - Advanced and visibility properties', () => {
|
||||
widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
|
||||
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.number_visible);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
|
||||
|
||||
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
|
||||
expect(widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
|
||||
expect(widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 4);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
});
|
102
e2e/process-services/widgets/people_widget.e2e.ts
Normal file
102
e2e/process-services/widgets/people_widget.e2e.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('People widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.ADD_PEOPLE;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C212870] should check People widget', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
|
||||
|
||||
let admin = processUserModel.firstName + ' ' + processUserModel.lastName;
|
||||
widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
|
||||
widget.peopleWidget().checkDropDownListIsDisplayed();
|
||||
widget.peopleWidget().checkUserIsListed(admin);
|
||||
widget.peopleWidget().selectUserFromDropDown(admin);
|
||||
});
|
||||
|
||||
it('[C274707] Add people widget - Visibility', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
|
||||
|
||||
let admin = processUserModel.firstName + ' ' + processUserModel.lastName;
|
||||
widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
|
||||
widget.peopleWidget().checkDropDownListIsDisplayed();
|
||||
widget.peopleWidget().checkUserIsListed(admin);
|
||||
widget.peopleWidget().selectUserFromDropDown(admin);
|
||||
});
|
||||
});
|
95
e2e/process-services/widgets/radio_buttons_widget.e2e.ts
Normal file
95
e2e/process-services/widgets/radio_buttons_widget.e2e.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Radio Buttons Widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277316] Radio buttons widget - default behaviour', () => {
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
widget.radioWidget().isSelectionClean(app.FIELD.radio_buttons_id);
|
||||
});
|
||||
|
||||
it('[C274704] Radio buttons widget - Visibility', () => {
|
||||
taskPage.formFields().checkWidgetIsHidden(app.FIELD.radio_buttons_id);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
|
||||
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
expect(widget.radioWidget().getRadioWidgetLabel(app.FIELD.radio_buttons_id)).toContain('Radio posts');
|
||||
widget.radioWidget().selectOption(app.FIELD.radio_buttons_id, 1);
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
});
|
122
e2e/process-services/widgets/text_widget.e2e.ts
Normal file
122
e2e/process-services/widgets/text_widget.e2e.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* @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 AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process_services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process_services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Text widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.TEXT;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C268157] General Properties', async () => {
|
||||
let label = widget.textWidget().getFieldLabel(app.FIELD.simpleText);
|
||||
expect(label).toBe('textSimple*');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
let placeHolder = widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText);
|
||||
expect(placeHolder).toBe('Type something...');
|
||||
widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C268170] Min-max length properties', async () => {
|
||||
widget.textWidget().setValue(app.FIELD.textMinMax, 'A');
|
||||
expect(widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toBe('Enter at least 4 characters');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
widget.textWidget().setValue(app.FIELD.textMinMax, 'AAAAAAAAAAA');
|
||||
expect(widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toBe('Enter no more than 10 characters');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('[C268171] Input mask reversed checkbox properties', async () => {
|
||||
widget.textWidget().setValue(app.FIELD.textMask, '18951523');
|
||||
expect(widget.textWidget().getFieldValue(app.FIELD.textMask)).toBe('1895-1523');
|
||||
});
|
||||
|
||||
it('[C268171] Input mask reversed checkbox properties', async () => {
|
||||
widget.textWidget().setValue(app.FIELD.textMaskReversed, '1234567899');
|
||||
expect(widget.textWidget().getFieldValue(app.FIELD.textMaskReversed)).toBe('3456-7899');
|
||||
});
|
||||
|
||||
it('[C268177] Regex Pattern property', async () => {
|
||||
widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
|
||||
widget.textWidget().setValue(app.FIELD.textRegexp, 'T');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
expect(widget.textWidget().getErrorMessage(app.FIELD.textRegexp)).toBe('Enter a different value');
|
||||
widget.textWidget().setValue(app.FIELD.textRegexp, 'TE');
|
||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('[C274712] Visibility condition', async () => {
|
||||
widget.textWidget().isWidgetNotVisible(app.FIELD.textHidden);
|
||||
widget.textWidget().setValue(app.FIELD.showHiddenText, '1');
|
||||
widget.textWidget().isWidgetVisible(app.FIELD.textHidden);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user