Added a new LocalStorageUtil and using the setConfigMethod to set the local storage variables (#4575)

* added a new LocalStorageUtil and using the setConfigMethod to set the localstorage variables, instead of using hte settings ui page.

* linting fix

* fixing import paths

* update new path LocalStorageUtil

* fix problems after rebase

* fix async loadin and clear

* local storage fix

* fix lint

* fix cs tests

* fix tag navigation and rename file appNavigation to processTabNavigation

* fix lint

* fix process test

* fix lint

Signed-off-by: Eugenio Romano <eugenio.romano@alfresco.com>

* fix start process cloud

* inc timeout
This commit is contained in:
gmandakini
2019-04-21 23:42:59 +01:00
committed by Eugenio Romano
parent 97ad54a4f8
commit e85b57876e
69 changed files with 369 additions and 351 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { ViewerPage } from '../../pages/adf/viewerPage';
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
@@ -30,7 +30,6 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '../../actions/ACS/upload.actions';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { check } from '../../util/material';
import { setConfigField } from '../../proxy';
describe('Aspect oriented config', () => {
@@ -96,7 +95,7 @@ describe('Aspect oriented config', () => {
it('[C261117] Should be possible restrict the display properties of one an aspect', async () => {
await setConfigField('content-metadata', JSON.stringify({
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: [
{
@@ -137,7 +136,7 @@ describe('Aspect oriented config', () => {
it('[C260185] Should ignore not existing aspect when present in the configuration', async () => {
await setConfigField('content-metadata', JSON.stringify({
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
'exif:exif': '*',
@@ -164,7 +163,7 @@ describe('Aspect oriented config', () => {
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided', async () => {
await setConfigField('content-metadata', '{}');
await LocalStorageUtil.setConfigField('content-metadata', '{}');
navigationBarPage.clickContentServicesButton();
@@ -182,7 +181,7 @@ describe('Aspect oriented config', () => {
it('[C260182] Should show all the aspects if the default configuration contains the star symbol', async () => {
await setConfigField('content-metadata', JSON.stringify({
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: '*'
}
@@ -205,7 +204,7 @@ describe('Aspect oriented config', () => {
it('[C268899] Should be possible use a Translation key as Title of a metadata group', async () => {
await setConfigField('content-metadata', '{' +
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": {' +
' "default": [' +
' {' +
@@ -250,7 +249,7 @@ describe('Aspect oriented config', () => {
it('[C279968] Should be possible use a custom preset', async () => {
await setConfigField('content-metadata', '{' +
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": {' +
' "custom-preset": {' +
' "exif:exif": "*",' +
@@ -280,7 +279,7 @@ describe('Aspect oriented config', () => {
it('[C299186] The aspect without properties is not displayed', async () => {
await setConfigField('content-metadata', '{' +
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": { "' + modelOneName +
' ": { "' + modelOneName + ':' + emptyAspectName +
' ":"*"' +
@@ -303,7 +302,7 @@ describe('Aspect oriented config', () => {
it('[C299187] The aspect with empty properties is displayed when edit', async () => {
await setConfigField('content-metadata', '{' +
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": { "' + defaultModel +
' ": { "' + defaultModel + ':' + defaultEmptyPropertiesAspect +
' ":"*"' +

View File

@@ -102,13 +102,13 @@ describe('permissions', () => {
done();
});
afterAll(async(done) => {
afterAll(async (done) => {
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id);
done();
});
it('[C274692] Should not be possible edit metadata properties when the user is a consumer user', () => {
loginPage.loginToContentServicesUsingUserModel(consumerUser);
it('[C274692] Should not be possible edit metadata properties when the user is a consumer user', async () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
@@ -119,8 +119,8 @@ describe('permissions', () => {
metadataViewPage.editIconIsNotDisplayed();
});
it('[C279971] Should be possible edit metadata properties when the user is a collaborator user', () => {
loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
it('[C279971] Should be possible edit metadata properties when the user is a collaborator user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
@@ -139,8 +139,8 @@ describe('permissions', () => {
metadataViewPage.editIconIsDisplayed();
});
it('[C279972] Should be possible edit metadata properties when the user is a contributor user', () => {
loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
it('[C279972] Should be possible edit metadata properties when the user is a contributor user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);

View File

@@ -17,7 +17,7 @@
import { browser } from 'protractor';
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, LocalStorageUtil } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ViewerPage } from '../../pages/adf/viewerPage';
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
@@ -32,7 +32,6 @@ import dateFormat = require('dateformat');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '../../actions/ACS/upload.actions';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { setConfigField } from '../../proxy';
describe('Metadata component', () => {
@@ -97,7 +96,7 @@ describe('Metadata component', () => {
describe('Viewer Metadata', () => {
beforeAll(async() => {
await setConfigField('content-metadata', JSON.stringify({
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
'exif:exif': '*'