[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:
davidcanonieto
2019-05-28 15:27:26 +01:00
committed by Eugenio Romano
parent 36faed0fab
commit f2f08a5bf8
10 changed files with 1894 additions and 110 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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();
};

View File

@@ -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';

View 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 + '`);'
);
}
}

View File

@@ -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';