From 45af7ca88d8965bb0c4f46ea02712b0da5271797 Mon Sep 17 00:00:00 2001
From: siva kumar
Date: Wed, 19 Jun 2019 14:56:56 +0530
Subject: [PATCH 001/140] * Added content-services as peer dependency into
process-cloud-services (#4863)
---
lib/process-services-cloud/package.json | 1 +
lib/process-services-cloud/src/lib/form/form-cloud.module.ts | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/process-services-cloud/package.json b/lib/process-services-cloud/package.json
index 7ff015cfd0..512fdf909e 100644
--- a/lib/process-services-cloud/package.json
+++ b/lib/process-services-cloud/package.json
@@ -28,6 +28,7 @@
"@alfresco/js-api": "3.3.0",
"rxjs": ">=6.2.2",
"@alfresco/adf-core": "3.3.0",
+ "@alfresco/adf-content-services": "3.3.0",
"@ngx-translate/core": ">=11.0.0",
"hammerjs": ">=2.0.8",
"moment": ">=2.22.2",
diff --git a/lib/process-services-cloud/src/lib/form/form-cloud.module.ts b/lib/process-services-cloud/src/lib/form/form-cloud.module.ts
index ef29b08e0e..80afdc2029 100644
--- a/lib/process-services-cloud/src/lib/form/form-cloud.module.ts
+++ b/lib/process-services-cloud/src/lib/form/form-cloud.module.ts
@@ -28,6 +28,7 @@ import { FormDefinitionSelectorCloudService } from './services/form-definition-s
import { FormCustomOutcomesComponent } from './components/form-cloud-custom-outcomes.component';
import { DropdownCloudWidgetComponent } from './components/dropdown-cloud/dropdown-cloud.widget';
import { AttachFileCloudWidgetComponent } from './components/attach-file-cloud-widget/attach-file-cloud-widget.component';
+import { ContentNodeSelectorModule } from '@alfresco/adf-content-services';
@NgModule({
imports: [
@@ -39,7 +40,8 @@ import { AttachFileCloudWidgetComponent } from './components/attach-file-cloud-w
FormsModule,
ReactiveFormsModule,
FormBaseModule,
- CoreModule
+ CoreModule,
+ ContentNodeSelectorModule
],
declarations: [
FormCloudComponent,
From c5739ff4353e17b160d93818402f3e399e479456 Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Wed, 19 Jun 2019 11:01:50 +0100
Subject: [PATCH 002/140] updated translation files 3.3.0
---
demo-shell/resources/i18n/da.json | 3 +-
demo-shell/resources/i18n/sv.json | 18 +++++-----
lib/content-services/i18n/da.json | 8 ++++-
lib/content-services/i18n/sv.json | 16 ++++-----
lib/core/i18n/da.json | 5 +++
lib/core/i18n/sv.json | 28 +++++++--------
.../src/lib/i18n/sv.json | 36 +++++++++----------
lib/process-services/i18n/sv.json | 6 ++--
8 files changed, 66 insertions(+), 54 deletions(-)
diff --git a/demo-shell/resources/i18n/da.json b/demo-shell/resources/i18n/da.json
index 9db3adb983..d9a08e34ca 100644
--- a/demo-shell/resources/i18n/da.json
+++ b/demo-shell/resources/i18n/da.json
@@ -95,7 +95,8 @@
"PEOPLE_GROUPS_CLOUD": "Person/gruppecloud",
"PEOPLE_CLOUD": "Personcloudkomponent",
"GROUPS_CLOUD": "Gruppecloudkomponent",
- "CONFIRM-DIALOG": "Bekræftelsesdialogboks"
+ "CONFIRM-DIALOG": "Bekræftelsesdialogboks",
+ "COMMUNITY": "Community"
},
"TRASHCAN": {
"ACTIONS": {
diff --git a/demo-shell/resources/i18n/sv.json b/demo-shell/resources/i18n/sv.json
index f1ec698080..585c1654ba 100644
--- a/demo-shell/resources/i18n/sv.json
+++ b/demo-shell/resources/i18n/sv.json
@@ -64,7 +64,7 @@
"TASK_LIST": "Uppgiftslista",
"PROCESS_LIST": "Processlista",
"PROCESS_CLOUD": "Activiti Cloud",
- "CARD_VIEW": "CardView",
+ "CARD_VIEW": "Kortvy",
"PROCESS_SERVICES": "Process Services",
"LOGIN": "Inloggning",
"CUSTOM_SOURCES": "Anpassade källor",
@@ -75,7 +75,7 @@
"FORM": "Formulär",
"FORM_LIST": "Formulärlista",
"FORM_LOADING": "Formulär läses in",
- "UPLOADER": "Uppladdare",
+ "UPLOADER": "Uppladdad av",
"WEBSCRIPT": "Webbskript",
"TAG": "Tagg",
"TRASHCAN": "Papperskorg",
@@ -95,7 +95,7 @@
"PEOPLE_GROUPS_CLOUD": "Personer/grupp moln",
"PEOPLE_CLOUD": "Personer moln-komponent",
"GROUPS_CLOUD": "Grupper moln-komponent",
- "CONFIRM-DIALOG": "Bekräftelsedialog",
+ "CONFIRM-DIALOG": "Dialogruta för bekräftelse",
"COMMUNITY": "Community"
},
"TRASHCAN": {
@@ -110,7 +110,7 @@
}
},
"DOCUMENT_LIST": {
- "MULTISELECT_CHECKBOXES": "Flera val (med kryssrutor)",
+ "MULTISELECT_CHECKBOXES": "Fleraval (med kryssrutor)",
"THUMBNAILS": "Aktivera miniatyrbilder",
"ALLOW_DROP_FILES": "Aktivera släpp filer i en mapp",
"MULTIPLE_FILE_UPLOAD": "Uppladdning av flera filer",
@@ -178,8 +178,8 @@
"ADD_ROW": "Lägg till rad",
"REPLACE_ROWS": "Ersätt rader",
"REPLACE_COLUMNS": "Ersätt kolumner",
- "LOAD_NODE": "Ladda upp nod",
- "MULTISELECT": "Flera val",
+ "LOAD_NODE": "Läs in nod",
+ "MULTISELECT": "Fleraval",
"MULTISELECT_DESCRIPTION": "Använd Cmd (Mac) eller Ctrl (Windows) för att växla val av flera objekt"
},
"ANALYTICS_REPORT": {
@@ -209,7 +209,7 @@
"FORM_DATA_MESSAGE": "Ange värden för att fylla formuläret",
"TYPEAHEAD_PLACEHOLDER": "Typeahead",
"RADIO_PLACEHOLDER": "Radioknapp",
- "SELECT_PLACEHOLDER": "DropDown"
+ "SELECT_PLACEHOLDER": "Dropdown"
},
"LOGIN": {
"CONTENT_SERVICES": "Content Services",
@@ -225,8 +225,8 @@
"FACET_FIELDS": {
"TYPE": "1:Typ",
"SIZE": "2:Storlek",
- "CREATOR": "3:Skapat av",
- "MODIFIER": "4:Ändrat av",
+ "CREATOR": "3:Skapad av",
+ "MODIFIER": "4:Ändrad av",
"CREATED": "5:Skapad den"
},
"FACET_QUERIES": {
diff --git a/lib/content-services/i18n/da.json b/lib/content-services/i18n/da.json
index 9fce22fdb4..d1fda870da 100644
--- a/lib/content-services/i18n/da.json
+++ b/lib/content-services/i18n/da.json
@@ -277,6 +277,11 @@
"CREATED_DATE": "Oprettelsesdato",
"MODIFIER": "Ændret af",
"MODIFIED_DATE": "Ændringsdato"
+ },
+ "ERRORS": {
+ "GENERIC": "Der opstod fejl under opdatering af egenskaben",
+ "409": "Dublet af underordnet navn er ikke tilladt [409]",
+ "422": "Ugyldig egenskabsværdi"
}
},
"SHARE": {
@@ -293,6 +298,7 @@
"CANCEL": "Annuller",
"REMOVE": "Fjern"
},
+ "UNSHARE_ERROR": "Der opstod fejl under stop af deling af denne fil",
"UNSHARE_PERMISSION_ERROR": "Du har ikke tilladelse til at ophæve delingen af denne fil"
},
"PERMISSION_MANAGER": {
@@ -364,4 +370,4 @@
"LIBRARY_UPDATED": "Egenskaberne for biblioteket er blevet opdateret"
}
}
-}
+}
\ No newline at end of file
diff --git a/lib/content-services/i18n/sv.json b/lib/content-services/i18n/sv.json
index 33c2bc7afa..72809993c7 100644
--- a/lib/content-services/i18n/sv.json
+++ b/lib/content-services/i18n/sv.json
@@ -44,8 +44,8 @@
"DELETED_ON": "Raderad",
"DELETED_BY": "Raderad av",
"STATUS": "Status",
- "MODIFIED_ON": "Modifierad",
- "MODIFIED_BY": "Modifierad av",
+ "MODIFIED_ON": "Ändrad",
+ "MODIFIED_BY": "Ändrad av",
"SHARED_BY": "Delad av",
"LOAD_MORE": "Läs in mer"
},
@@ -189,8 +189,8 @@
"ERROR": "Vi stötte på ett problem under sökningen - försök igen.",
"COLUMNS": {
"NAME": "Visa namn",
- "MODIFIED_BY": "Modifierad av",
- "MODIFIED_AT": "Modiferad den"
+ "MODIFIED_BY": "Ändrad av",
+ "MODIFIED_AT": "Ändrad den"
}
},
"FILTER": {
@@ -273,10 +273,10 @@
"AUTHOR": "Författare",
"MIMETYPE": "Mime-typ",
"SIZE": "Storlek",
- "CREATOR": "Upphovsperson",
+ "CREATOR": "Skapad av",
"CREATED_DATE": "Skapad datum",
- "MODIFIER": "Modifierare",
- "MODIFIED_DATE": "Modifieringsdatum"
+ "MODIFIER": "Ändrad av",
+ "MODIFIED_DATE": "Ändringsdatum"
},
"ERRORS": {
"GENERIC": "Fel vid uppdatering av egenskaper",
@@ -356,7 +356,7 @@
},
"ERRORS": {
"GENERIC": "Vi har stött på ett problem",
- "EXISTENT_SITE": "Det här biblioteks-ID:t är inte tillgängligt Testa ett annat biblioteks-ID.",
+ "EXISTENT_SITE": "Det här biblioteks-ID:t är inte tillgängligt Testa ett annat Biblioteks-ID.",
"CONFLICT": "Det här Biblioteks-ID:t används redan. Kontrollera papperskorgen",
"ID_TOO_LONG": "Använd 72 tecken eller färre för URL-namnet",
"DESCRIPTION_TOO_LONG": "Använd 512 tecken eller färre till beskrivningen",
diff --git a/lib/core/i18n/da.json b/lib/core/i18n/da.json
index dd9dafda25..ed9444116a 100644
--- a/lib/core/i18n/da.json
+++ b/lib/core/i18n/da.json
@@ -5,6 +5,11 @@
"CLAIM": "Gør krav på",
"UNCLAIM": "Frigiv",
"START PROCESS": "Start proces",
+ "NOTIFICATION_HISTORY": {
+ "NO_MESSAGE": "Ingen meddelelser",
+ "NOTIFICATIONS": "Meddelelser",
+ "MARK_AS_READ": "Markér alle som læst"
+ },
"FORM": {
"START_FORM": {
"TITLE": "Åbn formular"
diff --git a/lib/core/i18n/sv.json b/lib/core/i18n/sv.json
index 916c7da6ca..64b539d753 100644
--- a/lib/core/i18n/sv.json
+++ b/lib/core/i18n/sv.json
@@ -76,7 +76,7 @@
},
"FILE_DIALOG": {
"FILE_LOCK": "Lås fil",
- "ALLOW_OTHERS_CHECKBOX": "Tillåt ägaren att modifiera den här filen",
+ "ALLOW_OTHERS_CHECKBOX": "Tillåt ägaren att ändra den här filen",
"FILE_LOCK_CHECKBOX": "Lås fil",
"TIME_LOCK_CHECKBOX": "Tidslås",
"SAVE_BUTTON": {
@@ -93,7 +93,7 @@
"LABEL": "Namn",
"ERRORS": {
"REQUIRED": "Mappnamn krävs",
- "SPECIAL_CHARACTERS": "Mappnamnet får inte innehålla de här tecknen * \" < > \\ / ? : |",
+ "SPECIAL_CHARACTERS": "Mappnamnet får inte innehålla något av följande tecken: * \" < > \\ / ? : |",
"ENDING_DOT": "Mappnamnet får inte sluta med en punkt .",
"ONLY_SPACES": "Mappnamnet får inte bara innehålla mellanslag"
}
@@ -122,7 +122,7 @@
"PARTIAL_PLURAL": "{{ number }} objekt ej återställda på grund av problem med återställningsplatsen",
"NODE_EXISTS": "Kan inte återställa, {{ name }} objektet finns redan",
"LOCATION_MISSING": "Kan inte återställa {{ name }} objekt, den ursprungliga platsen finns inte längre",
- "GENERIC": "Det var ett problem med att återställa objektet {{ name }}",
+ "GENERIC": "Det uppdstod ett problem med att återställa objektet {{ name }}",
"PLURAL": "Återställning lyckades",
"SINGULAR": "{{ name }} objekt återställt"
},
@@ -175,10 +175,10 @@
"AUTHOR": "Författare",
"MIMETYPE": "Mime-typ",
"SIZE": "Storlek",
- "CREATOR": "Upphovsperson",
+ "CREATOR": "Skapad av",
"CREATED_DATE": "Skapad datum",
- "MODIFIER": "Modifierare",
- "MODIFIED_DATE": "Modifieringsdatum"
+ "MODIFIER": "Ändrad av",
+ "MODIFIED_DATE": "Ändringsdatum"
},
"ACTIONS": {
"EDIT": "Redigera",
@@ -228,11 +228,11 @@
"LOGIN": "Logga in",
"CHECKING": "Kontrollerar",
"WELCOME": "Välkommen",
- "SSO": "Sign in SSO"
+ "SSO": "Logga in SSO"
},
"ACTION": {
"HELP": "Behöver du hjälp?",
- "REGISTER": "Handling"
+ "REGISTER": "Registrera"
},
"DIALOG": {
"CANCEL": "Avbryt",
@@ -284,7 +284,7 @@
"PREV_FILE": "Föregående fil"
},
"ARIA": {
- "PREVIOUS_PAGE": "Tidigare sida",
+ "PREVIOUS_PAGE": "Föregående sida",
"NEXT_PAGE": "Nästa sida",
"ZOOM_IN": "Zooma in",
"ZOOM_OUT": "Zooma ut",
@@ -297,7 +297,7 @@
"SHOWING": "Visar",
"OF": "av"
},
- "LOADING": "Laddar upp",
+ "LOADING": "Läser in",
"UNKNOWN_FORMAT": "Kunde inte läsa in förhandsgranskning",
"SIDEBAR": {
"THUMBNAILS": {
@@ -397,7 +397,7 @@
}
},
"SOURCE_CODE": {
- "TITLE": "källkod",
+ "TITLE": "Källkod",
"DESCRIPTION": "Du driver projektet baserat på följande åtaganden:"
},
"PACKAGES": {
@@ -415,9 +415,9 @@
"VERSION_MAX": "Version max"
},
"STATUS": {
- "READ_ONLY": "ReadOnly",
- "AUDIT_ENABLED": "Är revision aktiverad",
- "QUICK_SHARE_ENABLED": "Är snabbdelad aktiverad",
+ "READ_ONLY": "Skrivskyddad",
+ "AUDIT_ENABLED": "Är Revision aktiverad",
+ "QUICK_SHARE_ENABLED": "Är Snabbdelad aktiverad",
"THUMBNAIL_ENABLED": "Miniatyrbildsgenerering"
},
"LICENSE": {
diff --git a/lib/process-services-cloud/src/lib/i18n/sv.json b/lib/process-services-cloud/src/lib/i18n/sv.json
index 66ab0035f3..7d0e474869 100644
--- a/lib/process-services-cloud/src/lib/i18n/sv.json
+++ b/lib/process-services-cloud/src/lib/i18n/sv.json
@@ -17,9 +17,9 @@
"DESCRIPTION": "Beskrivning",
"LAST_MODIFIED": "Senast ändrad",
"PROCESS_NAME": "Processnamn",
- "PARENT_TASK_ID": "Föräldrauppgifts-ID",
- "PROCESS_DEF_ID": "Processdefinition",
- "PROCESS_DEF_KEY": "Processdefinition"
+ "PARENT_TASK_ID": "Överordnad uppgift ID",
+ "PROCESS_DEF_ID": "Processdefinitions-ID",
+ "PROCESS_DEF_KEY": "Processdefinitionsnyckel"
},
"ADF_CLOUD_START_PROCESS": {
"BUTTON": "Starta process",
@@ -53,7 +53,7 @@
},
"ERROR": {
"TITLE": "Ett fel uppstod",
- "SUBTITLE": "Kontrollera att du har behörighet att öppna apparna"
+ "SUBTITLE": "Kontrollera att du har behörighet att öppna programmen"
}
},
"START_TASK": {
@@ -100,7 +100,7 @@
},
"ADF_CLOUD_PROCESS_FILTERS": {
"ALL_PROCESSES": "Alla processer",
- "RUNNING_PROCESSES": "Köra processer",
+ "RUNNING_PROCESSES": "Aktiva processer",
"COMPLETED_PROCESSES": "Slutförda processer"
},
"ADF_CLOUD_START_TASK": {
@@ -119,21 +119,21 @@
"DELETE": "Radera filter"
},
"LABEL": {
- "APP_NAME": "ApplicationName",
+ "APP_NAME": "Programnamn",
"TASK_ID": "Uppgifts-ID",
"PROCESS_DEF_ID": "Processdefinitions-ID",
"STATUS": "Status",
"ASSIGNMENT": "Tilldelad användare",
"DIRECTION": "Riktning",
"PROCESS_INSTANCE_ID": "Processinstans-ID",
- "TASK_NAME": "TaskName",
- "PARENT_TASK_ID": "ParentTaskId",
+ "TASK_NAME": "Uppgiftsnamn",
+ "PARENT_TASK_ID": "Överordnad uppgift ID",
"PRIORITY": "Prioritet",
- "STAND_ALONE": "StandAlone",
- "LAST_MODIFIED_FROM": "Senast modifierad från",
- "LAST_MODIFIED_TO": "Senast modifierad till",
+ "STAND_ALONE": "Stand-alone",
+ "LAST_MODIFIED_FROM": "Senast ändrad från",
+ "LAST_MODIFIED_TO": "Senast ändrad till",
"OWNER": "Ägare",
- "DUE_DATE": "Leveransdatum",
+ "DUE_DATE": "Förfallodatum",
"SORT": "Sortera",
"START_DATE": "Startdatum"
},
@@ -146,7 +146,7 @@
"ADF_CLOUD_EDIT_PROCESS_FILTER": {
"TITLE": "Anpassa ditt filter",
"LABEL": {
- "APP_NAME": "ApplicationName",
+ "APP_NAME": "Programnamn",
"PROCESS_INS_ID": "Processinstans-ID",
"STATUS": "Status",
"INITIATOR": "Initerare",
@@ -155,9 +155,9 @@
"DIRECTION": "Riktning",
"PROCESS_DEF_ID": "Processdefinitions-ID",
"PROCESS_DEF_KEY": "Processdefinitionsnyckel",
- "LAST_MODIFIED": "Senast modifierad",
- "LAST_MODIFIED_DATE_FORM": "Senast modifierad från",
- "LAST_MODIFIED_TO": "Senast modifierad till",
+ "LAST_MODIFIED": "Senast ändrad",
+ "LAST_MODIFIED_DATE_FORM": "Senast ändrad från",
+ "LAST_MODIFIED_TO": "Senast ändrad till",
"PROCESS_NAME": "Processnamn"
},
"ERROR": {
@@ -189,7 +189,7 @@
"TASK_NAME": "Uppgift",
"THUMBNAIL": "Miniatyrbild",
"DURATION": "Varaktighet",
- "PARENT_TASK_ID": "Föräldrauppgifts-ID",
+ "PARENT_TASK_ID": "Överordnad uppgift ID",
"NAME": "Namn",
"ASSIGNEE": "Tilldelad användare",
"ASSIGNEE_DEFAULT": "Ingen tilldelad användare",
@@ -226,7 +226,7 @@
"INITIATOR": "Initerare",
"START_DATE": "Startdatum",
"LAST_MODIFIED": "Senast ändrad",
- "PARENT_ID": "Föräldra-ID",
+ "PARENT_ID": "Överordnad ID",
"NONE": "Ingen"
}
},
diff --git a/lib/process-services/i18n/sv.json b/lib/process-services/i18n/sv.json
index 7033258b3b..65297ec02f 100644
--- a/lib/process-services/i18n/sv.json
+++ b/lib/process-services/i18n/sv.json
@@ -15,7 +15,7 @@
"APPS": {
"TITLE": "Inga program hittades",
"SUBTITLE": "Skapa ett nytt program som du enkelt hittar senare",
- "TASK_APP_NAME": "Överordnad namn"
+ "TASK_APP_NAME": "Uppgiftsapp"
},
"LIST": {
"MESSAGES": {
@@ -28,7 +28,7 @@
"TASK_NAME": "Uppgift",
"THUMBNAIL": "Miniatyrbild",
"DURATION": "Varaktighet",
- "PARENT_TASK_ID": "Föräldrauppgifts-ID",
+ "PARENT_TASK_ID": "Överordnad uppgift ID",
"NAME": "Namn",
"ASSIGNEE": "Tilldelad användare",
"ASSIGNEE_DEFAULT": "Ingen tilldelad användare",
@@ -213,7 +213,7 @@
"LABELS": {
"STARTED_BY": "Startad av",
"STARTED": "Startade",
- "ENDED": "Mime-typ",
+ "ENDED": "Avslutade",
"COMMENTS": "Kommentarer",
"START_FORM": "Startformulär",
"TASKS_ACTIVE": "Aktiva uppgifter",
From bb322bb5edc86f1147cf6b9ef1534be19d8d126f Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Wed, 19 Jun 2019 12:23:31 +0100
Subject: [PATCH 003/140] fix form variables
---
.../components/widgets/core/form-field.model.ts | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/core/form/components/widgets/core/form-field.model.ts b/lib/core/form/components/widgets/core/form-field.model.ts
index 11020cbd71..833e1c88ef 100644
--- a/lib/core/form/components/widgets/core/form-field.model.ts
+++ b/lib/core/form/components/widgets/core/form-field.model.ts
@@ -181,7 +181,7 @@ export class FormFieldModel extends FormWidgetModel {
if (processVariable) {
this.value = processVariable;
}
- } else if (json.params.field.responseVariable) {
+ } else if (json.params.responseVariable) {
const formVariable = this.getVariablesValue(json.params.field.name, form);
if (formVariable) {
this.value = formVariable;
@@ -287,7 +287,7 @@ export class FormFieldModel extends FormWidgetModel {
}
parseValue(json: any): any {
- let value = json.value;
+ let value = json.hasOwnProperty('value') ? json.value : null;
/*
This is needed due to Activiti issue related to reading dropdown values as value string
@@ -446,16 +446,16 @@ export class FormFieldModel extends FormWidgetModel {
private isDateField(json: any) {
return (json.params &&
- json.params.field &&
- json.params.field.type === FormFieldTypes.DATE ) ||
- json.type === FormFieldTypes.DATE;
+ json.params.field &&
+ json.params.field.type === FormFieldTypes.DATE) ||
+ json.type === FormFieldTypes.DATE;
}
private isDateTimeField(json: any): boolean {
return (json.params &&
- json.params.field &&
- json.params.field.type === FormFieldTypes.DATETIME) ||
- json.type === FormFieldTypes.DATETIME;
+ json.params.field &&
+ json.params.field.type === FormFieldTypes.DATETIME) ||
+ json.type === FormFieldTypes.DATETIME;
}
}
From f063d943167360158bcda16caab45980825ae8cc Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Wed, 19 Jun 2019 13:16:50 +0100
Subject: [PATCH 004/140] fix test
---
.../src/lib/form/components/form-cloud.component.spec.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts
index c455cdcfd6..d1f6de7bf2 100644
--- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts
@@ -742,7 +742,7 @@ describe('FormCloudComponent', () => {
let labelField = formFields.find((field) => field.id === 'text1');
let radioField = formFields.find((field) => field.id === 'number1');
expect(labelField.value).toBeNull();
- expect(radioField.value).toBeUndefined();
+ expect(radioField.value).toBeNull();
const formValues: any[] = [{ name: 'text1', value: 'test' }, { name: 'number1', value: 99 }];
From f861b94de4df7875ea475e06899b21f4d98a4f94 Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Thu, 20 Jun 2019 12:32:41 +0100
Subject: [PATCH 005/140] [Staging-branch] 3.4.0 (#4839)
* next 3.4.0
* next 3.4.0
* [ADF-4426] Move CSS overrides from ACA to ADF - 2nd round (#4837)
* [ADF-4426] align toolbar icon color with design
* [ADF-4426] clean-up style - it is never applied
* [ADF-4426] display title for name location cell - useful for long names
* [ADF-4426] move content-node-selector cell fix from ACA
- fixes https://github.com/Alfresco/alfresco-ng2-components/issues/4686
* [ADF-4426] move content-node-selector cell fix from ACA
- fixes https://github.com/Alfresco/alfresco-ng2-components/issues/4686
* [ADF-4426] move image width fix from ACA
* [ADF-4426] allow more customization of data-table borders
* [ADF-4426] move fix from ACA
[ACA-2363] fixes issue with text being visible underneath the info drawer
* [ADF-4426] get adf-datatable-link style from ACA
* [ADF-4426] allow set of DL selected row icon color
* [ADF-4426] allow more document list customization
- code moved from ACA
- more css variables
- removed non used and duplicated outline styles
- some code clean-up...
* [ADF-4635] The Status drop-down is looking different for Processes than for Tasks (#4822)
---
README.md | 2 +-
demo-shell/src/app/app.component.scss | 15 ---
...content-node-selector-panel.component.scss | 28 +++-
.../name-location-cell.component.ts | 2 +-
.../components/document-list.component.scss | 11 +-
.../components/document-list.component.ts | 2 +-
.../datatable/datatable.component.scss | 121 ++++++++++--------
lib/core/toolbar/toolbar.component.scss | 10 +-
.../edit-task-filter-cloud.component.spec.ts | 23 +++-
.../mock/task-filters-cloud.mock.ts | 12 ++
.../task-filters/models/filter-cloud.model.ts | 2 +-
11 files changed, 141 insertions(+), 87 deletions(-)
diff --git a/README.md b/README.md
index 3579f2e550..58e5f3d4e9 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
-
+{{ name }}
+ {{ name }}
{{ path }}
`,
styleUrls: ['./name-location-cell.component.scss'],
diff --git a/lib/content-services/document-list/components/document-list.component.scss b/lib/content-services/document-list/components/document-list.component.scss
index 356b195391..55c42c0739 100644
--- a/lib/content-services/document-list/components/document-list.component.scss
+++ b/lib/content-services/document-list/components/document-list.component.scss
@@ -4,6 +4,15 @@
$accent: map-get($theme, accent);
$primary: map-get($theme, primary);
+ $document-list-selection-color: mat-color($accent) !default;
+ $document-list-background: mat-color($background, background) !default;
+
+ .adf-document-list {
+ min-height: 0;
+ height: 100%;
+ background-color: $document-list-background;
+ }
+
.mat-icon.adf-datatable-selected {
height: 100%;
width: 100%;
@@ -17,7 +26,7 @@
}
.adf-datatable-selected > svg {
- fill: mat-color($accent);
+ fill: $document-list-selection-color;
width: 32px;
height: 32px;
}
diff --git a/lib/content-services/document-list/components/document-list.component.ts b/lib/content-services/document-list/components/document-list.component.ts
index 9346cf9c4b..de19441c90 100644
--- a/lib/content-services/document-list/components/document-list.component.ts
+++ b/lib/content-services/document-list/components/document-list.component.ts
@@ -64,7 +64,7 @@ import { DocumentLoaderNode } from '../models/document-folder.model';
styleUrls: ['./document-list.component.scss'],
templateUrl: './document-list.component.html',
encapsulation: ViewEncapsulation.None,
- host: { class: '.adf-document-list' }
+ host: { class: 'adf-document-list' }
})
export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, AfterContentInit, PaginatedComponent, NavigableComponentInterface {
diff --git a/lib/core/datatable/components/datatable/datatable.component.scss b/lib/core/datatable/components/datatable/datatable.component.scss
index dfa95c29d8..387115f206 100644
--- a/lib/core/datatable/components/datatable/datatable.component.scss
+++ b/lib/core/datatable/components/datatable/datatable.component.scss
@@ -9,20 +9,32 @@
$data-table-header-color: mat-color($foreground, text) !default;
$data-table-header-sorted-color: mat-color($foreground, text) !default;
$data-table-header-sorted-icon-hover-color: mat-color($foreground, disabled-text) !default;
+ $data-table-cell-text-color: mat-color($foreground, text) !default;
+ $data-table-cell-link-hover-color: mat-color($alfresco-ecm-blue, 500) !default;
+ $data-table-cell-outline: 1px solid mat-color($alfresco-ecm-blue, A200) !default;
$data-table-divider-color: mat-color($foreground, text, 0.07) !default;
$data-table-hover-color: mat-color($background, 'hover') !default;
$data-table-selection-color: mat-color($background, 'selected-button') !default;
$data-table-dividers: 1px solid $data-table-divider-color !default;
+ $data-table-dividers-edge-row: $data-table-dividers !default;
+ $data-table-dividers-wrapper-border: $data-table-dividers !default;
$data-table-row-height: 56px !default;
$data-table-column-spacing: 36px !default;
$data-table-column-padding: $data-table-column-spacing / 2;
$data-table-card-padding: 24px !default;
$data-table-cell-top: $data-table-card-padding / 2;
- $data-table-drag-border: 1px dashed rgb(68, 138, 255);
+ $data-table-drag-border: 1px dashed mat-color($alfresco-ecm-blue, A200);
$data-table-thumbnail-width: 50px !default;
+ $data-table-cell-min-width: 50px !default;
+ $data-table-cell-min-width--no-grow: 100px !default;
+ $data-table-cell-min-width--fileSize: $data-table-cell-min-width !default;
+
+ .adf-datatable {
+ overflow-y: scroll;
+ height: 100%;
+ }
.adf-datatable-card {
-
border: 1px solid mat-color($foreground, divider);
.adf-datatable-body {
@@ -130,9 +142,7 @@
margin: 8px;
padding: 4px;
overflow: visible;
- border-bottom-color: mat-color($foreground, divider);
- border-bottom-width: 1px;
- border-bottom-style: solid;
+ border-bottom: 1px solid mat-color($foreground, divider);
.adf-datatable-cell-container {
float: left;
@@ -167,40 +177,43 @@
display: flex;
flex-direction: column;
background-color: mat-color($background, card);
- border: $data-table-dividers;
+ border: $data-table-dividers-wrapper-border;
box-sizing: border-box;
- @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
- .adf-datatable-center-size-column-ie {
- padding-top: 17px;
- }
-
- .adf-datatable-center-actions-column-ie {
- padding-top: 7px !important;
- }
-
- .adf-datatable-center-date-column-ie {
- position: relative !important;
-
- .adf-datatable-cell-value {
- width: 100%;
- }
- }
-
- .adf-datatable-center-img-ie {
- padding:0;
- min-width: 0;
- width: 24px;
- height: 56px;
- }
-
+ @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
+ .adf-datatable-center-size-column-ie {
+ padding-top: 17px;
}
+ .adf-datatable-center-actions-column-ie {
+ padding-top: 7px !important;
+ }
+
+ .adf-datatable-center-date-column-ie {
+ position: relative !important;
+
+ .adf-datatable-cell-value {
+ width: 100%;
+ }
+ }
+
+ .adf-datatable-center-img-ie {
+ padding:0;
+ min-width: 0;
+ width: 24px;
+ height: 56px;
+ }
+ }
+
.adf-datatable-header {
display: flex;
flex-direction: column;
}
+ .adf-datatable-cell {
+ color: $data-table-cell-text-color;
+ }
+
.adf-datatable-body {
display: flex;
flex-direction: column;
@@ -215,7 +228,7 @@
@include adf-no-select;
- &:hover {
+ &:hover, &:focus {
background-color: $data-table-hover-color;
}
@@ -224,7 +237,7 @@
}
&:last-child {
- border-bottom: $data-table-dividers;
+ border-bottom: $data-table-dividers-edge-row;
}
}
}
@@ -251,6 +264,7 @@
.adf-datatable-cell, .adf-datatable-cell-header {
text-align: left;
box-sizing: border-box;
+ min-width: $data-table-cell-min-width;
&--text {
text-align: left;
@@ -271,11 +285,10 @@
width: $data-table-thumbnail-width;
min-width: $data-table-thumbnail-width;
text-align: left;
-
}
- &:focus {
- outline-width: 0;
+ &--fileSize {
+ min-width: $data-table-cell-min-width--fileSize;
}
}
@@ -294,13 +307,6 @@
padding-bottom: 8px;
box-sizing: border-box;
- &:focus {
- outline-offset: -1px;
- outline-width: 1px;
- outline-color: rgb(68, 138, 255);
- outline-style: solid;
- }
-
&.adf-sortable {
@include adf-no-select;
&:hover {
@@ -356,7 +362,7 @@
.adf-datatable-cell-header.adf-no-grow-cell, .adf-datatable-cell.adf-no-grow-cell {
flex-grow: 0;
- min-width: 100px;
+ min-width: $data-table-cell-min-width--no-grow;
}
.adf-datatable-cell, .adf-datatable-cell-header {
@@ -386,7 +392,7 @@
&:focus {
outline-offset: -1px;
- outline: #448aff solid 1px;
+ outline: $data-table-cell-outline;
}
}
@@ -409,10 +415,10 @@
.adf-location-cell {
a {
text-decoration: none;
- color: mat-color($foreground, text);
+ color: $data-table-cell-text-color;
&:hover {
- color: #2196f3;
+ color: $data-table-cell-link-hover-color;
text-decoration: underline;
}
}
@@ -436,18 +442,34 @@
.adf-datatable-link {
text-decoration: none;
- color: mat-color($foreground, text);
+ color: $data-table-cell-text-color;
&:hover {
- color: #2196f3;
+ color: $data-table-cell-link-hover-color;
text-decoration: underline;
}
}
+ .adf-dynamic-column .adf-datatable-link:hover {
+ text-decoration: none;
+
+ .adf-datatable-cell-value {
+ text-decoration: underline;
+ }
+ }
+
+ .adf-datatable-cell,
+ .adf-datatable-cell-header {
+ .adf-datatable-link .adf-datatable-cell-value {
+ padding: 0 10px;
+ }
+ }
+
.adf-ellipsis-cell {
position: sticky;
text-overflow: ellipsis;
white-space: nowrap;
+ overflow: hidden;
&.adf-datatable-cell-header,
.adf-datatable-content-cell {
@@ -568,16 +590,13 @@
& > div {
border-top: $data-table-drag-border !important;
border-bottom: $data-table-drag-border !important;
- border-color: $data-table-drag-border;
&:first-child {
border-left: $data-table-drag-border;
- border-color: $data-table-drag-border;
}
&:last-child {
border-right: $data-table-drag-border !important;
- border-color: $data-table-drag-border;
}
}
}
diff --git a/lib/core/toolbar/toolbar.component.scss b/lib/core/toolbar/toolbar.component.scss
index 31b911d36e..1f85cb8d6a 100644
--- a/lib/core/toolbar/toolbar.component.scss
+++ b/lib/core/toolbar/toolbar.component.scss
@@ -4,6 +4,7 @@
$adf-toolbar-single-row-height: 64px !default;
$adf-toolbar-font-size: 14px !default;
$adf-toolbar-padding: 16px !default;
+ $adf-toolbar-icon-color: mat-color($foreground, text, 0.54) !default;
.adf-toolbar {
&--spacer {
@@ -19,6 +20,7 @@
.mat-toolbar {
min-height: $adf-toolbar-height;
border: 1px solid mat-color($foreground, text, 0.07);
+ color: $adf-toolbar-icon-color;
}
.mat-toolbar-row {
@@ -40,12 +42,4 @@
}
}
}
-
- .adf-viewer {
- .adf-toolbar {
- .mat-toolbar {
- color: mat-color($foreground, text, 0.54);
- }
- }
- }
}
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts
index 85b526109c..d4f3147038 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts
@@ -30,7 +30,7 @@ import { TaskFiltersCloudModule } from '../task-filters-cloud.module';
import { EditTaskFilterCloudComponent } from './edit-task-filter-cloud.component';
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component';
-import { fakeFilter } from '../mock/task-filters-cloud.mock';
+import { fakeFilter, fakeAllTaskFilter } from '../mock/task-filters-cloud.mock';
import { AbstractControl } from '@angular/forms';
import moment from 'moment-es6';
@@ -194,6 +194,27 @@ describe('EditTaskFilterCloudComponent', () => {
});
}));
+ it('should select \'All\' option in Task Status if All filter is set', async(() => {
+
+ getTaskFilterSpy.and.returnValue(fakeAllTaskFilter);
+
+ const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+
+ const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+
+ const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"]');
+ stateElement.click();
+ fixture.detectChanges();
+
+ fixture.whenStable().then(() => {
+ expect(stateElement.textContent.trim()).toBe('ALL');
+ });
+ }));
+
it('should display sort drop down', async(() => {
fixture.detectChanges();
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts b/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts
index 4272581f9b..dc84ffdcce 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts
+++ b/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts
@@ -55,3 +55,15 @@ export let fakeFilter = new TaskFilterCloudModel({
order: 'ASC',
sort: 'id'
});
+
+export let fakeAllTaskFilter = new TaskFilterCloudModel({
+ name: 'AllTasks',
+ icon: 'adjust',
+ id: 'mock-task-filter-id',
+ status: '',
+ appName: 'mock-app-name',
+ processDefinitionId: 'process-def-id',
+ assignee: 'fake-involved',
+ order: 'ASC',
+ sort: 'id'
+});
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts b/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts
index 08d441a858..882aafb2ac 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts
+++ b/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts
@@ -115,7 +115,7 @@ export class TaskFilterProperties {
if (obj) {
this.label = obj.label || null;
this.type = obj.type || null;
- this.value = obj.value || null;
+ this.value = obj.value || '';
this.key = obj.key || null;
this.options = obj.options || null;
}
From 82d6ebd763ae77bb68552c0fca49be86b53d4752 Mon Sep 17 00:00:00 2001
From: Marouan Bentaleb <38426175+marouanbentaleb@users.noreply.github.com>
Date: Thu, 20 Jun 2019 12:33:46 +0100
Subject: [PATCH 006/140] [ADF-4593] Fixing skipped tests in Start Task Cloud
(#4868)
---
.../start-task-custom-app-cloud.e2e.ts | 24 ++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
index 114e731ae0..f90d9dc89b 100644
--- a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
@@ -121,10 +121,10 @@ describe('Start Task', () => {
expect(taskHeaderCloudPage.getAssignee()).toBe('No assignee');
});
- xit('[C291956] Should be able to create a new standalone task without assignee', () => {
+ it('[C291956] Should be able to create a new standalone task without assignee', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.checkFormIsDisplayed();
- expect(peopleCloudComponent.getAssignee()).toContain(apsUser.firstName, 'does not contain Admin');
+ expect(peopleCloudComponent.getAssignee()).toContain(testUser.firstName, 'does not contain Admin');
startTask.addName(unassignedTaskName);
startTask.clickStartButton();
startTask.checkStartButtonIsEnabled();
@@ -135,7 +135,7 @@ describe('Start Task', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(unassignedTaskName);
});
- xit('[C290166] Should be possible to cancel a task', () => {
+ it('[C290166] Should be possible to cancel a task', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.checkFormIsDisplayed();
startTask.checkStartButtonIsDisabled()
@@ -172,7 +172,7 @@ describe('Start Task', () => {
.clickCancelButton();
});
- xit('[C291774] Should be displayed an error message if the date is invalid', () => {
+ it('[C291774] Should be displayed an error message if the date is invalid', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.addDueDate('12/12/2018')
.checkStartButtonIsEnabled();
@@ -183,7 +183,7 @@ describe('Start Task', () => {
.clickCancelButton();
});
- xit('[C290182] Should be possible to assign the task to another user', () => {
+ it('[C290182] Should be possible to assign the task to another user', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.checkFormIsDisplayed();
startTask.addName(standaloneTaskName);
@@ -195,24 +195,26 @@ describe('Start Task', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(standaloneTaskName);
});
- xit('[C291953] Assignee field should display the logged user as default', () => {
+ it('[C291953] Assignee field should display the logged user as default', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.checkFormIsDisplayed();
- expect(peopleCloudComponent.getAssignee()).toContain(apsUser.firstName, 'does not contain Admin');
+ expect(peopleCloudComponent.getAssignee()).toContain(testUser.firstName, 'does not contain Admin');
startTask.clickCancelButton();
});
- xit('[C305050] Should be able to reassign the removed user when starting a new task', () => {
+ it('[C305050] Should be able to reassign the removed user when starting a new task', () => {
tasksCloudDemoPage.openNewTaskForm();
startTask.checkFormIsDisplayed();
startTask.addName(reassignTaskName);
- expect(peopleCloudComponent.getAssignee()).toBe(`${apsUser.firstName} ${apsUser.lastName}`);
+ expect(peopleCloudComponent.getAssignee()).toBe(`${testUser.firstName} ${testUser.lastName}`);
peopleCloudComponent.searchAssignee(apsUser.username);
peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
peopleCloudComponent.selectAssigneeFromList(`${apsUser.firstName} ${apsUser.lastName}`);
startTask.clickStartButton();
- tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
- expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
+ tasksCloudDemoPage.editTaskFilterCloudComponent()
+ .clickCustomiseFilterHeader()
+ .clearAssignee()
+ .setStatusFilterDropDown('ALL');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(reassignTaskName);
tasksCloudDemoPage.taskListCloudComponent().selectRow(reassignTaskName);
expect(taskHeaderCloudPage.getAssignee()).toBe(apsUser.username);
From 685404432af2e426bc8f6dd6bd423e13b2327174 Mon Sep 17 00:00:00 2001
From: davidcanonieto
Date: Thu, 20 Jun 2019 14:06:01 +0100
Subject: [PATCH 007/140] Add typeahead unit test for start process cloud
component (#4869)
---
.../start-process-cloud.component.spec.ts | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
index fdbe4805f6..1e7782078d 100755
--- a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
@@ -372,7 +372,7 @@ describe('StartProcessCloudComponent', () => {
});
}));
- it('should reload processes when appId input changed', async(() => {
+ it('should reload processes when appName input changed', async(() => {
component.ngOnChanges({ appName: change });
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -402,6 +402,23 @@ describe('StartProcessCloudComponent', () => {
tick(3000);
expect(component.filteredProcesses.length).toEqual(1);
}));
+
+ it('should display the matching results in the dropdown as the user types down', fakeAsync(() => {
+ component.processDefinitionList = fakeProcessDefinitions;
+ component.ngOnInit();
+ component.ngOnChanges({ appName: change });
+ fixture.detectChanges();
+
+ component.processForm.controls['processDefinition'].setValue('process');
+ fixture.detectChanges();
+ tick(3000);
+ expect(component.filteredProcesses.length).toEqual(3);
+
+ component.processForm.controls['processDefinition'].setValue('processwithfo');
+ fixture.detectChanges();
+ tick(3000);
+ expect(component.filteredProcesses.length).toEqual(1);
+ }));
});
describe('start process', () => {
@@ -487,7 +504,7 @@ describe('StartProcessCloudComponent', () => {
fixture.detectChanges();
});
- it('should able to start the process when the required fields are filled up', (done) => {
+ it('should be able to start the process when the required fields are filled up', (done) => {
component.processForm.controls['processInstanceName'].setValue('My Process 1');
component.processForm.controls['processDefinition'].setValue('NewProcess 1');
From 938286671d9a53ad8eaee1884dc4cedbca7f4a00 Mon Sep 17 00:00:00 2001
From: Geeta Mandakini Ayyalasomayajula
<45559635+gmandakini@users.noreply.github.com>
Date: Thu, 20 Jun 2019 14:25:46 +0100
Subject: [PATCH 008/140] test enabled (#4871)
---
e2e/process-services-cloud/process-custom-filters.e2e.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/e2e/process-services-cloud/process-custom-filters.e2e.ts b/e2e/process-services-cloud/process-custom-filters.e2e.ts
index 9a9cb27f78..d462f2a24f 100644
--- a/e2e/process-services-cloud/process-custom-filters.e2e.ts
+++ b/e2e/process-services-cloud/process-custom-filters.e2e.ts
@@ -28,7 +28,7 @@ import { browser } from 'protractor';
import { ProcessListCloudConfiguration } from './config/process-list-cloud.config';
import { EditProcessFilterConfiguration } from './config/edit-process-filter.config';
-xdescribe('Process list cloud', () => {
+describe('Process list cloud', () => {
describe('Process List', () => {
const loginSSOPage = new LoginSSOPage();
From be234f227f32db53921c7a9ec0da2a48c98cf1d8 Mon Sep 17 00:00:00 2001
From: Geeta Mandakini Ayyalasomayajula
<45559635+gmandakini@users.noreply.github.com>
Date: Mon, 24 Jun 2019 17:36:02 +0100
Subject: [PATCH 009/140] [ADF-4448] Automate Start and Save a task with a
form. (#4876)
* automated Start and save a task with a form.
* crc's
* test title updated
* test title updated
* start process with start event form automated
* moved the expect statements to the tests.
* fix circular dependency
* deleting the standalonetask in afterAll
* split the tests for better readability
* split the tests for better readability
---
.../processDetailsCloudDemoPage.ts | 33 +++
.../config/start-process-cloud.config.ts | 39 ++++
.../start-process-cloud.e2e.ts | 12 +-
.../start-task-form-cloud.e2e.ts | 211 ++++++++++++++++++
.../core/pages/form/widgets/numberWidget.ts | 4 +
.../start-process-cloud-component.page.ts | 11 +-
.../pages/start-tasks-cloud-component.page.ts | 7 +
.../pages/task-form-cloud-component.page.ts | 6 +
.../pages/task-list-cloud-component.page.ts | 4 +
9 files changed, 316 insertions(+), 11 deletions(-)
create mode 100644 e2e/pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage.ts
create mode 100644 e2e/process-services-cloud/config/start-process-cloud.config.ts
create mode 100644 e2e/process-services-cloud/start-task-form-cloud.e2e.ts
diff --git a/e2e/pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage.ts b/e2e/pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage.ts
new file mode 100644
index 0000000000..f97570fcad
--- /dev/null
+++ b/e2e/pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage.ts
@@ -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 { DataTableComponentPage } from '@alfresco/adf-testing';
+
+export class ProcessDetailsCloudDemoPage {
+
+ dataTable = new DataTableComponentPage();
+
+ checkTaskIsDisplayed(taskName: string) {
+ this.dataTable.checkContentIsDisplayed('Name', taskName);
+ return this;
+ }
+
+ selectProcessTaskByName(taskName: string) {
+ this.dataTable.selectRow('Name', taskName);
+ return this;
+ }
+}
diff --git a/e2e/process-services-cloud/config/start-process-cloud.config.ts b/e2e/process-services-cloud/config/start-process-cloud.config.ts
new file mode 100644
index 0000000000..488adcf93c
--- /dev/null
+++ b/e2e/process-services-cloud/config/start-process-cloud.config.ts
@@ -0,0 +1,39 @@
+/*!
+ * @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.
+ */
+
+export class StartProcessCloudConfiguration {
+
+ getConfiguration() {
+ return {
+ 'name': 'processwithstarteventform',
+ 'values': [
+ {
+ 'name': 'FirstName',
+ 'value': 'sample name'
+ },
+ {
+ 'name': 'Number07vyx9',
+ 'value': 17
+ }
+ ],
+ 'variables': {
+ 'my-key1': 'myvalue',
+ 'my-key2': 'myvalue2'
+ }
+ };
+ }
+}
diff --git a/e2e/process-services-cloud/start-process-cloud.e2e.ts b/e2e/process-services-cloud/start-process-cloud.e2e.ts
index b4f8c31aae..aee66a6203 100644
--- a/e2e/process-services-cloud/start-process-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-process-cloud.e2e.ts
@@ -36,7 +36,7 @@ describe('Start Process', () => {
browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
);
- const processDefinitionWithoutName = 'process-bc59fd64-d0b1-4eda-8b02-2ef38062cf39';
+ const processDefinitionWithoutName = 'process-';
const processName = StringUtil.generateRandomString(10);
const processName255Characters = StringUtil.generateRandomString(255);
const processNameBiggerThen255Characters = StringUtil.generateRandomString(256);
@@ -84,7 +84,7 @@ describe('Start Process', () => {
startProcessPage.clearField(startProcessPage.processNameInput);
startProcessPage.blur(startProcessPage.processNameInput);
startProcessPage.checkValidationErrorIsDisplayed(requiredError);
- startProcessPage.checkStartProcessButtonIsDisabled();
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
startProcessPage.clickCancelProcessButton();
});
@@ -93,12 +93,12 @@ describe('Start Process', () => {
appListCloudComponent.goToApp(simpleApp);
processCloudDemoPage.openNewProcessForm();
startProcessPage.enterProcessName(processName255Characters);
- startProcessPage.checkStartProcessButtonIsEnabled();
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(true);
startProcessPage.enterProcessName(processNameBiggerThen255Characters);
startProcessPage.blur(startProcessPage.processNameInput);
startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
- startProcessPage.checkStartProcessButtonIsDisabled();
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
});
it('[C291860] Should be able to start a process', () => {
@@ -107,7 +107,7 @@ describe('Start Process', () => {
processCloudDemoPage.openNewProcessForm();
startProcessPage.clearField(startProcessPage.processNameInput);
startProcessPage.enterProcessName(processName);
- startProcessPage.checkStartProcessButtonIsEnabled();
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(true);
startProcessPage.clickStartProcessButton();
processCloudDemoPage.clickOnProcessFilters();
@@ -124,7 +124,7 @@ describe('Start Process', () => {
startProcessPage.clearField(startProcessPage.processNameInput);
startProcessPage.enterProcessName(processName);
startProcessPage.selectFromProcessDropdown(processDefinitionWithoutName);
- startProcessPage.checkStartProcessButtonIsEnabled();
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(true);
});
});
diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
new file mode 100644
index 0000000000..12e70eae4d
--- /dev/null
+++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
@@ -0,0 +1,211 @@
+/*!
+ * @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';
+import { NavigationBarPage } from '../pages/adf/navigationBarPage';
+import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
+import {
+ LoginSSOPage,
+ AppListCloudPage,
+ StringUtil,
+ StartTasksCloudPage,
+ ApiService,
+ IdentityService,
+ SettingsPage,
+ GroupIdentityService,
+ TaskFormCloudComponent,
+ Widget, LocalStorageUtil, StartProcessCloudPage, TaskHeaderCloudPage, ProcessHeaderCloudPage, TasksService
+} from '@alfresco/adf-testing';
+import resources = require('../util/resources');
+import { StartProcessCloudConfiguration } from './config/start-process-cloud.config';
+import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage';
+import { ProcessDetailsCloudDemoPage } from '../pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage';
+
+describe('Start Task Form', () => {
+
+ const loginSSOPage = new LoginSSOPage();
+ const taskFormCloudComponent = new TaskFormCloudComponent();
+ const navigationBarPage = new NavigationBarPage();
+ const appListCloudComponent = new AppListCloudPage();
+ const tasksCloudDemoPage = new TasksCloudDemoPage();
+ const startTask = new StartTasksCloudPage();
+ const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage();
+ const settingsPage = new SettingsPage();
+ const widget = new Widget();
+ const startProcessPage = new StartProcessCloudPage();
+ const processCloudDemoPage = new ProcessCloudDemoPage();
+ const taskHeaderCloudPage = new TaskHeaderCloudPage();
+ const processHeaderCloud = new ProcessHeaderCloudPage();
+ const apiService = new ApiService(
+ browser.params.config.oauth2.clientId,
+ browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
+ );
+ const startProcessCloudConfiguration = new StartProcessCloudConfiguration();
+ const startProcessCloudConfig = startProcessCloudConfiguration.getConfiguration();
+
+ const standaloneTaskName = StringUtil.generateRandomString(5);
+ const startEventFormProcess = StringUtil.generateRandomString(5);
+ let testUser, groupInfo, processId, taskId;
+ const candidateBaseApp = resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name;
+
+ let identityService: IdentityService;
+ let groupIdentityService: GroupIdentityService;
+
+ beforeAll(async (done) => {
+ await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+
+ identityService = new IdentityService(apiService);
+ groupIdentityService = new GroupIdentityService(apiService);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
+ await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
+ await apiService.login(testUser.email, testUser.password);
+
+ await settingsPage.setProviderBpmSso(
+ browser.params.config.bpmHost,
+ browser.params.config.oauth2.host,
+ browser.params.config.identityHost);
+ loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
+ await LocalStorageUtil.setConfigField('adf-cloud-start-process', JSON.stringify(startProcessCloudConfig));
+ done();
+ });
+
+ afterAll(async (done) => {
+ try {
+ await apiService.login(testUser.email, testUser.password);
+ const tasksService = new TasksService(apiService);
+ const taskID = await tasksService.getTaskId(standaloneTaskName, candidateBaseApp);
+ await tasksService.deleteTask(taskID, candidateBaseApp);
+ await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ await identityService.deleteIdentityUser(testUser.idIdentityService);
+ } catch (error) {
+ }
+ done();
+ });
+
+ describe('StandaloneTask with form', () => {
+
+ beforeEach(() => {
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.checkAppIsDisplayed(candidateBaseApp);
+ appListCloudComponent.goToApp(candidateBaseApp);
+ tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody();
+ });
+
+ it('[C307976] Should be able to start and save a task with a form', () => {
+ tasksCloudDemoPage.openNewTaskForm();
+ startTask.checkFormIsDisplayed();
+ startTask.addName(standaloneTaskName);
+ startTask.selectFormDefinition('StartEventForm');
+ startTask.clickStartButton();
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(standaloneTaskName);
+ tasksCloudDemoPage.taskListCloudComponent().selectRow(standaloneTaskName);
+ taskFormCloudComponent.formFields().checkFormIsDisplayed();
+ taskFormCloudComponent.formFields().checkWidgetIsVisible('FirstName');
+ taskFormCloudComponent.formFields().checkWidgetIsVisible('Number07vyx9');
+ widget.textWidget().setValue('FirstName', 'sample');
+ widget.numberWidget().setFieldValue('Number07vyx9', 26);
+ taskFormCloudComponent.checkSaveButtonIsDisplayed().clickSaveButton();
+ expect(widget.textWidget().getFieldValue('FirstName')).toBe('sample');
+ expect(widget.numberWidget().getFieldValue('Number07vyx9')).toBe('26');
+
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.checkAppIsDisplayed(candidateBaseApp);
+ appListCloudComponent.goToApp(candidateBaseApp);
+ tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody();
+
+ expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(standaloneTaskName);
+ tasksCloudDemoPage.taskListCloudComponent().selectRow(standaloneTaskName);
+ taskFormCloudComponent.formFields().checkFormIsDisplayed();
+ expect(widget.textWidget().getFieldValue('FirstName')).toBe('sample');
+ expect(widget.numberWidget().getFieldValue('Number07vyx9')).toBe('26');
+ taskFormCloudComponent.checkCompleteButtonIsDisplayed();
+ });
+
+ });
+
+ describe('Start a process with a start event form', () => {
+
+ beforeEach(() => {
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.checkAppIsDisplayed(candidateBaseApp);
+ appListCloudComponent.goToApp(candidateBaseApp);
+ processCloudDemoPage.openNewProcessForm();
+ startProcessPage.clearField(startProcessPage.processNameInput);
+ startProcessPage.enterProcessName(startEventFormProcess);
+ startProcessPage.selectFromProcessDropdown('processwithstarteventform');
+ startProcessPage.formFields().checkFormIsDisplayed();
+ });
+ it('[C311277] Should be able to start a process with a start event form - default values', async () => {
+
+ expect(widget.textWidget().getFieldValue('FirstName')).toBe('sample name');
+ expect(widget.numberWidget().getFieldValue('Number07vyx9')).toBe('17');
+ });
+
+ it('[C311277] Should be able to start a process with a start event form - form validation', async () => {
+
+ expect(widget.textWidget().getErrorMessage('FirstName')).toBe('Enter no more than 10 characters');
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
+
+ widget.textWidget().setValue('FirstName', 'Sam');
+ expect(widget.textWidget().getErrorMessage('FirstName')).toBe('Enter at least 5 characters');
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
+ widget.numberWidget().setFieldValue('Number07vyx9', 9);
+ expect(widget.numberWidget().getErrorMessage('Number07vyx9')).toBe('Can\'t be less than 10');
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
+ widget.numberWidget().setFieldValue('Number07vyx9', 99999);
+ expect(widget.numberWidget().getErrorMessage('Number07vyx9')).toBe('Can\'t be greater than 1,000');
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(false);
+ });
+
+ it('[C311277] Should be able to start a process with a start event form - claim and complete the process', async () => {
+
+ widget.textWidget().setValue('FirstName', 'Sample');
+ widget.numberWidget().setFieldValue('Number07vyx9', 100);
+ expect(startProcessPage.checkStartProcessButtonIsEnabled()).toBe(true);
+ startProcessPage.clickStartProcessButton();
+ processCloudDemoPage.clickOnProcessFilters();
+ processCloudDemoPage.runningProcessesFilter().clickProcessFilter();
+ expect(processCloudDemoPage.getActiveFilterName()).toBe('Running Processes');
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processName', startEventFormProcess);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(startEventFormProcess);
+
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', startEventFormProcess);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('StartEventFormTask');
+ processId = await processHeaderCloud.getId();
+ processDetailsCloudDemoPage.selectProcessTaskByName('StartEventFormTask');
+ taskFormCloudComponent.clickClaimButton();
+ taskId = await taskHeaderCloudPage.getId();
+ taskFormCloudComponent.checkCompleteButtonIsDisplayed().clickCompleteButton();
+ expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId);
+
+ tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId);
+ processCloudDemoPage.clickOnProcessFilters();
+ processCloudDemoPage.completedProcessesFilter().clickProcessFilter();
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(processId);
+
+ });
+
+ });
+});
diff --git a/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts
index a86ecaf5de..7645446e0c 100644
--- a/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts
+++ b/lib/testing/src/lib/core/pages/form/widgets/numberWidget.ts
@@ -28,6 +28,10 @@ export class NumberWidget {
return BrowserActions.getText(label);
}
+ getFieldValue(fieldId) {
+ return this.formFields.getFieldValue(fieldId);
+ }
+
setFieldValue(fieldId, value) {
return this.formFields.setValueInInputById(fieldId, value);
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
index 8d83771fa2..e88ef1a72e 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
@@ -18,6 +18,7 @@
import { by, element, Key, protractor, browser } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
+import { FormFields } from '../../core/pages/form/formFields';
export class StartProcessCloudPage {
@@ -83,11 +84,7 @@ export class StartProcessCloudPage {
checkStartProcessButtonIsEnabled() {
BrowserVisibility.waitUntilElementIsClickable(this.startProcessButton);
- expect(this.startProcessButton.isEnabled()).toBe(true);
- }
-
- checkStartProcessButtonIsDisabled() {
- expect(this.startProcessButton.isEnabled()).toBe(false);
+ return this.startProcessButton.isEnabled();
}
clickStartProcessButton() {
@@ -114,4 +111,8 @@ export class StartProcessCloudPage {
}
});
}
+
+ formFields() {
+ return new FormFields();
+ }
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/start-tasks-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/start-tasks-cloud-component.page.ts
index 0deb5396a0..791fe45259 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/start-tasks-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/start-tasks-cloud-component.page.ts
@@ -29,6 +29,7 @@ export class StartTasksCloudPage {
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
cancelButton = element(by.css('button[id="button-cancel"]'));
form = element.all(by.css('adf-cloud-start-task form')).first();
+ formDefinitionSelector = element(by.css('.adf-form-definition-selector'));
checkFormIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.form);
@@ -102,4 +103,10 @@ export class StartTasksCloudPage {
clearField(locator) {
BrowserActions.clearSendKeys(locator, '');
}
+
+ selectFormDefinition(option: string) {
+ BrowserActions.click(this.formDefinitionSelector);
+ const row = element(by.cssContainingText('mat-option span', option));
+ BrowserActions.click(row);
+ }
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
index 5baddee6d3..90fe1c809a 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
@@ -26,6 +26,7 @@ export class TaskFormCloudComponent {
completeButton = element(by.css('button[id="adf-form-complete"]'));
releaseButton = element(by.css('button[adf-cloud-unclaim-task]'));
saveButton = element(by.css('button[id="adf-form-save"]'));
+ claimButton = element(by.css('button[adf-cloud-claim-task]'));
form = element(by.css('adf-cloud-form'));
checkCompleteButtonIsDisplayed() {
@@ -48,6 +49,11 @@ export class TaskFormCloudComponent {
return this;
}
+ clickClaimButton() {
+ BrowserActions.click(this.claimButton);
+ return this;
+ }
+
formFields() {
return new FormFields();
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
index 6a92067480..8fae156284 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
@@ -87,6 +87,10 @@ export class TaskListCloudComponentPage {
return this.dataTable.checkContentIsDisplayed(column.id, taskId);
}
+ checkContentIsNotDisplayedById(taskId) {
+ return this.dataTable.checkContentIsNotDisplayed(column.id, taskId);
+ }
+
checkContentIsDisplayedByProcessInstanceId(taskName) {
return this.dataTable.checkContentIsDisplayed(column.processInstanceId, taskName);
}
From 317ae3db68a742560bddd4d05be35906f28b4a62 Mon Sep 17 00:00:00 2001
From: Suzana Dirla
Date: Mon, 24 Jun 2019 19:39:06 +0300
Subject: [PATCH 010/140] [ADF-4696] Display name on metadata card (#4870)
* [ADF-4696] Display names on content metadata
* [ADF-4696] unit test
---
.../card-view-textitem.component.spec.ts | 15 +++++++++++++++
.../card-view/models/card-view-baseitem.model.ts | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts
index 2c0c2d424c..9a9327f5a6 100644
--- a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts
+++ b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts
@@ -62,6 +62,21 @@ describe('CardViewTextItemComponent', () => {
expect(value.nativeElement.innerText.trim()).toBe('Lorem ipsum');
});
+ it('should render the displayName as value when available', () => {
+ let componentWithDisplayName: CardViewTextItemComponent;
+ componentWithDisplayName = fixture.componentInstance;
+ componentWithDisplayName.property = new CardViewTextItemModel({
+ label: 'Name label',
+ value: {id: 123, displayName: 'User Name'},
+ key: 'namekey'
+ });
+ fixture.detectChanges();
+
+ const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`));
+ expect(value).not.toBeNull();
+ expect(value.nativeElement.innerText.trim()).toBe('User Name');
+ });
+
it('should NOT render the default as value if the value is empty, editable is false and displayEmpty is false', () => {
component.property = new CardViewTextItemModel({
label: 'Text label',
diff --git a/lib/core/card-view/models/card-view-baseitem.model.ts b/lib/core/card-view/models/card-view-baseitem.model.ts
index 74f48ea8e0..5c09e0a217 100644
--- a/lib/core/card-view/models/card-view-baseitem.model.ts
+++ b/lib/core/card-view/models/card-view-baseitem.model.ts
@@ -30,7 +30,7 @@ export abstract class CardViewBaseItemModel {
constructor(cardViewItemProperties: CardViewItemProperties) {
this.label = cardViewItemProperties.label || '';
- this.value = cardViewItemProperties.value;
+ this.value = cardViewItemProperties.value && cardViewItemProperties.value.displayName || cardViewItemProperties.value;
this.key = cardViewItemProperties.key;
this.default = cardViewItemProperties.default;
this.editable = !!cardViewItemProperties.editable;
From 31d98fc368449fcbc67785d159bfbb2791ec8bf6 Mon Sep 17 00:00:00 2001
From: Marouan Bentaleb <38426175+marouanbentaleb@users.noreply.github.com>
Date: Mon, 24 Jun 2019 18:43:33 +0200
Subject: [PATCH 011/140] [ADF-4515] Removing duplicated test and moving other
test to the right spec (#4872)
---
.../upload/remove-upload.e2e.ts | 93 -------------------
e2e/content-services/upload/upload-dialog.ts | 33 +++++--
2 files changed, 24 insertions(+), 102 deletions(-)
delete mode 100644 e2e/content-services/upload/remove-upload.e2e.ts
diff --git a/e2e/content-services/upload/remove-upload.e2e.ts b/e2e/content-services/upload/remove-upload.e2e.ts
deleted file mode 100644
index 83adaa61bb..0000000000
--- a/e2e/content-services/upload/remove-upload.e2e.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-/*!
- * @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 { LoginPage, BrowserActions } from '@alfresco/adf-testing';
-import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
-import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
-import { VersionManagePage } from '../../pages/adf/versionManagerPage';
-
-import { AcsUserModel } from '../../models/ACS/acsUserModel';
-import { FileModel } from '../../models/ACS/fileModel';
-
-import { browser } from 'protractor';
-import resources = require('../../util/resources');
-
-import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
-
-describe('Upload component', () => {
- const contentServicesPage = new ContentServicesPage();
- const uploadDialog = new UploadDialog();
- const versionManagePage = new VersionManagePage();
- const loginPage = new LoginPage();
- const acsUser = new AcsUserModel();
-
- const docxFileModel = new FileModel({
- name: resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_name,
- location: resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_location
- });
-
- const fileModelVersion = new FileModel({
- 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
- 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
- });
-
- beforeAll(async (done) => {
- this.alfrescoJsApi = new AlfrescoApi({
- provider: 'ECM',
- hostEcm: browser.params.testConfig.adf.url
- });
-
- await this.alfrescoJsApi.login(
- browser.params.testConfig.adf.adminEmail,
- browser.params.testConfig.adf.adminPassword
- );
-
- await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
-
- await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
-
- await loginPage.loginToContentServicesUsingUserModel(acsUser);
-
- done();
- });
-
- it('should remove uploaded file', () => {
- contentServicesPage.goToDocumentList();
- contentServicesPage.uploadFile(docxFileModel.location);
- uploadDialog.fileIsUploaded(docxFileModel.name);
- uploadDialog
- .removeUploadedFile(docxFileModel.name)
- .fileIsCancelled(docxFileModel.name)
- .clickOnCloseButton();
- });
-
- it('should not have remove action if uploaded file is a file version', () => {
- contentServicesPage.goToDocumentList();
- contentServicesPage.uploadFile(docxFileModel.location);
- uploadDialog.fileIsUploaded(docxFileModel.name);
- contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
-
- contentServicesPage.versionManagerContent(docxFileModel.name);
- BrowserActions.click(versionManagePage.showNewVersionButton);
- versionManagePage.uploadNewVersionFile(
- fileModelVersion.location
- );
- versionManagePage.closeVersionDialog();
- uploadDialog.removeUploadedFile(fileModelVersion.name);
- contentServicesPage.checkContentIsDisplayed(fileModelVersion.name);
- });
-});
diff --git a/e2e/content-services/upload/upload-dialog.ts b/e2e/content-services/upload/upload-dialog.ts
index 5961a2fe01..4d160fffa1 100644
--- a/e2e/content-services/upload/upload-dialog.ts
+++ b/e2e/content-services/upload/upload-dialog.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { LoginPage, UploadActions } from '@alfresco/adf-testing';
+import { BrowserActions, LoginPage, UploadActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
@@ -24,6 +24,7 @@ import { FileModel } from '../../models/ACS/fileModel';
import { browser } from 'protractor';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
+import { VersionManagePage } from '../../pages/adf/versionManagerPage';
describe('Upload component', () => {
@@ -32,6 +33,7 @@ describe('Upload component', () => {
const uploadToggles = new UploadToggles();
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
+ const versionManagePage = new VersionManagePage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf.url
@@ -78,15 +80,15 @@ describe('Upload component', () => {
});
afterEach(async (done) => {
- const nodesPromise = await contentServicesPage.getElementsDisplayedId();
+ const nbResults = await contentServicesPage.numberOfResultsDisplayed();
+ if (nbResults > 1) {
+ const nodesPromise = await contentServicesPage.getElementsDisplayedId();
- nodesPromise.forEach(async (currentNodePromise) => {
- await currentNodePromise.then(async (currentNode) => {
- if (currentNode && currentNode !== 'Node id') {
- await uploadActions.deleteFileOrFolder(currentNode);
- }
+ nodesPromise.forEach(async (currentNodePromise) => {
+ const nodeId = await currentNodePromise;
+ await uploadActions.deleteFileOrFolder(nodeId);
});
- });
+ }
done();
});
@@ -140,7 +142,6 @@ describe('Upload component', () => {
});
it('[C260170] Should be possible to upload multiple files', () => {
- contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile(filesLocation).checkContentsAreDisplayed(filesName);
@@ -150,4 +151,18 @@ describe('Upload component', () => {
uploadToggles.disableMultipleFileUpload();
});
+ it('[C311305] Should NOT be able to remove uploaded version', () => {
+ contentServicesPage.uploadFile(docxFileModel.location);
+ uploadDialog.fileIsUploaded(docxFileModel.name);
+ contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
+
+ contentServicesPage.versionManagerContent(docxFileModel.name);
+ BrowserActions.click(versionManagePage.showNewVersionButton);
+ versionManagePage.uploadNewVersionFile(
+ pngFileModel.location
+ );
+ versionManagePage.closeVersionDialog();
+ uploadDialog.removeUploadedFile(pngFileModel.name);
+ contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
+ });
});
From 72eab9e84d6131afdd235131433f033285082cbb Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Tue, 25 Jun 2019 13:00:05 +0100
Subject: [PATCH 012/140] fix script
---
scripts/check-env/check-activiti-env.js | 7 +++++++
scripts/update-project.sh | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/check-env/check-activiti-env.js b/scripts/check-env/check-activiti-env.js
index 8cef521345..4a98988a17 100755
--- a/scripts/check-env/check-activiti-env.js
+++ b/scripts/check-env/check-activiti-env.js
@@ -17,6 +17,8 @@ let TIMEOUT = 1000;
async function main() {
+ console.log('---START---');
+
program
.version('0.1.0')
.option('--host [type]', 'Remote environment host adf.lab.com ')
@@ -44,6 +46,8 @@ async function main() {
host = program.host;
+ console.log('---Login---');
+
try {
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility(config);
await this.alfrescoJsApi.login(program.username, program.password);
@@ -51,6 +55,9 @@ async function main() {
console.log('Login error' + e);
}
+ console.log('---Login ok---');
+
+
await deployAbsentApps(this.alfrescoJsApi);
let pushFailed = await getPushFailedApps(this.alfrescoJsApi);
diff --git a/scripts/update-project.sh b/scripts/update-project.sh
index ed3ff9af09..7253785aac 100755
--- a/scripts/update-project.sh
+++ b/scripts/update-project.sh
@@ -7,7 +7,7 @@ TEMP_GENERATOR_DIR=".tmp-generator";
VERSION=$(npm view @alfresco/adf-core@beta version)
show_help() {
- echo "Usage: update-generator.sh"
+ echo "Usage: update-project.sh"
echo ""
echo "-t or --token Github ouath token"
echo "-n or --name Github name of the project"
@@ -43,7 +43,7 @@ git clone https://$TOKEN@github.com/$NAME_REPO.git $TEMP_GENERATOR_DIR
cd $TEMP_GENERATOR_DIR
git checkout development
-BRANCH="generator-update-beta-$VERSION"
+BRANCH="ADF-update-beta-$VERSION"
git checkout -b $BRANCH
if $GNU; then
From d531a022d0160cbe538f38d6cfc584fe60895c48 Mon Sep 17 00:00:00 2001
From: Geeta Mandakini Ayyalasomayajula
<45559635+gmandakini@users.noreply.github.com>
Date: Tue, 25 Jun 2019 14:44:30 +0100
Subject: [PATCH 013/140] [ADF-4026] - automate process filter results check
(#4874)
* process-filter-results test automated
* updated the test case numbers
* fix test
* fix test
* added wait for the datatable to load
* fixes
* created another process instance in simpleApp by anotherUser, to test the negative scenario's in filtering.
* created another process instance in simpleApp by anotherUser, to test the negative scenario's in filtering.
* delete both the users created.
---
.../config/edit-process-filter.config.ts | 4 +-
.../process-filter-results.e2e.ts | 298 ++++++++++++++++++
.../process-list-cloud-component.page.ts | 4 +
3 files changed, 303 insertions(+), 3 deletions(-)
create mode 100644 e2e/process-services-cloud/process-filter-results.e2e.ts
diff --git a/e2e/process-services-cloud/config/edit-process-filter.config.ts b/e2e/process-services-cloud/config/edit-process-filter.config.ts
index 4c11ba99c2..fa5ac1322e 100644
--- a/e2e/process-services-cloud/config/edit-process-filter.config.ts
+++ b/e2e/process-services-cloud/config/edit-process-filter.config.ts
@@ -30,9 +30,7 @@ export class EditProcessFilterConfiguration {
'processInstanceId',
'initiator',
'processDefinitionId',
- 'processDefinitionKey',
- 'startDate',
- 'businessKey'
+ 'processDefinitionKey'
],
'sortProperties':
[
diff --git a/e2e/process-services-cloud/process-filter-results.e2e.ts b/e2e/process-services-cloud/process-filter-results.e2e.ts
new file mode 100644
index 0000000000..74475c0ea1
--- /dev/null
+++ b/e2e/process-services-cloud/process-filter-results.e2e.ts
@@ -0,0 +1,298 @@
+/*!
+ * @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 {
+ TasksService, QueryService, ProcessDefinitionsService, ProcessInstancesService,
+ LoginSSOPage, ApiService, SettingsPage, IdentityService, GroupIdentityService, StringUtil, DateUtil
+} from '@alfresco/adf-testing';
+import { NavigationBarPage } from '../pages/adf/navigationBarPage';
+import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage';
+import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
+import { AppListCloudPage, LocalStorageUtil } from '@alfresco/adf-testing';
+import resources = require('../util/resources');
+import { browser } from 'protractor';
+import { ProcessListCloudConfiguration } from './config/process-list-cloud.config';
+import { EditProcessFilterConfiguration } from './config/edit-process-filter.config';
+import { ProcessListPage } from '../pages/adf/process-services/processListPage';
+import moment = require('moment');
+
+describe('Process filters cloud', () => {
+ const loginSSOPage = new LoginSSOPage();
+ const navigationBarPage = new NavigationBarPage();
+ const appListCloudComponent = new AppListCloudPage();
+ const processCloudDemoPage = new ProcessCloudDemoPage();
+ const tasksCloudDemoPage = new TasksCloudDemoPage();
+ const processListPage = new ProcessListPage();
+ const settingsPage = new SettingsPage();
+ const apiService = new ApiService(
+ browser.params.config.oauth2.clientId,
+ browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
+ );
+ const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
+ const currentDate = DateUtil.formatDate('DD/MM/YYYY');
+ const afterDate = moment().add(1, 'days').format('DD/MM/YYYY');
+ const processListCloudConfiguration = new ProcessListCloudConfiguration();
+ const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
+ const processListCloudConfigFile = processListCloudConfiguration.getConfiguration();
+ const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
+
+ let tasksService: TasksService;
+ let identityService: IdentityService;
+ let groupIdentityService: GroupIdentityService;
+ let processDefinitionService: ProcessDefinitionsService;
+ let processInstancesService: ProcessInstancesService;
+ let queryService: QueryService;
+
+ let completedProcess, runningProcessInstance, suspendProcessInstance, testUser, anotherUser, groupInfo, anotherProcessInstance, processDefinition, anotherProcessDefinition,
+ differentAppUserProcessInstance, simpleAppProcessDefinition;
+ const candidateBaseApp = resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name;
+ const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
+
+ beforeAll(async (done) => {
+
+ await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ identityService = new IdentityService(apiService);
+ groupIdentityService = new GroupIdentityService(apiService);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ anotherUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+
+ groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
+ await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
+ await identityService.addUserToGroup(anotherUser.idIdentityService, groupInfo.id);
+
+ await apiService.login(anotherUser.email, anotherUser.password);
+ processDefinitionService = new ProcessDefinitionsService(apiService);
+ simpleAppProcessDefinition = await processDefinitionService.getProcessDefinitionByName('simpleProcess', simpleApp);
+ processInstancesService = new ProcessInstancesService(apiService);
+ await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp);
+ differentAppUserProcessInstance = await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ await apiService.login(testUser.email, testUser.password);
+ processDefinition = await processDefinitionService.getProcessDefinitionByName('candidateGroupProcess', candidateBaseApp);
+ anotherProcessDefinition = await processDefinitionService.getProcessDefinitionByName('anotherCandidateGroupProcess', candidateBaseApp);
+ await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
+
+ runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ anotherProcessInstance = await processInstancesService.createProcessInstance(anotherProcessDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ suspendProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+ await processInstancesService.suspendProcessInstance(suspendProcessInstance.entry.id, candidateBaseApp);
+
+ completedProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+ queryService = new QueryService(apiService);
+
+ const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, candidateBaseApp);
+ tasksService = new TasksService(apiService);
+ const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, candidateBaseApp);
+ await tasksService.completeTask(claimedTask.entry.id, candidateBaseApp);
+
+ await settingsPage.setProviderBpmSso(
+ browser.params.config.bpmHost,
+ browser.params.config.oauth2.host,
+ browser.params.config.identityHost);
+ loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
+ await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
+ await LocalStorageUtil.setConfigField('adf-cloud-process-list', JSON.stringify(processListCloudConfigFile));
+ done();
+ });
+
+ afterAll(async (done) => {
+ await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ await identityService.deleteIdentityUser(testUser.idIdentityService);
+ await identityService.deleteIdentityUser(anotherUser.idIdentityService);
+ done();
+ });
+
+ beforeEach(() => {
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.goToApp(candidateBaseApp);
+ tasksCloudDemoPage.taskListCloudComponent().checkTaskListIsLoaded();
+ processCloudDemoPage.clickOnProcessFilters();
+ });
+
+ it('[C306887] Should be able to filter by appName', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown(candidateBaseApp).setProperty('initiator', testUser.email);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
+
+ });
+
+ it('[C306889] Should be able to see "No process found" when using an app with no processes in the appName field', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown('subprocessapp').setProperty('initiator', testUser.email);
+ expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
+
+ });
+
+ it('[C306890] Should be able to filter by initiator', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', testUser.email);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
+
+ });
+
+ it('[C306891] Should be able to see "No process found" when providing an initiator whitout processes', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', anotherUser.email);
+ expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
+
+ });
+
+ it('[C311315] Should be able to filter by process definition id', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processDefinitionId', processDefinition.entry.id);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processDefinitionId', anotherProcessDefinition.entry.id);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311316] Should be able to filter by process definition key', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processDefinitionKey', processDefinition.entry.key);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processDefinitionKey', anotherProcessDefinition.entry.key);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311317] Should be able to filter by process instance id', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processInstanceId', runningProcessInstance.entry.id);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ expect(processCloudDemoPage.processListCloudComponent().getDataTable().getNumberOfRows()).toBe(1);
+
+ processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processInstanceId', anotherProcessInstance.entry.id);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+ expect(processCloudDemoPage.processListCloudComponent().getDataTable().getNumberOfRows()).toBe(1);
+
+ });
+
+ it('[C311321] Should be able to filter by process name', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processName', runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processName', anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C306892] Should be able to filter by process status - Running', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('RUNNING');
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(completedProcess.entry.name);
+ });
+
+ it('[C306892] Should be able to filter by process status - Created', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('CREATED');
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(completedProcess.entry.name);
+ });
+
+ it('[C306892] Should be able to filter by process status - Completed', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('COMPLETED');
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(completedProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
+ });
+
+ it('[C306892] Should be able to filter by process status - Suspended', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('SUSPENDED');
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(completedProcess.entry.name);
+ });
+
+ it('[C306892] Should be able to filter by process status - All', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ALL');
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(completedProcess.entry.name);
+ });
+
+ it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = currentDate', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', currentDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = beforeDate', async () => {
+
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', beforeDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311318] Should be able to filter by lastModifiedFrom - does not display record when date = afterDate', async () => {
+
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', afterDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = currentDate', async () => {
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', currentDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311319] Should be able to filter by lastModifiedTo - does not display record when date = beforeDate', async () => {
+
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', beforeDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = afterDate', async () => {
+
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', afterDate);
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
+ });
+
+ it('[C311319] Should not display any processes when the lastModifiedFrom and lastModifiedTo are set to a future date', () => {
+
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', afterDate);
+ processCloudDemoPage.editProcessFilterCloudComponent().setProperty('lastModifiedTo', afterDate);
+ expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
+ });
+
+});
diff --git a/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts
index d3d6715f9d..6c4a212f93 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/process-list-cloud-component.page.ts
@@ -68,6 +68,10 @@ export class ProcessListCloudComponentPage {
return this.dataTable.checkContentIsDisplayed(this.columns.name, processName);
}
+ checkContentIsNotDisplayedByName(processName) {
+ return this.dataTable.checkContentIsNotDisplayed(this.columns.name, processName);
+ }
+
checkContentIsDisplayedById(processId) {
return this.dataTable.checkContentIsDisplayed(this.columns.id, processId);
}
From 90c403ae9e9bbdd4ac440dfec16db247ca2aca3b Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Tue, 25 Jun 2019 15:37:24 +0100
Subject: [PATCH 014/140] [ADF-4707] add properties in node selector search
(#4878)
* add properties in node selector search
* fix test
---
.../content-node-selector-panel.component.spec.ts | 2 +-
.../content-node-selector.service.spec.ts | 3 ++-
.../content-node-selector/content-node-selector.service.ts | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts b/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts
index 06eaf1aed0..3e2174456f 100644
--- a/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts
+++ b/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts
@@ -331,7 +331,7 @@ describe('ContentNodeSelectorComponent', () => {
query: {
query: searchTerm ? `${searchTerm}* OR name:${searchTerm}*` : searchTerm
},
- include: ['path', 'allowableOperations'],
+ include: ['path', 'allowableOperations', 'properties'],
paging: {
maxItems: 25,
skipCount: skipCount
diff --git a/lib/content-services/content-node-selector/content-node-selector.service.spec.ts b/lib/content-services/content-node-selector/content-node-selector.service.spec.ts
index 91d10d683a..e07d813773 100644
--- a/lib/content-services/content-node-selector/content-node-selector.service.spec.ts
+++ b/lib/content-services/content-node-selector/content-node-selector.service.spec.ts
@@ -23,6 +23,7 @@ import { ContentTestingModule } from '../testing/content.testing.module';
class SearchServiceMock {
public query: QueryBody;
+
searchByQueryBody(query: QueryBody) {
this.query = query;
}
@@ -56,7 +57,7 @@ describe('ContentNodeSelectorService', () => {
it('should make it including the path and allowableOperations', () => {
service.search('nuka cola quantum');
- expect(search.query.include).toEqual(['path', 'allowableOperations']);
+ expect(search.query.include).toEqual(['path', 'allowableOperations', 'properties']);
});
it('should make the search restricted to nodes only', () => {
diff --git a/lib/content-services/content-node-selector/content-node-selector.service.ts b/lib/content-services/content-node-selector/content-node-selector.service.ts
index a725d6cf67..9996b70bdf 100644
--- a/lib/content-services/content-node-selector/content-node-selector.service.ts
+++ b/lib/content-services/content-node-selector/content-node-selector.service.ts
@@ -60,7 +60,7 @@ export class ContentNodeSelectorService {
query: {
query: `${searchTerm}* OR name:${searchTerm}*`
},
- include: ['path', 'allowableOperations'],
+ include: ['path', 'allowableOperations', 'properties'],
paging: {
maxItems: maxItems,
skipCount: skipCount
From 5c07d5b3e6d03510c18afe7c395f48119deb7def Mon Sep 17 00:00:00 2001
From: davidcanonieto
Date: Tue, 25 Jun 2019 16:21:13 +0100
Subject: [PATCH 015/140] [ADF-4457] StorageService should be independent of
AppConfigService (#4712)
* [ADF-4457] StorageService should be independent of AppConfigService
* [ADF-4457] Fix e2e tests
* [ADF-4457] Fix e2e tests
* [ADF-4457] Improve storage service workflow
* Fix linting
* Fix unit tests
* Fix e2e test
* Add missing class to constructor
* Fix e2e test
* Rebase branch
* Improve unit test
* fix test
---
.../content-metadata.component.ts | 19 +-
.../services/document-actions.service.spec.ts | 4 +-
.../services/document-list.service.spec.ts | 4 +-
.../services/folder-actions.service.spec.ts | 5 +-
lib/core/app-config/app-config.service.ts | 1 +
.../app-config/debug-app-config.service.ts | 11 +-
.../datatable-cell.component.spec.ts | 4 +-
lib/core/dialogs/download-zip.dialog.spec.ts | 6 +-
.../node-favorite.directive.spec.ts | 3 +-
lib/core/mock/alfresco-api.service.mock.ts | 13 +-
lib/core/services/alfresco-api.service.ts | 14 +-
.../auth-guard-sso-role.service.spec.ts | 26 +-
.../services/auth-guard-sso-role.service.ts | 17 +-
lib/core/services/jwt-helper.service.ts | 11 +-
lib/core/services/storage.service.spec.ts | 114 +++---
lib/core/services/storage.service.ts | 43 +--
.../services/user-preferences.service.spec.ts | 325 +++++++++---------
lib/core/services/user-preferences.service.ts | 6 +-
.../form/services/form-cloud.service.spec.ts | 13 +-
.../process-list-cloud.service.spec.ts | 4 +-
.../task/services/task-cloud.service.spec.ts | 4 +-
.../services/task-list-cloud.service.spec.ts | 4 +-
.../services/process-filter.service.spec.ts | 5 +-
.../services/process.service.spec.ts | 5 +-
.../services/task-filter.service.spec.ts | 6 +-
.../services/tasklist.service.spec.ts | 6 +-
.../src/lib/core/utils/local-storage.util.ts | 6 +
.../actions/testing-alfresco-api.service.ts | 8 +-
package-lock.json | 114 +++---
29 files changed, 432 insertions(+), 369 deletions(-)
diff --git a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
index 877f4ade03..820e49164d 100644
--- a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
+++ b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
@@ -18,7 +18,14 @@
import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { Node } from '@alfresco/js-api';
import { Observable, Subject, of } from 'rxjs';
-import { CardViewItem, NodesApiService, LogService, CardViewUpdateService, AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
+import {
+ CardViewItem,
+ NodesApiService,
+ LogService,
+ CardViewUpdateService,
+ AlfrescoApiService,
+ TranslationService
+} from '@alfresco/adf-core';
import { ContentMetadataService } from '../../services/content-metadata.service';
import { CardViewGroup } from '../../interfaces/content-metadata.interfaces';
import { switchMap, takeUntil, catchError } from 'rxjs/operators';
@@ -78,7 +85,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
private logService: LogService,
private alfrescoApiService: AlfrescoApiService,
private translationService: TranslationService
- ) {}
+ ) {
+ }
ngOnInit() {
this.cardViewUpdateService.itemUpdated$
@@ -112,7 +120,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
try {
statusCode = JSON.parse(error.message).error.statusCode;
- } catch {}
+ } catch {
+ }
let message = `METADATA.ERRORS.${statusCode}`;
@@ -143,12 +152,12 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
return this.nodesApiService.updateNode(this.node.id, nodeBody);
}
- showGroup(group: CardViewGroup) {
+ showGroup(group: CardViewGroup): boolean {
const properties = group.properties.filter((property) => {
return !!property.displayValue;
});
- return properties.length;
+ return properties.length > 0;
}
ngOnDestroy() {
diff --git a/lib/content-services/document-list/services/document-actions.service.spec.ts b/lib/content-services/document-list/services/document-actions.service.spec.ts
index 1cca686419..837d65d6de 100644
--- a/lib/content-services/document-list/services/document-actions.service.spec.ts
+++ b/lib/content-services/document-list/services/document-actions.service.spec.ts
@@ -16,7 +16,7 @@
*/
import { AlfrescoApiServiceMock, AppConfigService, ContentService,
- setupTestBed, CoreModule, TranslationMock
+ setupTestBed, CoreModule, TranslationMock, StorageService
} from '@alfresco/adf-core';
import { FileNode, FolderNode } from '../../mock';
import { ContentActionHandler } from '../models/content-action.model';
@@ -37,7 +37,7 @@ describe('DocumentActionsService', () => {
beforeEach(() => {
const contentService = new ContentService(null, null, null, null);
- const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
documentListService = new DocumentListService(contentService, alfrescoApiService, null, null);
service = new DocumentActionsService(null, null, new TranslationMock(), documentListService, contentService);
diff --git a/lib/content-services/document-list/services/document-list.service.spec.ts b/lib/content-services/document-list/services/document-list.service.spec.ts
index a57edea050..483960c518 100644
--- a/lib/content-services/document-list/services/document-list.service.spec.ts
+++ b/lib/content-services/document-list/services/document-list.service.spec.ts
@@ -16,7 +16,7 @@
*/
import { AlfrescoApiServiceMock, AlfrescoApiService,
- AppConfigService, ContentService, setupTestBed, CoreModule, LogService, AppConfigServiceMock } from '@alfresco/adf-core';
+ AppConfigService, ContentService, setupTestBed, CoreModule, LogService, AppConfigServiceMock, StorageService } from '@alfresco/adf-core';
import { DocumentListService } from './document-list.service';
import { CustomResourcesService } from './custom-resources.service';
@@ -70,7 +70,7 @@ describe('DocumentListService', () => {
beforeEach(() => {
const logService = new LogService(new AppConfigServiceMock(null));
const contentService = new ContentService(null, null, null, null);
- alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
const customActionService = new CustomResourcesService(alfrescoApiService, logService);
service = new DocumentListService(contentService, alfrescoApiService, logService, customActionService);
jasmine.Ajax.install();
diff --git a/lib/content-services/document-list/services/folder-actions.service.spec.ts b/lib/content-services/document-list/services/folder-actions.service.spec.ts
index 544af2bd20..d42e7d2f46 100644
--- a/lib/content-services/document-list/services/folder-actions.service.spec.ts
+++ b/lib/content-services/document-list/services/folder-actions.service.spec.ts
@@ -16,7 +16,8 @@
*/
import { TestBed } from '@angular/core/testing';
-import { AlfrescoApiServiceMock, AppConfigService, ContentService, setupTestBed, CoreModule, TranslationMock } from '@alfresco/adf-core';
+import { AlfrescoApiServiceMock, AppConfigService, ContentService, setupTestBed,
+ CoreModule, TranslationMock, StorageService } from '@alfresco/adf-core';
import { Observable } from 'rxjs';
import { FileNode, FolderNode } from '../../mock';
import { ContentActionHandler } from '../models/content-action.model';
@@ -39,7 +40,7 @@ describe('FolderActionsService', () => {
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
const contentService = new ContentService(null, null, null, null);
- const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
documentListService = new DocumentListService(contentService, alfrescoApiService, null, null);
service = new FolderActionsService(null, documentListService, contentService, new TranslationMock());
});
diff --git a/lib/core/app-config/app-config.service.ts b/lib/core/app-config/app-config.service.ts
index d9f7247701..9487c5078b 100644
--- a/lib/core/app-config/app-config.service.ts
+++ b/lib/core/app-config/app-config.service.ts
@@ -39,6 +39,7 @@ export enum AppConfigValues {
DISABLECSRF = 'disableCSRF',
AUTH_WITH_CREDENTIALS = 'auth.withCredentials',
APPLICATION = 'application',
+ STORAGE_PREFIX = 'application.storagePrefix',
NOTIFY_DURATION = 'notificationDefaultDuration'
}
diff --git a/lib/core/app-config/debug-app-config.service.ts b/lib/core/app-config/debug-app-config.service.ts
index f9566dc676..352e31ec05 100644
--- a/lib/core/app-config/debug-app-config.service.ts
+++ b/lib/core/app-config/debug-app-config.service.ts
@@ -17,26 +17,23 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
+import { StorageService } from '../services/storage.service';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
@Injectable()
export class DebugAppConfigService extends AppConfigService {
- constructor(http: HttpClient) {
+ constructor(private storage: StorageService, http: HttpClient) {
super(http);
}
/** @override */
get(key: string, defaultValue?: T): T {
if (key === AppConfigValues.OAUTHCONFIG) {
- return (JSON.parse(this.getItem(key)) || super.get(key, defaultValue));
+ return (JSON.parse(this.storage.getItem(key)) || super.get(key, defaultValue));
} else if (key === AppConfigValues.APPLICATION) {
return undefined;
} else {
- return ( this.getItem(key) || super.get(key, defaultValue));
+ return ( this.storage.getItem(key) || super.get(key, defaultValue));
}
}
-
- getItem(key: string): string | null {
- return localStorage.getItem(key);
- }
}
diff --git a/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts b/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts
index 0ad003740d..ed7054395a 100644
--- a/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts
+++ b/lib/core/datatable/components/datatable/datatable-cell.component.spec.ts
@@ -17,14 +17,14 @@
import { DateCellComponent } from './date-cell.component';
import { Subject } from 'rxjs';
-import { AlfrescoApiServiceMock, AppConfigService } from '@alfresco/adf-core';
+import { AlfrescoApiServiceMock, AppConfigService, StorageService } from '@alfresco/adf-core';
import { Node } from '@alfresco/js-api';
describe('DataTableCellComponent', () => {
let alfrescoApiService: AlfrescoApiServiceMock;
beforeEach(() => {
- alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
});
it('should use medium format by default', () => {
diff --git a/lib/core/dialogs/download-zip.dialog.spec.ts b/lib/core/dialogs/download-zip.dialog.spec.ts
index 4c20f1b956..0781fa8463 100755
--- a/lib/core/dialogs/download-zip.dialog.spec.ts
+++ b/lib/core/dialogs/download-zip.dialog.spec.ts
@@ -102,7 +102,7 @@ describe('DownloadZipDialogComponent', () => {
it('should call cancelDownload when CANCEL button is clicked', () => {
fixture.detectChanges();
- spyOn(component, 'cancelDownload').and.returnValue('');
+ spyOn(component, 'cancelDownload');
const cancelButton: HTMLButtonElement = element.querySelector('#cancel-button');
cancelButton.click();
@@ -118,7 +118,7 @@ describe('DownloadZipDialogComponent', () => {
it('should close dialog when download is completed', () => {
component.download('fakeUrl', 'fileName');
- spyOn(component, 'cancelDownload').and.returnValue('');
+ spyOn(component, 'cancelDownload');
fixture.detectChanges();
expect(dialogRef.close).toHaveBeenCalled();
});
@@ -134,7 +134,7 @@ describe('DownloadZipDialogComponent', () => {
it('should interrupt download when cancel button is clicked', () => {
spyOn(component, 'downloadZip');
spyOn(component, 'download');
- spyOn(component, 'cancelDownload').and.returnValue('');
+ spyOn(component, 'cancelDownload');
fixture.detectChanges();
diff --git a/lib/core/directives/node-favorite.directive.spec.ts b/lib/core/directives/node-favorite.directive.spec.ts
index 4b2e321fd0..f20dd37440 100644
--- a/lib/core/directives/node-favorite.directive.spec.ts
+++ b/lib/core/directives/node-favorite.directive.spec.ts
@@ -22,6 +22,7 @@ import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
import { AppConfigService } from '../app-config/app-config.service';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
+import { StorageService } from '../services/storage.service';
describe('NodeFavoriteDirective', () => {
@@ -33,7 +34,7 @@ describe('NodeFavoriteDirective', () => {
});
beforeEach(() => {
- alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
directive = new NodeFavoriteDirective( alfrescoApiService);
});
diff --git a/lib/core/mock/alfresco-api.service.mock.ts b/lib/core/mock/alfresco-api.service.mock.ts
index 89f408ccc1..ade5d48df3 100644
--- a/lib/core/mock/alfresco-api.service.mock.ts
+++ b/lib/core/mock/alfresco-api.service.mock.ts
@@ -18,15 +18,24 @@
import { Injectable } from '@angular/core';
import { AppConfigService } from '../app-config/app-config.service';
import { AlfrescoApiService } from '../services/alfresco-api.service';
+import { StorageService } from '../services/storage.service';
/* tslint:disable:adf-file-name */
@Injectable()
export class AlfrescoApiServiceMock extends AlfrescoApiService {
- constructor(protected appConfig: AppConfigService) {
- super(appConfig);
+ constructor(protected appConfig: AppConfigService,
+ protected storageService: StorageService) {
+ super(appConfig, storageService);
if (!this.alfrescoApi) {
this.initAlfrescoApi();
}
}
+
+ initialize(): Promise {
+ return new Promise((resolve) => {
+ this.alfrescoApiInitializedSubject.next();
+ resolve();
+ });
+ }
}
diff --git a/lib/core/services/alfresco-api.service.ts b/lib/core/services/alfresco-api.service.ts
index b6d3200981..72fff5440b 100644
--- a/lib/core/services/alfresco-api.service.ts
+++ b/lib/core/services/alfresco-api.service.ts
@@ -25,8 +25,9 @@ import {
} from '@alfresco/js-api';
import { AlfrescoApiCompatibility, AlfrescoApiConfig } from '@alfresco/js-api';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
-import { Subject } from 'rxjs';
+import { Subject, Observable } from 'rxjs';
import { OauthConfigModel } from '../models/oauth-config.model';
+import { StorageService } from './storage.service';
/* tslint:disable:adf-file-name */
@@ -39,6 +40,9 @@ export class AlfrescoApiService {
*/
nodeUpdated = new Subject();
+ protected alfrescoApiInitializedSubject: Subject;
+ alfrescoApiInitialized: Observable;
+
protected alfrescoApi: AlfrescoApiCompatibility;
lastConfig: AlfrescoApiConfig;
@@ -95,12 +99,18 @@ export class AlfrescoApiService {
return this.getInstance().core.groupsApi;
}
- constructor(protected appConfig: AppConfigService) {
+ constructor(
+ protected appConfig: AppConfigService,
+ protected storageService: StorageService) {
+ this.alfrescoApiInitializedSubject = new Subject();
+ this.alfrescoApiInitialized = this.alfrescoApiInitializedSubject.asObservable();
}
async load() {
await this.appConfig.load().then(() => {
+ this.storageService.prefix = this.appConfig.get(AppConfigValues.STORAGE_PREFIX, '');
this.initAlfrescoApi();
+ this.alfrescoApiInitializedSubject.next();
});
}
diff --git a/lib/core/services/auth-guard-sso-role.service.spec.ts b/lib/core/services/auth-guard-sso-role.service.spec.ts
index 90cc6a6a44..a1c82faa05 100644
--- a/lib/core/services/auth-guard-sso-role.service.spec.ts
+++ b/lib/core/services/auth-guard-sso-role.service.spec.ts
@@ -40,7 +40,7 @@ describe('Auth Guard SSO role service', () => {
});
it('Should canActivate be true if the Role is present int the JWT token', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({ 'realm_access': { roles: ['role1'] } });
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
@@ -50,7 +50,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should canActivate be false if the Role is not present int the JWT token', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({ 'realm_access': { roles: ['role3'] } });
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
@@ -60,7 +60,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should not redirect if canActivate is', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({ 'realm_access': { roles: ['role1'] } });
spyOn(routerService, 'navigate').and.stub();
@@ -72,7 +72,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should canActivate return false if the data Role to check is empty', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({ 'realm_access': { roles: ['role1', 'role3'] } });
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
@@ -81,7 +81,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should canActivate return false if the realm_access is not present', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({});
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
@@ -90,7 +90,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should redirect to the redirectURL if canActivate is false and redirectUrl is in data', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({});
spyOn(routerService, 'navigate').and.stub();
@@ -102,7 +102,7 @@ describe('Auth Guard SSO role service', () => {
}));
it('Should not redirect if canActivate is false and redirectUrl is not in data', async(() => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({});
spyOn(routerService, 'navigate').and.stub();
@@ -137,7 +137,7 @@ describe('Auth Guard SSO role service', () => {
it('Should canActivate be true if both Real Role and Client Role are present int the JWT token', () => {
const route: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({
'realm_access': { roles: ['role1'] },
@@ -152,7 +152,7 @@ describe('Auth Guard SSO role service', () => {
it('Should canActivate be false if the Client Role is not present int the JWT token with the correct role', () => {
const route: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue({
'realm_access': { roles: ['role1'] },
@@ -168,7 +168,7 @@ describe('Auth Guard SSO role service', () => {
describe('ClientRole ', () => {
it('Should be true if the resource_access contains the single role', () => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue(
{
@@ -180,7 +180,7 @@ describe('Auth Guard SSO role service', () => {
});
it('Should be true if the resource_access contains at least one of the roles', () => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue(
{
@@ -192,7 +192,7 @@ describe('Auth Guard SSO role service', () => {
});
it('Should be false if the resource_access does not contain the role', () => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue(
{
'resource_access': { fakeapp: { roles: ['role3'] } }
@@ -202,7 +202,7 @@ describe('Auth Guard SSO role service', () => {
});
it('Should be false if the resource_access does not contain the client role related to the app', () => {
- spyOn(localStorage, 'getItem').and.returnValue('my-access_token');
+ spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token');
spyOn(jwtHelperService, 'decodeToken').and.returnValue(
{
'resource_access': { anotherfakeapp: { roles: ['role1'] } }
diff --git a/lib/core/services/auth-guard-sso-role.service.ts b/lib/core/services/auth-guard-sso-role.service.ts
index 8c64d0ce34..0d6e01d2b2 100644
--- a/lib/core/services/auth-guard-sso-role.service.ts
+++ b/lib/core/services/auth-guard-sso-role.service.ts
@@ -18,7 +18,6 @@
import { Injectable } from '@angular/core';
import { JwtHelperService } from './jwt-helper.service';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
-import { StorageService } from './storage.service';
@Injectable({
providedIn: 'root'
@@ -52,28 +51,22 @@ export class AuthGuardSsoRoleService implements CanActivate {
return hasRole;
}
- constructor(private storageService: StorageService, private jwtHelperService: JwtHelperService, private router: Router) {
+ constructor(private jwtHelperService: JwtHelperService, private router: Router) {
}
getRealmRoles(): string[] {
const access = this.jwtHelperService.getValueFromLocalAccessToken('realm_access');
- const roles = access ? access['roles'] : [];
- return roles;
+ return access ? access['roles'] : [];
}
getClientRoles(client: string): string[] {
const clientRole = this.jwtHelperService.getValueFromLocalAccessToken('resource_access')[client];
- const roles = clientRole ? clientRole['roles'] : [];
- return roles;
- }
-
- getAccessToken(): string {
- return this.storageService.getItem(JwtHelperService.USER_ACCESS_TOKEN);
+ return clientRole ? clientRole['roles'] : [];
}
hasRealmRole(role: string): boolean {
let hasRole = false;
- if (this.getAccessToken()) {
+ if (this.jwtHelperService.getAccessToken()) {
const realmRoles = this.getRealmRoles();
hasRole = realmRoles.some((currentRole) => {
return currentRole === role;
@@ -96,7 +89,7 @@ export class AuthGuardSsoRoleService implements CanActivate {
hasClientRole(clientRole, role: string): boolean {
let hasRole = false;
- if (this.getAccessToken()) {
+ if (this.jwtHelperService.getAccessToken()) {
const clientRoles = this.getClientRoles(clientRole);
hasRole = clientRoles.some((currentRole) => {
return currentRole === role;
diff --git a/lib/core/services/jwt-helper.service.ts b/lib/core/services/jwt-helper.service.ts
index 275e153a15..c920afd57a 100644
--- a/lib/core/services/jwt-helper.service.ts
+++ b/lib/core/services/jwt-helper.service.ts
@@ -79,8 +79,15 @@ export class JwtHelperService {
* @returns Value from the token
*/
getValueFromLocalAccessToken(key: string): T {
- const accessToken = localStorage.getItem(JwtHelperService.USER_ACCESS_TOKEN);
- return this.getValueFromToken(accessToken, key);
+ return this.getValueFromToken(this.getAccessToken(), key);
+ }
+
+ /**
+ * Gets access token
+ * @returns access token
+ */
+ getAccessToken(): string {
+ return localStorage.getItem(JwtHelperService.USER_ACCESS_TOKEN);
}
/**
diff --git a/lib/core/services/storage.service.spec.ts b/lib/core/services/storage.service.spec.ts
index 99bf60d2b3..8c7d8b31e7 100644
--- a/lib/core/services/storage.service.spec.ts
+++ b/lib/core/services/storage.service.spec.ts
@@ -29,69 +29,81 @@ describe('StorageService', () => {
const key = 'test_key';
const value = 'test_value';
- setupTestBed({
- imports: [CoreTestingModule],
- providers: [
- { provide: AppConfigService, useClass: AppConfigServiceMock }
- ]
- });
+ describe('StorageService', () => {
+ setupTestBed({
+ imports: [CoreTestingModule]
+ });
- beforeEach(() => {
- appConfig = TestBed.get(AppConfigService);
- appConfig.config = {
- application: {
- storagePrefix: 'ADF_APP'
- }
- };
- storage = TestBed.get(StorageService);
- });
+ beforeEach(() => {
+ appConfig = TestBed.get(AppConfigService);
+ appConfig.config = {
+ application: {
+ storagePrefix: 'ADF_APP'
+ }
+ };
+ storage = TestBed.get(StorageService);
+ });
- it('should get the prefix for the storage from app config', (done) => {
- appConfig.load().then(() => {
- expect(storage.storagePrefix).toBe('ADF_APP_');
- done();
+ it('should get the prefix for the storage from app config', (done) => {
+ appConfig.load().then(() => {
+ expect(storage.prefix).toBe('ADF_APP_');
+ done();
+ });
+ });
+
+ it('should set a property with the prefix in the local storage', (done) => {
+ storage.clear();
+
+ appConfig.load().then(() => {
+ storage.setItem(key, value);
+ const storageKey = localStorage.key(0);
+ expect(storageKey).toBe('ADF_APP_' + key);
+ expect(localStorage.getItem(storageKey)).toBe(value);
+ done();
+ });
+ });
+
+ it('should be able to get a property from the local storage', (done) => {
+ storage.clear();
+
+ appConfig.load().then(() => {
+ storage.setItem(key, value);
+
+ expect(storage.getItem(key)).toBe(value);
+ done();
+ });
});
});
- it('should set an empty prefix when the it is not defined in the app config', (done) => {
- appConfig.config.application.storagePrefix = '';
- appConfig.load().then(() => {
- expect(storage.storagePrefix).toBe('');
- done();
+ describe('StorageService', () => {
+ setupTestBed({
+ imports: [CoreTestingModule]
});
- });
- it('should set a property with the prefix in the local storage', (done) => {
- storage.clear();
-
- appConfig.load().then(() => {
- storage.setItem(key, value);
- expect(localStorage.hasOwnProperty('ADF_APP_' + key)).not.toBe(null);
- expect(localStorage.getItem('ADF_APP_' + key)).toBe(value);
- done();
+ beforeEach(() => {
+ appConfig = TestBed.get(AppConfigService);
+ appConfig.config = {
+ application: {
+ storagePrefix: ''
+ }
+ };
+ storage = TestBed.get(StorageService);
});
- });
- it('should set a property without a prefix in the local storage', (done) => {
- storage.clear();
- appConfig.config.application.storagePrefix = '';
-
- appConfig.load().then(() => {
- storage.setItem(key, value);
- expect(localStorage.hasOwnProperty(key)).not.toBe(null);
- expect(localStorage.getItem(key)).toBe(value);
- done();
+ it('should set an empty prefix when the it is not defined in the app config', (done) => {
+ appConfig.load().then(() => {
+ expect(storage.prefix).toBe('');
+ done();
+ });
});
- });
- it('should be able to get a property from the local storage', (done) => {
- storage.clear();
+ it('should set a property without a prefix in the local storage', (done) => {
+ appConfig.load().then(() => {
+ storage.setItem(key, value);
- appConfig.load().then(() => {
- storage.setItem(key, value);
-
- expect(storage.getItem(key)).toBe(value);
- done();
+ expect(localStorage.getItem(key)).toBe(value);
+ done();
+ });
});
});
});
diff --git a/lib/core/services/storage.service.ts b/lib/core/services/storage.service.ts
index f8979ae6e7..a195be4f83 100644
--- a/lib/core/services/storage.service.ts
+++ b/lib/core/services/storage.service.ts
@@ -16,7 +16,6 @@
*/
import { Injectable } from '@angular/core';
-import { AppConfigService } from '../app-config/app-config.service';
@Injectable({
providedIn: 'root'
@@ -25,11 +24,18 @@ export class StorageService {
private memoryStore: { [key: string]: any } = {};
private useLocalStorage: boolean = false;
- storagePrefix: string;
+ private _prefix: string = '';
- constructor(private appConfigService: AppConfigService) {
+ get prefix() {
+ return this._prefix;
+ }
+
+ set prefix(prefix: string) {
+ this._prefix = prefix ? prefix + '_' : '';
+ }
+
+ constructor() {
this.useLocalStorage = this.storageAvailable('localStorage');
- this.appConfigService.onLoad.subscribe(this.getAppPrefix.bind(this));
}
/**
@@ -39,9 +45,9 @@ export class StorageService {
*/
getItem(key: string): string | null {
if (this.useLocalStorage) {
- return localStorage.getItem(this.storagePrefix + key);
+ return localStorage.getItem(this.prefix + key);
} else {
- return this.memoryStore.hasOwnProperty(this.storagePrefix + key) ? this.memoryStore[this.storagePrefix + key] : null;
+ return this.memoryStore.hasOwnProperty(this.prefix + key) ? this.memoryStore[this.prefix + key] : null;
}
}
@@ -52,9 +58,9 @@ export class StorageService {
*/
setItem(key: string, data: string) {
if (this.useLocalStorage) {
- localStorage.setItem(this.storagePrefix + key, data);
+ localStorage.setItem(this.prefix + key, data);
} else {
- this.memoryStore[this.storagePrefix + key] = data.toString();
+ this.memoryStore[this.prefix + key] = data.toString();
}
}
@@ -73,9 +79,9 @@ export class StorageService {
*/
removeItem(key: string) {
if (this.useLocalStorage) {
- localStorage.removeItem(this.storagePrefix + key);
+ localStorage.removeItem(this.prefix + key);
} else {
- delete this.memoryStore[this.storagePrefix + key];
+ delete this.memoryStore[this.prefix + key];
}
}
@@ -86,7 +92,7 @@ export class StorageService {
*/
hasItem(key: string): boolean {
if (this.useLocalStorage) {
- return localStorage.getItem(this.storagePrefix + key) ? true : false;
+ return localStorage.getItem(this.prefix + key) ? true : false;
} else {
return this.memoryStore.hasOwnProperty(key);
}
@@ -103,19 +109,4 @@ export class StorageService {
return false;
}
}
-
- /**
- * Sets the prefix that is used for the local storage of the app
- * It assigns the string that is defined i the app config,
- * empty prefix otherwise.
- */
- getAppPrefix() {
- const appConfiguration = this.appConfigService.get('application');
- if (appConfiguration && appConfiguration.storagePrefix) {
- this.storagePrefix = appConfiguration.storagePrefix + '_';
- } else {
- this.storagePrefix = '';
- }
- }
-
}
diff --git a/lib/core/services/user-preferences.service.spec.ts b/lib/core/services/user-preferences.service.spec.ts
index e95b9dc999..010044bbd2 100644
--- a/lib/core/services/user-preferences.service.spec.ts
+++ b/lib/core/services/user-preferences.service.spec.ts
@@ -23,6 +23,8 @@ import { UserPreferencesService, UserPreferenceValues } from './user-preferences
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
+import { AlfrescoApiService } from './alfresco-api.service';
+import { AlfrescoApiServiceMock } from '../mock/alfresco-api.service.mock';
describe('UserPreferencesService', () => {
@@ -30,13 +32,15 @@ describe('UserPreferencesService', () => {
let preferences: UserPreferencesService;
let storage: StorageService;
let appConfig: AppConfigServiceMock;
+ let alfrescoApiService: AlfrescoApiServiceMock;
let translate: TranslateService;
let changeDisposable: any;
setupTestBed({
imports: [CoreTestingModule],
providers: [
- { provide: AppConfigService, useClass: AppConfigServiceMock }
+ { provide: AppConfigService, useClass: AppConfigServiceMock },
+ { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
]
});
@@ -51,6 +55,7 @@ describe('UserPreferencesService', () => {
storage = TestBed.get(StorageService);
translate = TestBed.get(TranslateService);
+ alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
});
beforeEach(() => {
@@ -65,176 +70,170 @@ describe('UserPreferencesService', () => {
storage.clear();
});
- it('should get default pagination from app config', (done) => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.config.pagination.size = 0;
- appConfig.load().then(() => {
- expect(preferences.paginationSize).toBe(0);
- done();
+ describe(' with pagination config', () => {
+
+ beforeEach(() => {
+ preferences = new UserPreferencesService(translate, appConfig, storage, alfrescoApiService);
});
- });
- it('should return supported page sizes defined in the app config', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- const supportedPages = preferences.supportedPageSizes;
- appConfig.load();
- expect(supportedPages).toEqual(supportedPaginationSize);
- });
-
- it('should use [GUEST] as default storage prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.setStoragePrefix(null);
- expect(preferences.getStoragePrefix()).toBe('GUEST');
- });
-
- it('should change storage prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.setStoragePrefix('USER_A');
- expect(preferences.getStoragePrefix()).toBe('USER_A');
- });
-
- it('should format property key for default prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.setStoragePrefix(null);
- expect(preferences.getPropertyKey('propertyA')).toBe('GUEST__propertyA');
- });
-
- it('should format property key for custom prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.setStoragePrefix('USER_A');
- expect(preferences.getPropertyKey('propertyA')).toBe('USER_A__propertyA');
- });
-
- it('should save value with default prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.set('propertyA', 'valueA');
- const propertyKey = preferences.getPropertyKey('propertyA');
- expect(storage.getItem(propertyKey)).toBe('valueA');
- });
-
- it('should null value return default prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- storage.setItem('paginationSize', null);
- const paginationSize = preferences.getPropertyKey('paginationSize');
- expect(preferences.get(paginationSize, 'default')).toBe('default');
- });
-
- it('should save value with custom prefix', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.setStoragePrefix('USER_A');
- preferences.set('propertyA', 'valueA');
- const propertyKey = preferences.getPropertyKey('propertyA');
- expect(storage.getItem(propertyKey)).toBe('valueA');
- });
-
- it('should return as default locale the app.config locate as first', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.config.locale = 'fake-locate-config';
- spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
- expect(preferences.getDefaultLocale()).toBe('fake-locate-config');
- });
-
- it('should return as default locale the browser locale as second', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
- expect(preferences.getDefaultLocale()).toBe('fake-locate-browser');
- });
-
- it('should return as default locale the component property as third ', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- spyOn(translate, 'getBrowserCultureLang').and.stub();
- expect(preferences.getDefaultLocale()).toBe('en');
- });
-
- it('should return as locale the store locate', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.locale = 'fake-store-locate';
- appConfig.config.locale = 'fake-locate-config';
- spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
- expect(preferences.locale).toBe('fake-store-locate');
- });
-
- it('should store default textOrientation based on language ', async(() => {
- appConfig.config.languages = [
- {
- key: 'fake-locale-config'
- }
- ];
- appConfig.config.locale = 'fake-locale-config';
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.load();
- const textOrientation = preferences.getPropertyKey('textOrientation');
- expect(storage.getItem(textOrientation)).toBe('ltr');
- }));
-
- it('should store textOrientation based on language config direction', async(() => {
- appConfig.config.languages = [
- {
- key: 'fake-locale-config',
- direction: 'rtl'
- }
- ];
- appConfig.config.locale = 'fake-locale-config';
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.load();
- const textOrientation = preferences.getPropertyKey('textOrientation');
- expect(storage.getItem(textOrientation)).toBe('rtl');
- }));
-
- it('should not store textOrientation based on language ', async(() => {
- appConfig.config.languages = [
- {
- key: 'fake-locale-browser'
- }
- ];
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.load();
-
- const textOrientation = preferences.getPropertyKey('textOrientation');
- expect(storage.getItem(textOrientation)).toBe(null);
- }));
-
- it('should default to browser locale for textOrientation when locale is not defined in configuration', (done) => {
- appConfig.config.languages = [
- {
- key: 'fake-locale-browser',
- direction: 'rtl'
- }
- ];
- spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locale-browser');
- preferences = new UserPreferencesService(translate, appConfig, storage);
- appConfig.load();
-
- changeDisposable = preferences.onChange
- .subscribe((userPreferenceStatus) => {
- expect(userPreferenceStatus['textOrientation']).toBe('rtl');
+ it('should get default pagination from app config', (done) => {
+ appConfig.config.pagination.size = 0;
+ appConfig.load().then(() => {
+ expect(preferences.paginationSize).toBe(0);
done();
+ });
+ });
+
+ it('should return supported page sizes defined in the app config', () => {
+ const supportedPages = preferences.supportedPageSizes;
+ appConfig.load();
+ expect(supportedPages).toEqual(supportedPaginationSize);
+ });
+
+ it('should use [GUEST] as default storage prefix', () => {
+ preferences.setStoragePrefix(null);
+ expect(preferences.getStoragePrefix()).toBe('GUEST');
+ });
+
+ it('should change storage prefix', () => {
+ preferences.setStoragePrefix('USER_A');
+ expect(preferences.getStoragePrefix()).toBe('USER_A');
+ });
+
+ it('should format property key for default prefix', () => {
+ preferences.setStoragePrefix(null);
+ expect(preferences.getPropertyKey('propertyA')).toBe('GUEST__propertyA');
+ });
+
+ it('should format property key for custom prefix', () => {
+ preferences.setStoragePrefix('USER_A');
+ expect(preferences.getPropertyKey('propertyA')).toBe('USER_A__propertyA');
+ });
+
+ it('should save value with default prefix', () => {
+ preferences.set('propertyA', 'valueA');
+ const propertyKey = preferences.getPropertyKey('propertyA');
+ expect(storage.getItem(propertyKey)).toBe('valueA');
+ });
+
+ it('should null value return default prefix', () => {
+ storage.setItem('paginationSize', null);
+ const paginationSize = preferences.getPropertyKey('paginationSize');
+ expect(preferences.get(paginationSize, 'default')).toBe('default');
+ });
+
+ it('should save value with custom prefix', () => {
+ preferences.setStoragePrefix('USER_A');
+ preferences.set('propertyA', 'valueA');
+ const propertyKey = preferences.getPropertyKey('propertyA');
+ expect(storage.getItem(propertyKey)).toBe('valueA');
+ });
+
+ it('should return as default locale the app.config locate as first', () => {
+ appConfig.config.locale = 'fake-locate-config';
+ spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
+ expect(preferences.getDefaultLocale()).toBe('fake-locate-config');
+ });
+
+ it('should return as default locale the browser locale as second', () => {
+ spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
+ expect(preferences.getDefaultLocale()).toBe('fake-locate-browser');
+ });
+
+ it('should return as default locale the component property as third ', () => {
+ spyOn(translate, 'getBrowserCultureLang').and.stub();
+ expect(preferences.getDefaultLocale()).toBe('en');
+ });
+
+ it('should return as locale the store locate', () => {
+ preferences.locale = 'fake-store-locate';
+ appConfig.config.locale = 'fake-locate-config';
+ spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
+ expect(preferences.locale).toBe('fake-store-locate');
+ });
+
+ it('should not store in the storage the locale if the app.config.json does not have a value', () => {
+ preferences.locale = 'fake-store-locate';
+ spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
+ expect(preferences.locale).toBe('fake-store-locate');
+ expect(storage.getItem(UserPreferenceValues.Locale)).toBe(null);
+ });
+
+ it('should stream the page size value when is set', (done) => {
+ preferences.paginationSize = 5;
+ changeDisposable = preferences.onChange.subscribe((userPreferenceStatus) => {
+ expect(userPreferenceStatus[UserPreferenceValues.PaginationSize]).toBe(5);
+ done();
+ });
+ });
+
+ it('should stream the user preference status when changed', (done) => {
+ preferences.set('propertyA', 'valueA');
+ changeDisposable = preferences.onChange.subscribe((userPreferenceStatus) => {
+ expect(userPreferenceStatus.propertyA).toBe('valueA');
+ done();
+ });
});
});
- it('should not store in the storage the locale if the app.config.json does not have a value', () => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.locale = 'fake-store-locate';
- spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locate-browser');
- expect(preferences.locale).toBe('fake-store-locate');
- expect(storage.getItem(UserPreferenceValues.Locale)).toBe(null);
- });
+ describe('with language config', () => {
- it('should stream the page size value when is set', (done) => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.paginationSize = 5;
- changeDisposable = preferences.onChange.subscribe((userPreferenceStatus) => {
- expect(userPreferenceStatus[UserPreferenceValues.PaginationSize]).toBe(5);
- done();
- });
- });
+ it('should store default textOrientation based on language', async(() => {
+ appConfig.config.languages = [
+ {
+ key: 'fake-locale-config'
+ }
+ ];
+ appConfig.config.locale = 'fake-locale-config';
+ preferences = new UserPreferencesService(translate, appConfig, storage, alfrescoApiService);
+ alfrescoApiService.initialize();
+ const textOrientation = preferences.getPropertyKey('textOrientation');
+ expect(storage.getItem(textOrientation)).toBe('ltr');
+ }));
- it('should stream the user preference status when changed', (done) => {
- preferences = new UserPreferencesService(translate, appConfig, storage);
- preferences.set('propertyA', 'valueA');
- changeDisposable = preferences.onChange.subscribe((userPreferenceStatus) => {
- expect(userPreferenceStatus.propertyA).toBe('valueA');
- done();
+ it('should store textOrientation based on language config direction', async(() => {
+ appConfig.config.languages = [
+ {
+ key: 'fake-locale-config',
+ direction: 'rtl'
+ }
+ ];
+ appConfig.config.locale = 'fake-locale-config';
+ preferences = new UserPreferencesService(translate, appConfig, storage, alfrescoApiService);
+ alfrescoApiService.initialize();
+ const textOrientation = preferences.getPropertyKey('textOrientation');
+ expect(storage.getItem(textOrientation)).toBe('rtl');
+ }));
+
+ it('should not store textOrientation based on language ', async(() => {
+ appConfig.config.languages = [
+ {
+ key: 'fake-locale-browser'
+ }
+ ];
+ preferences = new UserPreferencesService(translate, appConfig, storage, alfrescoApiService);
+ alfrescoApiService.initialize();
+
+ const textOrientation = preferences.getPropertyKey('textOrientation');
+ expect(storage.getItem(textOrientation)).toBe(null);
+ }));
+
+ it('should default to browser locale for textOrientation when locale is not defined in configuration', (done) => {
+ appConfig.config.languages = [
+ {
+ key: 'fake-locale-browser',
+ direction: 'rtl'
+ }
+ ];
+ spyOn(translate, 'getBrowserCultureLang').and.returnValue('fake-locale-browser');
+ preferences = new UserPreferencesService(translate, appConfig, storage, alfrescoApiService);
+ alfrescoApiService.initialize();
+
+ changeDisposable = preferences.onChange
+ .subscribe((userPreferenceStatus) => {
+ expect(userPreferenceStatus['textOrientation']).toBe('rtl');
+ done();
+ });
});
});
});
diff --git a/lib/core/services/user-preferences.service.ts b/lib/core/services/user-preferences.service.ts
index 0c4be0fb21..78ab7f7e81 100644
--- a/lib/core/services/user-preferences.service.ts
+++ b/lib/core/services/user-preferences.service.ts
@@ -22,6 +22,7 @@ import { AppConfigService, AppConfigValues } from '../app-config/app-config.serv
import { LanguageItem } from '../language-menu/language.interface';
import { StorageService } from './storage.service';
import { distinctUntilChanged, map } from 'rxjs/operators';
+import { AlfrescoApiService } from './alfresco-api.service';
export enum UserPreferenceValues {
PaginationSize = 'paginationSize',
@@ -48,8 +49,9 @@ export class UserPreferencesService {
constructor(public translate: TranslateService,
private appConfig: AppConfigService,
- private storage: StorageService) {
- this.appConfig.onLoad.subscribe(this.initUserPreferenceStatus.bind(this));
+ private storage: StorageService,
+ private alfrescoApiService: AlfrescoApiService) {
+ this.alfrescoApiService.alfrescoApiInitialized.subscribe(this.initUserPreferenceStatus.bind(this));
this.onChangeSubject = new BehaviorSubject(this.userPreferenceStatus);
this.onChange = this.onChangeSubject.asObservable();
}
diff --git a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.spec.ts
index 1c47eea24b..b708222fec 100644
--- a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.spec.ts
+++ b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.spec.ts
@@ -18,7 +18,7 @@
import { TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { FormCloudService } from './form-cloud.service';
-import { AlfrescoApiService, CoreModule, setupTestBed, AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core';
+import { AlfrescoApiService, CoreModule, setupTestBed, AppConfigService } from '@alfresco/adf-core';
import { of } from 'rxjs';
declare let jasmine: any;
@@ -28,11 +28,6 @@ const responseBody = {
{ id: 'id', name: 'name', formKey: 'form-key' }
};
-const alfrescoApiServiceStub = {
- getInstance() { },
- load() { }
-};
-
const oauth2Auth = jasmine.createSpyObj('oauth2Auth', ['callCustomApi']);
describe('Form Cloud service', () => {
@@ -48,11 +43,7 @@ describe('Form Cloud service', () => {
NoopAnimationsModule,
CoreModule.forRoot()
],
- providers: [
- FormCloudService,
- { provide: AlfrescoApiService, useValue: alfrescoApiServiceStub },
- { provide: AppConfigService, useClass: AppConfigServiceMock }
- ]
+ providers: [FormCloudService, AlfrescoApiService, AppConfigService]
});
beforeEach(() => {
diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts
index 03fd9d492c..47f6705a0e 100644
--- a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts
+++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { async } from '@angular/core/testing';
-import { setupTestBed } from '@alfresco/adf-core';
+import { setupTestBed, StorageService } from '@alfresco/adf-core';
import { fakeProcessCloudList } from '../mock/process-list-service.mock';
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
import { ProcessListCloudService } from './process-list-cloud.service';
@@ -62,7 +62,7 @@ describe('Activiti ProcessList Cloud Service', () => {
});
beforeEach(async(() => {
- alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
service = new ProcessListCloudService(alfrescoApiMock,
new AppConfigService(null),
new LogService(new AppConfigService(null)));
diff --git a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts
index b203b2b6cf..58329bf8eb 100644
--- a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts
+++ b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts
@@ -16,7 +16,7 @@
*/
import { async, TestBed } from '@angular/core/testing';
-import { setupTestBed, IdentityUserService } from '@alfresco/adf-core';
+import { setupTestBed, IdentityUserService, StorageService } from '@alfresco/adf-core';
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
import { TaskCloudService } from './task-cloud.service';
import { taskCompleteCloudMock } from '../task-header/mocks/fake-complete-task.mock';
@@ -68,7 +68,7 @@ describe('Task Cloud Service', () => {
});
beforeEach(async(() => {
- alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
identityUserService = TestBed.get(IdentityUserService);
spyOn(identityUserService, 'getCurrentUserInfo').and.returnValue(cloudMockUser);
service = new TaskCloudService(alfrescoApiMock,
diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts
index 3a381eea6d..26729c3139 100644
--- a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts
+++ b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts
@@ -16,7 +16,7 @@
*/
import { async } from '@angular/core/testing';
-import { setupTestBed } from '@alfresco/adf-core';
+import { setupTestBed, StorageService } from '@alfresco/adf-core';
import { fakeTaskCloudList } from '../mock/fakeTaskResponseMock';
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
import { TaskListCloudService } from './task-list-cloud.service';
@@ -64,7 +64,7 @@ describe('Activiti TaskList Cloud Service', () => {
});
beforeEach(async(() => {
- alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
+ alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
service = new TaskListCloudService(alfrescoApiMock,
new AppConfigService(null),
new LogService(new AppConfigService(null)));
diff --git a/lib/process-services/process-list/services/process-filter.service.spec.ts b/lib/process-services/process-list/services/process-filter.service.spec.ts
index 61e05841f9..e43761cbaf 100644
--- a/lib/process-services/process-list/services/process-filter.service.spec.ts
+++ b/lib/process-services/process-list/services/process-filter.service.spec.ts
@@ -19,7 +19,8 @@ import { async } from '@angular/core/testing';
import { mockError, fakeProcessFilters } from '../../mock';
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
import { ProcessFilterService } from './process-filter.service';
-import { AlfrescoApiServiceMock, AlfrescoApiService, AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
+import { AlfrescoApiServiceMock, AlfrescoApiService, AppConfigService,
+ setupTestBed, CoreModule, StorageService } from '@alfresco/adf-core';
declare let jasmine: any;
@@ -36,7 +37,7 @@ describe('Process filter', () => {
});
beforeEach(() => {
- apiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ apiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
service = new ProcessFilterService(apiService);
alfrescoApi = apiService.getInstance();
});
diff --git a/lib/process-services/process-list/services/process.service.spec.ts b/lib/process-services/process-list/services/process.service.spec.ts
index 1fe11c0122..fc425e3d88 100644
--- a/lib/process-services/process-list/services/process.service.spec.ts
+++ b/lib/process-services/process-list/services/process.service.spec.ts
@@ -21,7 +21,8 @@ import { mockError, fakeProcessDef, fakeTasksList } from '../../mock';
import { ProcessFilterParamRepresentationModel } from '../models/filter-process.model';
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
import { ProcessService } from './process.service';
-import { AlfrescoApiService, AlfrescoApiServiceMock, AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
+import { AlfrescoApiService, AlfrescoApiServiceMock, AppConfigService,
+ setupTestBed, CoreModule, StorageService } from '@alfresco/adf-core';
declare let moment: any;
@@ -38,7 +39,7 @@ describe('ProcessService', () => {
});
beforeEach(() => {
- apiService = new AlfrescoApiServiceMock(new AppConfigService(null));
+ apiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
service = new ProcessService(apiService);
alfrescoApi = apiService.getInstance();
});
diff --git a/lib/process-services/task-list/services/task-filter.service.spec.ts b/lib/process-services/task-list/services/task-filter.service.spec.ts
index cf6d9b5591..7fa87b2422 100644
--- a/lib/process-services/task-list/services/task-filter.service.spec.ts
+++ b/lib/process-services/task-list/services/task-filter.service.spec.ts
@@ -19,7 +19,7 @@ import { async } from '@angular/core/testing';
import { fakeAppFilter, fakeAppPromise, fakeFilters } from '../../mock';
import { FilterRepresentationModel } from '../models/filter.model';
import { TaskFilterService } from './task-filter.service';
-import { AlfrescoApiServiceMock, LogService, AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
+import { AlfrescoApiServiceMock, LogService, AppConfigService, setupTestBed, CoreModule, StorageService } from '@alfresco/adf-core';
declare let jasmine: any;
@@ -34,7 +34,9 @@ describe('Activiti Task filter Service', () => {
});
beforeEach(async(() => {
- service = new TaskFilterService(new AlfrescoApiServiceMock(new AppConfigService(null)), new LogService(new AppConfigService(null)));
+ service = new TaskFilterService(
+ new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()),
+ new LogService(new AppConfigService(null)));
jasmine.Ajax.install();
}));
diff --git a/lib/process-services/task-list/services/tasklist.service.spec.ts b/lib/process-services/task-list/services/tasklist.service.spec.ts
index 575e611cae..084d0305a2 100644
--- a/lib/process-services/task-list/services/tasklist.service.spec.ts
+++ b/lib/process-services/task-list/services/tasklist.service.spec.ts
@@ -16,7 +16,7 @@
*/
import { async } from '@angular/core/testing';
-import { UserProcessModel, setupTestBed, CoreModule } from '@alfresco/adf-core';
+import { UserProcessModel, setupTestBed, CoreModule, StorageService } from '@alfresco/adf-core';
import { of } from 'rxjs';
import {
fakeCompletedTaskList,
@@ -50,7 +50,9 @@ describe('Activiti TaskList Service', () => {
});
beforeEach(async(() => {
- service = new TaskListService(new AlfrescoApiServiceMock(new AppConfigService(null)), new LogService(new AppConfigService(null)));
+ service = new TaskListService(
+ new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()),
+ new LogService(new AppConfigService(null)));
jasmine.Ajax.install();
}));
diff --git a/lib/testing/src/lib/core/utils/local-storage.util.ts b/lib/testing/src/lib/core/utils/local-storage.util.ts
index 0d44cd9731..2df048fe20 100644
--- a/lib/testing/src/lib/core/utils/local-storage.util.ts
+++ b/lib/testing/src/lib/core/utils/local-storage.util.ts
@@ -31,6 +31,12 @@ export class LocalStorageUtil {
);
}
+ static async removeStorageItem(field: string) {
+ await browser.executeScript(
+ 'window.adf.removeStorageItem(`' + field + '`);'
+ );
+ }
+
static async setUserPreference(field: string, value: any) {
await browser.executeScript(
'window.adf.setUserPreference(`' + field + '`, `' + value + '`);'
diff --git a/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts b/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts
index 186abbc7f2..c102735e41 100644
--- a/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts
+++ b/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts
@@ -16,7 +16,7 @@
*/
import { AlfrescoApiCompatibility, AlfrescoApiConfig } from '@alfresco/js-api';
-import { AlfrescoApiService, AppConfigValues, AppConfigService } from '@alfresco/adf-core';
+import { AlfrescoApiService, AppConfigValues, AppConfigService, StorageService } from '@alfresco/adf-core';
export class TestingAlfrescoApiService extends AlfrescoApiService {
@@ -25,9 +25,10 @@ export class TestingAlfrescoApiService extends AlfrescoApiService {
config = {
};
- constructor(public appConfig: AppConfigService) {
- super(null);
+ constructor(public appConfig: AppConfigService, public storageService: StorageService) {
+ super(null, null);
const oauth = Object.assign({}, this.appConfig.get(AppConfigValues.OAUTHCONFIG, null));
+ this.storageService.prefix = this.appConfig.get(AppConfigValues.STORAGE_PREFIX, '');
this.config = new AlfrescoApiConfig({
provider: this.appConfig.get(AppConfigValues.PROVIDERS),
hostEcm: this.appConfig.get(AppConfigValues.ECMHOST),
@@ -37,6 +38,7 @@ export class TestingAlfrescoApiService extends AlfrescoApiService {
contextRoot: this.appConfig.get(AppConfigValues.CONTEXTROOTECM),
disableCsrf: this.appConfig.get(AppConfigValues.DISABLECSRF),
withCredentials: this.appConfig.get(AppConfigValues.AUTH_WITH_CREDENTIALS, false),
+ domainPrefix: this.storageService.prefix,
oauth2: oauth
});
}
diff --git a/package-lock.json b/package-lock.json
index ff7a3fca27..3a99fd1c3e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,69 +1,69 @@
{
"name": "alfresco-components",
- "version": "3.2.1",
+ "version": "3.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@alfresco/adf-content-services": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.2.1.tgz",
- "integrity": "sha512-dljtJUnvlA2OC1g9u8TyQEnoHqTEVl94AH6S7dcpWiACLCSMiwd5Zkdpe/p/5FWxPY4on53iIR31KJmyYXfoYQ==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.3.0.tgz",
+ "integrity": "sha512-VzEqJC+e2CYtFSwSJDXI8PR7xFCozsV113CpLEW9GT1rcNOyZrwQUe1MZqD3iNJzZdtsw+VI1kfsOwX9v0LNeA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-core": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.2.1.tgz",
- "integrity": "sha512-BFaL3ARaErwvYa4OjgAgWbN0Pm1NMfULd9gFZROQCqPhr794KtwhGqIVmr+G6JjaQvIXMZ3hSTppKu63NyBoqA==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.3.0.tgz",
+ "integrity": "sha512-OKjG0FduZWj/Ux4O/hKtvz4opWCLrrRP0bsQfRPMfNymIUlHHhS12ciPVSlKaVlozrJ4poyjq8maGa8gqSDMcA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-extensions": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.2.1.tgz",
- "integrity": "sha512-ULYZmpRfR7ckLvNe/273DhgWvx7wvoUDzy1lsOIpFS0LfyfjEqEjOcQQ3V2DAcbR1Rl7cJ7+3RXkfVHmp/d6ng==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.3.0.tgz",
+ "integrity": "sha512-Fvet22KpZ8zLGKccgsjlf9uEE2+47h0QMDMSX1S4tMbLlLs34PpHQiYNPOEKZgeV/kWx0+nhM7QhQUfH8NpRUA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-insights": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-insights/-/adf-insights-3.2.1.tgz",
- "integrity": "sha512-6ktlzvoHJ2Pf6+Qcp/ua8rZ/RYuakO0Y6QeFNXlilVt3FK/jF1AmJT3Xj21tdnxOEzWAKTH1lb+rd/0itP+DoQ==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-insights/-/adf-insights-3.3.0.tgz",
+ "integrity": "sha512-EX04XBLz4tuGzG/pcJpkxUL8gjbUtr/njBa+J1R4V5H4Lk66pBf9okINZvSrNWExNSPKmuz/1YqmS+X5QMwAQQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-process-services": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-process-services/-/adf-process-services-3.2.1.tgz",
- "integrity": "sha512-cHNFYxzkUgvf0oqWJt87rnmEl9ujtJ2Jw73jR/Wcayk2QgOrmMuhaIaFlkgqhfudIHeXnpT2RfcgxcF7rWCWaA==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-process-services/-/adf-process-services-3.3.0.tgz",
+ "integrity": "sha512-ib08V7g7h8BCkJ/lkkDTZPBOz8qSqD40aif5uySr8YX6QKSZ5KyEdfqKikYyEchISEOd0yhhN/nxZW1ExHb0iQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-process-services-cloud": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-process-services-cloud/-/adf-process-services-cloud-3.2.1.tgz",
- "integrity": "sha512-40IirZWLqRqTcJlYMwNRX7AyWUdrRzOHG2OPsAtTO4ozEub3UzYZDte/7uh7a52CoVsSz+Kx/oom8pGK+9MVoQ==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-process-services-cloud/-/adf-process-services-cloud-3.3.0.tgz",
+ "integrity": "sha512-7PQlXx4zi8uWk/Gp8A8ETicFFfHzEcaR9sI4UK+vUtPyG5MbDobbaPWLyn8iMZQniuCBk1oFwVRY2JrXf5Tciw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/adf-testing": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-3.2.1.tgz",
- "integrity": "sha512-8RG80G3JMvB3QjtVRI4jsLXDUicvqXyc9TrTgOcH6ilYKKTqt6P+OJi3H45yLPhat41MwSeP1LgCoUW3d1SWHQ==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-3.3.0.tgz",
+ "integrity": "sha512-xZUgLyuHTWwR22xdT7x5sh11vUrk/94thdfIFsYEuTX6X4W5lJkylF/C9fAuAPIuTkrAu8DWloUgSNVtyTCMVg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@alfresco/js-api": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-3.2.1.tgz",
- "integrity": "sha512-qaXftaHqFonWRKRmYxhB2/bEpUh5fvUj6cN+xuKUXIGgt9XxF76NpWkXnEEQLZ0BWg5upd19Q3N1x4E7DiNGUg==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-3.3.0.tgz",
+ "integrity": "sha512-A15Q5j4jVNFUI0hdw0zIGonU05Wbjvq8ZJBijrkC3fq904oYuq49giKpPkbXjowk9xBfZZejGvaDMT5jYTXlxg==",
"requires": {
"event-emitter": "0.3.4",
"superagent": "3.8.2"
@@ -5629,11 +5629,12 @@
},
"dependencies": {
"d": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
- "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
+ "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
"requires": {
- "es5-ext": "^0.10.9"
+ "es5-ext": "^0.10.50",
+ "type": "^1.0.1"
}
}
}
@@ -5663,11 +5664,12 @@
},
"dependencies": {
"d": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
- "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
+ "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
"requires": {
- "es5-ext": "^0.10.9"
+ "es5-ext": "^0.10.50",
+ "type": "^1.0.1"
}
}
}
@@ -6527,7 +6529,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -6548,12 +6551,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -6568,17 +6573,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -6695,7 +6703,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -6707,6 +6716,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -6721,6 +6731,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -6728,12 +6739,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -6752,6 +6765,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -6832,7 +6846,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -6844,6 +6859,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -6929,7 +6945,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -6965,6 +6982,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -6984,6 +7002,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -7027,12 +7046,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
@@ -17056,6 +17077,11 @@
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
"dev": true
},
+ "type": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
+ "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
+ },
"type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
From f99b943bcb99dbac5bd7de0c317ee6075fd39901 Mon Sep 17 00:00:00 2001
From: Denys Vuika
Date: Wed, 26 Jun 2019 09:50:50 +0100
Subject: [PATCH 016/140] [ADF-4594] e2e configuration to disable animations
(#4760)
* e2e environment
* configuration fixes
* update dist configuration
* use e2e configuration on travis
---
angular.json | 32 +++++++++++++++++--
demo-shell/src/app/app.module.ts | 5 +--
.../src/environments/environment.e2e.ts | 21 ++++++++++++
.../src/environments/environment.prod.ts | 3 +-
demo-shell/src/environments/environment.ts | 3 +-
package.json | 9 +++---
6 files changed, 63 insertions(+), 10 deletions(-)
create mode 100644 demo-shell/src/environments/environment.e2e.ts
diff --git a/angular.json b/angular.json
index 38fabb96b6..d8ca03c35b 100644
--- a/angular.json
+++ b/angular.json
@@ -106,6 +106,14 @@
"with": "demo-shell/src/environments/environment.prod.ts"
}
]
+ },
+ "e2e": {
+ "fileReplacements": [
+ {
+ "replace": "demo-shell/src/environments/environment.ts",
+ "with": "demo-shell/src/environments/environment.e2e.ts"
+ }
+ ]
}
}
},
@@ -113,11 +121,17 @@
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "dist:build",
- "port": 3000
+ "host": "0.0.0.0",
+ "port": 3000,
+ "proxyConfig": "demo-shell/proxy.conf.js",
+ "disableHostCheck": true
},
"configurations": {
"production": {
"browserTarget": "dist:build:production"
+ },
+ "e2e": {
+ "browserTarget": "dist:build:e2e"
}
}
},
@@ -352,6 +366,14 @@
"with": "demo-shell/src/environments/environment.prod.ts"
}
]
+ },
+ "e2e": {
+ "fileReplacements": [
+ {
+ "replace": "demo-shell/src/environments/environment.ts",
+ "with": "demo-shell/src/environments/environment.e2e.ts"
+ }
+ ]
}
}
},
@@ -359,11 +381,17 @@
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "dev:build",
- "port": 3000
+ "host": "0.0.0.0",
+ "port": 3000,
+ "proxyConfig": "demo-shell/proxy.conf.js",
+ "disableHostCheck": true
},
"configurations": {
"production": {
"browserTarget": "dev:build:production"
+ },
+ "e2e": {
+ "browserTarget": "dev:build:e2e"
}
}
},
diff --git a/demo-shell/src/app/app.module.ts b/demo-shell/src/app/app.module.ts
index a8a6abad55..a789607957 100644
--- a/demo-shell/src/app/app.module.ts
+++ b/demo-shell/src/app/app.module.ts
@@ -21,7 +21,7 @@ import { FormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { ChartsModule } from 'ng2-charts';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService } from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
@@ -90,6 +90,7 @@ import { CommunityStartTaskCloudDemoComponent } from './components/cloud/communi
import { CommunityProcessDetailsCloudDemoComponent } from './components/cloud/community/community-process-details-cloud.component';
import { CommunityProcessesCloudDemoComponent } from './components/cloud/community/community-processes-cloud.component';
import { CommunityTaskDetailsCloudDemoComponent } from './components/cloud/community/community-task-details-cloud.component';
+import { environment } from '../environments/environment';
import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
@@ -129,7 +130,7 @@ registerLocaleData(localeSv);
@NgModule({
imports: [
BrowserModule,
- BrowserAnimationsModule,
+ environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
ReactiveFormsModule,
routing,
FormsModule,
diff --git a/demo-shell/src/environments/environment.e2e.ts b/demo-shell/src/environments/environment.e2e.ts
new file mode 100644
index 0000000000..75794a8611
--- /dev/null
+++ b/demo-shell/src/environments/environment.e2e.ts
@@ -0,0 +1,21 @@
+/*!
+ * @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.
+ */
+
+export const environment = {
+ production: false,
+ e2e: true
+};
diff --git a/demo-shell/src/environments/environment.prod.ts b/demo-shell/src/environments/environment.prod.ts
index 6755c5e302..774915cd9e 100644
--- a/demo-shell/src/environments/environment.prod.ts
+++ b/demo-shell/src/environments/environment.prod.ts
@@ -16,5 +16,6 @@
*/
export const environment = {
- production: true
+ production: true,
+ e2e: false
};
diff --git a/demo-shell/src/environments/environment.ts b/demo-shell/src/environments/environment.ts
index 15a3b4b68c..3461759621 100644
--- a/demo-shell/src/environments/environment.ts
+++ b/demo-shell/src/environments/environment.ts
@@ -21,5 +21,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
- production: false
+ production: false,
+ e2e: false
};
diff --git a/package.json b/package.json
index 1bfe47eccf..05ce37b1df 100644
--- a/package.json
+++ b/package.json
@@ -33,12 +33,13 @@
"stylelint": "stylelint ./**/*.scss --config stylelint-config.json",
"04": "echo -------------------------------------------- Demo Shell -----------------------------------------------",
"04s": "",
- "start": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --host 0.0.0.0 --proxy-config ./demo-shell/proxy.conf.js --open",
- "start:dev": "ng lint dev && npm run validate-config && npm run server-versions && concurrently \"ng serve dev --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open\" \"npm run style:dev --watch\" ",
- "start:dist": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --prod --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open",
+ "start": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --open",
+ "start:dev": "ng lint dev && npm run validate-config && npm run server-versions && concurrently \"ng serve dev --open\" \"npm run style:dev --watch\" ",
+ "start:dist": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --prod --open",
"build": "npm run validate-config && npm run server-versions && ng build dist",
"build:dev": "npm run validate-config && npm run style:dev && npm run server-versions && ng build dev",
- "build:dist": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod ",
+ "build:dist": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod --stats-json ",
+ "build:dist:e2e": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod --configuration=e2e --stats-json ",
"style:dev": "npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail",
"test": "npm run validate-config && ng test dev --watch=false",
"server-versions": "rimraf ./demo-shell/src/versions.json && npm list --depth=0 --json=true --prod=true > ./demo-shell/src/versions.json || exit 0",
From d4010185191d8cfb0c8fdb517cf79f72586ff746 Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Wed, 26 Jun 2019 10:02:04 +0100
Subject: [PATCH 017/140] codeowners
---
.github/CODEOWNERS.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .github/CODEOWNERS.md
diff --git a/.github/CODEOWNERS.md b/.github/CODEOWNERS.md
new file mode 100644
index 0000000000..e69de29bb2
From 24714b8a87e903e88b2023dc61c1effee7e0c62e Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Wed, 26 Jun 2019 10:28:05 +0100
Subject: [PATCH 018/140] codeowners
---
.github/CODEOWNERS.md | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/.github/CODEOWNERS.md b/.github/CODEOWNERS.md
index e69de29bb2..c256931223 100644
--- a/.github/CODEOWNERS.md
+++ b/.github/CODEOWNERS.md
@@ -0,0 +1,39 @@
+
+# This is a comment.
+# Each line is a file pattern followed by one or more owners.
+
+ # These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence,
+# these users will be requested for
+# review when someone opens a pull request.
+* @eromano @popovicsandras @DenysVuika
+
+ # Order is important; the last matching pattern takes the most
+# precedence. When someone opens a pull request that only
+# modifies JS files, only @js-owner and not the global
+# owner(s) will be requested for a review.
+e2e/* @eromano @cristinaj @gmandakini @marouanbentaleb
+
+ # You can also use email addresses if you prefer. They'll be
+# used to look up users just like we do for commit author
+# emails.
+#*.go docs@example.com
+docs/* @m-hulbert @eromano
+
+ # In this example, @doctocat owns any files in the build/logs
+# directory at the root of the repository and any of its
+# subdirectories.
+#/build/logs/ @doctocat
+
+ # The `docs/*` pattern will match files like
+# `docs/getting-started.md` but not further nested files like
+# `docs/build-app/troubleshooting.md`.
+#docs/* docs@example.com
+
+ # In this example, @octocat owns any file in an apps directory
+# anywhere in your repository.
+#apps/ @octocat
+
+ # In this example, @doctocat owns any file in the `/docs`
+# directory in the root of your repository.
+#/docs/ @doctocat
From 069e4297eaf0dad31312161b63b020c8eabfec6b Mon Sep 17 00:00:00 2001
From: davidcanonieto
Date: Wed, 26 Jun 2019 13:07:51 +0100
Subject: [PATCH 019/140] =?UTF-8?q?[ADF-4499]=20Form=20definition=20select?=
=?UTF-8?q?or=20should=20only=20display=20standAlone=20co=E2=80=A6=20(#488?=
=?UTF-8?q?0)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [ADF-4499] Form definition selector should only display standAlone compatible forms
* Improve service method
* fix typo
---
...orm-definition-selector-cloud.component.md | 2 +-
...efinition-selector-cloud.component.spec.ts | 2 +-
...orm-definition-selector-cloud.component.ts | 2 +-
.../form-definition-selector-cloud.model.ts | 2 +
...-definition-selector-cloud.service.spec.ts | 101 ++++++++++++++++++
.../form-definition-selector-cloud.service.ts | 15 +++
6 files changed, 121 insertions(+), 3 deletions(-)
create mode 100644 lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.spec.ts
diff --git a/docs/process-services-cloud/components/form-definition-selector-cloud.component.md b/docs/process-services-cloud/components/form-definition-selector-cloud.component.md
index ddd4c1fb33..f561e98683 100644
--- a/docs/process-services-cloud/components/form-definition-selector-cloud.component.md
+++ b/docs/process-services-cloud/components/form-definition-selector-cloud.component.md
@@ -6,7 +6,7 @@ Status: Active
# [Form Definition Selector Cloud](../../../lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts "Defined in form-definition-selector-cloud.component.ts")
-Allows one form to be selected.
+Allows one form to be selected from a dropdown list. For forms to be displayed in this component they will need to be compatible with standAlone tasks.
## Basic Usage
diff --git a/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.spec.ts
index eba60d81b9..452221746e 100644
--- a/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.spec.ts
@@ -42,7 +42,7 @@ describe('FormDefinitionCloudComponent', () => {
fixture = TestBed.createComponent(FormDefinitionSelectorCloudComponent);
element = fixture.nativeElement;
service = TestBed.get(FormDefinitionSelectorCloudService);
- getFormsSpy = spyOn(service, 'getForms').and.returnValue(of([{ id: 'fake-form', name: 'fakeForm' }]));
+ getFormsSpy = spyOn(service, 'getStandAloneTaskForms').and.returnValue(of([{ id: 'fake-form', name: 'fakeForm' }]));
});
it('should load the forms by default', () => {
diff --git a/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts b/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts
index 80e395313c..26f74c15bb 100644
--- a/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts
+++ b/lib/process-services-cloud/src/lib/form/components/form-definition-selector-cloud.component.ts
@@ -43,7 +43,7 @@ export class FormDefinitionSelectorCloudComponent implements OnInit {
}
ngOnInit(): void {
- this.forms$ = this.formDefinitionCloudService.getForms(this.appName);
+ this.forms$ = this.formDefinitionCloudService.getStandAloneTaskForms(this.appName);
}
onSelect(event: MatSelectChange) {
diff --git a/lib/process-services-cloud/src/lib/form/models/form-definition-selector-cloud.model.ts b/lib/process-services-cloud/src/lib/form/models/form-definition-selector-cloud.model.ts
index 4b3bff172f..f24b543afc 100644
--- a/lib/process-services-cloud/src/lib/form/models/form-definition-selector-cloud.model.ts
+++ b/lib/process-services-cloud/src/lib/form/models/form-definition-selector-cloud.model.ts
@@ -21,6 +21,7 @@ export class FormDefinitionSelectorCloudModel {
name: string;
description: string;
version: string;
+ standAlone: string;
constructor(obj?: any) {
if (obj) {
@@ -28,6 +29,7 @@ export class FormDefinitionSelectorCloudModel {
this.name = obj.name || null;
this.description = obj.description || null;
this.version = obj.version || null;
+ this.standAlone = obj.standAlone || null;
}
}
}
diff --git a/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.spec.ts
new file mode 100644
index 0000000000..a577a79b0f
--- /dev/null
+++ b/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.spec.ts
@@ -0,0 +1,101 @@
+/*!
+ * @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 { TestBed } from '@angular/core/testing';
+import { NoopAnimationsModule } from '@angular/platform-browser/animations';
+import { AlfrescoApiService, CoreModule, setupTestBed, AppConfigService } from '@alfresco/adf-core';
+import { FormDefinitionSelectorCloudService } from './form-definition-selector-cloud.service';
+
+declare let jasmine: any;
+
+const responseBody = [
+ {
+ formRepresentation: {
+ id: 'form-de8895be-d0d7-4434-beef-559b15305d72',
+ name: 'Form 1',
+ description: '',
+ version: 0,
+ standAlone: true
+ }
+ },
+ {
+ formRepresentation: {
+ id: 'form-de8895be-d0d7-4434-beef-fgr34ttgrtgd',
+ name: 'Form 2',
+ description: '',
+ version: 0,
+ standAlone: false
+ }
+ },
+ {
+ formRepresentation: {
+ id: 'form-de8895be-d0d7-4434-beef-53453453452',
+ name: 'Form 3',
+ description: '',
+ version: 0
+ }
+ }
+];
+
+const oauth2Auth = jasmine.createSpyObj('oauth2Auth', ['callCustomApi']);
+
+describe('Form Definition Selector Cloud Service', () => {
+
+ let service: FormDefinitionSelectorCloudService;
+ let apiService: AlfrescoApiService;
+ const appName = 'app-name';
+
+ setupTestBed({
+ imports: [
+ NoopAnimationsModule,
+ CoreModule.forRoot()
+ ],
+ providers: [
+ FormDefinitionSelectorCloudService,
+ AlfrescoApiService,
+ AppConfigService
+ ]
+ });
+
+ beforeEach(() => {
+ service = TestBed.get(FormDefinitionSelectorCloudService);
+ apiService = TestBed.get(AlfrescoApiService);
+ spyOn(apiService, 'getInstance').and.returnValue({ oauth2Auth: oauth2Auth });
+ });
+
+ it('should fetch all the forms when getForms is called', (done) => {
+ oauth2Auth.callCustomApi.and.returnValue(Promise.resolve(responseBody));
+
+ service.getForms(appName).subscribe((result) => {
+ expect(result).toBeDefined();
+ expect(result.length).toBe(3);
+ done();
+ });
+ });
+
+ it('should fetch only standAlone enabled forms when getStandAloneTaskForms is called', (done) => {
+ oauth2Auth.callCustomApi.and.returnValue(Promise.resolve(responseBody));
+
+ service.getStandAloneTaskForms(appName).subscribe((result) => {
+ expect(result).toBeDefined();
+ expect(result.length).toBe(2);
+ expect(result[0].name).toBe('Form 1');
+ expect(result[1].name).toBe('Form 3');
+ done();
+ });
+ });
+});
diff --git a/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.ts b/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.ts
index a5f680204e..2d4969965b 100644
--- a/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.ts
+++ b/lib/process-services-cloud/src/lib/form/services/form-definition-selector-cloud.service.ts
@@ -65,6 +65,21 @@ export class FormDefinitionSelectorCloudService extends BaseCloudService {
);
}
+ /**
+ * Get all forms of an app.
+ * @param appName Name of the application
+ * @returns Details of the forms
+ */
+ getStandAloneTaskForms(appName: string): Observable {
+ return from(this.getForms(appName)).pipe(
+ map((data: any) => {
+ return data.filter((formData: any) => formData.standAlone || formData.standAlone === undefined);
+ }),
+ catchError((err) => this.handleError(err))
+ );
+
+ }
+
private buildGetFormsUrl(appName: string): any {
return `${this.getBasePath(appName)}/form/v1/forms`;
}
From 5c5bb7f9b74de008b940d519b28cb9cbdf938cd6 Mon Sep 17 00:00:00 2001
From: cristinaj
Date: Wed, 26 Jun 2019 21:47:09 +0300
Subject: [PATCH 020/140] [ADF-4576]Add new tests for application cloud
component (#4873)
* Add a new test
* Revert file
* Fix lint errors
* Add a wait
* fix roles constant uppercase
* fix lint
---
cspell.json | 3 +-
.../apps-section-cloud.e2e.ts | 32 ++++++++++++--
.../edit-process-filters-component.e2e.ts | 2 +-
.../edit-task-filters-component.e2e.ts | 2 +-
.../form-field/dropdown-widget.e2e.ts | 2 +-
.../people-group-cloud-component.e2e.ts | 44 +++++++++----------
...people-group-cloud-filter-component.e2e.ts | 26 +++++------
.../process-custom-filters.e2e.ts | 2 +-
.../process-filter-results.e2e.ts | 4 +-
.../process-filters-cloud.e2e.ts | 2 +-
.../process-header-cloud.e2e.ts | 2 +-
.../process-list-cloud-component.e2e.ts | 2 +-
.../process-list-selection-cloud.e2e.ts | 2 +-
.../start-process-cloud.e2e.ts | 2 +-
.../start-task-custom-app-cloud.e2e.ts | 4 +-
.../start-task-form-cloud.e2e.ts | 2 +-
.../task-filters-cloud.e2e.ts | 2 +-
.../task-header-cloud.e2e.ts | 2 +-
.../task-list-properties.e2e.ts | 2 +-
.../task-list-selection.e2e.ts | 2 +-
.../tasks-custom-filters.e2e.ts | 2 +-
.../actions/identity/applications.service.ts | 42 ++++++++++++++++++
.../core/actions/identity/identity.service.ts | 11 ++---
.../lib/core/actions/identity/public-api.ts | 1 +
.../app/app-list-cloud.page.ts | 12 +++++
25 files changed, 146 insertions(+), 63 deletions(-)
create mode 100644 lib/testing/src/lib/core/actions/identity/applications.service.ts
diff --git a/cspell.json b/cspell.json
index 473b064741..0d69f62980 100644
--- a/cspell.json
+++ b/cspell.json
@@ -126,7 +126,8 @@
"uncheck",
"subfolders",
"ECMBPM",
- "processwithvariables"
+ "processwithvariables",
+ "devops"
],
"dictionaries": [
"html",
diff --git a/e2e/process-services-cloud/apps-section-cloud.e2e.ts b/e2e/process-services-cloud/apps-section-cloud.e2e.ts
index a5e12182f9..c9eb37b9cc 100644
--- a/e2e/process-services-cloud/apps-section-cloud.e2e.ts
+++ b/e2e/process-services-cloud/apps-section-cloud.e2e.ts
@@ -16,7 +16,7 @@
*/
import { browser } from 'protractor';
-import { ApiService, IdentityService, LoginSSOPage, SettingsPage } from '@alfresco/adf-testing';
+import { ApiService, IdentityService, LoginSSOPage, SettingsPage, LocalStorageUtil, ApplicationsService } from '@alfresco/adf-testing';
import { AppListCloudPage } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import resources = require('../util/resources');
@@ -29,18 +29,31 @@ describe('Applications list', () => {
const appListCloudPage = new AppListCloudPage();
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
let identityService: IdentityService;
+ let applicationsService: ApplicationsService;
let testUser;
+ const appNames = [];
+ let applications;
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.config.bpmHost, browser.params.config.oauth2.host, 'BPM');
beforeAll(async (done) => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER, identityService.ROLES.APS_DEVOPS_USER]);
await settingsPage.setProviderBpmSso(
browser.params.config.bpmHost,
browser.params.config.oauth2.host,
browser.params.config.identityHost);
loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
+ await apiService.login(testUser.email, testUser.password);
+ applicationsService = new ApplicationsService(apiService);
+ applications = await applicationsService.getApplicationsByStatus('RUNNING');
+
+ applications.list.entries.forEach(async (app) => {
+ appNames.push(app.entry.name.toLowerCase());
+ });
+
+ await LocalStorageUtil.setConfigField('alfresco-deployed-apps', '[]');
+
done();
});
@@ -50,11 +63,24 @@ describe('Applications list', () => {
done();
});
+ it('[C310373] Should all the app with running state be displayed on dashboard when alfresco-deployed-apps is not used in config file', async () => {
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudPage.checkApsContainer();
+
+ appListCloudPage.getNameOfTheApplications().then((list) => {
+ expect(JSON.stringify(list) === JSON.stringify(appNames)).toEqual(true);
+ });
+ });
+
it('[C289910] Should the app be displayed on dashboard when is deployed on APS', () => {
+ browser.refresh();
navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudPage.checkApsContainer();
appListCloudPage.checkAppIsDisplayed(simpleApp);
- appListCloudPage.goToApp(simpleApp);
+ appListCloudPage.checkAppIsDisplayed(resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name);
+ appListCloudPage.checkAppIsDisplayed(resources.ACTIVITI7_APPS.SUB_PROCESS_APP.name);
+
+ expect(appListCloudPage.countAllApps()).toEqual(3);
});
});
diff --git a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts
index 3b0826153c..50d79e9a85 100644
--- a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts
+++ b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts
@@ -43,7 +43,7 @@ describe('Edit process filters cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
index 3f72f7a338..b94c50c038 100644
--- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
+++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
@@ -44,7 +44,7 @@ describe('Edit task filters cloud', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
tasksService = new TasksService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts
index 28e213a3bb..a4802b0d3c 100644
--- a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts
+++ b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts
@@ -56,7 +56,7 @@ describe('Form Field Component - Dropdown Widget', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
index becdb10e0b..ec6183d4a5 100644
--- a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
+++ b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts
@@ -62,27 +62,27 @@ describe('People Groups Cloud Component', () => {
groupIdentityService = new GroupIdentityService(apiService);
clientId = await groupIdentityService.getClientIdByApplicationName(resources.ACTIVITI7_APPS.SIMPLE_APP.name);
groupActiviti = await groupIdentityService.createIdentityGroup();
- clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_admin);
- clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_user);
+ clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_ADMIN);
+ clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_USER);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.activiti_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.ACTIVITI_USER]);
noRoleUser = await identityService.createIdentityUser();
- await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
- await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.roles.activiti_user);
+ await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
+ await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.ROLES.ACTIVITI_USER);
groupAps = await groupIdentityService.createIdentityGroup();
- apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_admin);
- apsUserRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_user);
- await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.roles.aps_admin);
- await groupIdentityService.assignRole(groupAps.id, apsUserRoleId, identityService.roles.aps_user);
- activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.activiti_admin);
- await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.roles.activiti_admin);
+ apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_ADMIN);
+ apsUserRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_USER);
+ await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.ROLES.APS_ADMIN);
+ await groupIdentityService.assignRole(groupAps.id, apsUserRoleId, identityService.ROLES.APS_USER);
+ activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.ACTIVITI_ADMIN);
+ await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
groupNoRole = await groupIdentityService.createIdentityGroup();
- await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
- await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
+ await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
+ await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
users = [`${apsUser.idIdentityService}`, `${activitiUser.idIdentityService}`, `${noRoleUser.idIdentityService}`, `${testUser.idIdentityService}`];
groups = [`${groupAps.id}`, `${groupActiviti.id}`, `${groupNoRole.id}`];
@@ -134,7 +134,7 @@ describe('People Groups Cloud Component', () => {
});
it('One role filtering', () => {
- peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.roles.aps_user}"]`);
+ peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.ROLES.APS_USER}"]`);
peopleCloudComponent.searchAssignee(apsUser.lastName);
peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
peopleCloudComponent.searchAssignee(activitiUser.lastName);
@@ -144,7 +144,7 @@ describe('People Groups Cloud Component', () => {
});
it('Multiple roles filtering', () => {
- peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.roles.aps_user}", "${identityService.roles.activiti_user}"]`);
+ peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.ROLES.APS_USER}", "${identityService.ROLES.ACTIVITI_USER}"]`);
peopleCloudComponent.searchAssignee(apsUser.lastName);
peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
peopleCloudComponent.searchAssignee(activitiUser.lastName);
@@ -172,7 +172,7 @@ describe('People Groups Cloud Component', () => {
});
it('One role filtering', () => {
- peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_admin}"]`);
+ peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupAps.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupAps.name);
groupCloudComponentPage.searchGroups(groupActiviti.name);
@@ -182,7 +182,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Activit_Admin', () => {
- peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.activiti_admin}"]`);
+ peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.ACTIVITI_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -192,7 +192,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Aps_User', () => {
- peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_user}"]`);
+ peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_USER}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsNotDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -202,7 +202,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Activiti_User', () => {
- peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.activiti_user}"]`);
+ peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.ACTIVITI_USER}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsNotDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -212,7 +212,7 @@ describe('People Groups Cloud Component', () => {
});
it('Multiple roles filtering', () => {
- peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_admin}", "${identityService.roles.activiti_admin}"]`);
+ peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_ADMIN}", "${identityService.ROLES.ACTIVITI_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupAps.name);
diff --git a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
index ea8cbfaec1..c7bd2f2a92 100644
--- a/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
+++ b/e2e/process-services-cloud/people-group-cloud-filter-component.e2e.ts
@@ -60,25 +60,25 @@ describe('People Groups Cloud Component', () => {
groupIdentityService = new GroupIdentityService(apiService);
clientId = await groupIdentityService.getClientIdByApplicationName(resources.ACTIVITI7_APPS.SIMPLE_APP.name);
groupActiviti = await groupIdentityService.createIdentityGroup();
- clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_admin);
- clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_user);
+ clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_ADMIN);
+ clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_USER);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.activiti_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.ACTIVITI_USER]);
noRoleUser = await identityService.createIdentityUser();
- await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
- await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.roles.activiti_user);
+ await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
+ await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.ROLES.ACTIVITI_USER);
groupAps = await groupIdentityService.createIdentityGroup();
- apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_admin);
- await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.roles.aps_admin);
- activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.activiti_admin);
- await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.roles.activiti_admin);
+ apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_ADMIN);
+ await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.ROLES.APS_ADMIN);
+ activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.ACTIVITI_ADMIN);
+ await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
groupNoRole = await groupIdentityService.createIdentityGroup();
- await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin );
- await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin );
+ await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN );
+ await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN );
users = [`${apsUser.idIdentityService}`, `${activitiUser.idIdentityService}`, `${noRoleUser.idIdentityService}`, `${testUser.idIdentityService}`];
groups = [`${groupAps.id}`, `${groupActiviti.id}`, `${groupNoRole.id}`];
diff --git a/e2e/process-services-cloud/process-custom-filters.e2e.ts b/e2e/process-services-cloud/process-custom-filters.e2e.ts
index d462f2a24f..aeb2c8d73b 100644
--- a/e2e/process-services-cloud/process-custom-filters.e2e.ts
+++ b/e2e/process-services-cloud/process-custom-filters.e2e.ts
@@ -61,7 +61,7 @@ describe('Process list cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/process-filter-results.e2e.ts b/e2e/process-services-cloud/process-filter-results.e2e.ts
index 74475c0ea1..139f804cc0 100644
--- a/e2e/process-services-cloud/process-filter-results.e2e.ts
+++ b/e2e/process-services-cloud/process-filter-results.e2e.ts
@@ -67,8 +67,8 @@ describe('Process filters cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- anotherUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ anotherUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/process-filters-cloud.e2e.ts b/e2e/process-services-cloud/process-filters-cloud.e2e.ts
index ba0d5a89ce..4f9eeef252 100644
--- a/e2e/process-services-cloud/process-filters-cloud.e2e.ts
+++ b/e2e/process-services-cloud/process-filters-cloud.e2e.ts
@@ -61,7 +61,7 @@ describe('Process filters cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/process-header-cloud.e2e.ts b/e2e/process-services-cloud/process-header-cloud.e2e.ts
index 4a71693b78..696500f04c 100644
--- a/e2e/process-services-cloud/process-header-cloud.e2e.ts
+++ b/e2e/process-services-cloud/process-header-cloud.e2e.ts
@@ -73,7 +73,7 @@ describe('Process Header cloud component', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/process-list-cloud-component.e2e.ts b/e2e/process-services-cloud/process-list-cloud-component.e2e.ts
index f43276d776..7568c79ff6 100644
--- a/e2e/process-services-cloud/process-list-cloud-component.e2e.ts
+++ b/e2e/process-services-cloud/process-list-cloud-component.e2e.ts
@@ -55,7 +55,7 @@ describe('Process list cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/process-list-selection-cloud.e2e.ts b/e2e/process-services-cloud/process-list-selection-cloud.e2e.ts
index e3e8cf2295..580b9f8d0d 100644
--- a/e2e/process-services-cloud/process-list-selection-cloud.e2e.ts
+++ b/e2e/process-services-cloud/process-list-selection-cloud.e2e.ts
@@ -52,7 +52,7 @@ describe('Process list cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/start-process-cloud.e2e.ts b/e2e/process-services-cloud/start-process-cloud.e2e.ts
index aee66a6203..1af4bff66d 100644
--- a/e2e/process-services-cloud/start-process-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-process-cloud.e2e.ts
@@ -51,7 +51,7 @@ describe('Start Process', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
await settingsPage.setProviderBpmSso(
diff --git a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
index f90d9dc89b..00f4a79262 100644
--- a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
@@ -58,8 +58,8 @@ describe('Start Task', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
- apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user, identityService.roles.activiti_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
+ apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER, identityService.ROLES.ACTIVITI_USER]);
activitiUser = await identityService.createIdentityUser();
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
index 12e70eae4d..0eb5ac0d17 100644
--- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
@@ -70,7 +70,7 @@ describe('Start Task Form', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
await apiService.login(testUser.email, testUser.password);
diff --git a/e2e/process-services-cloud/task-filters-cloud.e2e.ts b/e2e/process-services-cloud/task-filters-cloud.e2e.ts
index 6096af3f4d..c9791119e7 100644
--- a/e2e/process-services-cloud/task-filters-cloud.e2e.ts
+++ b/e2e/process-services-cloud/task-filters-cloud.e2e.ts
@@ -43,7 +43,7 @@ describe('Task filters cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/task-header-cloud.e2e.ts b/e2e/process-services-cloud/task-header-cloud.e2e.ts
index 4c3d66bf6f..3a39c031d3 100644
--- a/e2e/process-services-cloud/task-header-cloud.e2e.ts
+++ b/e2e/process-services-cloud/task-header-cloud.e2e.ts
@@ -57,7 +57,7 @@ describe('Task Header cloud component', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/task-list-properties.e2e.ts b/e2e/process-services-cloud/task-list-properties.e2e.ts
index 9e58510e25..3b0a16adc8 100644
--- a/e2e/process-services-cloud/task-list-properties.e2e.ts
+++ b/e2e/process-services-cloud/task-list-properties.e2e.ts
@@ -64,7 +64,7 @@ describe('Edit task filters and task list properties', () => {
tasksService = new TasksService(apiService);
const settingsPage = new SettingsPage();
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts
index be4d40612f..39d9a1a8c7 100644
--- a/e2e/process-services-cloud/task-list-selection.e2e.ts
+++ b/e2e/process-services-cloud/task-list-selection.e2e.ts
@@ -50,7 +50,7 @@ describe('Task list cloud - selection', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
index 824a284aa6..19f87f1c67 100644
--- a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
+++ b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
@@ -64,7 +64,7 @@ describe('Task filters cloud', () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
- testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
+ testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
diff --git a/lib/testing/src/lib/core/actions/identity/applications.service.ts b/lib/testing/src/lib/core/actions/identity/applications.service.ts
new file mode 100644
index 0000000000..3c22ac6c13
--- /dev/null
+++ b/lib/testing/src/lib/core/actions/identity/applications.service.ts
@@ -0,0 +1,42 @@
+/*!
+ * @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 { ApiService } from '../api.service';
+
+export class ApplicationsService {
+
+ api: ApiService;
+
+ constructor(api: ApiService) {
+ this.api = api;
+ }
+
+ async getApplicationsByStatus(status) {
+ try {
+ const path = '/deployment-service/v1/applications';
+ const method = 'GET';
+
+ const queryParams = {'status': status}, postBody = {};
+
+ return await this.api.performBpmOperation(path, method, queryParams, postBody);
+ } catch (error) {
+ // tslint:disable-next-line:no-console
+ console.log('Get Applications - Service error, Response: ', JSON.parse(JSON.stringify(error)).response.text);
+ }
+ }
+
+}
diff --git a/lib/testing/src/lib/core/actions/identity/identity.service.ts b/lib/testing/src/lib/core/actions/identity/identity.service.ts
index 79dd66773c..2f0fe63259 100644
--- a/lib/testing/src/lib/core/actions/identity/identity.service.ts
+++ b/lib/testing/src/lib/core/actions/identity/identity.service.ts
@@ -28,11 +28,12 @@ export class IdentityService {
this.api = api;
}
- roles = {
- aps_user: 'APS_USER',
- activiti_user: 'ACTIVITI_USER',
- aps_admin: 'APS_ADMIN',
- activiti_admin: 'ACTIVITI_ADMIN'
+ ROLES = {
+ APS_USER: 'APS_USER',
+ ACTIVITI_USER: 'ACTIVITI_USER',
+ APS_ADMIN: 'APS_ADMIN',
+ ACTIVITI_ADMIN: 'ACTIVITI_ADMIN',
+ APS_DEVOPS_USER: 'APS_DEVOPS'
};
async createIdentityUserWithRole(apiService: ApiService, roles: string[]) {
diff --git a/lib/testing/src/lib/core/actions/identity/public-api.ts b/lib/testing/src/lib/core/actions/identity/public-api.ts
index 1a5fe24bc1..0cb1aa3229 100644
--- a/lib/testing/src/lib/core/actions/identity/public-api.ts
+++ b/lib/testing/src/lib/core/actions/identity/public-api.ts
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+export * from './applications.service';
export * from './identity.service';
export * from './group-identity.service';
export * from './roles.service';
diff --git a/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts b/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts
index 9619014d2a..97d5238235 100644
--- a/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts
@@ -22,15 +22,27 @@ import { BrowserActions } from '../../core/utils/browser-actions';
export class AppListCloudPage {
apsAppsContainer = element(by.css('adf-cloud-app-list'));
+ allApps = element.all(by.css('adf-cloud-app-details'));
+ nameOfAllApps = element.all(by.css('adf-cloud-app-details div[class*="item-card-title"] h1'));
+ firstApp = element.all(by.css('adf-cloud-app-details div[class*="item-card-title"] h1')).first();
checkApsContainer() {
BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
+ BrowserVisibility.waitUntilElementIsVisible(this.firstApp);
}
goToApp(applicationName) {
BrowserActions.clickExecuteScript('mat-card[title="' + applicationName + '"]');
}
+ countAllApps() {
+ return this.allApps.count();
+ }
+
+ getNameOfTheApplications() {
+ return this.nameOfAllApps.getText();
+ }
+
checkAppIsNotDisplayed(applicationName) {
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
return BrowserVisibility.waitUntilElementIsNotOnPage(app);
From 2a2dfbcc42bbe9651af8ce5828e85984d290757b Mon Sep 17 00:00:00 2001
From: Geeta Mandakini Ayyalasomayajula
<45559635+gmandakini@users.noreply.github.com>
Date: Fri, 28 Jun 2019 14:44:15 +0100
Subject: [PATCH 021/140] automated C311280 should pick up default date format
from the app configuration (#4883)
---
.../task-header-cloud.e2e.ts | 30 +++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/e2e/process-services-cloud/task-header-cloud.e2e.ts b/e2e/process-services-cloud/task-header-cloud.e2e.ts
index 3a39c031d3..55b8a66540 100644
--- a/e2e/process-services-cloud/task-header-cloud.e2e.ts
+++ b/e2e/process-services-cloud/task-header-cloud.e2e.ts
@@ -16,7 +16,7 @@
*/
import CONSTANTS = require('../util/constants');
-import { ApiService, StringUtil, SettingsPage, IdentityService, GroupIdentityService } from '@alfresco/adf-testing';
+import { ApiService, StringUtil, SettingsPage, IdentityService, GroupIdentityService, LocalStorageUtil } from '@alfresco/adf-testing';
import moment = require('moment');
import { browser } from 'protractor';
@@ -35,11 +35,13 @@ describe('Task Header cloud component', () => {
let subTask;
let subTaskCreatedDate;
let completedEndDate;
+ let defaultDate;
let groupInfo, testUser;
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
const priority = 30;
const description = 'descriptionTask';
const formatDate = 'MMM D, YYYY';
+ const defaultFormat = 'M/D/YY';
const taskHeaderCloudPage = new TaskHeaderCloudPage();
@@ -77,6 +79,7 @@ describe('Task Header cloud component', () => {
completedTask = await tasksService.getTask(completedTaskId.entry.id, simpleApp);
completedCreatedDate = moment(completedTask.entry.createdDate).format(formatDate);
completedEndDate = moment(completedTask.entry.endDate).format(formatDate);
+ defaultDate = moment(completedTask.entry.createdDate).format(defaultFormat);
const subTaskId = await tasksService.createStandaloneSubtask(createdTaskId.entry.id, simpleApp, StringUtil.generateRandomString());
await tasksService.claimTask(subTaskId.entry.id, simpleApp);
@@ -91,7 +94,7 @@ describe('Task Header cloud component', () => {
done();
});
- afterAll(async(done) => {
+ afterAll(async (done) => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
await identityService.deleteIdentityUser(testUser.idIdentityService);
done();
@@ -125,6 +128,7 @@ describe('Task Header cloud component', () => {
});
it('[C291944] Should display task details for completed task', () => {
+ tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName);
@@ -165,4 +169,26 @@ describe('Task Header cloud component', () => {
expect(taskHeaderCloudPage.getParentTaskId())
.toEqual(subTask.entry.parentTaskId === null ? '' : subTask.entry.parentTaskId);
});
+
+ describe('Default Date format', () => {
+ beforeEach(async () => {
+ await LocalStorageUtil.setConfigField('dateValues', '{' +
+ '"defaultDateFormat": "shortDate",' +
+ '"defaultDateTimeFormat": "M/d/yy, h:mm a",' +
+ '"defaultLocale": "uk"' +
+ '}');
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.goToApp(simpleApp);
+ });
+
+ it('[C311280] Should pick up the default date format from the app configuration', () => {
+ tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
+ tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
+ tasksCloudDemoPage.taskListCloudComponent().selectRow(completedTaskName);
+ taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
+ expect(taskHeaderCloudPage.getCreated()).toEqual(defaultDate);
+ });
+ });
});
From 4dccc2a49a851a684f2bb9ac92bf33808d73049d Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Sat, 29 Jun 2019 10:34:13 +0100
Subject: [PATCH 022/140] fix login unit test to nit emit error in the network
(#4885)
* fix login unit test to nit emit error in the network
* fix lint
---
.../login/components/login.component.spec.ts | 390 ++++++++++--------
1 file changed, 215 insertions(+), 175 deletions(-)
diff --git a/lib/core/login/components/login.component.spec.ts b/lib/core/login/components/login.component.spec.ts
index 160d8dc0a1..f1e530ebdd 100644
--- a/lib/core/login/components/login.component.spec.ts
+++ b/lib/core/login/components/login.component.spec.ts
@@ -31,6 +31,7 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { setupTestBed } from '../../testing/setupTestBed';
import { CoreTestingModule } from '../../testing/core.testing.module';
+import { Observable } from 'rxjs/index';
describe('LoginComponent', () => {
let component: LoginComponent;
@@ -89,7 +90,7 @@ describe('LoginComponent', () => {
fixture.destroy();
});
- function loginWithCredentials(username, password, providers: string = 'ECM') {
+ function loginWithCredentials(username, password) {
usernameInput.value = username;
passwordInput.value = password;
@@ -130,6 +131,12 @@ describe('LoginComponent', () => {
it('should update user preferences upon login', async(() => {
spyOn(userPreferences, 'setStoragePrefix').and.callThrough();
+ spyOn(alfrescoApiService.getInstance(), 'login').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
component.success.subscribe(() => {
expect(userPreferences.setStoragePrefix).toHaveBeenCalledWith('fake-username');
@@ -276,74 +283,216 @@ describe('LoginComponent', () => {
expect(element.querySelector('#username-error')).toBeNull();
});
- it('should render validation min-length error when the username is just 1 character with a custom validation Validators.minLength(3)', () => {
- component.fieldsValidation = {
- username: ['', Validators.compose([Validators.required, Validators.minLength(3)])],
- password: ['', Validators.required]
- };
- component.addCustomValidationError('username', 'minlength', 'LOGIN.MESSAGES.USERNAME-MIN');
- component.ngOnInit();
- fixture.detectChanges();
+ describe('Error', () => {
- usernameInput.value = '1';
- usernameInput.dispatchEvent(new Event('input'));
+ it('should render validation min-length error when the username is just 1 character with a custom validation Validators.minLength(3)', () => {
+ component.fieldsValidation = {
+ username: ['', Validators.compose([Validators.required, Validators.minLength(3)])],
+ password: ['', Validators.required]
+ };
+ component.addCustomValidationError('username', 'minlength', 'LOGIN.MESSAGES.USERNAME-MIN');
+ component.ngOnInit();
+ fixture.detectChanges();
- fixture.detectChanges();
+ usernameInput.value = '1';
+ usernameInput.dispatchEvent(new Event('input'));
- expect(component.formError).toBeDefined();
- expect(component.formError.username).toBeDefined();
- expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
- expect(element.querySelector('#username-error')).toBeDefined();
- expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
- });
+ fixture.detectChanges();
- it('should render validation min-length error when the username is lower than 3 characters with a custom validation Validators.minLength(3)', () => {
- component.fieldsValidation = {
- username: ['', Validators.compose([Validators.required, Validators.minLength(3)])],
- password: ['', Validators.required]
- };
- component.addCustomValidationError('username', 'minlength', 'LOGIN.MESSAGES.USERNAME-MIN');
- component.ngOnInit();
- fixture.detectChanges();
+ expect(component.formError).toBeDefined();
+ expect(component.formError.username).toBeDefined();
+ expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
+ expect(element.querySelector('#username-error')).toBeDefined();
+ expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
+ });
- usernameInput.value = '12';
- usernameInput.dispatchEvent(new Event('input'));
+ it('should render validation min-length error when the username is lower than 3 characters with a custom validation Validators.minLength(3)', () => {
+ component.fieldsValidation = {
+ username: ['', Validators.compose([Validators.required, Validators.minLength(3)])],
+ password: ['', Validators.required]
+ };
+ component.addCustomValidationError('username', 'minlength', 'LOGIN.MESSAGES.USERNAME-MIN');
+ component.ngOnInit();
+ fixture.detectChanges();
- fixture.detectChanges();
+ usernameInput.value = '12';
+ usernameInput.dispatchEvent(new Event('input'));
- expect(component.formError).toBeDefined();
- expect(component.formError.username).toBeDefined();
- expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
- expect(element.querySelector('#username-error')).toBeDefined();
- expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
- });
+ fixture.detectChanges();
- it('should render validation required error when the username is empty and dirty', () => {
- usernameInput.value = '';
- component.form.controls.username.markAsDirty();
- usernameInput.dispatchEvent(new Event('input'));
+ expect(component.formError).toBeDefined();
+ expect(component.formError.username).toBeDefined();
+ expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
+ expect(element.querySelector('#username-error')).toBeDefined();
+ expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
+ });
- fixture.detectChanges();
+ it('should render validation required error when the username is empty and dirty', () => {
+ usernameInput.value = '';
+ component.form.controls.username.markAsDirty();
+ usernameInput.dispatchEvent(new Event('input'));
- expect(component.formError).toBeDefined();
- expect(component.formError.username).toBeDefined();
- expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-REQUIRED');
- expect(element.querySelector('#username-error')).toBeDefined();
- expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-REQUIRED');
- });
+ fixture.detectChanges();
- it('should render validation required error when the password is empty and dirty', () => {
- passwordInput.value = '';
- component.form.controls.password.markAsDirty();
- passwordInput.dispatchEvent(new Event('input'));
+ expect(component.formError).toBeDefined();
+ expect(component.formError.username).toBeDefined();
+ expect(component.formError.username).toEqual('LOGIN.MESSAGES.USERNAME-REQUIRED');
+ expect(element.querySelector('#username-error')).toBeDefined();
+ expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-REQUIRED');
+ });
- fixture.detectChanges();
+ it('should render validation required error when the password is empty and dirty', () => {
+ passwordInput.value = '';
+ component.form.controls.password.markAsDirty();
+ passwordInput.dispatchEvent(new Event('input'));
+
+ fixture.detectChanges();
+
+ expect(component.formError).toBeDefined();
+ expect(component.formError.password).toBeDefined();
+ expect(component.formError.password).toEqual('LOGIN.MESSAGES.PASSWORD-REQUIRED');
+ expect(element.querySelector('#password-required')).toBeDefined();
+ expect(element.querySelector('#password-required').innerText).toEqual('LOGIN.MESSAGES.PASSWORD-REQUIRED');
+ });
+
+ it('should render no validation errors when the username and password are filled', () => {
+ usernameInput.value = 'fake-username';
+ passwordInput.value = 'fake-password';
+
+ component.form.controls.username.markAsDirty();
+ component.form.controls.password.markAsDirty();
+
+ usernameInput.dispatchEvent(new Event('input'));
+ passwordInput.dispatchEvent(new Event('input'));
+
+ fixture.detectChanges();
+
+ expect(component.formError).toBeDefined();
+ expect(component.formError.username).toEqual('');
+ expect(component.formError.password).toEqual('');
+ expect(element.querySelector('#username-error')).toBeNull();
+ expect(element.querySelector('#password-required')).toBeNull();
+ });
+
+ it('should return error with a wrong username', (done) => {
+ spyOn(alfrescoApiService.getInstance(), 'login').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.error();
+ });
+ });
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
+ done();
+ });
+ });
+
+ loginWithCredentials('fake-wrong-username', 'fake-password');
+ });
+
+ it('should return error with a wrong password', (done) => {
+ spyOn(alfrescoApiService.getInstance(), 'login').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.error();
+ });
+ });
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ expect(component.isError).toBe(true);
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
+ done();
+ });
+ });
+
+ loginWithCredentials('fake-username', 'fake-wrong-password');
+ });
+
+ it('should return error with a wrong username and password', (done) => {
+ spyOn(alfrescoApiService.getInstance(), 'login').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.error();
+ });
+ });
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ expect(component.isError).toBe(true);
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
+ done();
+ });
+ });
+
+ loginWithCredentials('fake-wrong-username', 'fake-wrong-password');
+ });
+
+ it('should return CORS error when server CORS error occurs', (done) => {
+ spyOn(authService, 'login').and.returnValue(throwError({
+ error: {
+ crossDomain: true,
+ message: 'ERROR: the network is offline, Origin is not allowed by Access-Control-Allow-Origin'
+ }
+ }));
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ expect(component.isError).toBe(true);
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('ERROR: the network is offline, Origin is not allowed by Access-Control-Allow-Origin');
+ done();
+ });
+ });
+
+ loginWithCredentials('fake-username-CORS-error', 'fake-password');
+ });
+
+ it('should return CSRF error when server CSRF error occurs', async(() => {
+ spyOn(authService, 'login')
+ .and.returnValue(throwError({ message: 'ERROR: Invalid CSRF-token', status: 403 }));
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+
+ expect(component.isError).toBe(true);
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CSRF');
+ });
+
+ loginWithCredentials('fake-username-CSRF-error', 'fake-password');
+ }));
+
+ it('should return ECM read-only error when error occurs', async(() => {
+ spyOn(authService, 'login')
+ .and.returnValue(
+ throwError(
+ {
+ message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode',
+ status: 403
+ }
+ ));
+
+ component.error.subscribe(() => {
+ fixture.detectChanges();
+
+ expect(component.isError).toBe(true);
+ expect(getLoginErrorElement()).toBeDefined();
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ECM-LICENSE');
+ });
+
+ loginWithCredentials('fake-username-ECM-access-error', 'fake-password');
+ }));
- expect(component.formError).toBeDefined();
- expect(component.formError.password).toBeDefined();
- expect(component.formError.password).toEqual('LOGIN.MESSAGES.PASSWORD-REQUIRED');
- expect(element.querySelector('#password-required')).toBeDefined();
- expect(element.querySelector('#password-required').innerText).toEqual('LOGIN.MESSAGES.PASSWORD-REQUIRED');
});
it('should trim the username value', () => {
@@ -356,25 +505,6 @@ describe('LoginComponent', () => {
expect(usernameInput.value).toEqual('username');
});
- it('should render no validation errors when the username and password are filled', () => {
- usernameInput.value = 'fake-username';
- passwordInput.value = 'fake-password';
-
- component.form.controls.username.markAsDirty();
- component.form.controls.password.markAsDirty();
-
- usernameInput.dispatchEvent(new Event('input'));
- passwordInput.dispatchEvent(new Event('input'));
-
- fixture.detectChanges();
-
- expect(component.formError).toBeDefined();
- expect(component.formError.username).toEqual('');
- expect(component.formError.password).toEqual('');
- expect(element.querySelector('#username-error')).toBeNull();
- expect(element.querySelector('#password-required')).toBeNull();
- });
-
it('should render the new values after user and password values are changed', () => {
usernameInput.value = 'fake-change-username';
passwordInput.value = 'fake-change-password';
@@ -408,106 +538,9 @@ describe('LoginComponent', () => {
});
- it('should return error with a wrong username', (done) => {
-
- component.error.subscribe(() => {
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
- done();
- });
- });
-
- loginWithCredentials('fake-wrong-username', 'fake-password');
- });
-
- it('should return error with a wrong password', (done) => {
- component.error.subscribe(() => {
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- expect(component.isError).toBe(true);
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
- done();
- });
- });
-
- loginWithCredentials('fake-username', 'fake-wrong-password');
- });
-
- it('should return error with a wrong username and password', (done) => {
- component.error.subscribe(() => {
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- expect(component.isError).toBe(true);
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CREDENTIALS');
- done();
- });
- });
-
- loginWithCredentials('fake-wrong-username', 'fake-wrong-password');
- });
-
- it('should return CORS error when server CORS error occurs', (done) => {
- spyOn(authService, 'login').and.returnValue(throwError({
- error: {
- crossDomain: true,
- message: 'ERROR: the network is offline, Origin is not allowed by Access-Control-Allow-Origin'
- }
- }));
-
- component.error.subscribe(() => {
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- expect(component.isError).toBe(true);
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('ERROR: the network is offline, Origin is not allowed by Access-Control-Allow-Origin');
- done();
- });
- });
-
- loginWithCredentials('fake-username-CORS-error', 'fake-password');
- });
-
- it('should return CSRF error when server CSRF error occurs', async(() => {
- spyOn(authService, 'login')
- .and.returnValue(throwError({ message: 'ERROR: Invalid CSRF-token', status: 403 }));
-
- component.error.subscribe(() => {
- fixture.detectChanges();
-
- expect(component.isError).toBe(true);
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ERROR-CSRF');
- });
-
- loginWithCredentials('fake-username-CSRF-error', 'fake-password');
- }));
-
- it('should return ECM read-only error when error occurs', async(() => {
- spyOn(authService, 'login')
- .and.returnValue(
- throwError(
- {
- message: 'ERROR: 00170728 Access Denied. The system is currently in read-only mode',
- status: 403
- }
- ));
-
- component.error.subscribe(() => {
- fixture.detectChanges();
-
- expect(component.isError).toBe(true);
- expect(getLoginErrorElement()).toBeDefined();
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.LOGIN-ECM-LICENSE');
- });
-
- loginWithCredentials('fake-username-ECM-access-error', 'fake-password');
- }));
-
it('should emit success event after the login has succeeded and discard password', async(() => {
+ spyOn(authService, 'login').and.returnValue(of({ type: 'type', ticket: 'ticket' }));
+
component.success.subscribe((event) => {
fixture.detectChanges();
@@ -558,6 +591,13 @@ describe('LoginComponent', () => {
});
it('should emit only the username and not the password as part of the executeSubmit', async(() => {
+ spyOn(alfrescoApiService.getInstance(), 'login').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
+
component.executeSubmit.subscribe((res) => {
fixture.detectChanges();
@@ -626,7 +666,7 @@ describe('LoginComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
- expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.SSO-WRONG-CONFIGURATION' );
+ expect(getLoginErrorMessage()).toEqual('LOGIN.MESSAGES.SSO-WRONG-CONFIGURATION');
});
}));
From 43f08441cdc830762ed1c91221d8242b29dfedad Mon Sep 17 00:00:00 2001
From: Silviu Popa
Date: Mon, 1 Jul 2019 13:33:34 +0300
Subject: [PATCH 023/140] [ADF-4705] - Automate forms checkbox widget (#4881)
* [ADF-4705] - Automate forms checkox widget
* Move methods to a demo-shell page
* Adding 3 new tests
---
.../form-demo/cloud-form-demo.component.html | 4 +-
e2e/core/form/visibility-condition.e2e.ts | 177 ++++++++++++++
e2e/pages/adf/configEditorPage.ts | 22 +-
.../cloudFormDemoPage.ts | 46 ++++
e2e/pages/adf/navigationBarPage.ts | 5 +
.../forms/checkbox-visibility-condition.ts | 222 ++++++++++++++++++
.../src/lib/core/pages/form/formFields.ts | 8 +-
.../core/pages/form/widgets/checkboxWidget.ts | 2 +-
8 files changed, 476 insertions(+), 10 deletions(-)
create mode 100644 e2e/core/form/visibility-condition.e2e.ts
create mode 100644 e2e/pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage.ts
create mode 100644 e2e/resources/forms/checkbox-visibility-condition.ts
diff --git a/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.html b/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.html
index dfbfe67660..23e7bea30c 100644
--- a/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.html
+++ b/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.html
@@ -1,7 +1,7 @@
-
+
-
+
{
+
+ const loginPage = new LoginPage();
+ const navigationBarPage = new NavigationBarPage();
+ const formCloudDemoPage = new FormCloudDemoPage();
+ const checkboxVisibilityFormJson = JSON.parse(checkboxVisibilityForm);
+ const widget = new Widget();
+
+ let tenantId, user;
+ let visibleCheckbox;
+
+ const widgets = {
+ textOneId: 'textOne',
+ textTwoId: 'textTwo'
+ };
+
+ const value = {
+ displayCheckbox: 'showCheckbox',
+ notDisplayCheckbox: 'anythingElse'
+ };
+
+ const checkbox = {
+ checkboxFieldValue : 'CheckboxFieldValue',
+ checkboxVariableField: 'CheckboxVariableField',
+ checkboxFieldVariable: 'CheckboxFieldVariable',
+ checkboxFieldField: 'CheckboxFieldField',
+ checkboxVariableValue: 'CheckboxVariableValue',
+ checkboxVariableVariable: 'CheckboxVariableVariable'
+ };
+
+ beforeAll(async (done) => {
+ this.alfrescoJsApi = new AlfrescoApi({
+ provider: 'BPM',
+ hostBpm: browser.params.testConfig.adf.url
+ });
+
+ const users = new UsersActions();
+
+ await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
+
+ user = await users.createTenantAndUser(this.alfrescoJsApi);
+
+ tenantId = user.tenantId;
+
+ await this.alfrescoJsApi.login(user.email, user.password);
+
+ await loginPage.loginToProcessServicesUsingUserModel(user);
+
+ navigationBarPage.clickFormCloudButton();
+
+ formCloudDemoPage.setConfigToEditor(checkboxVisibilityFormJson);
+
+ done();
+ });
+
+ afterAll(async (done) => {
+ await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
+ await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
+ done();
+ });
+
+ it('[C309647] Should be able to see Checkbox widget when visibility condition refers to another field with specific value', () => {
+
+ widget.textWidget().isWidgetVisible(widgets.textOneId);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldValue);
+ widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldValue);
+
+ widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldValue);
+ });
+
+ it('[C309648] Should be able to see Checkbox widget when visibility condition refers to a form variable and a field', () => {
+
+ widget.textWidget().isWidgetVisible(widgets.textOneId);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField);
+
+ widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableField);
+
+ widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField);
+ });
+
+ it('[C309649] Should be able to see Checkbox widget when visibility condition refers to a field and a form variable', () => {
+
+ widget.textWidget().isWidgetVisible(widgets.textOneId);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable);
+
+ widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
+ expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldVariable)).toBe(true);
+
+ widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable);
+ });
+
+ it('[C311425] Should be able to see Checkbox widget when visibility condition refers to a field and another field', () => {
+
+ widget.textWidget().isWidgetVisible(widgets.textOneId);
+ widget.textWidget().isWidgetVisible(widgets.textTwoId);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField);
+
+ widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField);
+
+ widget.textWidget().setValue(widgets.textTwoId, value.displayCheckbox);
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldField);
+
+ widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField);
+ });
+
+ it('[C311424] Should be able to see Checkbox widget when visibility condition refers to a variable with specific value', () => {
+ formCloudDemoPage.setConfigToEditor(checkboxVisibilityFormJson);
+
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableValue);
+
+ visibleCheckbox = checkboxVisibilityFormJson;
+ visibleCheckbox.formRepresentation.formDefinition.variables[0].value = value.notDisplayCheckbox;
+ formCloudDemoPage.setConfigToEditor(visibleCheckbox);
+
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableValue);
+
+ visibleCheckbox = checkboxVisibilityFormJson;
+ visibleCheckbox.formRepresentation.formDefinition.variables[0].value = value.displayCheckbox;
+ formCloudDemoPage.setConfigToEditor(visibleCheckbox);
+ });
+
+ it('[C311426] Should be able to see Checkbox widget when visibility condition refers to form variable and another form variable', () => {
+ formCloudDemoPage.setConfigToEditor(checkboxVisibilityFormJson);
+
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableVariable);
+
+ visibleCheckbox = checkboxVisibilityFormJson;
+ visibleCheckbox.formRepresentation.formDefinition.variables[0].value = value.notDisplayCheckbox;
+ formCloudDemoPage.setConfigToEditor(visibleCheckbox);
+
+ widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableVariable);
+
+ visibleCheckbox = checkboxVisibilityFormJson;
+ visibleCheckbox.formRepresentation.formDefinition.variables[1].value = value.notDisplayCheckbox;
+ formCloudDemoPage.setConfigToEditor(visibleCheckbox);
+
+ widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableVariable);
+
+ visibleCheckbox = checkboxVisibilityFormJson;
+ visibleCheckbox.formRepresentation.formDefinition.variables[0].value = value.displayCheckbox;
+ visibleCheckbox.formRepresentation.formDefinition.variables[1].value = value.displayCheckbox;
+ formCloudDemoPage.setConfigToEditor(visibleCheckbox);
+ });
+});
diff --git a/e2e/pages/adf/configEditorPage.ts b/e2e/pages/adf/configEditorPage.ts
index 7e4f8c7277..f6738fd142 100644
--- a/e2e/pages/adf/configEditorPage.ts
+++ b/e2e/pages/adf/configEditorPage.ts
@@ -15,25 +15,35 @@
* limitations under the License.
*/
-import { element, by } from 'protractor';
+import { element, by, browser } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class ConfigEditorPage {
+ textField = element(by.css('#adf-form-config-editor div.overflow-guard > textarea'));
+
enterConfiguration(text) {
- const textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
- BrowserVisibility.waitUntilElementIsVisible(textField);
- textField.sendKeys(text);
+
+ BrowserVisibility.waitUntilElementIsVisible(this.textField);
+ this.textField.sendKeys(text);
return this;
}
clickSaveButton() {
- const saveButton = element(by.id('adf-configuration-save'));
+ const saveButton = element(by.id('adf-form-config-save'));
BrowserActions.click(saveButton);
}
clickClearButton() {
- const clearButton = element(by.id('adf-configuration-clear'));
+ BrowserVisibility.waitUntilElementIsVisible(this.textField);
+ const clearButton = element(by.id('adf-form-config-clear'));
BrowserActions.click(clearButton);
}
+
+ enterBulkConfiguration(text) {
+ this.clickClearButton();
+ BrowserVisibility.waitUntilElementIsVisible(this.textField);
+ browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + JSON.stringify(text) + '`)');
+ this.clickSaveButton();
+ }
}
diff --git a/e2e/pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage.ts b/e2e/pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage.ts
new file mode 100644
index 0000000000..4ea9a77c2f
--- /dev/null
+++ b/e2e/pages/adf/demo-shell/process-services-cloud/cloudFormDemoPage.ts
@@ -0,0 +1,46 @@
+/*!
+ * @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 { ConfigEditorPage } from '../../configEditorPage';
+import { BrowserVisibility } from '@alfresco/adf-testing';
+import { by, element, browser } from 'protractor';
+
+export class FormCloudDemoPage {
+
+ formCloudEditor = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
+ formCloudRender = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
+
+ configEditorPage = new ConfigEditorPage();
+
+ goToEditor() {
+ BrowserVisibility.waitUntilElementIsVisible(this.formCloudEditor);
+ this.formCloudEditor.click();
+ }
+
+ goToRenderedForm() {
+ BrowserVisibility.waitUntilElementIsVisible(this.formCloudRender);
+ this.formCloudRender.click();
+ }
+
+ setConfigToEditor(text) {
+ this.goToEditor();
+ browser.sleep(2000);
+ this.configEditorPage.enterBulkConfiguration(text);
+ this.goToRenderedForm();
+ browser.sleep(2000);
+ }
+}
diff --git a/e2e/pages/adf/navigationBarPage.ts b/e2e/pages/adf/navigationBarPage.ts
index c6450de776..bd345afea7 100644
--- a/e2e/pages/adf/navigationBarPage.ts
+++ b/e2e/pages/adf/navigationBarPage.ts
@@ -205,6 +205,11 @@ export class NavigationBarPage {
BrowserActions.click(this.formButton);
}
+ clickFormCloudButton() {
+ this.clickMenuButton('Process Cloud');
+ BrowserActions.click(this.formButton);
+ }
+
checkLogoTooltip(logoTooltipTitle) {
const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
diff --git a/e2e/resources/forms/checkbox-visibility-condition.ts b/e2e/resources/forms/checkbox-visibility-condition.ts
new file mode 100644
index 0000000000..91c8cc2f16
--- /dev/null
+++ b/e2e/resources/forms/checkbox-visibility-condition.ts
@@ -0,0 +1,222 @@
+/*!
+ * @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.
+ */
+
+ /* tslint:disable */
+export const checkboxVisibilityForm = `{
+ "formRepresentation": {
+ "id": "form-412cdeab-de90-4099-875f-676366e48fc9",
+ "name": "test",
+ "description": "",
+ "version": 0,
+ "formDefinition": {
+ "tabs": [],
+ "fields": [
+ {
+ "id": "85a4f564-2c70-438a-ae0f-b9c8af4887c2",
+ "name": "Label",
+ "type": "container",
+ "tab": null,
+ "numberOfColumns": 2,
+ "fields": {
+ "1": [
+ {
+ "id": "CheckboxFieldField",
+ "name": "CheckboxFieldField",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "textOne",
+ "leftRestResponseId": "",
+ "operator": "==",
+ "rightValue": "",
+ "rightType": null,
+ "rightFormFieldId": "textTwo",
+ "rightRestResponseId": "",
+ "nextConditionOperator": ""
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "CheckboxFieldVariable",
+ "name": "CheckboxFieldVariable",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "textOne",
+ "leftRestResponseId": "",
+ "operator": "==",
+ "rightValue": "",
+ "rightType": null,
+ "rightFormFieldId": "",
+ "rightRestResponseId": "cbc51284-04c4-462f-ab72-2b9f8b14907b",
+ "nextConditionOperator": ""
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "CheckboxFieldValue",
+ "name": "CheckboxFieldValue",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "textOne",
+ "leftRestResponseId": "",
+ "operator": "==",
+ "rightValue": "showCheckbox",
+ "rightType": null,
+ "rightFormFieldId": "",
+ "rightRestResponseId": "",
+ "nextConditionOperator": "",
+ "nextCondition": null
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "CheckboxVariableValue",
+ "name": "CheckboxVariableValue",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "",
+ "leftRestResponseId": "cbc51284-04c4-462f-ab72-2b9f8b14907b",
+ "operator": "==",
+ "rightValue": "showCheckbox",
+ "rightType": null,
+ "rightFormFieldId": "",
+ "rightRestResponseId": "",
+ "nextConditionOperator": "",
+ "nextCondition": null
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "CheckboxVariableVariable",
+ "name": "CheckboxVariableVariable",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "",
+ "leftRestResponseId": "cbc51284-04c4-462f-ab72-2b9f8b14907b",
+ "operator": "==",
+ "rightValue": "",
+ "rightType": null,
+ "rightFormFieldId": "",
+ "rightRestResponseId": "87df371a-4238-43f8-92e5-ef3f6a19f379",
+ "nextConditionOperator": "",
+ "nextCondition": null
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "CheckboxVariableField",
+ "name": "CheckboxVariableField",
+ "type": "boolean",
+ "required": false,
+ "colspan": 1,
+ "visibilityCondition": {
+ "leftFormFieldId": "",
+ "leftRestResponseId": "cbc51284-04c4-462f-ab72-2b9f8b14907b",
+ "operator": "==",
+ "rightValue": "",
+ "rightType": null,
+ "rightFormFieldId": "textOne",
+ "rightRestResponseId": "",
+ "nextConditionOperator": "",
+ "nextCondition": null
+ },
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ }
+ ],
+ "2": [
+ {
+ "id": "textOne",
+ "name": "textOne",
+ "type": "text",
+ "required": false,
+ "colspan": 1,
+ "placeholder": null,
+ "minLength": 0,
+ "maxLength": 0,
+ "regexPattern": null,
+ "visibilityCondition": null,
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ },
+ {
+ "id": "textTwo",
+ "name": "textTwo",
+ "type": "text",
+ "required": false,
+ "colspan": 1,
+ "placeholder": null,
+ "minLength": 0,
+ "maxLength": 0,
+ "regexPattern": null,
+ "visibilityCondition": null,
+ "params": {
+ "existingColspan": 1,
+ "maxColspan": 2
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "outcomes": [],
+ "metadata": {},
+ "variables": [
+ {
+ "id": "cbc51284-04c4-462f-ab72-2b9f8b14907b",
+ "name": "varString1",
+ "type": "string",
+ "value": "showCheckbox"
+ },
+ {
+ "id": "87df371a-4238-43f8-92e5-ef3f6a19f379",
+ "name": "varString2",
+ "type": "string",
+ "value": "showCheckbox"
+ }
+ ]
+ }
+ }
+}`;
diff --git a/lib/testing/src/lib/core/pages/form/formFields.ts b/lib/testing/src/lib/core/pages/form/formFields.ts
index c9f70f907a..006b1b78d7 100644
--- a/lib/testing/src/lib/core/pages/form/formFields.ts
+++ b/lib/testing/src/lib/core/pages/form/formFields.ts
@@ -42,7 +42,7 @@ export class FormFields {
checkWidgetIsVisible(fieldId) {
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
- BrowserVisibility.waitUntilElementIsVisible(fieldElement);
+ BrowserVisibility.waitUntilElementIsOnPage(fieldElement);
}
checkWidgetIsHidden(fieldId) {
@@ -50,6 +50,12 @@ export class FormFields {
BrowserVisibility.waitUntilElementIsVisible(hiddenElement);
}
+ checkWidgetIsNotHidden(fieldId) {
+ this.checkWidgetIsVisible(fieldId);
+ const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
+ return BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement, 6000);
+ }
+
getWidget(fieldId) {
const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
BrowserVisibility.waitUntilElementIsVisible(widget);
diff --git a/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts b/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts
index 72260387a1..582412ba9f 100644
--- a/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts
+++ b/lib/testing/src/lib/core/pages/form/widgets/checkboxWidget.ts
@@ -34,7 +34,7 @@ export class CheckboxWidget {
}
isCheckboxDisplayed(fieldId) {
- return this.formFields.checkWidgetIsVisible(fieldId);
+ return this.formFields.checkWidgetIsNotHidden(fieldId);
}
isCheckboxHidden(fieldId) {
From 028916e3868d46fe12910d4b0aec7e08bce367fd Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Mon, 1 Jul 2019 11:35:27 +0100
Subject: [PATCH 024/140] Fix user info unit test (#4887)
* fix unit test user info component
* fix unit test user info component
* replace download call with spy
* fix karma conf
---
lib/core/dialogs/download-zip.dialog.spec.ts | 42 +++++++++++++------
lib/core/karma.conf.js | 6 +++
.../components/user-info.component.spec.ts | 21 +++++-----
3 files changed, 46 insertions(+), 23 deletions(-)
diff --git a/lib/core/dialogs/download-zip.dialog.spec.ts b/lib/core/dialogs/download-zip.dialog.spec.ts
index 0781fa8463..f21a588567 100755
--- a/lib/core/dialogs/download-zip.dialog.spec.ts
+++ b/lib/core/dialogs/download-zip.dialog.spec.ts
@@ -22,7 +22,7 @@ import { DownloadZipDialogComponent } from './download-zip.dialog';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { DownloadZipService } from '../services/download-zip.service';
-import { of } from 'rxjs';
+import { Observable } from 'rxjs/index';
describe('DownloadZipDialogComponent', () => {
@@ -40,17 +40,6 @@ describe('DownloadZipDialogComponent', () => {
]
};
- const pendingDownloadEntry = {
- entry: {
- bytesAdded: 0,
- filesAdded: 0,
- id: '5bfb0907',
- status: 'PENDING',
- totalBytes: 0,
- totalFiles: 0
- }
- };
-
setupTestBed({
imports: [CoreTestingModule],
providers: [
@@ -101,6 +90,13 @@ describe('DownloadZipDialogComponent', () => {
});
it('should call cancelDownload when CANCEL button is clicked', () => {
+ spyOn(downloadZipService, 'createDownload').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
+
fixture.detectChanges();
spyOn(component, 'cancelDownload');
@@ -111,12 +107,25 @@ describe('DownloadZipDialogComponent', () => {
});
it('should call createDownload when component is initialize', () => {
- const createDownloadSpy = spyOn(downloadZipService, 'createDownload').and.returnValue(of(pendingDownloadEntry));
+ const createDownloadSpy = spyOn(downloadZipService, 'createDownload').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
+
fixture.detectChanges();
expect(createDownloadSpy).toHaveBeenCalled();
});
it('should close dialog when download is completed', () => {
+ spyOn(downloadZipService, 'createDownload').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
+
component.download('fakeUrl', 'fileName');
spyOn(component, 'cancelDownload');
fixture.detectChanges();
@@ -124,6 +133,13 @@ describe('DownloadZipDialogComponent', () => {
});
it('should close dialog when download is cancelled', () => {
+ spyOn(downloadZipService, 'createDownload').and.callFake(() => {
+ return new Observable((observer) => {
+ observer.next();
+ observer.complete();
+ });
+ });
+
fixture.detectChanges();
component.download('url', 'filename');
spyOn(downloadZipService, 'cancelDownload');
diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js
index 882b679916..a46e16d80e 100644
--- a/lib/core/karma.conf.js
+++ b/lib/core/karma.conf.js
@@ -12,8 +12,10 @@ module.exports = function (config) {
{pattern: 'node_modules/hammerjs/hammer.min.js.map', included: false, watched: false},
// pdf-js
+ {pattern: 'node_modules/pdfjs-dist/build/pdf.js.map', included: false, watched: false},
{pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false},
{pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false, served: true},
+ {pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js.map', included: false, watched: false},
{pattern: 'node_modules/pdfjs-dist/build/pdf.worker.min.js', included: true, watched: false, served: true},
{pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false},
@@ -28,6 +30,7 @@ module.exports = function (config) {
{pattern: 'lib/core/i18n/**/en.json', included: false, served: true, watched: false},
{pattern: 'lib/core/**/*.ts', included: false, served: true, watched: false},
{pattern: 'lib/core/assets/**/*.svg', included: false, served: true, watched: false},
+ {pattern: 'lib/core/assets/**/*.png', included: false, served: true, watched: false},
{pattern: 'lib/config/app.config.json', included: false, served: true, watched: false},
{pattern: 'lib/core/viewer/assets/fake-test-file.pdf', included: false, served: true, watched: false},
{pattern: 'lib/core/viewer/assets/fake-test-file.txt', included: false, served: true, watched: false},
@@ -45,7 +48,10 @@ module.exports = function (config) {
'/pdf.worker.min.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.min.js',
'/pdf.worker.js' :'/base/node_modules/pdfjs-dist/build/pdf.worker.js',
'/fake-url-file.png' :'/base/lib/core/assets/images/logo.png',
+ '/alfresco-logo.svg' :'/base/lib/core/assets/images/alfresco-logo.svg',
'/assets/images/': '/base/lib/core/assets/images/',
+ '/assets/images/ecm-background.png': '/base/lib/core/assets/images/ecm-background.png',
+ '/assets/images/bpm-background.png': '/base/lib/core/assets/images/bpm-background.png',
'/content.bin': '/base/lib/core/viewer/assets/fake-test-file.pdf',
'/base/assets/' :'/base/lib/core/assets/',
'/assets/adf-core/i18n/en.json': '/base/lib/core/i18n/en.json',
diff --git a/lib/core/userinfo/components/user-info.component.spec.ts b/lib/core/userinfo/components/user-info.component.spec.ts
index cb57d9e206..68eed47433 100644
--- a/lib/core/userinfo/components/user-info.component.spec.ts
+++ b/lib/core/userinfo/components/user-info.component.spec.ts
@@ -99,6 +99,9 @@ describe('User info component', () => {
bpmUserService = TestBed.get(BpmUserService);
contentService = TestBed.get(ContentService);
identityUserService = TestBed.get(IdentityUserService);
+
+ spyOn(bpmUserService, 'getCurrentUserProfileImage').and.returnValue('');
+ spyOn(contentService, 'getContentUrl').and.returnValue('alfresco-logo.svg');
}));
afterEach(() => {
@@ -203,7 +206,6 @@ describe('User info component', () => {
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
spyOn(authService, 'isLoggedIn').and.returnValue(true);
spyOn(ecmUserService, 'getCurrentUserInfo').and.returnValue(of(fakeEcmUser));
- spyOn(contentService, 'getContentUrl').and.returnValue('assets/images/ecmImg.gif');
fixture.detectChanges();
}));
@@ -217,7 +219,7 @@ describe('User info component', () => {
expect(element.querySelector('#userinfo_container')).not.toBeNull();
expect(loggedImage).not.toBeNull();
- expect(loggedImage.properties.src).toContain('assets/images/ecmImg.gif');
+ expect(loggedImage.properties.src).toContain('alfresco-logo.svg');
});
}));
@@ -235,11 +237,11 @@ describe('User info component', () => {
});
expect(element.querySelector('#userinfo_container')).not.toBeNull();
expect(loggedImage).not.toBeNull();
- expect(loggedImage.properties.src).toContain('assets/images/ecmImg.gif');
+ expect(loggedImage.properties.src).toContain('alfresco-logo.svg');
});
}));
- it('should get the ecm user informations from the service', async(() => {
+ it('should get the ecm user information from the service', async(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
@@ -253,7 +255,7 @@ describe('User info component', () => {
expect(element.querySelector('#userinfo_container')).not.toBeNull();
expect(fixture.debugElement.query(By.css('#ecm-username'))).not.toBeNull();
expect(ecmImage).not.toBeNull();
- expect(ecmImage.properties.src).toContain('assets/images/ecmImg.gif');
+ expect(ecmImage.properties.src).toContain('alfresco-logo.svg');
expect(ecmFullName.nativeElement.textContent).toContain('fake-ecm-first-name fake-ecm-last-name');
expect(ecmJobTitle.nativeElement.textContent).toContain('USER_PROFILE.LABELS.ECM.JOB_TITLE');
});
@@ -436,7 +438,6 @@ describe('User info component', () => {
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
spyOn(authService, 'isBpmLoggedIn').and.returnValue(true);
spyOn(authService, 'isLoggedIn').and.returnValue(true);
- spyOn(contentService, 'getContentUrl').and.returnValue('src/assets/images/ecmImg.gif');
ecmUserInfoSpy = spyOn(ecmUserService, 'getCurrentUserInfo').and.returnValue(of(fakeEcmUser));
spyOn(bpmUserService, 'getCurrentUserInfo').and.returnValue(of(fakeBpmUser));
@@ -468,7 +469,7 @@ describe('User info component', () => {
});
}));
- it('should get the bpm user informations from the service', async(() => {
+ it('should get the bpm user information from the service', async(() => {
openUserInfo();
const bpmTab = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label'))[1];
bpmTab.triggerEventHandler('click', null);
@@ -485,7 +486,7 @@ describe('User info component', () => {
});
}));
- it('should get the ecm user informations from the service', async(() => {
+ it('should get the ecm user information from the service', async(() => {
openUserInfo();
const ecmUsername = fixture.debugElement.query(By.css('#ecm-username'));
const ecmImage = fixture.debugElement.query(By.css('#ecm-user-detail-image'));
@@ -495,7 +496,7 @@ describe('User info component', () => {
expect(element.querySelector('#userinfo_container')).toBeDefined();
expect(ecmUsername).not.toBeNull();
expect(ecmImage).not.toBeNull();
- expect(ecmImage.properties.src).toContain('assets/images/ecmImg.gif');
+ expect(ecmImage.properties.src).toContain('alfresco-logo.svg');
expect(fixture.debugElement.query(By.css('#ecm-full-name')).nativeElement.textContent).toContain('fake-ecm-first-name fake-ecm-last-name');
expect(fixture.debugElement.query(By.css('#ecm-job-title')).nativeElement.textContent).toContain('job-ecm-test');
});
@@ -505,7 +506,7 @@ describe('User info component', () => {
openUserInfo();
expect(element.querySelector('#userinfo_container')).toBeDefined();
expect(element.querySelector('#logged-user-img')).toBeDefined();
- expect(element.querySelector('#logged-user-img').getAttribute('src')).toEqual('src/assets/images/ecmImg.gif');
+ expect(element.querySelector('#logged-user-img').getAttribute('src')).toEqual('alfresco-logo.svg');
}));
it('should show the ecm initials if the ecm user has no image', async(() => {
From 87b80235a705ddcedb0224364b16c1aacdafee76 Mon Sep 17 00:00:00 2001
From: Suzana Dirla
Date: Tue, 2 Jul 2019 14:07:15 +0300
Subject: [PATCH 025/140] [ADF-4701] Upgrade angular libs (#4877)
* [ADF-4701] Upgrade angular material to 7.3.7 version
* [ADF-4701] upgrade angular libs
* [ADF-4701] upgrade angular libs
* [ADF-4530] temporary disable test
- will be fixed in a separate PR for https://issues.alfresco.com/jira/browse/ADF-4704
- the 'expected behavior' of the ADF-4530 corresponding bug is that should display 'all the available Process Definitions defined in the app'
* e2e test does not need bpm user
* e2e FIX waitUntilElementIsClickable
* Revert "e2e test does not need bpm user"
This reverts commit 9a5c4d4 - Travis seems to need initial code
* e2e fix button selector
- caused TimeoutError: Element is not Clickable
* e2e scroll into view fix
* e2e fixes scroll into view & selectors
* e2e fixed close action menu
- close menu with all disabled items fix - opened related issue https://issues.alfresco.com/jira/browse/ADF-4712
- checkContextActionIsVisible should check only visibility - all items might be disabled, so un-clickable
- close menu changed bcs. overlay backdrop caused TimeoutError: Element is not Clickable
* e2e disabled button is not supposed to be clickable
- fixed TimeoutError: Element is not Clickable
* e2e update messages
* e2e check invisibilityOf item
* e2e extra filter
* e2e wait waitTillContentLoaded
- created related issue https://issues.alfresco.com/jira/browse/ADF-4715
* [ADF-4715] a process never has CREATED status
* [ADF-4717] wait for filtered content to be loaded
- initiator filter must have 'username' value
---
.../version/version-actions.e2e.ts | 6 +-
.../version/version-permissions.e2e.ts | 2 +-
.../version/version-properties.e2e.ts | 4 +-
e2e/pages/adf/contentServicesPage.ts | 10 +-
e2e/pages/adf/dialog/uploadToggles.ts | 5 +-
e2e/pages/adf/versionManagerPage.ts | 11 +-
e2e/pages/adf/viewerPage.ts | 4 +
.../process-filter-results.e2e.ts | 59 ++-
.../start-process-cloud.component.spec.ts | 5 +-
lib/testing/src/lib/core/pages/header.page.ts | 5 +-
.../src/lib/core/utils/browser-actions.ts | 5 +
.../src/lib/core/utils/browser-visibility.ts | 26 +-
.../start-process-cloud-component.page.ts | 1 -
package-lock.json | 351 +++++++++++-------
package.json | 30 +-
15 files changed, 305 insertions(+), 219 deletions(-)
diff --git a/e2e/content-services/version/version-actions.e2e.ts b/e2e/content-services/version/version-actions.e2e.ts
index 9c0010f86c..1d369300b5 100644
--- a/e2e/content-services/version/version-actions.e2e.ts
+++ b/e2e/content-services/version/version-actions.e2e.ts
@@ -90,14 +90,14 @@ describe('Version component actions', () => {
it('[C280003] Should not be possible delete a file version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
- versionManagePage.closeActionButton();
+ versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
});
it('[C280004] Should not be possible restore the version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
- versionManagePage.closeActionButton();
+ versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
});
@@ -108,7 +108,7 @@ describe('Version component actions', () => {
versionManagePage.clickActionButton('1.1').checkActionsArePresent('1.1');
- versionManagePage.closeActionButton();
+ versionManagePage.closeActionsMenu();
});
it('[C269081] Should be possible download all the version of a file', () => {
diff --git a/e2e/content-services/version/version-permissions.e2e.ts b/e2e/content-services/version/version-permissions.e2e.ts
index c79735a9b5..eb0c73fd90 100644
--- a/e2e/content-services/version/version-permissions.e2e.ts
+++ b/e2e/content-services/version/version-permissions.e2e.ts
@@ -316,7 +316,7 @@ describe('Version component permissions', () => {
expect(element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
- versionManagePage.closeActionButton();
+ versionManagePage.closeActionsMenu();
versionManagePage.closeVersionDialog();
});
diff --git a/e2e/content-services/version/version-properties.e2e.ts b/e2e/content-services/version/version-properties.e2e.ts
index 1b96137755..b46c10f4d0 100644
--- a/e2e/content-services/version/version-properties.e2e.ts
+++ b/e2e/content-services/version/version-properties.e2e.ts
@@ -79,7 +79,7 @@ describe('Version Properties', () => {
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
- versionManagePage.closeActionButton();
+ versionManagePage.closeDisabledActionsMenu();
});
it('[C279992] Should be present the download action when allowDownload property is true', () => {
@@ -89,7 +89,7 @@ describe('Version Properties', () => {
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
- versionManagePage.closeActionButton();
+ versionManagePage.closeActionsMenu();
});
it('[C269085] Should show/hide comments when showComments true/false', () => {
diff --git a/e2e/pages/adf/contentServicesPage.ts b/e2e/pages/adf/contentServicesPage.ts
index bdbef37a1e..99504118cf 100644
--- a/e2e/pages/adf/contentServicesPage.ts
+++ b/e2e/pages/adf/contentServicesPage.ts
@@ -48,7 +48,8 @@ export class ContentServicesPage {
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
activeBreadcrumb = element(by.css('div[class*="active"]'));
tooltip = by.css('div[class*="--text adf-full-width"] span');
- uploadFileButton = element(by.css('input[data-automation-id="upload-single-file"]'));
+ uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
+ uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
@@ -90,7 +91,6 @@ export class ContentServicesPage {
checkContextActionIsVisible(actionName) {
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
BrowserVisibility.waitUntilElementIsVisible(actionButton);
- BrowserVisibility.waitUntilElementIsClickable(actionButton);
return actionButton;
}
@@ -178,6 +178,7 @@ export class ContentServicesPage {
}
disableDropFilesInAFolder() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
return this;
}
@@ -390,8 +391,7 @@ export class ContentServicesPage {
uploadFile(fileLocation) {
this.checkUploadButton();
- BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
- this.uploadFileButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
+ this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
this.checkUploadButton();
return this;
}
@@ -416,7 +416,7 @@ export class ContentServicesPage {
getSingleFileButtonTooltip() {
BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
- return this.uploadFileButton.getAttribute('title');
+ return this.uploadFileButtonInput.getAttribute('title');
}
getMultipleFileButtonTooltip() {
diff --git a/e2e/pages/adf/dialog/uploadToggles.ts b/e2e/pages/adf/dialog/uploadToggles.ts
index 2fb2652516..7b01598a3b 100644
--- a/e2e/pages/adf/dialog/uploadToggles.ts
+++ b/e2e/pages/adf/dialog/uploadToggles.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { by, element, protractor } from 'protractor';
+import { browser, by, element, protractor } from 'protractor';
import { BrowserVisibility, FormControllersPage } from '@alfresco/adf-testing';
export class UploadToggles {
@@ -31,6 +31,7 @@ export class UploadToggles {
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
enableMultipleFileUpload() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
return this;
}
@@ -75,11 +76,13 @@ export class UploadToggles {
}
enableExtensionFilter() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
this.formControllersPage.enableToggle(this.extensionFilterToggle);
return this;
}
disableExtensionFilter() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
this.formControllersPage.disableToggle(this.extensionFilterToggle);
return this;
}
diff --git a/e2e/pages/adf/versionManagerPage.ts b/e2e/pages/adf/versionManagerPage.ts
index cc94d79f15..d71b03bace 100644
--- a/e2e/pages/adf/versionManagerPage.ts
+++ b/e2e/pages/adf/versionManagerPage.ts
@@ -153,9 +153,16 @@ export class VersionManagePage {
return this;
}
- closeActionButton() {
+ closeActionsMenu() {
const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
- BrowserActions.click(container);
+ BrowserActions.closeMenuAndDialogs();
+ BrowserVisibility.waitUntilElementIsNotVisible(container);
+ return this;
+ }
+
+ closeDisabledActionsMenu() {
+ const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
+ BrowserActions.closeDisabledMenu();
BrowserVisibility.waitUntilElementIsNotVisible(container);
return this;
}
diff --git a/e2e/pages/adf/viewerPage.ts b/e2e/pages/adf/viewerPage.ts
index 56138bcc5a..0604d3bea2 100644
--- a/e2e/pages/adf/viewerPage.ts
+++ b/e2e/pages/adf/viewerPage.ts
@@ -508,6 +508,7 @@ export class ViewerPage {
}
enableShowTabWithIcon() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.showTabWithIconSwitch);
this.formControllersPage.enableToggle(this.showTabWithIconSwitch);
}
@@ -552,6 +553,7 @@ export class ViewerPage {
}
disableAllowLeftSidebar() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.allowLeftSidebarSwitch);
this.formControllersPage.disableToggle(this.allowLeftSidebarSwitch);
}
@@ -582,11 +584,13 @@ export class ViewerPage {
}
disableCustomToolbar() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.customToolbarToggle);
this.formControllersPage.disableToggle(this.customToolbarToggle);
return this;
}
enableCustomToolbar() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.customToolbarToggle);
this.formControllersPage.enableToggle(this.customToolbarToggle);
return this;
}
diff --git a/e2e/process-services-cloud/process-filter-results.e2e.ts b/e2e/process-services-cloud/process-filter-results.e2e.ts
index 139f804cc0..b42cf96cec 100644
--- a/e2e/process-services-cloud/process-filter-results.e2e.ts
+++ b/e2e/process-services-cloud/process-filter-results.e2e.ts
@@ -142,47 +142,51 @@ describe('Process filters cloud', () => {
});
it('[C306887] Should be able to filter by appName', async () => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown(candidateBaseApp).setProperty('initiator', testUser.email);
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown(candidateBaseApp).setProperty('initiator', testUser.username);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
-
});
it('[C306889] Should be able to see "No process found" when using an app with no processes in the appName field', async () => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown('subprocessapp').setProperty('initiator', testUser.email);
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setAppNameDropDown('subprocessapp').setProperty('initiator', testUser.username);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
-
});
it('[C306890] Should be able to filter by initiator', async () => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', testUser.email);
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', testUser.username);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
-
});
it('[C306891] Should be able to see "No process found" when providing an initiator whitout processes', async () => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', anotherUser.email);
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('initiator', anotherUser.username);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
-
});
it('[C311315] Should be able to filter by process definition id', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processDefinitionId', processDefinition.entry.id);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processDefinitionId', anotherProcessDefinition.entry.id);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311316] Should be able to filter by process definition key', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processDefinitionKey', processDefinition.entry.key);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processDefinitionKey', anotherProcessDefinition.entry.key);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311317] Should be able to filter by process instance id', async () => {
@@ -196,36 +200,31 @@ describe('Process filters cloud', () => {
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
expect(processCloudDemoPage.processListCloudComponent().getDataTable().getNumberOfRows()).toBe(1);
-
});
it('[C311321] Should be able to filter by process name', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('processName', runningProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
+
processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processName', anotherProcessInstance.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C306892] Should be able to filter by process status - Running', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('RUNNING');
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
- processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
- processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(completedProcess.entry.name);
- });
-
- it('[C306892] Should be able to filter by process status - Created', async () => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('CREATED');
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
- processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
- processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(completedProcess.entry.name);
});
it('[C306892] Should be able to filter by process status - Completed', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('COMPLETED');
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(completedProcess.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
@@ -234,6 +233,7 @@ describe('Process filters cloud', () => {
it('[C306892] Should be able to filter by process status - Suspended', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('SUSPENDED');
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
@@ -242,6 +242,7 @@ describe('Process filters cloud', () => {
it('[C306892] Should be able to filter by process status - All', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ALL');
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
@@ -250,48 +251,44 @@ describe('Process filters cloud', () => {
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = currentDate', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', currentDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = beforeDate', async () => {
-
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', beforeDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311318] Should be able to filter by lastModifiedFrom - does not display record when date = afterDate', async () => {
-
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', afterDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = currentDate', async () => {
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', currentDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311319] Should be able to filter by lastModifiedTo - does not display record when date = beforeDate', async () => {
-
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', beforeDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = afterDate', async () => {
-
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedTo', afterDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(runningProcessInstance.entry.name);
-
});
it('[C311319] Should not display any processes when the lastModifiedFrom and lastModifiedTo are set to a future date', () => {
-
processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setProperty('lastModifiedFrom', afterDate);
processCloudDemoPage.editProcessFilterCloudComponent().setProperty('lastModifiedTo', afterDate);
+ processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
});
diff --git a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
index 1e7782078d..26751d3a6c 100755
--- a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts
@@ -387,7 +387,7 @@ describe('StartProcessCloudComponent', () => {
expect(component.processDefinitionList).toBe(fakeProcessDefinitions);
});
- it('should filter processes in the select list if input is empty', fakeAsync(() => {
+ xit('should NOT filter processes in the select list if input is empty', fakeAsync(() => {
component.processDefinitionList = fakeProcessDefinitions;
component.ngOnInit();
component.ngOnChanges({ appName: change });
@@ -398,9 +398,10 @@ describe('StartProcessCloudComponent', () => {
el.dispatchEvent(new Event('keyup'));
el.dispatchEvent(new Event('input'));
fixture.detectChanges();
+ expect(component.processDefinition.value).toEqual('', 'processDefinition value should be the one from input');
tick(3000);
- expect(component.filteredProcesses.length).toEqual(1);
+ expect(component.filteredProcesses.length).toEqual(fakeProcessDefinitions.length);
}));
it('should display the matching results in the dropdown as the user types down', fakeAsync(() => {
diff --git a/lib/testing/src/lib/core/pages/header.page.ts b/lib/testing/src/lib/core/pages/header.page.ts
index fbaa677b6e..087464ca00 100644
--- a/lib/testing/src/lib/core/pages/header.page.ts
+++ b/lib/testing/src/lib/core/pages/header.page.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { element, by, protractor } from 'protractor';
+import { element, by, protractor, browser } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
@@ -114,12 +114,11 @@ export class HeaderPage {
sideBarPositionStart() {
return BrowserActions.click(this.positionStart);
-
}
sideBarPositionEnd() {
+ browser.executeScript('arguments[0].scrollIntoView()', this.positionEnd);
return BrowserActions.click(this.positionEnd);
-
}
checkSidebarPositionStart() {
diff --git a/lib/testing/src/lib/core/utils/browser-actions.ts b/lib/testing/src/lib/core/utils/browser-actions.ts
index 9372253218..049d04c211 100644
--- a/lib/testing/src/lib/core/utils/browser-actions.ts
+++ b/lib/testing/src/lib/core/utils/browser-actions.ts
@@ -58,6 +58,11 @@ export class BrowserActions {
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
+ static async closeDisabledMenu() {
+ // if the opened menu has only disabled items, pressing escape to close it won't work
+ return browser.actions().sendKeys(protractor.Key.ENTER).perform();
+ }
+
static clickOnDropdownOption(option: string, dropDownElement: ElementFinder) {
this.click(dropDownElement);
BrowserVisibility.waitUntilElementIsVisible(element('div[class*="mat-menu-content"] button'));
diff --git a/lib/testing/src/lib/core/utils/browser-visibility.ts b/lib/testing/src/lib/core/utils/browser-visibility.ts
index bd6b51a261..e2acfc030c 100644
--- a/lib/testing/src/lib/core/utils/browser-visibility.ts
+++ b/lib/testing/src/lib/core/utils/browser-visibility.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { browser, by, element, ElementFinder, protractor } from 'protractor';
+import { browser, by, element, ExpectedConditions as EC, ElementFinder, protractor } from 'protractor';
const until = protractor.ExpectedConditions;
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 40000;
@@ -46,25 +46,13 @@ export class BrowserVisibility {
* Wait for element to be clickable
*/
static waitUntilElementIsClickable(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
- let isDisplayed = false;
- return browser.wait(() => {
- browser.waitForAngularEnabled();
-
- elementToCheck.isDisplayed().then(
- () => {
- isDisplayed = true;
- },
- () => {
- isDisplayed = false;
- }
- );
- return isDisplayed;
- }, waitTimeout, 'Element is not Clickable ' + elementToCheck.locator());
+ return browser.wait(EC.elementToBeClickable(elementToCheck),
+ waitTimeout, 'Element is not Clickable ' + elementToCheck.locator());
}
/*
- * Wait for element to not be visible
- */
+ * Wait for element to not be present on the page
+ */
static waitUntilElementIsStale(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
return browser.wait(until.stalenessOf(elementToCheck), waitTimeout, 'Element is not in stale ' + elementToCheck.locator());
}
@@ -103,7 +91,7 @@ export class BrowserVisibility {
* Wait for element to not be visible
*/
static waitUntilElementIsNotOnPage(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
- return browser.wait(until.not(until.visibilityOf(elementToCheck)), waitTimeout, 'Element is not in the page ' + elementToCheck.locator());
+ return browser.wait(until.invisibilityOf(elementToCheck), waitTimeout, 'Element is visible on the page ' + elementToCheck.locator());
}
static waitUntilElementIsPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
@@ -113,7 +101,7 @@ export class BrowserVisibility {
}
static waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
- return browser.wait(until.not(until.presenceOf(elementToCheck)), waitTimeout, 'Element is not in the page ' + elementToCheck.locator());
+ return browser.wait(until.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator());
}
static waitUntilDialogIsClose() {
diff --git a/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
index e88ef1a72e..25ddb073d1 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/start-process-cloud-component.page.ts
@@ -83,7 +83,6 @@ export class StartProcessCloudPage {
}
checkStartProcessButtonIsEnabled() {
- BrowserVisibility.waitUntilElementIsClickable(this.startProcessButton);
return this.startProcessButton.isEnabled();
}
diff --git a/package-lock.json b/package-lock.json
index 3a99fd1c3e..6b832785af 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -70,12 +70,12 @@
}
},
"@angular-devkit/architect": {
- "version": "0.13.6",
- "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.6.tgz",
- "integrity": "sha512-Cg9z4lmCvjt5uD00E/0tBRz3ESjYicmqT3NL/BIsNVNb+s1GwCCoPSOIM8Ss4nyGDtrdono1XKSOmkJnlzF3Cw==",
+ "version": "0.13.9",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.9.tgz",
+ "integrity": "sha512-EAFtCs9dsGhpMRC45PoYsrkiExpWz9Ax15qXfzwdDRacz5DmdOVt+QpkLW1beUOwiyj/bhFyj23eaONK2RTn/w==",
"dev": true,
"requires": {
- "@angular-devkit/core": "7.3.6",
+ "@angular-devkit/core": "7.3.9",
"rxjs": "6.3.3"
},
"dependencies": {
@@ -446,9 +446,9 @@
}
},
"@angular-devkit/core": {
- "version": "7.3.6",
- "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.6.tgz",
- "integrity": "sha512-aoarMK0DJIdwjVA0OuQIN7b8nKPcF9n5vSMF7MFmhKpTw5/uV3SynQZbm3YCgylu/2CMuiTzKuAunnWWdli//g==",
+ "version": "7.3.9",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz",
+ "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==",
"dev": true,
"requires": {
"ajv": "6.9.1",
@@ -488,12 +488,12 @@
}
},
"@angular-devkit/schematics": {
- "version": "7.3.6",
- "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.6.tgz",
- "integrity": "sha512-YXF7QusmMy3D9H0vNczc1n5BkuEHLwt7cW33euNeGNgTIsD0n6DrUhgClurXicnr2GNPSDYE5+3115lmJkhyrg==",
+ "version": "7.3.9",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.9.tgz",
+ "integrity": "sha512-xzROGCYp7aQbeJ3V6YC0MND7wKEAdWqmm/GaCufEk0dDS8ZGe0sQhcM2oBRa2nQqGQNeThFIH51kx+FayrJP0w==",
"dev": true,
"requires": {
- "@angular-devkit/core": "7.3.6",
+ "@angular-devkit/core": "7.3.9",
"rxjs": "6.3.3"
},
"dependencies": {
@@ -509,63 +509,63 @@
}
},
"@angular/animations": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.0.3.tgz",
- "integrity": "sha512-jCRHlt+ghfSnP5a8HKr6R/Adc5Cq7i/mcYsn3V6M2QBpGFCVmy0ZWZa66QOhRaqler8u8EGi1PdoCCoGAZc4OA==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.2.15.tgz",
+ "integrity": "sha512-8oBt3HLgd2+kyJHUgsd7OzKCCss67t2sch15XNoIWlOLfxclqU+EfFE6t/vCzpT8/+lpZS6LU9ZrTnb+UBj5jg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/cdk": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.0.3.tgz",
- "integrity": "sha512-QT7U2tOBVfwn8Q71Nyh0UjlyXfZNKdanq3+b8GJ/+IB/d8mVdMRTXBGQ4PqY7CP+wpkgm+wbbUt3urZF1AqdmQ==",
+ "version": "7.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.3.7.tgz",
+ "integrity": "sha512-xbXxhHHKGkVuW6K7pzPmvpJXIwpl0ykBnvA2g+/7Sgy5Pd35wCC+UtHD9RYczDM/mkygNxMQtagyCErwFnDtQA==",
"requires": {
"parse5": "^5.0.0",
"tslib": "^1.7.1"
}
},
"@angular/cli": {
- "version": "7.3.6",
- "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.6.tgz",
- "integrity": "sha512-u5lBcYVQRk9cez/DozJvFOYomeko9b5kE+NElyFhPtM3GF1SBcXKb5QyNxH/zSOc850VL7KPe7ZfC6kW3Phhyw==",
+ "version": "7.3.9",
+ "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.9.tgz",
+ "integrity": "sha512-7oJj7CKDlFUbQav1x1CV4xKKcbt0pnxY4unKcm7Q1tVXhu8bU2bc3cDA0aJnbofcYb6TJcd/C2qHgCt78q7edA==",
"dev": true,
"requires": {
- "@angular-devkit/architect": "0.13.6",
- "@angular-devkit/core": "7.3.6",
- "@angular-devkit/schematics": "7.3.6",
- "@schematics/angular": "7.3.6",
- "@schematics/update": "0.13.6",
+ "@angular-devkit/architect": "0.13.9",
+ "@angular-devkit/core": "7.3.9",
+ "@angular-devkit/schematics": "7.3.9",
+ "@schematics/angular": "7.3.9",
+ "@schematics/update": "0.13.9",
"@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5",
"inquirer": "6.2.1",
"npm-package-arg": "6.1.0",
- "opn": "5.4.0",
+ "open": "6.0.0",
"pacote": "9.4.0",
"semver": "5.6.0",
"symbol-observable": "1.2.0"
}
},
"@angular/common": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/common/-/common-7.0.3.tgz",
- "integrity": "sha512-aiuQh6+5kWFp34SYEtpnkAJWU3Qn17S/9LjWSZbgfiaYG6MyszepxqLZPBSBPTElxx2u5VoCPh97+TpKoDqx+g==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.15.tgz",
+ "integrity": "sha512-2b5JY2HWVHCf3D1GZjmde7jdAXSTXkYtmjLtA9tQkjOOTr80eHpNSujQqnzb97dk9VT9OjfjqTQd7K3pxZz8jw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.0.3.tgz",
- "integrity": "sha512-1eF4PzWej9eoEQhHwuMxujx9B4oSjP70vORIs9pgXF8O4nWDWTKtfPQyNCPxc8mY+Fwb0+nSOEvvA+Ou8Hnreg==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.2.15.tgz",
+ "integrity": "sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler-cli": {
- "version": "7.2.9",
- "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.9.tgz",
- "integrity": "sha512-3itdcfszdyXTHYEsO4eBu4WEx10hU8JpOgUcZyw+OYgwLQLyjEXOD9dfYZZpE/+2F0omoMLseCTHTP//uux+Iw==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.15.tgz",
+ "integrity": "sha512-+AsfyKawmj/sa+m4Pz8VSRFbCfx/3IOjAuuEjhopbyr154YpPDSu8NTbcwzq3yfbVcPwK4/4exmbQzpsndaCTg==",
"dev": true,
"requires": {
"canonical-path": "1.0.0",
@@ -594,9 +594,9 @@
"dev": true
},
"chokidar": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz",
- "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==",
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz",
+ "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==",
"dev": true,
"requires": {
"anymatch": "^2.0.0",
@@ -610,7 +610,7 @@
"normalize-path": "^3.0.0",
"path-is-absolute": "^1.0.0",
"readdirp": "^2.2.1",
- "upath": "^1.1.0"
+ "upath": "^1.1.1"
}
},
"cross-spawn": {
@@ -801,73 +801,73 @@
}
},
"@angular/core": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/core/-/core-7.0.3.tgz",
- "integrity": "sha512-x/OYYykVsi2vrKlYQJ37I8HYAI/s/CtL3Sd9bl87F6AnqLWnnKIxQaofT/ShfAfdP44LQoN5BNp5j+sjs8K4Kg==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/core/-/core-7.2.15.tgz",
+ "integrity": "sha512-XsuYm0jEU/mOqwDOk2utThv8J9kESkAerfuCHClE9rB2TtHUOGCfekF7lJWqjjypu6/J9ygoPFo7hdAE058ZGg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/flex-layout": {
- "version": "7.0.0-beta.23",
- "resolved": "https://registry.npmjs.org/@angular/flex-layout/-/flex-layout-7.0.0-beta.23.tgz",
- "integrity": "sha512-jH2i3i/M7SbK6scVlj2urVL5OhzwavbQ7KwvUjyc/UwccKnnzuOuWEGCINLja/aoaUO3I35LluCLv6a6VN0olA==",
+ "version": "7.0.0-beta.24",
+ "resolved": "https://registry.npmjs.org/@angular/flex-layout/-/flex-layout-7.0.0-beta.24.tgz",
+ "integrity": "sha512-ll6sK0nLGxqI/f5+z4jbd+pve1QITzgehv2AuGvfSDgIjPMeqUDB5YZqQmIGM/dQRk/vIio5KCW5LQPJWzMMYQ==",
"requires": {
"tslib": "^1.7.1"
}
},
"@angular/forms": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.0.3.tgz",
- "integrity": "sha512-URbSpsNDQOg2NxmAt2FgeXIbEXvJS2yQwP02NLkHGqqCe38dpcifijj6HlUxeH14ZBkoqeTQjtSkXlMkgt22YA==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.2.15.tgz",
+ "integrity": "sha512-p0kcIQLtBBC1qeTA6M3nOuXf/k91E80FKquVM9zEsO2kDjI0oZJVfFYL2UMov5samlJOPN+t6lRHEIUa7ApPsw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/http": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/http/-/http-7.0.3.tgz",
- "integrity": "sha512-aL+z1/tbVY8oJw5v46rbMli5vBGDVyJvs95d1l2n3hWnwMTzS9AVetjcL3B3uruAYuXoh4QlSJ+ysBgdmV1+IA==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/http/-/http-7.2.15.tgz",
+ "integrity": "sha512-TR7PEdmLWNIre3Zn8lvyb4lSrvPUJhKLystLnp4hBMcWsJqq5iK8S3bnlR4viZ9HMlf7bW7+Hm4SI6aB3tdUtw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/material": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.0.3.tgz",
- "integrity": "sha512-acJ2zU44k/rsd4OeTdAMVP0R3te8aXwfubDQGc8YI1CdRVW1XqMSvAWkToYDVaGvnZV53zQt/iSi1XWaSXYf1Q==",
+ "version": "7.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.3.7.tgz",
+ "integrity": "sha512-Eq+7frkeNGkLOfEtmkmJgR+AgoWajOipXZWWfCSamNfpCcPof82DwvGOpAmgGni9FuN2XFQdqP5MoaffQzIvUA==",
"requires": {
"tslib": "^1.7.1"
}
},
"@angular/material-moment-adapter": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-7.0.3.tgz",
- "integrity": "sha512-vbynHlQYWcgbZKRearq5LpflQp9VPDDNarHL+C4WD6aGLPYmIKotOWcBr083HfN1RnkCa7fh+GhOld/MHglHmg==",
+ "version": "7.3.7",
+ "resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-7.3.7.tgz",
+ "integrity": "sha512-Nb8hZkF6zcni7Jb+FXcTKKmbp8PhhFAhJSkch9FnKcFs1Py+sCNTLIH/cI53nPrTglkJwlVLwMW7fxj4w9I1CQ==",
"requires": {
"tslib": "^1.7.1"
}
},
"@angular/platform-browser": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.0.3.tgz",
- "integrity": "sha512-OKDGce2dYw9Fw8agpcSNJA+ecMMnMQCi9xoPHNIp1pYdvte7mUXKUvUzR7chqQ7b83d7SzVeEhqAZYa4BUwFRA==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.2.15.tgz",
+ "integrity": "sha512-aYgmPsbC9Tvp9vmKWD8voeAp4crwCay7/D6lM3ClEe2EeK934LuEXq3/uczMrFVbnIX7BBIo8fh03Tl7wbiGPw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/platform-browser-dynamic": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.0.3.tgz",
- "integrity": "sha512-hrdBtlkKyq2CZRY6z2RWFTcGF4n4MirM7EEzByEjlgiXSU+c4qHYb0a8z30qdCF1D/DZ6Md7cRRH+1uR/rCqxQ==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.15.tgz",
+ "integrity": "sha512-UL2PqhzXMD769NQ6Lh6pxlBDKvN9Qol3XLRFil80lwJ1GRW16ITeYbCamcafIH2GOyd88IhmYcbMfUQ/6q4MMQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/router": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/@angular/router/-/router-7.0.3.tgz",
- "integrity": "sha512-885svORDpD9DkaMKjvGwn4g5bf0n3JR8os+gCNhzk0p4TPfpc+vmNo8SyY2jwdLMh2rQzrUQTDkn9SzzgiOfDQ==",
+ "version": "7.2.15",
+ "resolved": "https://registry.npmjs.org/@angular/router/-/router-7.2.15.tgz",
+ "integrity": "sha512-qAubRJRQanguUqJQ76J9GSZ4JFtoyhJKRmX5P23ANZJXpB6YLzF2fJmOGi+E6cV8F0tKBMEq1pjxFTisx0MXwQ==",
"requires": {
"tslib": "^1.9.0"
}
@@ -1457,13 +1457,13 @@
}
},
"@schematics/angular": {
- "version": "7.3.6",
- "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.6.tgz",
- "integrity": "sha512-Q4VXAjVaCDb2zXFXoIdOfNPsn+EQjqDBHK4a97omytnSNAmu1erl3l2FkEMi6x/VuzK2mQSzBbmHJIgauMmOAA==",
+ "version": "7.3.9",
+ "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.9.tgz",
+ "integrity": "sha512-B3lytFtFeYNLfWdlrIzvy3ulFRccD2/zkoL0734J+DAGfUz7vbysJ50RwYL46sQUcKdZdvb48ktfu1S8yooP6Q==",
"dev": true,
"requires": {
- "@angular-devkit/core": "7.3.6",
- "@angular-devkit/schematics": "7.3.6",
+ "@angular-devkit/core": "7.3.9",
+ "@angular-devkit/schematics": "7.3.9",
"typescript": "3.2.4"
},
"dependencies": {
@@ -1476,13 +1476,13 @@
}
},
"@schematics/update": {
- "version": "0.13.6",
- "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.6.tgz",
- "integrity": "sha512-TkeigdQTHG40ZGj4CAAzQHh7/rSotg0J6nkBBtc4Y+9md7IGg6dzSFJAvYbDX5JZ9tk7DpukdRHOVVopS/J0AQ==",
+ "version": "0.13.9",
+ "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.9.tgz",
+ "integrity": "sha512-4MQcaKFxhMzZyE//+DknDh3h3duy3avg2oxSHxdwXlCZ8Q92+4lpegjJcSRiqlEwO4qeJ5XnrjrvzfIiaIZOmA==",
"dev": true,
"requires": {
- "@angular-devkit/core": "7.3.6",
- "@angular-devkit/schematics": "7.3.6",
+ "@angular-devkit/core": "7.3.9",
+ "@angular-devkit/schematics": "7.3.9",
"@yarnpkg/lockfile": "1.1.0",
"ini": "1.3.5",
"pacote": "9.4.0",
@@ -3044,12 +3044,12 @@
}
},
"browser-sync": {
- "version": "2.26.5",
- "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.26.5.tgz",
- "integrity": "sha512-zVa6MmadAFgl5Uk53Yy5cw5tGTO7xSGAWK3Yx70GJ1t5jK+r6B4q3xq+1XbYfLt1SbeFg7WoNWneNhMT4B9jFw==",
+ "version": "2.26.7",
+ "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.26.7.tgz",
+ "integrity": "sha512-lY3emme0OyvA2ujEMpRmyRy9LY6gHLuTr2/ABxhIm3lADOiRXzP4dgekvnDrQqZ/Ec2Fz19lEjm6kglSG5766w==",
"dev": true,
"requires": {
- "browser-sync-client": "^2.26.4",
+ "browser-sync-client": "^2.26.6",
"browser-sync-ui": "^2.26.4",
"bs-recipes": "1.3.4",
"bs-snippet-injector": "^2.0.1",
@@ -3064,7 +3064,7 @@
"fs-extra": "3.0.1",
"http-proxy": "1.15.2",
"immutable": "^3",
- "localtunnel": "1.9.1",
+ "localtunnel": "1.9.2",
"micromatch": "^3.1.10",
"opn": "5.3.0",
"portscanner": "2.1.1",
@@ -3178,9 +3178,9 @@
}
},
"browser-sync-client": {
- "version": "2.26.4",
- "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.26.4.tgz",
- "integrity": "sha512-mQiDp5/tf79VezDS5j/EExU4Ze6f5DQYuL0Z7VdJgBbNLTHDfkYGi2R620qc6HkY9XZA0m4/UwihT7J42RBIJA==",
+ "version": "2.26.6",
+ "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.26.6.tgz",
+ "integrity": "sha512-mGrkZdNzttKdf/16I+y+2dTQxoMCIpKbVIMJ/uP8ZpnKu9f9qa/2CYVtLtbjZG8nsM14EwiCrjuFTGBEnT3Gjw==",
"dev": true,
"requires": {
"etag": "1.8.1",
@@ -6483,9 +6483,9 @@
}
},
"fs-minipass": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
- "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz",
+ "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==",
"dev": true,
"requires": {
"minipass": "^2.2.1"
@@ -7163,41 +7163,48 @@
}
},
"github-build": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/github-build/-/github-build-1.2.0.tgz",
- "integrity": "sha512-Iq7NialLYz5yRZDkiX8zaOWd+N3BssJJfUvG7wd8r4MeLCN88SdxEYo2esseMLpLtP4vNXhgamg1eRm7hw59qw==",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/github-build/-/github-build-1.2.1.tgz",
+ "integrity": "sha512-VAT4NFU8hm9Ks5yNKuuczD2zMbmouAKHtxtwvmCj34Q2DpZsjgp3LLjtrKlm/YvGSzSNGmj22ccJQQei+f/vIw==",
"dev": true,
"requires": {
- "axios": "0.15.3"
+ "axios": "0.19.0"
},
"dependencies": {
"axios": {
- "version": "0.15.3",
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.15.3.tgz",
- "integrity": "sha1-LJ1jiy4ZGgjqHWzJiOrda6W9wFM=",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
+ "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"dev": true,
"requires": {
- "follow-redirects": "1.0.0"
+ "follow-redirects": "1.5.10",
+ "is-buffer": "^2.0.2"
}
},
"debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"follow-redirects": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.0.0.tgz",
- "integrity": "sha1-jjQpjL0uF28lTv/sdaHHjMhJ/Tc=",
+ "version": "1.5.10",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
+ "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"dev": true,
"requires": {
- "debug": "^2.2.0"
+ "debug": "=3.1.0"
}
},
+ "is-buffer": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
+ "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==",
+ "dev": true
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -9988,25 +9995,25 @@
}
},
"localtunnel": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.9.1.tgz",
- "integrity": "sha512-HWrhOslklDvxgOGFLxi6fQVnvpl6XdX4sPscfqMZkzi3gtt9V7LKBWYvNUcpHSVvjwCQ6xzXacVvICNbNcyPnQ==",
+ "version": "1.9.2",
+ "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.9.2.tgz",
+ "integrity": "sha512-NEKF7bDJE9U3xzJu3kbayF0WTvng6Pww7tzqNb/XtEARYwqw7CKEX7BvOMg98FtE9es2CRizl61gkV3hS8dqYg==",
"dev": true,
"requires": {
- "axios": "0.17.1",
- "debug": "2.6.9",
+ "axios": "0.19.0",
+ "debug": "4.1.1",
"openurl": "1.1.1",
"yargs": "6.6.0"
},
"dependencies": {
"axios": {
- "version": "0.17.1",
- "resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz",
- "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
+ "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"dev": true,
"requires": {
- "follow-redirects": "^1.2.5",
- "is-buffer": "^1.1.5"
+ "follow-redirects": "1.5.10",
+ "is-buffer": "^2.0.2"
}
},
"camelcase": {
@@ -10016,14 +10023,48 @@
"dev": true
},
"debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"requires": {
- "ms": "2.0.0"
+ "ms": "^2.1.1"
+ },
+ "dependencies": {
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ }
}
},
+ "follow-redirects": {
+ "version": "1.5.10",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
+ "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
+ "dev": true,
+ "requires": {
+ "debug": "=3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "is-buffer": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
+ "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==",
+ "dev": true
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -10434,23 +10475,29 @@
"ssri": "^6.0.0"
},
"dependencies": {
+ "bluebird": {
+ "version": "3.5.5",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
+ "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==",
+ "dev": true
+ },
"cacache": {
- "version": "11.3.2",
- "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
- "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
+ "version": "11.3.3",
+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
+ "integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
"dev": true,
"requires": {
- "bluebird": "^3.5.3",
+ "bluebird": "^3.5.5",
"chownr": "^1.1.1",
"figgy-pudding": "^3.5.1",
- "glob": "^7.1.3",
+ "glob": "^7.1.4",
"graceful-fs": "^4.1.15",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
- "rimraf": "^2.6.2",
+ "rimraf": "^2.6.3",
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
@@ -10467,6 +10514,20 @@
}
}
},
+ "glob": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
+ "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
"mississippi": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
@@ -12250,25 +12311,47 @@
},
"dependencies": {
"cacache": {
- "version": "11.3.2",
- "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz",
- "integrity": "sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==",
+ "version": "11.3.3",
+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
+ "integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
"dev": true,
"requires": {
- "bluebird": "^3.5.3",
+ "bluebird": "^3.5.5",
"chownr": "^1.1.1",
"figgy-pudding": "^3.5.1",
- "glob": "^7.1.3",
+ "glob": "^7.1.4",
"graceful-fs": "^4.1.15",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
- "rimraf": "^2.6.2",
+ "rimraf": "^2.6.3",
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
+ },
+ "dependencies": {
+ "bluebird": {
+ "version": "3.5.5",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
+ "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==",
+ "dev": true
+ },
+ "glob": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
+ "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
}
},
"get-stream": {
@@ -12327,18 +12410,18 @@
}
},
"tar": {
- "version": "4.4.8",
- "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz",
- "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
+ "version": "4.4.10",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz",
+ "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==",
"dev": true,
"requires": {
"chownr": "^1.1.1",
"fs-minipass": "^1.2.5",
- "minipass": "^2.3.4",
- "minizlib": "^1.1.1",
+ "minipass": "^2.3.5",
+ "minizlib": "^1.2.1",
"mkdirp": "^0.5.0",
"safe-buffer": "^5.1.2",
- "yallist": "^3.0.2"
+ "yallist": "^3.0.3"
}
},
"yallist": {
diff --git a/package.json b/package.json
index 05ce37b1df..038bab04c8 100644
--- a/package.json
+++ b/package.json
@@ -81,19 +81,19 @@
"@alfresco/adf-process-services-cloud": "3.3.0",
"@alfresco/adf-testing": "3.3.0",
"@alfresco/js-api": "3.3.0",
- "@angular/animations": "7.0.3",
- "@angular/cdk": "7.0.3",
- "@angular/common": "7.0.3",
- "@angular/compiler": "7.0.3",
- "@angular/core": "7.0.3",
- "@angular/flex-layout": "^7.0.0-beta.19",
- "@angular/forms": "7.0.3",
- "@angular/http": "7.0.3",
- "@angular/material": "7.0.3",
- "@angular/material-moment-adapter": "7.0.3",
- "@angular/platform-browser": "7.0.3",
- "@angular/platform-browser-dynamic": "7.0.3",
- "@angular/router": "7.0.3",
+ "@angular/animations": "^7.2.15",
+ "@angular/cdk": "7.3.7",
+ "@angular/common": "^7.2.15",
+ "@angular/compiler": "^7.2.15",
+ "@angular/core": "^7.2.15",
+ "@angular/flex-layout": "^7.0.0-beta.24",
+ "@angular/forms": "^7.2.15",
+ "@angular/http": "^7.2.15",
+ "@angular/material": "^7.3.7",
+ "@angular/material-moment-adapter": "^7.3.7",
+ "@angular/platform-browser": "^7.2.15",
+ "@angular/platform-browser-dynamic": "^7.2.15",
+ "@angular/router": "^7.2.15",
"@mat-datetimepicker/core": "^2.0.1",
"@mat-datetimepicker/moment": "^2.0.1",
"@ngx-translate/core": "^11.0.0",
@@ -121,8 +121,8 @@
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.4",
"@angular-devkit/build-ng-packagr": "~0.10.0",
- "@angular/cli": "^7.0.5",
- "@angular/compiler-cli": "^7.2.7",
+ "@angular/cli": "^7.3.9",
+ "@angular/compiler-cli": "^7.2.15",
"@nrwl/nx": "7.1.1",
"@nrwl/schematics": "7.1.1",
"@types/hammerjs": "2.0.35",
From 0d6140be77a6ea00918f19ab3520b456e1eebbc1 Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Tue, 2 Jul 2019 16:00:58 +0100
Subject: [PATCH 026/140] clean unit test (#4890)
* promote use setupTestbed
* fix comment using right spy and remove deprecated moment method usage
* restore md icon file
* remove error translation log
* restore extension test
---
.../name-location-cell.component.spec.ts | 15 ++--
.../file-uploading-list-row.component.spec.ts | 13 ++--
.../services/card-view-update.service.spec.ts | 13 ++--
lib/core/clipboard/clipboard.service.spec.ts | 27 ++++---
.../comments/comment-list.component.spec.ts | 8 +--
.../context-menu-holder.component.spec.ts | 37 +++++-----
.../context-menu-overlay.service.spec.ts | 13 ++--
lib/core/context-menu/context-menu.spec.ts | 23 +++---
lib/core/karma.conf.js | 2 +-
.../header/header.component.spec.ts | 13 ++--
.../sidebar-action-menu.component.spec.ts | 56 +++++++--------
lib/core/services/jwt-helper.service.spec.ts | 10 +--
lib/core/services/lock.service.spec.ts | 64 +++++++++--------
lib/core/services/log.service.spec.ts | 27 ++++---
.../services/notification.service.spec.ts | 72 +++++++++----------
.../tooltip/diagram-tooltip.component.spec.ts | 19 +++--
.../app-list-cloud.component.spec.ts | 22 ++----
17 files changed, 208 insertions(+), 226 deletions(-)
diff --git a/lib/content-services/content-node-selector/name-location-cell/name-location-cell.component.spec.ts b/lib/content-services/content-node-selector/name-location-cell/name-location-cell.component.spec.ts
index 11acdb8841..da0ac61d83 100644
--- a/lib/content-services/content-node-selector/name-location-cell/name-location-cell.component.spec.ts
+++ b/lib/content-services/content-node-selector/name-location-cell/name-location-cell.component.spec.ts
@@ -15,23 +15,22 @@
* limitations under the License.
*/
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NameLocationCellComponent } from './name-location-cell.component';
import { By } from '@angular/platform-browser';
import { DataRow } from '@alfresco/adf-core';
+import { setupTestBed } from '../../../core/testing/setupTestBed';
describe('NameLocationCellComponent', () => {
let component: NameLocationCellComponent;
let fixture: ComponentFixture;
let rowData: DataRow;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [
- NameLocationCellComponent
- ]
- }).compileComponents();
- }));
+ setupTestBed({
+ declarations: [
+ NameLocationCellComponent
+ ]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(NameLocationCellComponent);
diff --git a/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts b/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts
index fe6a28043e..4b367deb88 100644
--- a/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts
+++ b/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts
@@ -19,19 +19,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FileModel, CoreModule, FileUploadOptions, FileUploadStatus } from '@alfresco/adf-core';
import { UploadModule } from '../upload.module';
import { FileUploadingListRowComponent } from './file-uploading-list-row.component';
+import { setupTestBed } from '../../../core/testing/setupTestBed';
describe('FileUploadingListRowComponent', () => {
let fixture: ComponentFixture;
let component: FileUploadingListRowComponent;
const file = new FileModel( { name: 'fake-name' });
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [
- CoreModule.forRoot(),
- UploadModule
- ]
- }).compileComponents();
+ setupTestBed({
+ imports: [
+ CoreModule.forRoot(),
+ UploadModule
+ ]
});
beforeEach(() => {
diff --git a/lib/core/card-view/services/card-view-update.service.spec.ts b/lib/core/card-view/services/card-view-update.service.spec.ts
index a572b380a2..88472cd28a 100644
--- a/lib/core/card-view/services/card-view-update.service.spec.ts
+++ b/lib/core/card-view/services/card-view-update.service.spec.ts
@@ -18,6 +18,7 @@
import { async, TestBed } from '@angular/core/testing';
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
import { CardViewUpdateService, transformKeyToObject } from './card-view-update.service';
+import { setupTestBed } from '../../testing/setupTestBed';
describe('CardViewUpdateService', () => {
@@ -58,13 +59,11 @@ describe('CardViewUpdateService', () => {
clickable: false
};
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- providers: [
- CardViewUpdateService
- ]
- }).compileComponents();
- }));
+ setupTestBed({
+ providers: [
+ CardViewUpdateService
+ ]
+ });
beforeEach(() => {
cardViewUpdateService = TestBed.get(CardViewUpdateService);
diff --git a/lib/core/clipboard/clipboard.service.spec.ts b/lib/core/clipboard/clipboard.service.spec.ts
index 8c97214ddf..3760b5f7c9 100644
--- a/lib/core/clipboard/clipboard.service.spec.ts
+++ b/lib/core/clipboard/clipboard.service.spec.ts
@@ -26,26 +26,25 @@ import { AppConfigServiceMock } from '../mock/app-config.service.mock';
import { HttpClientModule } from '@angular/common/http';
import { MatSnackBarModule } from '@angular/material';
import { TranslationMock } from '@alfresco/adf-core';
+import { setupTestBed } from '../testing/setupTestBed';
describe('ClipboardService', () => {
let clipboardService: ClipboardService;
let notificationService: NotificationService;
let inputElement;
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [
- ClipboardModule,
- HttpClientModule,
- MatSnackBarModule
- ],
- providers: [
- LogService,
- { provide: TranslationService, useClass: TranslationMock },
- { provide: AppConfigService, useClass: AppConfigServiceMock },
- NotificationService
- ]
- });
+ setupTestBed({
+ imports: [
+ ClipboardModule,
+ HttpClientModule,
+ MatSnackBarModule
+ ],
+ providers: [
+ LogService,
+ { provide: TranslationService, useClass: TranslationMock },
+ { provide: AppConfigService, useClass: AppConfigServiceMock },
+ NotificationService
+ ]
});
beforeEach(() => {
diff --git a/lib/core/comments/comment-list.component.spec.ts b/lib/core/comments/comment-list.component.spec.ts
index fd23166c78..4fc4180482 100644
--- a/lib/core/comments/comment-list.component.spec.ts
+++ b/lib/core/comments/comment-list.component.spec.ts
@@ -117,10 +117,10 @@ describe('CommentListComponent', () => {
beforeEach(async(() => {
ecmUserService = TestBed.get(EcmUserService);
- spyOn(ecmUserService, 'getUserProfileImage').and.returnValue('content-user-image');
+ spyOn(ecmUserService, 'getUserProfileImage').and.returnValue('alfresco-logo.svg');
peopleProcessService = TestBed.get(PeopleProcessService);
- spyOn(peopleProcessService, 'getUserImage').and.returnValue('process-user-image');
+ spyOn(peopleProcessService, 'getUserImage').and.returnValue('alfresco-logo.svg');
fixture = TestBed.createComponent(CommentListComponent);
commentList = fixture.componentInstance;
@@ -259,7 +259,7 @@ describe('CommentListComponent', () => {
fixture.whenStable().then(() => {
const elements = fixture.nativeElement.querySelectorAll('.adf-people-img');
expect(elements.length).toBe(1);
- expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('content-user-image');
+ expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('alfresco-logo.svg');
});
}));
@@ -270,7 +270,7 @@ describe('CommentListComponent', () => {
fixture.whenStable().then(() => {
const elements = fixture.nativeElement.querySelectorAll('.adf-people-img');
expect(elements.length).toBe(1);
- expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('process-user-image');
+ expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('alfresco-logo.svg');
});
}));
diff --git a/lib/core/context-menu/context-menu-holder.component.spec.ts b/lib/core/context-menu/context-menu-holder.component.spec.ts
index e64cef1407..6206e25794 100644
--- a/lib/core/context-menu/context-menu-holder.component.spec.ts
+++ b/lib/core/context-menu/context-menu-holder.component.spec.ts
@@ -23,6 +23,7 @@ import { ContextMenuModule } from './context-menu.module';
import { ContextMenuService } from './context-menu.service';
import { CoreModule } from '../core.module';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
+import { setupTestBed } from '../testing/setupTestBed';
describe('ContextMenuHolderComponent', () => {
let fixture: ComponentFixture;
@@ -52,25 +53,25 @@ describe('ContextMenuHolderComponent', () => {
})
};
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [
- NoopAnimationsModule,
- CoreModule.forRoot(),
- ContextMenuModule
- ],
- providers: [
- {
- provide: OverlayContainer,
- useValue: overlayContainer
- },
- {
- provide: ViewportRuler,
- useValue: getViewportRect
- }
- ]
- });
+ setupTestBed({
+ imports: [
+ NoopAnimationsModule,
+ CoreModule.forRoot(),
+ ContextMenuModule
+ ],
+ providers: [
+ {
+ provide: OverlayContainer,
+ useValue: overlayContainer
+ },
+ {
+ provide: ViewportRuler,
+ useValue: getViewportRect
+ }
+ ]
+ });
+ beforeEach(() => {
fixture = TestBed.createComponent(ContextMenuHolderComponent);
component = fixture.componentInstance;
contextMenuService = TestBed.get(ContextMenuService);
diff --git a/lib/core/context-menu/context-menu-overlay.service.spec.ts b/lib/core/context-menu/context-menu-overlay.service.spec.ts
index 13df9279a1..6f96d4e3f9 100644
--- a/lib/core/context-menu/context-menu-overlay.service.spec.ts
+++ b/lib/core/context-menu/context-menu-overlay.service.spec.ts
@@ -15,12 +15,13 @@
* limitations under the License.
*/
-import { TestBed } from '@angular/core/testing';
import { Overlay } from '@angular/cdk/overlay';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { CoreTestingModule } from '../testing/core.testing.module';
import { ContextMenuOverlayService } from './context-menu-overlay.service';
import { Injector } from '@angular/core';
+import { setupTestBed } from '../testing/setupTestBed';
+import { TestBed } from '@angular/core/testing';
describe('ContextMenuService', () => {
let contextMenuOverlayService: ContextMenuOverlayService;
@@ -34,12 +35,12 @@ describe('ContextMenuService', () => {
}
};
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [NoopAnimationsModule, CoreTestingModule],
- providers: [ Overlay ]
- });
+ setupTestBed({
+ imports: [NoopAnimationsModule, CoreTestingModule],
+ providers: [ Overlay ]
+ });
+ beforeEach(() => {
overlay = TestBed.get(Overlay);
injector = TestBed.get(Injector);
});
diff --git a/lib/core/context-menu/context-menu.spec.ts b/lib/core/context-menu/context-menu.spec.ts
index 5a3a20bb2c..b266a830d1 100644
--- a/lib/core/context-menu/context-menu.spec.ts
+++ b/lib/core/context-menu/context-menu.spec.ts
@@ -20,6 +20,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
import { ContextMenuModule } from './context-menu.module';
import { CoreModule } from '../core.module';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
+import { setupTestBed } from '../testing/setupTestBed';
@Component({
selector: 'adf-test-component',
@@ -78,18 +79,18 @@ describe('ContextMenuDirective', () => {
}
];
- beforeEach(() => {
- TestBed.configureTestingModule({
- imports: [
- CoreModule.forRoot(),
- ContextMenuModule,
- NoopAnimationsModule
- ],
- declarations: [
- TestComponent
- ]
- });
+ setupTestBed({
+ imports: [
+ CoreModule.forRoot(),
+ ContextMenuModule,
+ NoopAnimationsModule
+ ],
+ declarations: [
+ TestComponent
+ ]
+ });
+ beforeEach(() => {
fixture = TestBed.createComponent(TestComponent);
fixture.componentInstance.actions = actions;
fixture.detectChanges();
diff --git a/lib/core/karma.conf.js b/lib/core/karma.conf.js
index a46e16d80e..47c44d0143 100644
--- a/lib/core/karma.conf.js
+++ b/lib/core/karma.conf.js
@@ -18,7 +18,6 @@ module.exports = function (config) {
{pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js.map', included: false, watched: false},
{pattern: 'node_modules/pdfjs-dist/build/pdf.worker.min.js', included: true, watched: false, served: true},
{pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false},
-
{
pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css',
included: true,
@@ -56,6 +55,7 @@ module.exports = function (config) {
'/base/assets/' :'/base/lib/core/assets/',
'/assets/adf-core/i18n/en.json': '/base/lib/core/i18n/en.json',
'/assets/adf-core/i18n/en-GB.json': '/base/lib/core/i18n/en.json',
+ '/assets/adf-core/i18n/en-US.json': '/base/lib/core/i18n/en.json',
'/app.config.json': '/base/lib/config/app.config.json',
'/fake-test-file.pdf': '/base/lib/core/viewer/assets/fake-test-file.pdf',
'/fake-test-file.txt': '/base/lib/core/viewer/assets/fake-test-file.txt',
diff --git a/lib/core/layout/components/header/header.component.spec.ts b/lib/core/layout/components/header/header.component.spec.ts
index 37f51524cd..3242d853ee 100644
--- a/lib/core/layout/components/header/header.component.spec.ts
+++ b/lib/core/layout/components/header/header.component.spec.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { ComponentFixture, TestBed, async } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HeaderLayoutComponent } from './header.component';
import { setupTestBed } from '../../../testing/setupTestBed';
import { CoreTestingModule } from '../../../testing/core.testing.module';
@@ -151,13 +151,10 @@ describe('HeaderLayoutComponent', () => {
})
class HeaderLayoutTesterComponent {}
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [HeaderLayoutTesterComponent],
- imports: [ CoreTestingModule, LayoutModule, MaterialModule, RouterTestingModule ]
- })
- .compileComponents();
- }));
+ setupTestBed({
+ declarations: [HeaderLayoutTesterComponent],
+ imports: [ CoreTestingModule, LayoutModule, MaterialModule, RouterTestingModule ]
+ });
it('should project the provided nodes into the component', () => {
const hostFixture = TestBed.createComponent(HeaderLayoutTesterComponent);
diff --git a/lib/core/layout/components/sidebar-action/sidebar-action-menu.component.spec.ts b/lib/core/layout/components/sidebar-action/sidebar-action-menu.component.spec.ts
index 9417e9e306..4634444800 100644
--- a/lib/core/layout/components/sidebar-action/sidebar-action-menu.component.spec.ts
+++ b/lib/core/layout/components/sidebar-action/sidebar-action-menu.component.spec.ts
@@ -16,7 +16,7 @@
*/
import { Component } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MaterialModule } from '../../../material.module';
import { SidebarActionMenuComponent } from './sidebar-action-menu.component';
import { setupTestBed } from '../../../testing/setupTestBed';
@@ -57,23 +57,23 @@ describe('SidebarActionMenuComponent', () => {
@Component({
template: `
-
- arrow_drop_down
-
- queue
-
-
-
-
-
-
- `
+
+ arrow_drop_down
+
+ queue
+
+
+
+
+
+
+ `
})
class CustomSidebarActionMenuComponent {
title: string = 'Fake title';
@@ -85,17 +85,15 @@ describe('Custom SidebarActionMenuComponent', () => {
let component: CustomSidebarActionMenuComponent;
let element: HTMLElement;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [
- SidebarActionMenuComponent,
- CustomSidebarActionMenuComponent
- ],
- imports: [
- MaterialModule
- ]
- }).compileComponents();
- }));
+ setupTestBed({
+ declarations: [
+ SidebarActionMenuComponent,
+ CustomSidebarActionMenuComponent
+ ],
+ imports: [
+ MaterialModule
+ ]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(CustomSidebarActionMenuComponent);
diff --git a/lib/core/services/jwt-helper.service.spec.ts b/lib/core/services/jwt-helper.service.spec.ts
index 73858dd806..f5b0d57d71 100644
--- a/lib/core/services/jwt-helper.service.spec.ts
+++ b/lib/core/services/jwt-helper.service.spec.ts
@@ -15,18 +15,20 @@
* limitations under the License.
*/
-import { TestBed } from '@angular/core/testing';
import { JwtHelperService } from './jwt-helper.service';
import { mockToken } from './../mock/jwt-helper.service.spec';
+import { setupTestBed } from '../testing/setupTestBed';
+import { TestBed } from '@angular/core/testing';
describe('JwtHelperService', () => {
let jwtHelperService: JwtHelperService;
+ setupTestBed({
+ providers: [JwtHelperService]
+ });
+
beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [JwtHelperService]
- });
jwtHelperService = TestBed.get(JwtHelperService);
});
diff --git a/lib/core/services/lock.service.spec.ts b/lib/core/services/lock.service.spec.ts
index 53ce615a88..c9328e83b6 100644
--- a/lib/core/services/lock.service.spec.ts
+++ b/lib/core/services/lock.service.spec.ts
@@ -60,8 +60,10 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- { 'cm:lockType': 'READ_ONLY_LOCK',
- 'cm:lockLifetime': 'PERSISTENT' }
+ {
+ 'cm:lockType': 'READ_ONLY_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT'
+ }
};
const nodeReadOnlyWithExpiredDate: Node = {
@@ -69,12 +71,12 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- {
- 'cm:lockType': 'WRITE_LOCK',
- 'cm:lockLifetime': 'PERSISTENT',
- 'cm:lockOwner': { id: 'lock-owner-user' },
- 'cm:expiryDate': moment().subtract('days', '4')
- }
+ {
+ 'cm:lockType': 'WRITE_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT',
+ 'cm:lockOwner': { id: 'lock-owner-user' },
+ 'cm:expiryDate': moment().subtract(4, 'days')
+ }
};
const nodeReadOnlyWithActiveExpiration: Node = {
@@ -82,12 +84,12 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- {
- 'cm:lockType': 'WRITE_LOCK',
- 'cm:lockLifetime': 'PERSISTENT',
- 'cm:lockOwner': { id: 'lock-owner-user' },
- 'cm:expiryDate': moment().add('days', '4')
- }
+ {
+ 'cm:lockType': 'WRITE_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT',
+ 'cm:lockOwner': { id: 'lock-owner-user' },
+ 'cm:expiryDate': moment().add(4, 'days')
+ }
};
it('should return true when readonly lock is active', () => {
@@ -109,11 +111,11 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- {
- 'cm:lockType': 'WRITE_LOCK',
- 'cm:lockLifetime': 'PERSISTENT',
- 'cm:lockOwner': { id: 'lock-owner-user' }
- }
+ {
+ 'cm:lockType': 'WRITE_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT',
+ 'cm:lockOwner': { id: 'lock-owner-user' }
+ }
};
const nodeOwnerAllowedLockWithExpiredDate: Node = {
@@ -121,12 +123,12 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- {
- 'cm:lockType': 'WRITE_LOCK',
- 'cm:lockLifetime': 'PERSISTENT',
- 'cm:lockOwner': { id: 'lock-owner-user' },
- 'cm:expiryDate': moment().subtract('days', '4')
- }
+ {
+ 'cm:lockType': 'WRITE_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT',
+ 'cm:lockOwner': { id: 'lock-owner-user' },
+ 'cm:expiryDate': moment().subtract(4, 'days')
+ }
};
const nodeOwnerAllowedLockWithActiveExpiration: Node = {
@@ -134,12 +136,12 @@ describe('PeopleProcessService', () => {
isLocked: true,
isFile: true,
properties:
- {
- 'cm:lockType': 'WRITE_LOCK',
- 'cm:lockLifetime': 'PERSISTENT',
- 'cm:lockOwner': { id: 'lock-owner-user' },
- 'cm:expiryDate': moment().add('days', '4')
- }
+ {
+ 'cm:lockType': 'WRITE_LOCK',
+ 'cm:lockLifetime': 'PERSISTENT',
+ 'cm:lockOwner': { id: 'lock-owner-user' },
+ 'cm:expiryDate': moment().add(4, 'days')
+ }
};
it('should return false when the user is the lock owner', () => {
diff --git a/lib/core/services/log.service.spec.ts b/lib/core/services/log.service.spec.ts
index d8deda5740..c73dcd4d01 100644
--- a/lib/core/services/log.service.spec.ts
+++ b/lib/core/services/log.service.spec.ts
@@ -17,9 +17,10 @@
import { HttpClientModule } from '@angular/common/http';
import { Component } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService } from '../app-config/app-config.service';
import { LogService } from './log.service';
+import { setupTestBed } from '../testing/setupTestBed';
@Component({
template: '',
@@ -61,20 +62,16 @@ describe('Log Service', () => {
let providesLogComponent: ComponentFixture;
let appConfigService: AppConfigService;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [
- HttpClientModule
- ],
- declarations: [ProvidesLogComponent],
- providers: [
- LogService,
- AppConfigService
- ]
- });
-
- TestBed.compileComponents();
- }));
+ setupTestBed({
+ imports: [
+ HttpClientModule
+ ],
+ declarations: [ProvidesLogComponent],
+ providers: [
+ LogService,
+ AppConfigService
+ ]
+ });
beforeEach(() => {
appConfigService = TestBed.get(AppConfigService);
diff --git a/lib/core/services/notification.service.spec.ts b/lib/core/services/notification.service.spec.ts
index fba92dbce9..d0e82a4f9e 100644
--- a/lib/core/services/notification.service.spec.ts
+++ b/lib/core/services/notification.service.spec.ts
@@ -18,7 +18,7 @@
import { LiveAnnouncer } from '@angular/cdk/a11y';
import { OVERLAY_PROVIDERS, OverlayModule } from '@angular/cdk/overlay';
import { Component } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatSnackBar, MatSnackBarModule, MatSnackBarConfig } from '@angular/material';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -26,6 +26,7 @@ import { NotificationService } from './notification.service';
import { TranslationMock } from '../mock/translation.service.mock';
import { TranslationService } from './translation.service';
import { HttpClientModule } from '@angular/common/http';
+import { setupTestBed } from '../testing/setupTestBed';
@Component({
template: '',
@@ -37,33 +38,33 @@ class ProvidesNotificationServiceComponent {
}
sendMessageWithoutConfig() {
- const promise = this.notificationService.openSnackMessage('Test notification', 1000);
- return promise;
+ return this.notificationService.openSnackMessage('Test notification', 1000);
}
sendMessage() {
- const promise = this.notificationService.openSnackMessage('Test notification', 1000);
- return promise;
+ return this.notificationService.openSnackMessage('Test notification', 1000);
}
sendCustomMessage() {
- const promise = this.notificationService.openSnackMessage('Test notification', new MatSnackBarConfig());
- return promise;
+ const matSnackBarConfig = new MatSnackBarConfig();
+ matSnackBarConfig.duration = 1000;
+
+ return this.notificationService.openSnackMessage('Test notification', matSnackBarConfig);
}
sendMessageActionWithoutConfig() {
- const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000);
- return promise;
+ return this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000);
}
sendMessageAction() {
- const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000);
- return promise;
+ return this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000);
}
sendCustomMessageAction() {
- const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', new MatSnackBarConfig());
- return promise;
+ const matSnackBarConfig = new MatSnackBarConfig();
+ matSnackBarConfig.duration = 1000;
+
+ return this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', matSnackBarConfig);
}
}
@@ -72,28 +73,25 @@ describe('NotificationService', () => {
let fixture: ComponentFixture;
let translationService: TranslationService;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [
- NoopAnimationsModule,
- OverlayModule,
- MatSnackBarModule,
- HttpClientModule
- ],
- declarations: [ProvidesNotificationServiceComponent],
- providers: [
- NotificationService,
- MatSnackBar,
- OVERLAY_PROVIDERS,
- LiveAnnouncer,
- { provide: TranslationService, useClass: TranslationMock }
- ]
- });
-
- translationService = TestBed.get(TranslationService);
- }));
+ setupTestBed({
+ imports: [
+ NoopAnimationsModule,
+ OverlayModule,
+ MatSnackBarModule,
+ HttpClientModule
+ ],
+ declarations: [ProvidesNotificationServiceComponent],
+ providers: [
+ NotificationService,
+ MatSnackBar,
+ OVERLAY_PROVIDERS,
+ LiveAnnouncer,
+ { provide: TranslationService, useClass: TranslationMock }
+ ]
+ });
beforeEach(() => {
+ translationService = TestBed.get(TranslationService);
fixture = TestBed.createComponent(ProvidesNotificationServiceComponent);
fixture.detectChanges();
});
@@ -132,7 +130,7 @@ describe('NotificationService', () => {
expect(document.querySelector('snack-bar-container')).not.toBeNull();
});
- it('should open a message notification bar with custom configuration', async((done) => {
+ it('should open a message notification bar with custom configuration', (done) => {
const promise = fixture.componentInstance.sendCustomMessage();
promise.afterDismissed().subscribe(() => {
done();
@@ -141,7 +139,7 @@ describe('NotificationService', () => {
fixture.detectChanges();
expect(document.querySelector('snack-bar-container')).not.toBeNull();
- }));
+ });
it('should open a message notification bar with action', (done) => {
const promise = fixture.componentInstance.sendMessageAction();
@@ -154,7 +152,7 @@ describe('NotificationService', () => {
expect(document.querySelector('snack-bar-container')).not.toBeNull();
});
- it('should open a message notification bar with action and custom configuration', async((done) => {
+ it('should open a message notification bar with action and custom configuration', (done) => {
const promise = fixture.componentInstance.sendCustomMessageAction();
promise.afterDismissed().subscribe(() => {
done();
@@ -163,7 +161,7 @@ describe('NotificationService', () => {
fixture.detectChanges();
expect(document.querySelector('snack-bar-container')).not.toBeNull();
- }));
+ });
it('should open a message notification bar with action and no custom configuration', (done) => {
const promise = fixture.componentInstance.sendMessageActionWithoutConfig();
diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts
index 7a18134ff4..00e779d07f 100644
--- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts
+++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts
@@ -16,9 +16,10 @@
*/
import { Component } from '@angular/core';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DiagramTooltipComponent } from './diagram-tooltip.component';
+import { setupTestBed } from '../../../../core/testing/setupTestBed';
@Component({
template: `
@@ -39,11 +40,9 @@ describe('DiagramTooltipComponent', () => {
let component: DiagramTooltipComponent;
let data;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [DiagramTooltipComponent]
- }).compileComponents();
- }));
+ setupTestBed({
+ declarations: [DiagramTooltipComponent]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(DiagramTooltipComponent);
@@ -127,11 +126,9 @@ describe('DiagramTooltipComponent', () => {
let fixture: ComponentFixture;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [DiagramTooltipComponent, TestHostComponent]
- }).compileComponents();
- }));
+ setupTestBed({
+ declarations: [DiagramTooltipComponent, TestHostComponent]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(TestHostComponent);
diff --git a/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.spec.ts
index eb89b3832b..86ba05eb78 100644
--- a/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.spec.ts
@@ -40,21 +40,13 @@ describe('AppListCloudComponent', () => {
}
};
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [CoreModule.forRoot(), ProcessServiceCloudTestingModule, AppListCloudModule],
- providers: [
- AppsProcessCloudService
- ]
- })
- .overrideComponent(AppListCloudComponent, {
- set: {
- providers: [
- { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
- ]
- }
- }).compileComponents();
- }));
+ setupTestBed({
+ imports: [CoreModule.forRoot(), ProcessServiceCloudTestingModule, AppListCloudModule],
+ providers: [
+ AppsProcessCloudService,
+ { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
+ ]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(AppListCloudComponent);
From 4d0c98d753200445321241c127d775c29c780152 Mon Sep 17 00:00:00 2001
From: Geeta Mandakini Ayyalasomayajula
<45559635+gmandakini@users.noreply.github.com>
Date: Tue, 2 Jul 2019 22:00:14 +0100
Subject: [PATCH 027/140] [ADF-4697] attach content to processcloudtaskform
using upload widget (#4882)
* automated upload local and content file from task from upload widget.
* automated upload local and content file from task from upload widget.
* reverting the git ignore change
* updated the app with the new process definition using the form with upload widgets
* Save error screenshot
* creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud
* creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud
* removed the wait till clickable, as not relevant here.
* Update process-services-cloud-e2e.sh
---
.../breadcrumb/breadCrumbDropdownPage.ts | 5 +
.../start-task-form-cloud.e2e.ts | 303 +++++++++++++++++-
e2e/resources/activiti7/candidatebaseapp.zip | Bin 5976 -> 9206 bytes
.../content-node-selector-dialog.page.ts | 8 +
.../core/pages/data-table-component.page.ts | 13 +
.../form/widgets/attachFileWidgetCloud.ts | 94 ++++++
.../src/lib/core/pages/form/widgets/widget.ts | 5 +
.../src/lib/core/pages/settings.page.ts | 17 +
.../pages/task-form-cloud-component.page.ts | 5 +
.../pages/task-list-cloud-component.page.ts | 4 +
10 files changed, 444 insertions(+), 10 deletions(-)
create mode 100644 lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts
diff --git a/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts b/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts
index 0504bed96e..caa2995796 100644
--- a/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts
+++ b/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts
@@ -23,6 +23,7 @@ export class BreadCrumbDropdownPage {
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
breadCrumbDropdown = element(by.css(`div[class*='mat-select-panel']`));
+ currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
choosePath(pathName) {
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
@@ -38,4 +39,8 @@ export class BreadCrumbDropdownPage {
checkBreadCrumbDropdownIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
}
+
+ getTextOfCurrentFolder() {
+ return BrowserActions.getText(this.currentFolder);
+ }
}
diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
index 0eb5ac0d17..e846fe22f5 100644
--- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts
@@ -28,12 +28,25 @@ import {
SettingsPage,
GroupIdentityService,
TaskFormCloudComponent,
- Widget, LocalStorageUtil, StartProcessCloudPage, TaskHeaderCloudPage, ProcessHeaderCloudPage, TasksService
+ Widget,
+ LocalStorageUtil,
+ StartProcessCloudPage,
+ TaskHeaderCloudPage,
+ ProcessHeaderCloudPage,
+ TasksService,
+ UploadActions,
+ ContentNodeSelectorDialogPage,
+ ProcessInstancesService,
+ ProcessDefinitionsService
} from '@alfresco/adf-testing';
import resources = require('../util/resources');
import { StartProcessCloudConfiguration } from './config/start-process-cloud.config';
import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage';
import { ProcessDetailsCloudDemoPage } from '../pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage';
+import { FileModel } from '../models/ACS/fileModel';
+import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
+import { AcsUserModel } from '../models/ACS/acsUserModel';
+import { BreadCrumbDropdownPage } from '../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage';
describe('Start Task Form', () => {
@@ -43,6 +56,8 @@ describe('Start Task Form', () => {
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();
const startTask = new StartTasksCloudPage();
+ const contentNodeSelectorDialogPage = new ContentNodeSelectorDialogPage();
+ const breadCrumbDropdownPage = new BreadCrumbDropdownPage();
const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage();
const settingsPage = new SettingsPage();
const widget = new Widget();
@@ -54,18 +69,39 @@ describe('Start Task Form', () => {
browser.params.config.oauth2.clientId,
browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
);
+ this.alfrescoJsApi = new AlfrescoApi({
+ provider: 'ECM',
+ hostEcm: browser.params.config.bpmHost
+ });
+ const uploadActions = new UploadActions(this.alfrescoJsApi);
+
const startProcessCloudConfiguration = new StartProcessCloudConfiguration();
const startProcessCloudConfig = startProcessCloudConfiguration.getConfiguration();
const standaloneTaskName = StringUtil.generateRandomString(5);
const startEventFormProcess = StringUtil.generateRandomString(5);
- let testUser, groupInfo, processId, taskId;
+ let testUser, acsUser, groupInfo;
+ let processDefinitionService: ProcessDefinitionsService;
+ let processInstancesService: ProcessInstancesService;
+ let processDefinition, uploadLocalFileProcess, uploadContentFileProcess, uploadDefaultFileProcess, cancelUploadFileProcess, completeUploadFileProcess;
const candidateBaseApp = resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name;
+ const pdfFile = new FileModel({'name': resources.Files.ADF_DOCUMENTS.PDF.file_name});
+ const pdfFileModel = new FileModel({
+ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
+ 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
+ });
+ const testFileModel = new FileModel({
+ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
+ 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
+ });
let identityService: IdentityService;
let groupIdentityService: GroupIdentityService;
+ const folderName = StringUtil.generateRandomString(5);
+ let uploadedFolder;
beforeAll(async (done) => {
+
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
@@ -73,12 +109,58 @@ describe('Start Task Form', () => {
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
- await apiService.login(testUser.email, testUser.password);
- await settingsPage.setProviderBpmSso(
+ await apiService.login(testUser.email, testUser.password);
+ processDefinitionService = new ProcessDefinitionsService(apiService);
+ processInstancesService = new ProcessInstancesService(apiService);
+ processDefinition = await processDefinitionService.getProcessDefinitionByName('uploadFileProcess', candidateBaseApp);
+ await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
+
+ uploadLocalFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ uploadContentFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ uploadDefaultFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ cancelUploadFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ completeUploadFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
+ 'name': StringUtil.generateRandomString(),
+ 'businessKey': StringUtil.generateRandomString()
+ });
+
+ acsUser = await new AcsUserModel({
+ email: testUser.email,
+ password: testUser.password,
+ id: testUser.username,
+ firstName: testUser.firstName,
+ lastName: testUser.lastName
+ });
+ await this.alfrescoJsApi.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
+ await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
+ uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
+ await uploadActions.uploadFile(testFileModel.location, testFileModel.name, uploadedFolder.entry.id);
+ await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id);
+
+ await settingsPage.setProviderEcmBpmSso(
+ browser.params.config.bpmHost,
browser.params.config.bpmHost,
browser.params.config.oauth2.host,
- browser.params.config.identityHost);
+ browser.params.config.identityHost,
+ 'alfresco');
loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
await LocalStorageUtil.setConfigField('adf-cloud-start-process', JSON.stringify(startProcessCloudConfig));
done();
@@ -86,11 +168,12 @@ describe('Start Task Form', () => {
afterAll(async (done) => {
try {
+ await this.alfrescoJsApi.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await apiService.login(testUser.email, testUser.password);
const tasksService = new TasksService(apiService);
- const taskID = await tasksService.getTaskId(standaloneTaskName, candidateBaseApp);
- await tasksService.deleteTask(taskID, candidateBaseApp);
- await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
+ const standAloneTaskId = await tasksService.getTaskId(standaloneTaskName, candidateBaseApp);
+ await tasksService.deleteTask(standAloneTaskId, candidateBaseApp);
await identityService.deleteIdentityUser(testUser.idIdentityService);
} catch (error) {
}
@@ -154,6 +237,7 @@ describe('Start Task Form', () => {
startProcessPage.selectFromProcessDropdown('processwithstarteventform');
startProcessPage.formFields().checkFormIsDisplayed();
});
+
it('[C311277] Should be able to start a process with a start event form - default values', async () => {
expect(widget.textWidget().getFieldValue('FirstName')).toBe('sample name');
@@ -191,10 +275,10 @@ describe('Start Task Form', () => {
processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', startEventFormProcess);
processDetailsCloudDemoPage.checkTaskIsDisplayed('StartEventFormTask');
- processId = await processHeaderCloud.getId();
+ const processId = await processHeaderCloud.getId();
processDetailsCloudDemoPage.selectProcessTaskByName('StartEventFormTask');
taskFormCloudComponent.clickClaimButton();
- taskId = await taskHeaderCloudPage.getId();
+ const taskId = await taskHeaderCloudPage.getId();
taskFormCloudComponent.checkCompleteButtonIsDisplayed().clickCompleteButton();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId);
@@ -208,4 +292,203 @@ describe('Start Task Form', () => {
});
});
+
+ describe('Attach content to process-cloud task form using upload widget', async () => {
+
+ beforeEach(async (done) => {
+ navigationBarPage.navigateToProcessServicesCloudPage();
+ appListCloudComponent.checkApsContainer();
+ appListCloudComponent.checkAppIsDisplayed(candidateBaseApp);
+ appListCloudComponent.goToApp(candidateBaseApp);
+ processCloudDemoPage.clickOnProcessFilters();
+ processCloudDemoPage.runningProcessesFilter().clickProcessFilter();
+ processCloudDemoPage.processListCloudComponent().checkProcessListIsLoaded();
+ done();
+ });
+
+ it('[C310358] Should be able to attach a file to a form from local', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadLocalFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadLocalFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+ taskFormCloudComponent.clickClaimButton();
+
+ const localFileWidget = widget.attachFileWidgetCloud('Attachlocalfile');
+ browser.sleep(5000);
+ localFileWidget.attachLocalFile(pdfFile.location);
+ localFileWidget.checkFileIsAttached(pdfFile.name);
+ localFileWidget.removeFile(pdfFile.name);
+ localFileWidget.checkFileIsNotAttached(pdfFile.name);
+ });
+
+ it('[C311285] Should be able to attach a file to a form from acs repository', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+ taskFormCloudComponent.clickClaimButton();
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+
+ contentNodeSelectorDialogPage.clickMoveCopyButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.removeFile(testFileModel.name);
+ contentFileWidget.checkFileIsNotAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsDisplayed('Attachsinglecontentfile');
+ });
+
+ it('[C311287] Content node selector default location when attaching a file to a form from acs repository', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadDefaultFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadDefaultFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+ taskFormCloudComponent.clickClaimButton();
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ expect(breadCrumbDropdownPage.getTextOfCurrentFolder()).toBe(testUser.username);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowContentIsDisplayed(folderName);
+ expect(contentNodeSelectorDialogPage.checkCancelButtonIsEnabled()).toBe(true);
+ expect(contentNodeSelectorDialogPage.checkCopyMoveButtonIsEnabled()).toBe(false);
+
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(folderName);
+ expect(contentNodeSelectorDialogPage.checkCancelButtonIsEnabled()).toBe(true);
+ expect(contentNodeSelectorDialogPage.checkCopyMoveButtonIsEnabled()).toBe(false);
+ contentNodeSelectorDialogPage.clickCancelButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+ });
+
+ it('[C311288] No file should be attached when canceling the content node selector', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(cancelUploadFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', cancelUploadFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+ taskFormCloudComponent.clickClaimButton();
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowContentIsDisplayed(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+
+ contentNodeSelectorDialogPage.clickCancelButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+ contentFileWidget.checkFileIsNotAttached(testFileModel.name);
+ });
+
+ it('[C311289] Should be able to attach single file', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+
+ contentNodeSelectorDialogPage.clickMoveCopyButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ });
+
+ it('[C311292] Attached file is not displayed anymore after release if the form is not saved', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+
+ contentNodeSelectorDialogPage.clickMoveCopyButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ taskFormCloudComponent.clickReleaseButton();
+ taskFormCloudComponent.clickClaimButton();
+ contentFileWidget.checkFileIsNotAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsDisplayed('Attachsinglecontentfile');
+ });
+
+ it('[C311293] Attached file is displayed after release if the form was saved', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+ contentNodeSelectorDialogPage.clickMoveCopyButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ taskFormCloudComponent.clickSaveButton();
+ taskFormCloudComponent.clickReleaseButton();
+ taskFormCloudComponent.clickClaimButton();
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ });
+
+ it('[C311295] Attached file is displayed after complete', async () => {
+ processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(completeUploadFileProcess.entry.name);
+ processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', completeUploadFileProcess.entry.name);
+ processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask');
+ processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask');
+ taskFormCloudComponent.clickClaimButton();
+
+ const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile');
+ contentFileWidget.clickAttachContentFile('Attachsinglecontentfile');
+ contentNodeSelectorDialogPage.checkDialogIsDisplayed();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded();
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name);
+ contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name);
+ contentNodeSelectorDialogPage.clickMoveCopyButton();
+ contentNodeSelectorDialogPage.checkDialogIsNotDisplayed();
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ const taskId = await taskHeaderCloudPage.getId();
+ taskFormCloudComponent.checkCompleteButtonIsDisplayed().clickCompleteButton();
+ expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId);
+
+ tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
+ tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId);
+ tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId);
+ contentFileWidget.checkFileIsAttached(testFileModel.name);
+ contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile');
+ });
+ });
});
diff --git a/e2e/resources/activiti7/candidatebaseapp.zip b/e2e/resources/activiti7/candidatebaseapp.zip
index 318d6be329b32b7d54aca0a95481ffc5cee71713..5df5689ba428776b1047e36b78c0eb31b04c2557 100644
GIT binary patch
literal 9206
zcmb7}1yodP*T?CS?(PynN;-#l14&0q}w5+q)|#hx{>Y%LAr!*(EDD|
z^dHBNK+R8Gr7o~*_)n_jEX>rcZb{+Yr!szDS>%;XlF>m1${@b&H-QUypw{
zvo0$Ne>GLNC9PbtsU&ozZe%qDVY5_L>*ld{{Y`fx+ez$zRtOvoDrHx8nFpQwjVUq2P&y
zLVz?p7Zg`qIh%Z5NF^VGz@p>5#C@SnOc9E*5l(u;=@upUaaKoUgb2*QLTRU`O$-I8
z&OBBl#*{0O={0K^We0ASQkrI9AY*b;mjMNJHoSC(ntmpxTFZ;vDq-D9Uj&fgNktKV
zO0O%Dy)=o+d70VX-WOt|=bN76Va1OL=V}OAxKAtYiF>5V%^^o-#$hkuD#M?0)j=f^
zv?2-k^N7E*6|AE1%zogqOZ=)h7S3eckaMlF@1u`Mo3n~6@Z3R_Iq4qx{GnP0QuCaq
zNL@40c#X@f^K8i#i&i6gU84dN1CPWS#zhc%>9NkfnOOdr#p$D+F%6LK1Z&pmI30|rEG<>=9Zm
zn!oZQH5eCeEOz{2JctR)&39c5TAb2y*Hk5}eO?2d7D^0I0VSi9FoE~pDQCZuUyK{)
zeosMtHfIF_*$HPN4qM+$qwjgbo;UNz2=0HIMrt+|*7`_Uvcrs@mKa;6bkaH;vma^*EuhBY5Lq)CIoFsG%`cfzT0h;yVW2l&aeo
zS-6I4TNwR_#@&g?NZH#+fm6(T@b7I`i{6MzjCo%J`25sa=1dZG#u*3Iv@463Eg6nU
z>#A0>hBakIO$)3ZlAcfws3gv|)5WG4bE3D}!M!}PDvuA%2k4!GF=iF~Xv$Wz+zpN-
zFYRS1(~A@IxO$xiHE`afOvC~QQ_Ash5j~RRDHGh#xEJG1El7P=i$9~|gtLw1RQoxD
zPfLfwG4(oWPhS{teBIb9vGp0B({HajozJJVH47$;kXoE+Nt-z3I`&-ENek(97&VF^
z+Nf95rxrG!?uQZRKg8`#my$3jt4WjQ*w|Scg6!=<|3B7n|29(J%G$vcWGDU~9zV9TcC=CY>6iuN;sCO;
zH?y{~{{bSp@F(akl$cVx99z*q@z+jMgbCcoaIj%rS+LOZkI;$VB|VrlVSUB`No4cBw`UGP5nJ|H;|sbEAbU$#=*{J{|#(bSU$Y=&2sR;vL;&y*e`_n^9Sn`ax1LaY
z)NiYOaiqTwhm!*HN~s+>z@=5}dBr0_Q3YZD0mZ;sr4-jRmGId9VA3r^hj*?p{_}HY
z*~)$nQ?z93qtr7zcy1BTnWr$P*e#Z5t-`)fjTFncJPHeVZDp?sUrBm>{Fv9m$b-C~MX^}ZA
z77se6ckGmS)++>S0uAY-eTmgJfE>hI6EePFPp&Qn0v`i$t1tpyyhVlZg0XCr)a<G2ibG&8oZRT+T>WvTPfFyGN2aTuOxyc|3Tp5`*UwL)dAke#MYy#zf~arqlI|
zW0-OSSzaTjxIonDgl=a%5jIORe}8bI?*96BCG!s!q~8%75*ur4TDRj(?jMnMyP1-e
zYKx}qz@QgwLS8AA5S0A$Lc0I^
zLbA6vGl9IA{t*z(=zf%#64#*q=w~Phjod=xBdnqtsEAJ&?Mw|%oil|#@FXSSy!3-!
zEMx6to~EwX?N-QmRIJqQqW`r5ds1Lj&bw8^+?3LjCVuSHODJs^2scrT(oL!^MtW^e
z*Q6-6Sc=nXGxjFXD~O|^w&7Abb$mLb|)8T?@H$u3VPLb?6ZEL
zK+ol|aOgv}7bbO+Nqt{RDyld=?G0-5s<0WGvo5xH;IcBtz*DIcJkcpJ_6l~j1C1Jz
z_g2VMqzooid*d^iL~XZmh>u6s@&$U8tsxmTbSXhvw+Jx1Y$8c6eg+2w&0al@tN0COwbQ9{rlTtAf*9O9O8deuyKzQ%On8
z-o75AEPlorT)_QM7e=WD>_?&OT@tqGwh^-ICPXZ{ZZEE7mFr}P4aotfYW>NP#Sv3g
z{KU^9GAAN%O#6;{#wLBO>(%vIie}XDy2KBGZA(G8dfIliX58A)y2hqe^W7SCa8zx%
zF5mJe_Q*`>N9f-yi~uimJnOX=5>SU2+H~R1Yl-F2EF=r@wl@jP!PIleiVF5V6j+mD
zUJ(7l@&G>LYOKGMSiV<*qgz#Fo=%kBr<%^1+NL`AfJ5B!rNF(H6X(_7QkNuyQ{-l<
zDG+?{C-G3nkQiWZbrXo!x_~>Ps-(tbjari7G$3XCUGKzb;Ud4Q{A8G2V20r!ig
z4UJElD_~0jT}l*Lc6M#iw%$~&tD(p*>)1R`L}K`4oh~0)D{mstSDx(yFTRmUVw_kl
z(H$jmAY%8ONsXs2ZYAJ|yyaBK11X?20Jr!csV|IAWOA=?m{LmGR>0bmnutte{b0Dbt+q1_aJ`=
z@@~?!y}SG2&g7sq;PJ%!wvLJLo`BJN)Yg;B9Z_`41!hxMZ#s|PA|BI4fzpMsYhPY=
zR8J@3_f}nMZ+lap&Nb*>r0!n-c)4bBQ5GIRm;j4<7ZX^2TSR|vo-5b8EuJ~o%%l^3p^$B}<5U>G`~oITVW
z(bFg54eTPgp+me_$+`z5?C3k`!1V8l-D1Rh^(m`GHe8S0rxLChwV2O>ePngk!Pq-l
zmJg0tI3i?(-
z<$WoX+B^Dk$pX3L+kQ!gMxg$tb>x8wVFsotFEy?NCfT#u6J}(D*NbR4btau?%^LLj
zv{9E6t!w9r!qVihu6yQ_4w_Woi=q_{!BOO3l;T44b35OJg6w*@UcjJtfjbgQa2Sq5Bkb{0viryH*?x@G)RojKUvbz>2_AaY~k|
z`mD0U0sSvt+5=D1Kn~9iM?QyVg+)IK?0LDaCTuQ8qM=@m@d&9&w4$-3*cX6dDp&LJ
zJB1ET(Y&l0wXs2wSX22bbf{OZZ9H=*iadXkB~}mPvl616d<=YO*5gEmKv39yx1XPF|m3#Z7>1L(@RpO(Y{Sn
zP1pwa>mo-Bil@0-?2)}CG>tv}&v5-dEnp?%yW(;%nV)1K#eHA`5tw6A1z7itF&ZsC
zM9UqaLD9+1D_P@%k`Y(@jt>%ncG%K?xK$QvP|ojci|;CdjCl;JUNE)xQHJl>l#*bo
z?8O^=@5ykrZf<^R6t!dBoLQi2-lY@mCjO+xWqW&5!56*kyu(4x`k^4cQw(9v4a-y0
z{0s2bI>wH-GZ|;Ub>PN&&uazVSs@gAXF_Cz-H`!$queL>2pYc87=qGEOUt3KiyQ
zwIdIhcZ0^pX
zyHh7T{O?Og%^qZThgkRv33Qp0@dJh5EDVGrP9>1_@D+M5&Hd1c7vlA168tCM_$~yOo-kz^LZjAUC-
zRu^6%PQjx?d5%}?diN5@9dr`y5}ECFnM>M3+ib60tni1~!mx-D1wCqGz&}sPZDw0u
zRzvbMT!;NMVT3#?T`QGS7wG;Iu-{Sle~N{X6Tf}>m`Q3gHd)Lr9OOjQhZV?Cz#d)m_iHc^!2h7R$cZLrj>I`
z65dq{gLGkY!7J6^1m9gJGgqS#bQlJK3{NVnm${PUi*qhhC>nU$o-Y2|bT%3Fp8+Ly
zqtt2>DEeY8z&wPj6dhzXw3&^icAjr4RI*4rfXcYf4$DkfdFw!b$@j=m!Zyy!G7Sh0
z55yNglzI*^imQ4Sqpp>|mt!w0)Kz-36hqcMmPB!(BvY{C$NFAj~?Ua7ftHN!@j}z!m&U%Bsg7#gx|m#=e0%)XAxdc)`#Uyx0p
z^{Z?;Gj9PLo9*Ch8SCcM4mFN5%$tQvr+L+J)_6JR`enY|Ga0{HF#cJXC`3nKpM-$m
z6#1?N!}%Ks{wh&8n>m=;-&8h1HjpcS~1wm
z5Mbe!17GS|Ejl^bck9{s^dxrn#?A`l&uRhc^y!v+MD3P5G;~#!s%B04VPhiy;lXxq
z%Z3*u`1m_{@H^-JF}>fQa3d2iJ%7ps9%L9M$IQafs+kv45GK$k(W-yWEmNJ}9p`4J
zZBh}fx2{U!wD0TD*R!eUS?yu~!V#P)ak&SAMal88`eHKA&+YQhHhb4!U;@JIO
zYS}EpP+$_3a!i{iF{#9|Cd%Y(w(p1D8Qel-AZu{LE0uS>pcfu`+a^)5Ww|yTq2Ge>
zqcF>MRs9(~-i6jJlVmN%87=0aFAu5@<NH4tAl?oKPq<{WxV`{S`QE{j_kCD!g6|(ajLkR>L|^
z_+;M2(iD*Gn4Y%MEcNuk&M@gp#$M28QVyxF+E3+#sR!vS>O9g^fnWDF6qLtse24o?
zI4HUq)$OmV3J!u9@6XeMLblDXva6b~o~(fQfMmmq49D-wNc~d3C{3=T$#^ELgdCo*
z491o2equE`m6Ai4QVT~PFU>_CzQ*7`p03X}oSPvCUz$X|n&G8aE;rBf6A))w_%`fE
zC17CV?W+#*oj6{^xAXWsVfo&R!~u7Pc-q$CF=xJ8h*522gtV1dMDz#YxI_Izr%nQy
zuY#|7D`rzKE~391j%s;pJpNgJxJPTAgaZo&wRWehc<>ud9RIFr|Ffn*Y5lp)z>?*n
zu8lvQ9Pnu7E|HXW2tm+%d97<1xr@eW?^DeNWo?@m>mR$m&YW91CKMo69AFzPrm-2P
zZY-Qc&fiIqH%Ux!((RZGMyla1JHQ^Cy%byWE|og$!;OxlYPPAQ$z!=u6wjh2g2p3d
zf0iJCDX0T(kbooZBnbW8DcvGRBcvYr=0_1i)Qcf8QUW&)xEZZ5JXxZtX=dG7hV~61
z(O@{|;)pXHI=XVBd$!bbSE%D84OUxcH~N`-Zmpi+kuRUGX!iY8|J*2yv~(*+0_}d*
zk}-{FP4Y}Cxg=nwn5ygBJKdd+slDR
zUNdvWdx7-QCU0LeeyZ#R+aS6MhJYoalr5$OXGIFI>HSr^*}r--$2)(QZ|QrY<6(Y)
zB%E6D?2zMw1JP~1NB+GmKrMXSYQN6FQ8BRR0tTa~uZ9f)H`0RzI=yD%G`76gi@
z5ShLt;L8&+<6RsNtKfGLTU3PN>~>rvBb+J2e8k%SAXr~-W_Yb6f93vwrim+6f6VS-
zFXD<{M6sM{0R3owf=iyjaq>D+k`l&S*qs5ofvlW_uqZotK(tq{YZNkFn#Z(C-etPS
z$k4;}6x*h`LHd;Mp5COE;s`of_b0aWCYWJ((UiBptYK03VuV!Jv-B~<4vdg7>hpG_
zVWSs}zc5`O>358v?RgMhSMVGQ&&hhGHiP1VFgw;MY7`7KBq|Ft+o)93bRU>TFnSNr
zK*M(E&S3C1hjSUJ1=BXqqOq!E3DXGM$j9X^TkvfzRe&U{JoNf~sxp};JI^Q9zYrSo
zcep&1kx+Ewp|p@cNNl}uNUD~!P8upILK3ig;<9<1NET8rh|g04kU9J=CBjpMlo4RJ
zP!qI`m?bc=9RF&=>4`c;pl5>4>BhrdnTQon>HQq%4hfT7zN;W&;%l#rz_FG5d_f`p
zmDZZC25SZSr8-Hj*L8#+NJsjUZ1_@b7{b;cv;F$O!L!e=Bp?JJJT=Ekh5g;e|3IG(6@KYH#+#2jbi;*
zzqfYDf9m}|W4^t)_~Xf8|C{eSLcT5PZ+0fXY!G{2BLc8T0!+X~h4Z
zE^tTixAnx05c*}z#J7F_t1S96=-UXrkt4tC`fkU+1q=TJk62JxQ0@>ufXHvW{2zIG
BA#(r#
literal 5976
zcmb_g2{_d2+n!-C_I+QDB3le143d4P$-c`nBFhY8ED^G0%f42M5)!g6p|V7l24lFg;{A^Z0WcjBFg}CeuQb>X7ZU`WIIx(5orj}~qn$V07zOu&
z{bvt|J<{Fdgc!un-3^U|0D$AVX|VmhevwgPt%B8ySn5QGnqaQ*
z&D@MR%K?oMQ)WW~*RH}u{fR`{xZXbXDB-f=3Skl#I%=$ZjURCmx-!tO%4)p)L(+md
z_363T0HY3&oPKqkS7D3QxKHs*>h&}I#B^>3?L7_0BH5*btXEPOOHmh#S_?N##H`glbbwy!>!L&Vyv!gOa2R8U>pCL3+3i4Ff2Rh0)6|OoIu#1+Rl-6fVoJ
z?JPc;Ad0qp)dk+>kC~#l1X-+efxWquZm@aJG-EO`VTa28@j_m&v7w>omxN3ww;MDl
zBveZVckDfya~=0ZHLj+FPxVxx0u}#efIa%lnNr9X0z6!3AGW0A@8M-=4>&)D3j`qj
z3%H2D{k-8GC>MkW3UUF3@IWIa06<8Yrs>Zyb2yE&TaGG(n+DL|;6_Qhd}TbUG*X#c
z(ayfE!Cv}7CdnHrF74;+HR|8Hb8?e&?_waK+Gr4cUd5OgcZhGtpuIljj>KGO
zwZ;uLP-%5)CdSsG5#Q(^S{*Ycd%R%3_xy3ALI8>HHLBr-KqJ3L459#_2PjkUJ5Bx|
zrNqP%ab1k%(&7WfAbw&3^B8R*v{r%E2NRK!D(RUQ5HrdQdwT5d7AuN0BTuio>FL^L
zAZ8OnWjeC$eE)-UyE$FJlN&6Gcf|F1ZyWK&(;Sl(H;`f!EHOj6R>YjLsl
zv1RAv>ZdQmq6Q<%Ml*TM0o?*Hp7kAoP>j8SE@RsX3i>aP9$QW)s%xGXXBKF$iZ*C$
zs^cXy;yxo7DNVh8dWJFIP9~jlF&JX%JE_@%p|lP{ya6k4R$BQSeN;ocShjMMmxPDw
zm4J4w5kCbHYfK0qj0v_xsFqp)9$2fuHisWeygw+}Inz@j^^q{6fvN%oeew;jY(1&qA%j-3Uwwlg=pD6V12R
zxRoBmwQedHNo&>yRu{-HJ6EQ0C(Rlq)l~5|`>Q(S20EAd@@;d|-_MpeE*k!Tm0r-X
za88cpPNHlu8yKtdHsLU_UKnq5B-iXF*-Lu(ny6l_rpxtxe
z7=g3icEhd;BsP^2E&)B?uTf#y2Tj*=#Z1|JX++d74NK@ccs*M!ve{6N0y9;94yS&$
z-Ew_0vcMLHIcZ#;zzcGg@08FD?w?bV9wf}8YOfBxl~W|LQrIr-Gq0XiG|yJMDo`D!
zo@t4BS#d4!=}Yt4tCLR^+|KG+=2@hr>$F|a>3+RA)3$cOJf&DA)r2>wVMPvFLmaMg
z<*bcXSwPB+c+yuYt};E=wYR|Tbm(yw+FX+S6DmjGN&-bM%Zv%HcukE!i(}5bP@FFG
zDDakjTZMJOSY|JG%7e4nzjAxOIO34YU*Im_?c?%wF}ze$@r?e28Lq$neHYy0@|3~m
zTksHYt)k6c%KT@Ar0t6n9+l|aH(j^J}SS!)9=P8t!M%_q~K9f}A`%9Yoh^QUQ+
z8_44o8kv}bfq0m`p2xLJ?D0tz>Ca#$3Xu5~%nmaH8Yu|?dNbkpe}T2bd7RzidyGN>
zc=FggpOkFq8G@$Bjs`52N%O@6+4x!(L{03a74NF1HdB%oj_D*nN&EVpNyHV|Xy)FF
zbCjS@<1)jE_Cy2cF;*6@?j3nm4!z>{m2H|3-zt$@QO&Ozg%==lpjA5*%H_NV9R58n
z5d;7Oo>ye-_xIx;H)Pu?WL|SR^o95|n0yOV&;qgIHL&Ad<={m)Izt=I3p%O56f2
zo1@3rYZh0bb6Z=P*T>!K&Q58yxU^ZFqwvn5i9D)n{wg$ME?|hbcHlm{C{@7jIkXErN8b(7FUNKNih?Zg-Jq2mPk)zL@>O+B7C2dmkA$$e;&?TB90x^c$
zs_4`}%pi$neDjL-*`lzkDPUR*`Ng5yq6GewXbm^CW$DX@)JTct%cSFvB#wStgNJUHV%(Ji=y
z73&b6o^xspcXElWb#krInn?Xi)zL1$&-@&4X$#RpQ2&+y=cm+^8P??yf~~u3#omsQ
z<09|6pO1tX)HWKP=>~8ZNQJyuq|aaWh?oOQD`i9tB`pU05lj_(%2Z(dE9Hlgfrz5x
zSV4L_KVRj~7s^hQI*97b!*2()B}6G0ltGp}JWg4n-b}ISboU6jNStX@AOZ~y2>y<8wRPPWAGvhau)M9Jhia;T_$lu&+N%1bBiMuPy{Od$|bMv=Al
znqVNg7p`7z)^N^`GWBF`vqkDli&pi80qFC}V4>r>0UYa?4+6c>*2|LbBMSm4eN^3d
z$yK*GE6%JGimyc5Bz*N(nv>zy5ZzE13X|%~*U6>`YQu7=>H8U(`Z(5Re&{&aBJ0UX
z1nuu8GD`PUS9BNdh&CUF6BLIjKR%ixc^gF_)Uegd-hBsgLhz3UfGotxc=N|&pVXF93=aVf;bpH^7hcmt<7vcqkFjFfxjh&eI&g3h<
z)+QS27daE7IwggiwB^NhEPPcqu8tk_vVX*hOZD||F+3aK9m+I}_`q5JZ1Oe*nrOsE
zTX*ik)M)Q$)6$KOFo3^ux##DVPXdN!`OwgsrB4pB4G11m
zIY!xCn`y8@T$a9N)HtzcxSEnA2bg>f(lGD}ca{^$^=DqbzIRX7{a$KeJArjYC1C%&F1o_~XRx#;{Q
zu!yglXohT+NbxvT#MTRM^(_{gv9~PBB#)JI)C_8LmTY)#WBik(YHCC!=^gJQes9M0xhGiOLs>YA9GQj)&-Tz*QP*s
zQ#w_27l)Ue?CKkk^L3``{Dr*Y4~5D6+g-NeHY}BP4MdpIr-RJn}^{>hrV~2)J+Ap|iWM(vYT1*iV
z1-nk(SoC>6z@}CeEo|c7>EGt2hoa7YXA4hf>L{Wxm+wZk-!1xAT%RJ1KPjg&=>s9oc@CPE~Ozh
z%%z5tw<4H1e(@7mAEi^7H&G{R0FKXRA!g=b2!{MfZIEJqf3@yRtA1a|gqr>Eai`2%
zqSy0oFW-|wLY&wVY^xvPX-D81q1LZyhY`R9`0oV7-VOz~Ln8ljeQW?=^QIj7yWie7
z>C)-ZGp;bu*6-2j)YTH!($f~!*Ao_iVb2QbhzMbNdI_~HgoX(I9OUfeHPs63nKi*b
z4I7Yv0r2fyXz%a&Gw^evZ)5*ZzcVF*>3qA?K?97xTkMD4-pl=^{@c<2*No_JAqNdA
z-f!KNN0Gq-j8IO-!1I#$Mt{W?!zS>q&YmV?nf*w;NP$;
VOoxaVzX;jhLzoBvV4}mn`yWi6VHyAc
diff --git a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts
index 132e75be19..e4a80e3b95 100644
--- a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts
+++ b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts
@@ -65,6 +65,14 @@ export class ContentNodeSelectorDialogPage {
return BrowserActions.click(this.cancelButton);
}
+ checkCancelButtonIsEnabled() {
+ return this.cancelButton.isEnabled();
+ }
+
+ checkCopyMoveButtonIsEnabled() {
+ return this.moveCopyButton.isEnabled();
+ }
+
checkMoveCopyButtonIsDisplayed() {
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
}
diff --git a/lib/testing/src/lib/core/pages/data-table-component.page.ts b/lib/testing/src/lib/core/pages/data-table-component.page.ts
index f3a4487f13..fb974a02ec 100644
--- a/lib/testing/src/lib/core/pages/data-table-component.page.ts
+++ b/lib/testing/src/lib/core/pages/data-table-component.page.ts
@@ -329,6 +329,19 @@ export class DataTableComponentPage {
BrowserActions.click(resultElement);
}
+ checkRowContentIsDisplayed(content) {
+ const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
+ BrowserVisibility.waitUntilElementIsVisible(resultElement);
+ return this;
+ }
+
+ doubleClickRowByContent(name) {
+ const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
+ BrowserActions.click(resultElement);
+ browser.actions().sendKeys(protractor.Key.ENTER).perform();
+ return this;
+ }
+
getCopyContentTooltip() {
return BrowserActions.getText(this.copyColumnTooltip);
}
diff --git a/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts
new file mode 100644
index 0000000000..1cbbb2385a
--- /dev/null
+++ b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts
@@ -0,0 +1,94 @@
+/*!
+ * @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 { FormFields } from '../formFields';
+import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
+import * as remote from 'selenium-webdriver/remote';
+import { element, by, browser, ElementFinder } from 'protractor';
+
+export class AttachFileWidgetCloud {
+
+ widget: ElementFinder;
+ constructor(fieldId: string) {
+ this.widget = this.formFields.getWidget(fieldId);
+ }
+
+ formFields = new FormFields();
+ contentButton = element(by.css('button[id="attach-Alfresco Content"]'));
+ filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]');
+
+ attachLocalFile(fileLocation: string) {
+ browser.setFileDetector(new remote.FileDetector());
+ const uploadButton = this.widget.element(by.css(`a input`));
+ BrowserVisibility.waitUntilElementIsVisible(uploadButton);
+ uploadButton.sendKeys(browser.params.rootPath + '/e2e' + fileLocation);
+ BrowserVisibility.waitUntilElementIsVisible(uploadButton);
+ return this;
+ }
+
+ clickAttachContentFile(fileId: string) {
+ const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
+ BrowserActions.click(uploadButton);
+ BrowserActions.click(this.contentButton);
+
+ }
+
+ checkUploadContentButtonIsDisplayed(fileId: string) {
+ const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
+ BrowserVisibility.waitUntilElementIsVisible(uploadButton);
+ return this;
+ }
+
+ checkUploadContentButtonIsNotDisplayed(fileId: string) {
+ const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`));
+ BrowserVisibility.waitUntilElementIsNotVisible(uploadButton);
+ return this;
+ }
+
+ checkFileIsAttached(name) {
+ const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
+ BrowserVisibility.waitUntilElementIsVisible(fileAttached);
+ return this;
+ }
+
+ checkFileIsNotAttached(name) {
+ const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
+ BrowserVisibility.waitUntilElementIsNotVisible(fileAttached);
+ return this;
+ }
+
+ async getFileId(name: string) {
+ const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
+ BrowserVisibility.waitUntilElementIsVisible(fileAttached);
+ const fileId = await fileAttached.getAttribute('id');
+ return fileId;
+ }
+
+ async removeFile(fileName: string) {
+ const fileId = await this.getFileId(fileName);
+ const deleteButton = this.widget.element(by.css(`button[id='${fileId}-remove']`));
+ BrowserActions.click(deleteButton);
+ return this;
+ }
+
+ viewFile(name) {
+ const fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
+ BrowserActions.click(fileView);
+ browser.actions().doubleClick(fileView).perform();
+ return this;
+ }
+}
diff --git a/lib/testing/src/lib/core/pages/form/widgets/widget.ts b/lib/testing/src/lib/core/pages/form/widgets/widget.ts
index 8b4acb880a..38c151f3a1 100644
--- a/lib/testing/src/lib/core/pages/form/widgets/widget.ts
+++ b/lib/testing/src/lib/core/pages/form/widgets/widget.ts
@@ -33,6 +33,7 @@ import { AmountWidget } from './amountWidget';
import { ContainerWidget } from './containerWidget';
import { PeopleWidget } from './peopleWidget';
import { DocumentWidget } from './documentWidget';
+import { AttachFileWidgetCloud } from './attachFileWidgetCloud';
export class Widget {
@@ -52,6 +53,10 @@ export class Widget {
return new AttachFileWidget();
}
+ attachFileWidgetCloud(fieldId: string) {
+ return new AttachFileWidgetCloud(fieldId);
+ }
+
displayValueWidget() {
return new DisplayValueWidget();
}
diff --git a/lib/testing/src/lib/core/pages/settings.page.ts b/lib/testing/src/lib/core/pages/settings.page.ts
index 3451afb103..685cd545d7 100644
--- a/lib/testing/src/lib/core/pages/settings.page.ts
+++ b/lib/testing/src/lib/core/pages/settings.page.ts
@@ -169,6 +169,23 @@ export class SettingsPage {
await browser.sleep(1000);
}
+ async setProviderEcmBpmSso(contentServicesURL: string, processServiceURL, authHost, identityHost, clientId: string, silentLogin = true, implicitFlow = true) {
+ await this.goToSettingsPage();
+ this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
+ BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
+ BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
+ this.clickSsoRadioButton();
+ this.setClientId(clientId);
+ this.setContentServicesURL(contentServicesURL);
+ this.setProcessServicesURL(processServiceURL);
+ this.setAuthHost(authHost);
+ this.setIdentityHost(identityHost);
+ this.setSilentLogin(silentLogin);
+ this.setImplicitFlow(implicitFlow);
+ await this.clickApply();
+ await browser.sleep(1000);
+ }
+
async setLogoutUrl(logoutUrl) {
BrowserVisibility.waitUntilElementIsPresent(this.logoutUrlText);
this.logoutUrlText.clear();
diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
index 90fe1c809a..9b468c2e6a 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts
@@ -54,6 +54,11 @@ export class TaskFormCloudComponent {
return this;
}
+ clickReleaseButton() {
+ BrowserActions.click(this.releaseButton);
+ return this;
+ }
+
formFields() {
return new FormFields();
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
index 8fae156284..13b92a2a88 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts
@@ -79,6 +79,10 @@ export class TaskListCloudComponentPage {
return this.dataTable.selectRow(column.name, taskName);
}
+ selectRowByTaskId(taskId: string) {
+ return this.dataTable.selectRow(column.id, taskId);
+ }
+
getRow(taskName) {
return this.dataTable.getCellElementByValue(column.name, taskName);
}
From e03799e0382955f486380092fb1512bd75aceca2 Mon Sep 17 00:00:00 2001
From: davidcanonieto
Date: Tue, 2 Jul 2019 22:05:11 +0100
Subject: [PATCH 028/140] [ADF-4721] Fix Material Datetime Picker date format
(#4893)
---
demo-shell/src/app.config.json | 2 +-
.../card-view-dateitem/card-view-dateitem.component.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/demo-shell/src/app.config.json b/demo-shell/src/app.config.json
index 8686c4b995..b770b4ad60 100644
--- a/demo-shell/src/app.config.json
+++ b/demo-shell/src/app.config.json
@@ -441,7 +441,7 @@
"dateValues":{
"defaultDateFormat": "mediumDate",
"defaultDateTimeFormat": "MMM d, y, H:mm",
- "defaultLocale": "en-US"
+ "defaultLocale": "en"
},
"files": {
"excluded": [
diff --git a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
index cbfd3df618..f7fde2fe35 100644
--- a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
+++ b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
@@ -68,7 +68,7 @@ export class CardViewDateItemComponent implements OnInit {
this.dateAdapter.setLocale(locale);
});
- ( this.dateAdapter).overrideDisplayFormat = this.dateFormat;
+ ( this.dateAdapter).overrideDisplayFormat = 'MMM DD';
if (this.property.value) {
this.valueDate = moment(this.property.value, this.dateFormat);
From a13196a83696c92a6b04eeb73713ac9a9be97f76 Mon Sep 17 00:00:00 2001
From: Suzana Dirla
Date: Wed, 3 Jul 2019 11:48:14 +0300
Subject: [PATCH 029/140] [ADF-4715][ADF-4717] fix process-filter-results
random failing tests (#4888)
* [ADF-4715] a process never has CREATED status
* [ADF-4717] clean up in afterAll
* check mediumDate format
* check mediumDate format
* show more log data
* Revert "show more log data"
This reverts commit a19c629
---
.../metadata/metadata-smoke-tests.e2e.ts | 2 +-
e2e/process-services-cloud/process-filter-results.e2e.ts | 9 +++++++--
e2e/process-services/process-instance-details.e2e.ts | 2 +-
e2e/process-services/task-details.e2e.ts | 2 +-
e2e/util/constants.js | 2 +-
.../components/edit-process-filter-cloud.component.ts | 1 -
.../actions/process-instances.service.ts | 8 ++++----
7 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts
index 1ff6ca98d5..45bf0b26b4 100644
--- a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts
+++ b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts
@@ -33,7 +33,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Metadata component', () => {
const METADATA = {
- DATA_FORMAT: 'mmm dd, yyyy',
+ DATA_FORMAT: 'mmm d, yyyy',
TITLE: 'Details',
COMMENTS_TAB: 'COMMENTS',
PROPERTY_TAB: 'PROPERTIES',
diff --git a/e2e/process-services-cloud/process-filter-results.e2e.ts b/e2e/process-services-cloud/process-filter-results.e2e.ts
index b42cf96cec..f900df48ba 100644
--- a/e2e/process-services-cloud/process-filter-results.e2e.ts
+++ b/e2e/process-services-cloud/process-filter-results.e2e.ts
@@ -78,7 +78,6 @@ describe('Process filters cloud', () => {
processDefinitionService = new ProcessDefinitionsService(apiService);
simpleAppProcessDefinition = await processDefinitionService.getProcessDefinitionByName('simpleProcess', simpleApp);
processInstancesService = new ProcessInstancesService(apiService);
- await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp);
differentAppUserProcessInstance = await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp, {
'name': StringUtil.generateRandomString(),
'businessKey': StringUtil.generateRandomString()
@@ -87,7 +86,6 @@ describe('Process filters cloud', () => {
await apiService.login(testUser.email, testUser.password);
processDefinition = await processDefinitionService.getProcessDefinitionByName('candidateGroupProcess', candidateBaseApp);
anotherProcessDefinition = await processDefinitionService.getProcessDefinitionByName('anotherCandidateGroupProcess', candidateBaseApp);
- await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
'name': StringUtil.generateRandomString(),
@@ -127,6 +125,13 @@ describe('Process filters cloud', () => {
});
afterAll(async (done) => {
+ await processInstancesService.deleteProcessInstance(runningProcessInstance.entry.id, candidateBaseApp);
+ await processInstancesService.deleteProcessInstance(anotherProcessInstance.entry.id, candidateBaseApp);
+ await processInstancesService.deleteProcessInstance(suspendProcessInstance.entry.id, candidateBaseApp);
+
+ await apiService.login(anotherUser.email, anotherUser.password);
+ await processInstancesService.deleteProcessInstance(differentAppUserProcessInstance.entry.id, simpleApp);
+
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
await identityService.deleteIdentityUser(testUser.idIdentityService);
await identityService.deleteIdentityUser(anotherUser.idIdentityService);
diff --git a/e2e/process-services/process-instance-details.e2e.ts b/e2e/process-services/process-instance-details.e2e.ts
index 6b1be30596..3e6b453d4f 100644
--- a/e2e/process-services/process-instance-details.e2e.ts
+++ b/e2e/process-services/process-instance-details.e2e.ts
@@ -40,7 +40,7 @@ describe('Process Instance Details', () => {
let appModel, process, user;
const app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
- const PROCESS_DATE_FORMAT = 'mmm dd, yyyy';
+ const PROCESS_DATE_FORMAT = 'mmm d, yyyy';
beforeAll(async (done) => {
const apps = new AppsActions();
diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts
index 94cda8723b..a6f43bbb12 100644
--- a/e2e/process-services/task-details.e2e.ts
+++ b/e2e/process-services/task-details.e2e.ts
@@ -38,7 +38,7 @@ describe('Task Details component', () => {
let processUserModel, appModel;
const app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
- const TASK_DATE_FORMAT = 'mmm dd, yyyy';
+ const TASK_DATE_FORMAT = 'mmm d, yyyy';
let formModel;
let apps;
diff --git a/e2e/util/constants.js b/e2e/util/constants.js
index 649a3b2e2d..c5182a8f72 100644
--- a/e2e/util/constants.js
+++ b/e2e/util/constants.js
@@ -118,7 +118,7 @@ exports.PROCESS_BUSINESS_KEY = "None";
exports.PROCESS_DESCRIPTION = "No description";
-exports.PROCESS_DATE_FORMAT = "mmm dd, yyyy";
+exports.PROCESS_DATE_FORMAT = "mmm d, yyyy";
exports.PROCESS_DETAILS = {
NO_PARENT: "None",
diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts
index 60a652d011..d873ecaa80 100644
--- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts
+++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts
@@ -90,7 +90,6 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges {
status = [
{ label: 'ALL', value: '' },
- { label: 'CREATED', value: 'CREATED' },
{ label: 'RUNNING', value: 'RUNNING' },
{ label: 'SUSPENDED', value: 'SUSPENDED' },
{ label: 'CANCELLED', value: 'CANCELLED' },
diff --git a/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts b/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts
index e476bbe7ad..c4a7075450 100644
--- a/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts
+++ b/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts
@@ -40,7 +40,7 @@ export class ProcessInstancesService {
} catch (error) {
// tslint:disable-next-line:no-console
- console.log('create process-instances Service not working');
+ console.log('create process-instances Service not working', error.message);
}
}
@@ -56,7 +56,7 @@ export class ProcessInstancesService {
} catch (error) {
// tslint:disable-next-line:no-console
- console.log('suspend process-instances Service not working');
+ console.log('suspend process-instances Service not working', error.message);
}
}
@@ -71,7 +71,7 @@ export class ProcessInstancesService {
} catch (error) {
// tslint:disable-next-line:no-console
- console.log('delete process-instances Service not working');
+ console.log('delete process-instances Service not working', error.message);
}
}
@@ -87,7 +87,7 @@ export class ProcessInstancesService {
} catch (error) {
// tslint:disable-next-line:no-console
- console.log('complete process-instances Service not working');
+ console.log('complete process-instances Service not working', error.message);
}
}
}
From c9b7722bd00fa81fcf933ea963a58de2123782a4 Mon Sep 17 00:00:00 2001
From: Denys Vuika
Date: Wed, 3 Jul 2019 12:08:12 +0100
Subject: [PATCH 030/140] fix css class name typo (#4895)
* fix css class name typo
* fix more typos
---
.../cloud/community/community-task-details-cloud.component.scss | 2 +-
.../app/components/cloud/task-details-cloud-demo.component.scss | 2 +-
.../task-header/components/task-header-cloud.component.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.scss b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.scss
index e97ca949e4..e3cc8d8c52 100644
--- a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.scss
+++ b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.scss
@@ -5,7 +5,7 @@
display: flex;
}
- &-task-tiitle {
+ &-task-title {
margin-left:15px;
}
diff --git a/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.scss b/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.scss
index e97ca949e4..e3cc8d8c52 100644
--- a/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.scss
+++ b/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.scss
@@ -5,7 +5,7 @@
display: flex;
}
- &-task-tiitle {
+ &-task-title {
margin-left:15px;
}
diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.html b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.html
index f9fa6a5382..ead649fe3e 100644
--- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.html
+++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.html
@@ -1,4 +1,4 @@
-{{ taskDetails.name }}
+{{ taskDetails.name }}