mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +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
@@ -19,8 +19,8 @@ import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
|
||||
import { DynamicTable } from '../pages/adf/process_services/widgets/dynamicTable';
|
||||
import { Dropdown } from '../pages/adf/process_services/widgets/dropdown';
|
||||
import { DynamicTableWidget } from '../pages/adf/process_services/widgets/dynamicTableWidget';
|
||||
import { DropdownWidget } from '../pages/adf/process_services/widgets/dropdownWidget';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
@@ -35,7 +35,7 @@ describe('Dynamic Table', () => {
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let appNavigationBarPage = new AppNavigationBarPage();
|
||||
let dynamicTable = new DynamicTable();
|
||||
let dynamicTable = new DynamicTableWidget();
|
||||
let user, tenantId, appId, apps, users;
|
||||
|
||||
beforeAll(async(done) => {
|
||||
@@ -128,7 +128,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
describe('Required Dropdown', () => {
|
||||
let app = resources.Files.APP_DYNAMIC_TABLE_DROPDOWN;
|
||||
let dropdown = new Dropdown();
|
||||
let dropdown = new DropdownWidget();
|
||||
|
||||
beforeAll(async(done) => {
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
import { LoginPage } from '../pages/adf/loginPage';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { FormPage } from '../pages/adf/process_services/formPage';
|
||||
import { Date } from '../pages/adf/process_services/widgets/Date';
|
||||
import { Amount } from '../pages/adf/process_services/widgets/Amount';
|
||||
import { NumberWidget } from '../pages/adf/process_services/widgets/Number';
|
||||
import { DateWidget } from '../pages/adf/process_services/widgets/dateWidget';
|
||||
import { AmountWidget } from '../pages/adf/process_services/widgets/amountWidget';
|
||||
import { NumberWidget } from '../pages/adf/process_services/widgets/numberWidget';
|
||||
import TestConfig = require('../test.config');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
@@ -31,12 +31,18 @@ describe('Form Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const formPage = new FormPage();
|
||||
const dateWidget = new Date();
|
||||
const amountWidget = new Amount();
|
||||
const dateWidget = new DateWidget();
|
||||
const amountWidget = new AmountWidget();
|
||||
const numberWidget = new NumberWidget();
|
||||
|
||||
let tenantId, user;
|
||||
|
||||
let fields = {
|
||||
dateWidgetId: 'label7',
|
||||
numberWidgetId: 'label4',
|
||||
amountWidgetId: 'label11'
|
||||
};
|
||||
|
||||
let message = {
|
||||
test: 'Text Test',
|
||||
warningNumberAndAmount: 'Use a different number format',
|
||||
@@ -79,26 +85,27 @@ describe('Form Component', () => {
|
||||
});
|
||||
|
||||
it('[C286505] Should be able to display errors under the Error Log section', () => {
|
||||
numberWidget.checkLabel4IsDisplayed();
|
||||
numberWidget.addIntoNumberWidget(message.test);
|
||||
numberWidget.getNumberFieldLabel(fields.numberWidgetId);
|
||||
numberWidget.setFieldValue(fields.numberWidgetId, message.test);
|
||||
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
|
||||
formPage.checkErrorLogMessage(message.errorLogNumber);
|
||||
|
||||
dateWidget.checkLabel7IsDisplayed();
|
||||
dateWidget.addIntoDateWidget(message.test);
|
||||
dateWidget.checkLabelIsVisible(fields.dateWidgetId);
|
||||
dateWidget.setDateInput(fields.dateWidgetId, message.test);
|
||||
dateWidget.clickOutsideWidget(fields.dateWidgetId);
|
||||
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
|
||||
formPage.checkErrorLogMessage(message.errorLogDate);
|
||||
|
||||
amountWidget.checkLabel11IsDisplayed();
|
||||
amountWidget.addIntoAmountWidget(message.test);
|
||||
amountWidget.getAmountFieldLabel(fields.amountWidgetId);
|
||||
amountWidget.setFieldValue(fields.amountWidgetId, message.test);
|
||||
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
|
||||
formPage.checkErrorLogMessage(message.errorLogAmount);
|
||||
|
||||
amountWidget.removeFromAmountWidget();
|
||||
amountWidget.removeFromAmountWidget(fields.amountWidgetId);
|
||||
formPage.checkErrorMessageIsNotDisplayed(message.errorLogAmount);
|
||||
|
||||
dateWidget.removeFromDateWidget();
|
||||
numberWidget.removeFromNumberWidget();
|
||||
dateWidget.clearDateInput(fields.dateWidgetId);
|
||||
numberWidget.clearFieldValue(fields.numberWidgetId);
|
||||
formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
|
||||
formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
|
||||
formPage.checkErrorLogMessage(message.errorLabel);
|
||||
|
||||
@@ -31,181 +31,244 @@ import resources = require('../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
let formInstance = new FormDefinitionModel();
|
||||
|
||||
describe('Form widgets', () => {
|
||||
|
||||
let alfrescoJsApi;
|
||||
let taskPage = new TasksPage();
|
||||
let newTask = 'First task';
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
let processUserModel;
|
||||
let app = resources.Files.WIDGETS_SMOKE_TEST;
|
||||
let appFields = app.form_fields;
|
||||
let taskPage = new TasksPage();
|
||||
let appModel;
|
||||
let newTask = 'First task';
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
let appsActions = new AppsActions();
|
||||
describe('Form widgets', () => {
|
||||
let app = resources.Files.WIDGETS_SMOKE_TEST;
|
||||
let appFields = app.form_fields;
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
let appsActions = new AppsActions();
|
||||
|
||||
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);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272778] Should display text and multi-line in form', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name)
|
||||
.clickTasksButton();
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(newTask).addDescription('Description').addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.tasksListPage().checkTaskIsDisplayedInTasksList(newTask);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
})
|
||||
.then(() => {
|
||||
return alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
})
|
||||
.then( (response) => {
|
||||
return alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response.data[0].id);
|
||||
})
|
||||
.then((formDefinition) => {
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
return formInstance;
|
||||
})
|
||||
.then(() => {
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
|
||||
|
||||
expect(widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).name);
|
||||
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);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272778] Should display text and multi-line in form', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name)
|
||||
.clickTasksButton();
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(newTask).addDescription('Description').addForm(app.formName).clickStartButton()
|
||||
.then(() => {
|
||||
taskPage.tasksListPage().checkTaskIsDisplayedInTasksList(newTask);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
})
|
||||
.then(() => {
|
||||
return alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
})
|
||||
.then((response) => {
|
||||
return alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response.data[0].id);
|
||||
})
|
||||
.then((formDefinition) => {
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
return formInstance;
|
||||
})
|
||||
.then(() => {
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.text_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
|
||||
|
||||
expect(widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.multiline_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).name);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('[C272779] Should display number and amount in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
|
||||
});
|
||||
|
||||
it('[C272780] Should display attach file and attach folder in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.attachFolder_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFolder_id).name);
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.attachFile_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFile_id).name);
|
||||
});
|
||||
|
||||
it('[C272781] Should display date and date & time in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.date_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.date_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.dateTime_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.dateTime_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.dateTime_id).value || '');
|
||||
});
|
||||
|
||||
it('[C272782] Should display people and group in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
|
||||
});
|
||||
|
||||
it('[C272783] Should display displayText and displayValue in form', () => {
|
||||
|
||||
expect(widget.displayTextWidget().getFieldLabel(appFields.displayText_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayText_id).value);
|
||||
expect(widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || 'Unknown type: readonly');
|
||||
});
|
||||
|
||||
it('[C272784] Should display typeahead and header in form', () => {
|
||||
expect(widget.headerWidget().getFieldLabel(appFields.header_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).name);
|
||||
});
|
||||
|
||||
it('[C272785] Should display checkbox and radio button in form', () => {
|
||||
let radioOption = 1;
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.checkbox_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).name);
|
||||
expect(widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).options[radioOption - 1].name);
|
||||
});
|
||||
|
||||
it('[C268149] Should display hyperlink, dropdown and dynamic table in form', () => {
|
||||
|
||||
expect(widget.hyperlink().getFieldText(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
|
||||
expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
|
||||
|
||||
expect(widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).name);
|
||||
expect(widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('[C272779] Should display number and amount in form', () => {
|
||||
describe('with fields involving other people', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.number_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
|
||||
let appsActions = new AppsActions();
|
||||
let app = resources.Files.FORM_ADF;
|
||||
let deployedApp, process;
|
||||
let appFields = app.form_fields;
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.amount_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
|
||||
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('[C260405] Value fields configured with process variables', () => {
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
taskPage.formFields().setValueInInputById('label', 'value 1').completeForm();
|
||||
/* cspell:disable-next-line */
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
|
||||
expect(widget.displayTextWidget().getFieldText(appFields.displayText_id))
|
||||
.toContain('value 1');
|
||||
expect(widget.textWidget().getFieldValue(appFields.text_id))
|
||||
.toEqual('value 1');
|
||||
expect(widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
|
||||
.toEqual('value 1');
|
||||
});
|
||||
});
|
||||
|
||||
it('[C272780] Should display attach file and attach folder in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.attachFolder_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFolder_id).name);
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.attachFile_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.attachFile_id).name);
|
||||
});
|
||||
|
||||
it('[C272781] Should display date and date & time in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.date_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.date_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.dateTime_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
|
||||
expect(taskPage.formFields().getFieldValue(appFields.dateTime_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.dateTime_id).value || '');
|
||||
});
|
||||
|
||||
it('[C272782] Should display people and group in form', () => {
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.people_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.group_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
|
||||
});
|
||||
|
||||
it('[C272783] Should display displayText and displayValue in form', () => {
|
||||
|
||||
expect(widget.displayTextWidget().getFieldLabel(appFields.displayText_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayText_id).value);
|
||||
expect(widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || 'Unknown type: readonly');
|
||||
});
|
||||
|
||||
it('[C272784] Should display typeahead and header in form', () => {
|
||||
|
||||
expect(widget.headerWidget().getFieldLabel(appFields.header_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldValue(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).value || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.typeAhead_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).name);
|
||||
});
|
||||
|
||||
it('[C272785] Should display checkbox and radio button in form', () => {
|
||||
let radioOption = 1;
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.checkbox_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).name);
|
||||
expect(widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).options[radioOption - 1].name);
|
||||
});
|
||||
|
||||
it('[C268149] Should display hyperlink, dropdown and dynamic table in form', () => {
|
||||
|
||||
expect(widget.hyperlink().getFieldText(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
|
||||
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
|
||||
|
||||
expect(taskPage.formFields().getFieldLabel(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
|
||||
expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
|
||||
|
||||
expect(widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).name);
|
||||
expect(widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
|
||||
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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/');
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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