mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4529] Enable form configuration from e2e tests (#4738)
* [ADF-4529] Enable form configuration from e2e tests * Improve linting * Move form methods to new file
This commit is contained in:
committed by
Eugenio Romano
parent
36faed0fab
commit
f2f08a5bf8
1827
lib/core/mock/form/demo-form.mock.ts
Normal file
1827
lib/core/mock/form/demo-form.mock.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,11 +20,14 @@ import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { DemoForms } from '../mock/form/demo-form.mock';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CoreAutomationService {
|
||||
forms = new DemoForms();
|
||||
|
||||
constructor(private appConfigService: AppConfigService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private userPreferencesService: UserPreferencesService,
|
||||
@@ -46,6 +49,14 @@ export class CoreAutomationService {
|
||||
this.userPreferencesService.set(key, data);
|
||||
};
|
||||
|
||||
adfProxy.setFormInEditor = (json: string) => {
|
||||
this.forms.formDefinition = JSON.parse(json);
|
||||
};
|
||||
|
||||
adfProxy.setCloudFormInEditor = (json: string) => {
|
||||
this.forms.cloudFormDefinition = JSON.parse(json);
|
||||
};
|
||||
|
||||
adfProxy.clearStorage = () => {
|
||||
this.storageService.clear();
|
||||
};
|
||||
|
@@ -56,3 +56,4 @@ export * from './download-zip.service';
|
||||
export * from './lock.service';
|
||||
export * from './automation.service';
|
||||
export * from './previous-route.service';
|
||||
export * from './automation.service';
|
||||
|
33
lib/testing/src/lib/core/utils/form.util.ts
Normal file
33
lib/testing/src/lib/core/utils/form.util.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { browser } from 'protractor';
|
||||
|
||||
export class FormUtil {
|
||||
|
||||
static async setForm(value: string) {
|
||||
await browser.executeScript(
|
||||
'window.adf.setFormInEditor(`' + value + '`);'
|
||||
);
|
||||
}
|
||||
|
||||
static async setCloudForm(value: string) {
|
||||
await browser.executeScript(
|
||||
'window.adf.setCloudFormInEditor(`' + value + '`);'
|
||||
);
|
||||
}
|
||||
}
|
@@ -21,3 +21,4 @@ export * from './string.util';
|
||||
export * from './protractor.util';
|
||||
export * from './local-storage.util';
|
||||
export * from './file-browser.util';
|
||||
export * from './form.util';
|
||||
|
Reference in New Issue
Block a user