mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* [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
93 lines
3.9 KiB
TypeScript
93 lines
3.9 KiB
TypeScript
/*!
|
|
* @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);
|
|
});
|
|
});
|