mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
92
e2e/process-services/widgets/checkbox-widget.e2e.ts
Normal file
92
e2e/process-services/widgets/checkbox-widget.e2e.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage } from '../../pages/adf/loginPage';
|
||||
import { TasksPage } from '../../pages/adf/process-services/tasksPage';
|
||||
import { Widget } from '../../pages/adf/process-services/widgets/widget';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
describe('Checkbox Widget', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let processUserModel;
|
||||
let taskPage = new TasksPage();
|
||||
let widget = new Widget();
|
||||
let alfrescoJsApi;
|
||||
let appsActions = new AppsActions();
|
||||
let appModel;
|
||||
let app = resources.Files.WIDGET_CHECK_APP.CHECKBOX;
|
||||
let deployedApp, process;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
processUserModel = await users.createTenantAndUser(alfrescoJsApi);
|
||||
|
||||
await alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location);
|
||||
|
||||
let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
browser.get(urlToNavigateTo);
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
|
||||
await alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C268554] Should be able to set general settings for Checkbox widget ', () => {
|
||||
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] Should be able to set visibility settings for Checkbox widget', () => {
|
||||
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);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user