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