diff --git a/demo-shell/resources/i18n/ar.json b/demo-shell/resources/i18n/ar.json deleted file mode 100755 index 3ea3d8721b..0000000000 --- a/demo-shell/resources/i18n/ar.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "مرحبًا", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "تم تعيين المهمة {{taskName}} إلى {{assignee}}", - "PROCESS_STARTED": "تم بدء عملية {{processName}}", - "TASK_UPDATED": "تم تحديث تفاصيل مهمة {{taskName}}", - "TASK_CREATED": "تم إنشاء المهمة {{TaskName}}" - }, - "SEARCH": { - "RESULTS": "نتائج البحث", - "NO_RESULT": "لم يتم العثور على نتائج", - "FACET_FIELDS": { - "TYPE": "1:النوع", - "SIZE": "2:الحجم", - "CREATOR": "3:المُنشئ", - "MODIFIER": "4:المُعدل", - "CREATED": "5:تم الإنشاء" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "استعلامات واجهتي", - "CREATED_THIS_YEAR": "1.تم الإنشاء هذا العام", - "MIMETYPE": "2.النوع: HTML", - "XTRASMALL": "3.الحجم: فائق الصغر", - "SMALL": "4.الحجم: صغير", - "MEDIUM": "5.الحجم: متوسط", - "LARGE": "6.الحجم: كبير", - "XTRALARGE": "7.الحجم: فائق الكبر", - "XXTRALARGE": "8.الحجم: كبير XX" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "الترجمة الأولى للعنوان المخصص", - "GROUP-TITLE2-TRANSLATION-KEY": "الترجمة الثانية للعنوان المخصص", - "ERROR_CONTENT": { - "507": { - "TITLE": "قرص ACS ممتلئ", - "DESCRIPTION": "يتجاوز المحتوى حد سعة التخزين المكون للشبكة أو النظام" - } - } -} diff --git a/demo-shell/resources/i18n/cs.json b/demo-shell/resources/i18n/cs.json deleted file mode 100755 index 80d86242cb..0000000000 --- a/demo-shell/resources/i18n/cs.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Vítejte", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "Úkol {{taskName}} byl přiřazen uživateli {{assignee}}", - "PROCESS_STARTED": "Byl spuštěn proces {{processName}}", - "TASK_UPDATED": "Byly aktualizovány podrobnosti úkolu {{taskName}}", - "TASK_CREATED": "Úkol {{taskName}} byl vytvořen" - }, - "SEARCH": { - "RESULTS": "Výsledky hledání", - "NO_RESULT": "Nebyly nalezeny žádné výsledky", - "FACET_FIELDS": { - "TYPE": "1:Typ", - "SIZE": "2:Velikost", - "CREATOR": "3:Autor", - "MODIFIER": "4:Upravil(a)", - "CREATED": "5:Vytvořeno" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Moje dotazy na aspekty", - "CREATED_THIS_YEAR": "1.Vytvořeno tento rok", - "MIMETYPE": "2.Typ: HTML", - "XTRASMALL": "3.Velikost: extra malé", - "SMALL": "4.Velikost: malé", - "MEDIUM": "5.Velikost: střední", - "LARGE": "6.Velikost: velké", - "XTRALARGE": "7.Velikost: extra velké", - "XXTRALARGE": "8.Velikost: XX velké" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Vlastní překlad názvu 1", - "GROUP-TITLE2-TRANSLATION-KEY": "Vlastní překlad názvu 2", - "ERROR_CONTENT": { - "507": { - "TITLE": "Disk ACS plný", - "DESCRIPTION": "Obsah přesahuje celkovou kvótu úložiště nastavenou pro síť nebo systém" - } - } -} diff --git a/demo-shell/resources/i18n/da.json b/demo-shell/resources/i18n/da.json deleted file mode 100755 index 7a0089a8bd..0000000000 --- a/demo-shell/resources/i18n/da.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Velkommen", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}} opgave er blevet tildelt til {{assignee}}", - "PROCESS_STARTED": "{{processName}} processen er startet", - "TASK_UPDATED": "{{taskName}} opgavedetaljer er blevet opdateret", - "TASK_CREATED": "Opgaven {{taskName}} blev oprettet" - }, - "SEARCH": { - "RESULTS": "Søgeresultater", - "NO_RESULT": "Der blev ikke fundet nogen resultater", - "FACET_FIELDS": { - "TYPE": "1: Type", - "SIZE": "2: Størrelse", - "CREATOR": "3: Opretter", - "MODIFIER": "4: Modifikator", - "CREATED": "5: Oprettet" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mine facetforespørgsler", - "CREATED_THIS_YEAR": "1. Oprettet i år", - "MIMETYPE": "2. Type: HTML", - "XTRASMALL": "3. Størrelse: xtra small", - "SMALL": "4. Størrelse: small", - "MEDIUM": "5. Størrelse: medium", - "LARGE": "6. Størrelse: large", - "XTRALARGE": "7. Størrelse: xtra large", - "XXTRALARGE": "8. Størrelse: XX large" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Brugerdefineret titel oversættelse et", - "GROUP-TITLE2-TRANSLATION-KEY": "Brugerdefineret titel oversættelse to", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS-disken er fuld", - "DESCRIPTION": "Indholdet overskrider den generelle lagerkvotegrænse, der er konfigureret for netværket eller systemet" - } - } -} diff --git a/demo-shell/resources/i18n/de.json b/demo-shell/resources/i18n/de.json deleted file mode 100755 index ca042c8cb0..0000000000 --- a/demo-shell/resources/i18n/de.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Willkommen", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "Aufgabe '{{taskName}}' wurde {{assignee}} zugewiesen", - "PROCESS_STARTED": "Prozess '{{processName}}' wurde gestartet", - "TASK_UPDATED": "Aufgabe '{{taskName}}' wurde aktualisiert", - "TASK_CREATED": "Die Aufgabe {{taskName}} wurde erstellt" - }, - "SEARCH": { - "RESULTS": "Ergebnisse durchsuchen", - "NO_RESULT": "Keine Ergebnisse gefunden", - "FACET_FIELDS": { - "TYPE": "1:Typ", - "SIZE": "2:Größe", - "CREATOR": "3:Erstellt von", - "MODIFIER": "4:Bearbeitet von", - "CREATED": "5:Erstellt am" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Meine Facet-Abfragen", - "CREATED_THIS_YEAR": "1.Dieses Jahr erstellt", - "MIMETYPE": "2.Typ: HTML", - "XTRASMALL": "3.Größe: sehr klein", - "SMALL": "4.Größe: klein", - "MEDIUM": "5.Größe: mittel", - "LARGE": "6.Größe: groß", - "XTRALARGE": "7.Größe: sehr groß", - "XXTRALARGE": "8.Größe: extrem groß" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Übersetzung benutzerdefinierter Titel 1", - "GROUP-TITLE2-TRANSLATION-KEY": "Übersetzung benutzerdefinierter Titel 2", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS-Datenträger voll", - "DESCRIPTION": "Inhalt übersteigt die für das Netzwerk oder System konfigurierte Gesamtspeicherbegrenzung" - } - } -} diff --git a/demo-shell/resources/i18n/es.json b/demo-shell/resources/i18n/es.json deleted file mode 100755 index e7858f58d9..0000000000 --- a/demo-shell/resources/i18n/es.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Bienvenido", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "La tarea {{taskName}} ha sido asignada a {{assignee}}", - "PROCESS_STARTED": "Se ha iniciado el proceso {{processName}}", - "TASK_UPDATED": "Se actualizaron los detalles de la tarea {{taskName}}", - "TASK_CREATED": "Se ha creado la tarea {{taskName}}" - }, - "SEARCH": { - "RESULTS": "Resultados de la búsqueda", - "NO_RESULT": "Ningún resultado encontrado", - "FACET_FIELDS": { - "TYPE": "1:Tipo", - "SIZE": "2:Tamaño", - "CREATOR": "3:Creador", - "MODIFIER": "4:Modificador", - "CREATED": "5:Creados" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mis consultas por filtros", - "CREATED_THIS_YEAR": "1.Creadas este año", - "MIMETYPE": "2.Tipo: HTML", - "XTRASMALL": "3.Tamaño: extrapequeño", - "SMALL": "4.Tamaño: pequeño", - "MEDIUM": "5.Tamaño: mediano", - "LARGE": "6.Tamaño: grande", - "XTRALARGE": "7.Tamaño: extragrande", - "XXTRALARGE": "8.Tamaño: extraextragrande" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Traducción de título personalizado 1", - "GROUP-TITLE2-TRANSLATION-KEY": "Traducción de título personalizado 2", - "ERROR_CONTENT": { - "507": { - "TITLE": "Disco ACS lleno", - "DESCRIPTION": "El contenido supera el límite de la cuota de almacenamiento general configurado para la red o sistema." - } - } -} diff --git a/demo-shell/resources/i18n/fi.json b/demo-shell/resources/i18n/fi.json deleted file mode 100755 index 711d1709af..0000000000 --- a/demo-shell/resources/i18n/fi.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Tervetuloa", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}} -tehtävä on määritetty käyttäjälle {{assignee}}", - "PROCESS_STARTED": "{{processName}} -prosessi on käynnistetty", - "TASK_UPDATED": "{{taskName}} -tehtävän tiedot on päivitetty", - "TASK_CREATED": "{{taskName}} -tehtävä luotiin" - }, - "SEARCH": { - "RESULTS": "Hakutulokset", - "NO_RESULT": "Tuloksia ei löydy", - "FACET_FIELDS": { - "TYPE": "1: tyyppi", - "SIZE": "2: koko", - "CREATOR": "3: tekijä", - "MODIFIER": "4: muokkaaja", - "CREATED": "5: luotu" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Omat kyselyt", - "CREATED_THIS_YEAR": "1. Luotu tänä vuonna", - "MIMETYPE": "2. Tyyppi: HTML", - "XTRASMALL": "3. Koko: XS", - "SMALL": "4. Koko: S", - "MEDIUM": "5. Koko: M", - "LARGE": "6. Koko: L", - "XTRALARGE": "7. Koko: XL", - "XXTRALARGE": "8. Koko: XXL" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Oma otsikkokäännös yksi", - "GROUP-TITLE2-TRANSLATION-KEY": "Oma otsikkokäännös kaksi", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS-levy täynnä", - "DESCRIPTION": "Sisältö ylittää verkolle tai järjestelmälle määritetyn tallennustilan kokonaisrajoituksen" - } - } -} diff --git a/demo-shell/resources/i18n/fr.json b/demo-shell/resources/i18n/fr.json deleted file mode 100755 index f2618ad2f8..0000000000 --- a/demo-shell/resources/i18n/fr.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Bienvenue", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "La tâche {{taskName}} a été assignée à {{assignee}}", - "PROCESS_STARTED": "Le processus {{processName}} a été démarré", - "TASK_UPDATED": "Les détails de la tâche {{taskName}} ont été mis à jour", - "TASK_CREATED": "{{taskName}} tâche a été créée" - }, - "SEARCH": { - "RESULTS": "Résultats de la recherche", - "NO_RESULT": "Aucun résultat trouvé", - "FACET_FIELDS": { - "TYPE": "1:Type", - "SIZE": "2:Taille", - "CREATOR": "3:Créateur", - "MODIFIER": "4:Modificateur", - "CREATED": "5:Créé" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mes recherches avec filtre", - "CREATED_THIS_YEAR": "1.Créé cette année", - "MIMETYPE": "2.Type : HTML", - "XTRASMALL": "3.Taille : très petit", - "SMALL": "4.Taille : petit", - "MEDIUM": "5.Taille : moyen", - "LARGE": "6.Taille : gros", - "XTRALARGE": "7.Taille : très gros", - "XXTRALARGE": "8.Taille : énorme" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Titre personnalisé traduction un", - "GROUP-TITLE2-TRANSLATION-KEY": "Titre personnalisé traduction deux", - "ERROR_CONTENT": { - "507": { - "TITLE": "Disque ACS plein", - "DESCRIPTION": "Le contenu dépasse le quota maximum de stockage configuré pour le réseau ou système" - } - } -} diff --git a/demo-shell/resources/i18n/it.json b/demo-shell/resources/i18n/it.json deleted file mode 100755 index 15271d5095..0000000000 --- a/demo-shell/resources/i18n/it.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Benvenuto", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "Il compito {{taskName}} è stato assegnato a {{assignee}}", - "PROCESS_STARTED": "Il processo {{processName}} è stato avviato", - "TASK_UPDATED": "I dettagli del compito {{taskName}} sono stati aggiornati", - "TASK_CREATED": "Il compito {{taskName}} è stato creato" - }, - "SEARCH": { - "RESULTS": "Risultati della ricerca", - "NO_RESULT": "Nessun risultato trovato", - "FACET_FIELDS": { - "TYPE": "1. Tipo", - "SIZE": "2. Dimensioni", - "CREATOR": "3. Autore", - "MODIFIER": "4. Modificatore", - "CREATED": "5. Creati" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Le mie query filtri", - "CREATED_THIS_YEAR": "1. Creati quest'anno", - "MIMETYPE": "2.Tipo: HTML", - "XTRASMALL": "3. Dimensioni: extra piccolo", - "SMALL": "4. Dimensioni: piccolo", - "MEDIUM": "5. Dimensioni: medio", - "LARGE": "6. Dimensioni: grande", - "XTRALARGE": "7. Dimensioni: extra grande", - "XXTRALARGE": "8. Dimensioni: extra extra grande" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Custom Title Translation One", - "GROUP-TITLE2-TRANSLATION-KEY": "Custom Title Translation Two", - "ERROR_CONTENT": { - "507": { - "TITLE": "Dico ACS pieno", - "DESCRIPTION": "Il contenuto supera il limite di archiviazione complessivo configurato per la rete o il sistema" - } - } -} diff --git a/demo-shell/resources/i18n/ja.json b/demo-shell/resources/i18n/ja.json deleted file mode 100755 index dab3430be9..0000000000 --- a/demo-shell/resources/i18n/ja.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "ようこそ", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}}タスクが{{assignee}}に割り当てられました", - "PROCESS_STARTED": "{{processName}}プロセスが開始しました", - "TASK_UPDATED": "{{taskName}}タスクの詳細が更新されました", - "TASK_CREATED": "{{taskName}}タスクが作成されました" - }, - "SEARCH": { - "RESULTS": "検索結果", - "NO_RESULT": "一致するアイテムはありません", - "FACET_FIELDS": { - "TYPE": "1:タイプ", - "SIZE": "2:サイズ", - "CREATOR": "3:作成者", - "MODIFIER": "4:変更者", - "CREATED": "5:作成日" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "あなたのファセットクエリ", - "CREATED_THIS_YEAR": "1.今年作成", - "MIMETYPE": "2.タイプ: HTML", - "XTRASMALL": "3.サイズ: 極小", - "SMALL": "4.サイズ: 小", - "MEDIUM": "5.サイズ: 中", - "LARGE": "6.サイズ: 大", - "XTRALARGE": "7.サイズ: 特大", - "XXTRALARGE": "8.サイズ: 超特大" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "カスタムのタイトル翻訳 1", - "GROUP-TITLE2-TRANSLATION-KEY": "カスタムのタイトル翻訳 2", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS のディスクがいっぱいです", - "DESCRIPTION": "コンテンツのサイズが、ネットワークまたはシステムに設定されているストレージクォータの上限を超えています。" - } - } -} diff --git a/demo-shell/resources/i18n/nb.json b/demo-shell/resources/i18n/nb.json deleted file mode 100755 index a13f434e11..0000000000 --- a/demo-shell/resources/i18n/nb.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Velkommen", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}}-oppgaven er tilordnet til {{assignee}}", - "PROCESS_STARTED": "{{processName}}-prosessen er startet", - "TASK_UPDATED": "{{taskName}}-oppgavedetaljene er oppdatert", - "TASK_CREATED": "Oppgaven {{taskName}} ble opprettet" - }, - "SEARCH": { - "RESULTS": "Søkeresultater", - "NO_RESULT": "Ingen resultater funnet", - "FACET_FIELDS": { - "TYPE": "1:Type", - "SIZE": "2:Størrelse", - "CREATOR": "3:Oppretter", - "MODIFIER": "4:Modifikator", - "CREATED": "5:Opprettet" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mine egenskapsspørringer", - "CREATED_THIS_YEAR": "1.Opprettet i år", - "MIMETYPE": "2.Type: HTML", - "XTRASMALL": "3.Størrelse: xtra small", - "SMALL": "4.Størrelse: small", - "MEDIUM": "5.Størrelse: medium", - "LARGE": "6.Størrelse: large", - "XTRALARGE": "7.Størrelse: xtra large", - "XXTRALARGE": "8.Størrelse: XX large" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Egendefinert tittel, oversettelse én", - "GROUP-TITLE2-TRANSLATION-KEY": "Egendefinert tittel, oversettelse to", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS-disk er full", - "DESCRIPTION": "Innhold overgår samlet lagringskvotegrense konfigurert for nettverket eller systemet" - } - } -} diff --git a/demo-shell/resources/i18n/nl.json b/demo-shell/resources/i18n/nl.json deleted file mode 100755 index 5fe6e2ddea..0000000000 --- a/demo-shell/resources/i18n/nl.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Welkom", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}}-taak is toegewezen aan {{assignee}}", - "PROCESS_STARTED": "{{processName}}-proces is gestart", - "TASK_UPDATED": "{{taskName}}-taakdetails zijn bijgewerkt", - "TASK_CREATED": "Taak {{taskName}} is gemaakt" - }, - "SEARCH": { - "RESULTS": "Zoekresultaten", - "NO_RESULT": "Geen resultaten gevonden", - "FACET_FIELDS": { - "TYPE": "1:Type", - "SIZE": "2:Grootte", - "CREATOR": "3:Maker", - "MODIFIER": "4:Gewijzigd door", - "CREATED": "5:Gemaakt" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mijn facetquery's", - "CREATED_THIS_YEAR": "1.Dit jaar gemaakt", - "MIMETYPE": "2.Type: HTML", - "XTRASMALL": "3.Grootte: extra klein", - "SMALL": "4.Grootte: klein", - "MEDIUM": "5.Grootte: middelgroot", - "LARGE": "6.Grootte: groot", - "XTRALARGE": "7.Grootte: extra groot", - "XXTRALARGE": "8.Grootte: XX groot" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Aangepaste titel vertaling één", - "GROUP-TITLE2-TRANSLATION-KEY": "Aangepaste titel vertaling twee", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS-schijf vol", - "DESCRIPTION": "Content overschrijdt de totale opslaglimiet die is geconfigureerd voor het netwerk of systeem" - } - } -} diff --git a/demo-shell/resources/i18n/pl.json b/demo-shell/resources/i18n/pl.json deleted file mode 100755 index 3357571706..0000000000 --- a/demo-shell/resources/i18n/pl.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Witaj", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "Zadanie {{taskName}} zostało przydzielone do {{assignee}}", - "PROCESS_STARTED": "Proces {{processName}} został uruchomiony", - "TASK_UPDATED": "Szczegóły zadania {{taskName}} zostały zaktualizowane", - "TASK_CREATED": "Zadanie {{taskName}} zostało utworzone" - }, - "SEARCH": { - "RESULTS": "Wyniki wyszukiwania", - "NO_RESULT": "Brak wyników", - "FACET_FIELDS": { - "TYPE": "1: Typ", - "SIZE": "2: Rozmiar", - "CREATOR": "3: Twórca", - "MODIFIER": "4: Modyfikator", - "CREATED": "5: Utworzono" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Moje zapytania dotyczące aspektu", - "CREATED_THIS_YEAR": "1. Utworzone w tym roku", - "MIMETYPE": "2. Typ: HTML", - "XTRASMALL": "3. Rozmiar: bardzo mały", - "SMALL": "4. Rozmiar: mały", - "MEDIUM": "5. Rozmiar: średni", - "LARGE": "6. Rozmiar: duży", - "XTRALARGE": "7. Rozmiar: bardzo duży", - "XXTRALARGE": "8. Rozmiar: wyjątkowo duży" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Tytuł niestandardowy — tłumaczenie pierwsze", - "GROUP-TITLE2-TRANSLATION-KEY": "Tytuł niestandardowy — tłumaczenie drugie", - "ERROR_CONTENT": { - "507": { - "TITLE": "Dysk ACS pełny", - "DESCRIPTION": "Zawartość przekracza limit łącznego przydziału miejsca w magazynie skonfigurowany w sieci lub systemie" - } - } -} diff --git a/demo-shell/resources/i18n/pt-BR.json b/demo-shell/resources/i18n/pt-BR.json deleted file mode 100755 index 21d5d40164..0000000000 --- a/demo-shell/resources/i18n/pt-BR.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Bem-vindo", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "A tarefa {{taskName}} foi atribuída a {{assignee}}", - "PROCESS_STARTED": "O processo {{processName}} foi iniciado", - "TASK_UPDATED": "Os detalhes da tarefa {{taskName}} foram atualizados", - "TASK_CREATED": "A tarefa {{taskName}} foi criada" - }, - "SEARCH": { - "RESULTS": "Resultados da pesquisa", - "NO_RESULT": "Nenhum resultado encontrado", - "FACET_FIELDS": { - "TYPE": "1:Tipo", - "SIZE": "2:Tamanho", - "CREATOR": "3:Criador", - "MODIFIER": "4:Modificador", - "CREATED": "5:Criado" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Minhas consultas de faceta", - "CREATED_THIS_YEAR": "1.Criado este ano", - "MIMETYPE": "2.Tipo: HTML", - "XTRASMALL": "3.Tamanho: muito pequeno", - "SMALL": "4.Tamanho: pequeno", - "MEDIUM": "5.Tamanho: médio", - "LARGE": "6.Tamanho: grande", - "XTRALARGE": "7.Tamanho: muito grande", - "XXTRALARGE": "8.Tamanho: extragrande" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Tradução um de título personalizado", - "GROUP-TITLE2-TRANSLATION-KEY": "Tradução dois de título personalizado", - "ERROR_CONTENT": { - "507": { - "TITLE": "Disco ACS cheio", - "DESCRIPTION": "O conteúdo excede o limite de armazenamento geral configurado para a rede ou o sistema" - } - } -} diff --git a/demo-shell/resources/i18n/ru.json b/demo-shell/resources/i18n/ru.json deleted file mode 100755 index 7d960b6681..0000000000 --- a/demo-shell/resources/i18n/ru.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Добро пожаловать", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "Задача {{taskName}} была назначена {{assignee}}", - "PROCESS_STARTED": "Процесс {{processName}} запущен", - "TASK_UPDATED": "Сведения о задаче {{taskName}} обновлены", - "TASK_CREATED": "{{taskName}} задача создана" - }, - "SEARCH": { - "RESULTS": "Результаты поиска", - "NO_RESULT": "Результаты не найдены", - "FACET_FIELDS": { - "TYPE": "1: тип", - "SIZE": "2: размер", - "CREATOR": "3: автор", - "MODIFIER": "4: редактор", - "CREATED": "5: создано" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Мои фасетные запросы", - "CREATED_THIS_YEAR": "1. Создано в этом году", - "MIMETYPE": "2. Тип HTML", - "XTRASMALL": "3. Размер: крайне малый", - "SMALL": "4. Размер: малый", - "MEDIUM": "5. Размер: средний", - "LARGE": "6. Размер: большой", - "XTRALARGE": "7. Размер: очень большой", - "XXTRALARGE": "8. Размер: огромный" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Перевод пользовательского заголовка один", - "GROUP-TITLE2-TRANSLATION-KEY": "Перевод пользовательского заголовка два", - "ERROR_CONTENT": { - "507": { - "TITLE": "Диск ACS заполнен", - "DESCRIPTION": "Объем данных превысил максимально допустимое значение, установленное для сети или системы" - } - } -} diff --git a/demo-shell/resources/i18n/sv.json b/demo-shell/resources/i18n/sv.json deleted file mode 100755 index b12d1d4720..0000000000 --- a/demo-shell/resources/i18n/sv.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "Välkommen", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}} uppgiften har tilldelats till {{assignee}}", - "PROCESS_STARTED": "{{processName}} processen har startats", - "TASK_UPDATED": "{{taskName}} uppgiftsinformation har uppdaterats", - "TASK_CREATED": "Uppgiften {{taskName}} skapades" - }, - "SEARCH": { - "RESULTS": "Sökresultat", - "NO_RESULT": "Inga resultat hittades", - "FACET_FIELDS": { - "TYPE": "1:Typ", - "SIZE": "2:Storlek", - "CREATOR": "3:Skapad av", - "MODIFIER": "4:Ändrad av", - "CREATED": "5:Skapad den" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "Mina fasettförfrågningar", - "CREATED_THIS_YEAR": "1.Skapad det här året", - "MIMETYPE": "2.Typ: HTML", - "XTRASMALL": "3.Storlek: extra small", - "SMALL": "4.Storlek: small", - "MEDIUM": "5.Storlek: medium", - "LARGE": "6.Storlek: large", - "XTRALARGE": "7.Storlek: extra large", - "XXTRALARGE": "8.Storlek: XX large" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "Anpassad titelöversättning ett", - "GROUP-TITLE2-TRANSLATION-KEY": "Anpassad titelöversättning två", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS disk full", - "DESCRIPTION": "Innehållet överskrider övergripande kvotbegränsning som är konfigurerad för nätverket eller systemet" - } - } -} diff --git a/demo-shell/resources/i18n/zh-CN.json b/demo-shell/resources/i18n/zh-CN.json deleted file mode 100755 index e694f735a0..0000000000 --- a/demo-shell/resources/i18n/zh-CN.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "欢迎使用", - "NOTIFICATIONS": { - "TASK_ASSIGNED": "{{taskName}} 任务已分配给 {{assignee}}", - "PROCESS_STARTED": "{{processName}} 进程已启动", - "TASK_UPDATED": "{{taskName}} 任务详细信息已更新", - "TASK_CREATED": "{{taskName}} 任务已创建" - }, - "SEARCH": { - "RESULTS": "搜索结果", - "NO_RESULT": "未找到结果", - "FACET_FIELDS": { - "TYPE": "1:类型", - "SIZE": "2:字号", - "CREATOR": "3:创建者", - "MODIFIER": "4:修改者", - "CREATED": "5:已创建" - }, - "FACET_QUERIES": { - "MY_FACET_QUERIES": "我的分面查询", - "CREATED_THIS_YEAR": "1. 今年创建", - "MIMETYPE": "2. 类型: HTML", - "XTRASMALL": "3. 字号:超小", - "SMALL": "4. 字号:小", - "MEDIUM": "5. 字号:中等", - "LARGE": "6. 字号:大", - "XTRALARGE": "7. 字号:特大", - "XXTRALARGE": "8. 字号:超大" - } - }, - "GROUP-TITLE1-TRANSLATION-KEY": "自定义标题翻译 1", - "GROUP-TITLE2-TRANSLATION-KEY": "自定义标题翻译 2", - "ERROR_CONTENT": { - "507": { - "TITLE": "ACS 磁盘已满", - "DESCRIPTION": "内容超出为网络或系统配置的总存储配额限制" - } - } -} diff --git a/demo-shell/src/app/app.module.ts b/demo-shell/src/app/app.module.ts index bab44084a5..62c3197dd6 100644 --- a/demo-shell/src/app/app.module.ts +++ b/demo-shell/src/app/app.module.ts @@ -16,7 +16,7 @@ */ import { BrowserModule } from '@angular/platform-browser'; -import { APP_INITIALIZER, NgModule } from '@angular/core'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgChartsModule } from 'ng2-charts'; import { HttpClientModule } from '@angular/common/http'; @@ -39,8 +39,6 @@ import { HomeComponent } from './components/home/home.component'; import { SearchBarComponent } from './components/search/search-bar.component'; import { SearchResultComponent } from './components/search/search-result.component'; import { FormComponent } from './components/form/form.component'; -import { FormListComponent } from './components/form/form-list.component'; -import { FormLoadingComponent } from './components/form/form-loading.component'; import { ProcessServiceComponent } from './components/process-service/process-service.component'; import { ShowDiagramComponent } from './components/process-service/show-diagram.component'; import { FormViewerComponent } from './components/process-service/form-viewer.component'; @@ -52,7 +50,6 @@ import { MetadataDialogAdapterComponent } from './components/files/metadata-dial import { appRoutes } from './app.routes'; import { TaskAttachmentsComponent } from './components/process-service/task-attachments.component'; import { ProcessAttachmentsComponent } from './components/process-service/process-attachments.component'; -import { SharedLinkViewComponent } from './components/shared-link-view/shared-link-view.component'; import { DemoPermissionComponent } from './components/permissions/demo-permissions.component'; import { MonacoEditorModule } from 'ngx-monaco-editor-v2'; import { ContentModule } from '@alfresco/adf-content-services'; @@ -64,15 +61,12 @@ import { AppsCloudDemoComponent } from './components/cloud/apps-cloud-demo.compo import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.component'; import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component'; import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component'; -import { TaskHeaderCloudDemoComponent } from './components/cloud/task-header-cloud-demo.component'; -import { ServiceTaskListCloudDemoComponent } from './components/cloud/service-task-list-cloud-demo.component'; import { CloudViewerComponent } from './components/cloud/cloud-viewer.component'; import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component'; import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component'; import { StartProcessCloudDemoComponent } from './components/cloud/start-process-cloud-demo.component'; import { CloudBreadcrumbsComponent } from './components/cloud/cloud-breadcrumb-component'; import { CloudFiltersDemoComponent } from './components/cloud/cloud-filters-demo.component'; -import { PeopleGroupCloudDemoComponent } from './components/cloud/people-groups-cloud-demo.component'; import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/cloud-form-demo.component'; import { environment } from '../environments/environment'; import { AppCloudSharedModule } from './components/cloud/shared/cloud.shared.module'; @@ -81,46 +75,9 @@ import { ProcessServicesCloudModule } from '@alfresco/adf-process-services-cloud import { RouterModule } from '@angular/router'; import { ProcessCloudLayoutComponent } from './components/cloud/process-cloud-layout.component'; import { CustomEditorComponent, CustomWidgetComponent } from './components/cloud/custom-form-components/custom-editor.component'; - -import { registerLocaleData } from '@angular/common'; -import localeFr from '@angular/common/locales/fr'; -import localeDe from '@angular/common/locales/de'; -import localeIt from '@angular/common/locales/it'; -import localeEs from '@angular/common/locales/es'; -import localeJa from '@angular/common/locales/ja'; -import localeNl from '@angular/common/locales/nl'; -import localePt from '@angular/common/locales/pt'; -import localeNb from '@angular/common/locales/nb'; -import localeRu from '@angular/common/locales/ru'; -import localeCh from '@angular/common/locales/zh'; -import localeAr from '@angular/common/locales/ar'; -import localeCs from '@angular/common/locales/cs'; -import localePl from '@angular/common/locales/pl'; -import localeFi from '@angular/common/locales/fi'; -import localeDa from '@angular/common/locales/da'; -import localeSv from '@angular/common/locales/sv'; -import { setupAppNotifications } from './services/app-notifications-factory'; -import { AppNotificationsService } from './services/app-notifications.service'; import { SearchFilterChipsComponent } from './components/search/search-filter-chips.component'; import { UserInfoComponent } from './components/app-layout/user-info/user-info.component'; -registerLocaleData(localeFr); -registerLocaleData(localeDe); -registerLocaleData(localeIt); -registerLocaleData(localeEs); -registerLocaleData(localeJa); -registerLocaleData(localeNl); -registerLocaleData(localePt); -registerLocaleData(localeNb); -registerLocaleData(localeRu); -registerLocaleData(localeCh); -registerLocaleData(localeAr); -registerLocaleData(localeCs); -registerLocaleData(localePl); -registerLocaleData(localeFi); -registerLocaleData(localeDa); -registerLocaleData(localeSv); - @NgModule({ imports: [ BrowserModule, @@ -157,47 +114,33 @@ registerLocaleData(localeSv); AppsViewComponent, FilesComponent, FormComponent, - FormListComponent, VersionManagerDialogAdapterComponent, MetadataDialogAdapterComponent, TaskAttachmentsComponent, ProcessAttachmentsComponent, - SharedLinkViewComponent, - FormLoadingComponent, DemoPermissionComponent, DemoErrorComponent, - FormLoadingComponent, TreeViewSampleComponent, CloudLayoutComponent, AppsCloudDemoComponent, TasksCloudDemoComponent, ProcessesCloudDemoComponent, TaskDetailsCloudDemoComponent, - TaskHeaderCloudDemoComponent, CloudViewerComponent, ProcessDetailsCloudDemoComponent, StartTaskCloudDemoComponent, StartProcessCloudDemoComponent, CloudBreadcrumbsComponent, CloudFiltersDemoComponent, - PeopleGroupCloudDemoComponent, FormCloudDemoComponent, CustomEditorComponent, CustomWidgetComponent, ProcessCloudLayoutComponent, - ServiceTaskListCloudDemoComponent, SearchFilterChipsComponent ], providers: [ { provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production - provideTranslations('app', 'resources'), - AppNotificationsService, - { - provide: APP_INITIALIZER, - useFactory: setupAppNotifications, - deps: [AppNotificationsService], - multi: true - } + provideTranslations('app', 'resources') ], bootstrap: [AppComponent] }) diff --git a/demo-shell/src/app/app.routes.ts b/demo-shell/src/app/app.routes.ts index faab98f444..495d94b4e2 100644 --- a/demo-shell/src/app/app.routes.ts +++ b/demo-shell/src/app/app.routes.ts @@ -28,14 +28,10 @@ import { AppsViewComponent } from './components/process-service/apps-view.compon import { SearchResultComponent } from './components/search/search-result.component'; import { FilesComponent } from './components/files/files.component'; import { FormComponent } from './components/form/form.component'; -import { FormListComponent } from './components/form/form-list.component'; -import { SharedLinkViewComponent } from './components/shared-link-view/shared-link-view.component'; -import { FormLoadingComponent } from './components/form/form-loading.component'; import { DemoPermissionComponent } from './components/permissions/demo-permissions.component'; import { AppComponent } from './app.component'; import { TreeViewSampleComponent } from './components/tree-view/tree-view-sample.component'; import { AppsCloudDemoComponent } from './components/cloud/apps-cloud-demo.component'; -import { PeopleGroupCloudDemoComponent } from './components/cloud/people-groups-cloud-demo.component'; import { CloudLayoutComponent } from './components/cloud/cloud-layout.component'; import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.component'; import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component'; @@ -46,9 +42,7 @@ import { CloudViewerComponent } from './components/cloud/cloud-viewer.component' import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component'; import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/cloud-form-demo.component'; import { DemoErrorComponent } from './components/error/demo-error.component'; -import { TaskHeaderCloudDemoComponent } from './components/cloud/task-header-cloud-demo.component'; import { ProcessCloudLayoutComponent } from './components/cloud/process-cloud-layout.component'; -import { ServiceTaskListCloudDemoComponent } from './components/cloud/service-task-list-cloud-demo.component'; import { SearchFilterChipsComponent } from './components/search/search-filter-chips.component'; export const appRoutes: Routes = [ @@ -81,7 +75,6 @@ export const appRoutes: Routes = [ pathMatch: 'full', loadChildren: () => import('./components/file-view/file-view.module').then(m => m.FileViewModule) }, - { path: 'preview/s/:id', component: SharedLinkViewComponent }, { path: '', component: AppLayoutComponent, @@ -92,10 +85,6 @@ export const appRoutes: Routes = [ redirectTo: `/home`, pathMatch: 'full' }, - { - path: 'config-editor', - loadChildren: () => import('./components/config-editor/config-editor.module').then(m => m.AppConfigEditorModule) - }, { path: 'card-view', loadChildren: () => import('./components/card-view/card-view.module').then(m => m.AppCardViewModule) @@ -118,26 +107,6 @@ export const appRoutes: Routes = [ data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' }, component: AppsCloudDemoComponent }, - { - path: 'people-group-cloud', - data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' }, - component: PeopleGroupCloudDemoComponent - }, - { - path: 'task-header-cloud', - data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' }, - component: TaskHeaderCloudDemoComponent - }, - { - path: 'service-task-list', - data: { roles: ['ACTIVITI_ADMIN'], redirectUrl: '/error/403' }, - component: ServiceTaskListCloudDemoComponent - }, - { - path: 'community', - data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' }, - loadChildren: () => import('./components/cloud/community/community.module').then(m => m.AppCommunityModule) - }, { path: ':appName', canActivate: [AuthGuardSsoRoleService], @@ -187,11 +156,6 @@ export const appRoutes: Routes = [ path: 'settings-layout', loadChildren: () => import('./components/settings/settings.module').then(m => m.AppSettingsModule) }, - { - path: 'trashcan', - canActivate: [AuthGuardEcm], - loadChildren: () => import('./components/trashcan/trashcan.module').then(m => m.AppTrashcanModule) - }, { path: 'files', component: FilesComponent, @@ -207,11 +171,6 @@ export const appRoutes: Routes = [ component: FilesComponent, canActivate: [AuthGuardEcm] }, - { - path: 'dl-custom-sources', - canActivate: [AuthGuardEcm], - loadChildren: () => import('./components/files/custom-sources.module').then(m => m.AppCustomSourcesModule) - }, { path: 'search', component: SearchResultComponent, @@ -291,14 +250,8 @@ export const appRoutes: Routes = [ component: TreeViewSampleComponent, canActivate: [AuthGuardEcm] }, - { - path: 'about', - loadChildren: () => import('./components/about/about.module').then(m => m.AppAboutModule) - }, { path: 'form-cloud', component: FormCloudDemoComponent }, { path: 'form', component: FormComponent }, - { path: 'form-list', component: FormListComponent }, - { path: 'form-loading', component: FormLoadingComponent }, { path: 'task-list', canActivate: [AuthGuardBpm], diff --git a/demo-shell/src/app/components/about/about.component.html b/demo-shell/src/app/components/about/about.component.html deleted file mode 100644 index dfb0cd9453..0000000000 --- a/demo-shell/src/app/components/about/about.component.html +++ /dev/null @@ -1,34 +0,0 @@ -Dev Mode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demo-shell/src/app/components/about/about.component.ts b/demo-shell/src/app/components/about/about.component.ts deleted file mode 100644 index 9d06115765..0000000000 --- a/demo-shell/src/app/components/about/about.component.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnInit } from '@angular/core'; -import { AppExtensionService, ExtensionRef } from '@alfresco/adf-extensions'; -import { AuthenticationService, BpmProductVersionModel, RepositoryInfo } from '@alfresco/adf-core'; -import { DiscoveryApiService } from '@alfresco/adf-content-services'; -import pkg from '../../../../../package.json'; -import { Observable } from 'rxjs'; - -@Component({ - selector: 'app-about-page', - templateUrl: './about.component.html' -}) -export class AboutComponent implements OnInit { - pkg: any; - dev: true; - - extensions$: Observable; - repository: RepositoryInfo = null; - bpmVersion: BpmProductVersionModel = null; - - constructor( - private authenticationService: AuthenticationService, - private appExtensionService: AppExtensionService, - private discoveryApiService: DiscoveryApiService - ) { - this.pkg = pkg; - this.extensions$ = this.appExtensionService.references$; - } - - ngOnInit(): void { - if (this.authenticationService.isEcmLoggedIn()) { - this.setECMInfo(); - } - - if (this.authenticationService.isBpmLoggedIn()) { - this.setBPMInfo(); - } - } - - setECMInfo() { - this.discoveryApiService.getEcmProductInfo().subscribe((repository) => { - this.repository = repository as RepositoryInfo; - }); - } - - setBPMInfo() { - this.discoveryApiService.getBpmProductInfo().subscribe((bpmVersion) => { - this.bpmVersion = bpmVersion; - }); - } -} diff --git a/demo-shell/src/app/components/about/about.module.ts b/demo-shell/src/app/components/about/about.module.ts deleted file mode 100644 index 604f426100..0000000000 --- a/demo-shell/src/app/components/about/about.module.ts +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { AboutComponent } from './about.component'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; - -const routes: Routes = [ - { - path: '', - component: AboutComponent - } -]; - -@NgModule({ - imports: [ - CommonModule, - CoreModule, - RouterModule.forChild(routes) - ], - declarations: [AboutComponent] -}) -export class AppAboutModule {} diff --git a/demo-shell/src/app/components/app-layout/app-layout.component.html b/demo-shell/src/app/components/app-layout/app-layout.component.html index 214e1b5af4..9f2303604a 100644 --- a/demo-shell/src/app/components/app-layout/app-layout.component.html +++ b/demo-shell/src/app/components/app-layout/app-layout.component.html @@ -18,15 +18,6 @@ - - - - - - - diff --git a/demo-shell/src/app/components/app-layout/app-layout.component.ts b/demo-shell/src/app/components/app-layout/app-layout.component.ts index d4088c8ab3..b1118b830f 100644 --- a/demo-shell/src/app/components/app-layout/app-layout.component.ts +++ b/demo-shell/src/app/components/app-layout/app-layout.component.ts @@ -33,27 +33,17 @@ export class AppLayoutComponent { { href: '/cloud', icon: 'cloud', title: 'Process Cloud', children: [ { href: '/cloud/', icon: 'cloud', title: 'Home' }, - { href: '/cloud/community', icon: 'cloud', title: 'Community' }, - { href: '/form-cloud', icon: 'poll', title: 'Form' }, - { href: '/cloud/people-group-cloud', icon: 'group', title: 'People/Group Cloud' }, - { href: '/cloud/task-header-cloud', icon: 'cloud', title: 'Task Header Cloud' }, - { href: '/cloud/service-task-list', icon: 'cloud', title: 'Service Task List' } + { href: '/form-cloud', icon: 'poll', title: 'Form' } ] }, { href: '/activiti', icon: 'device_hub', title: 'Process Services', children: [ { href: '/activiti', icon: 'vpn_key', title: 'App' }, { href: '/process-list', icon: 'assignment', title: 'Process List' }, - { href: '/form', icon: 'poll', title: 'Form' }, - { href: '/form-list', icon: 'library_books', title: 'Form List' }, - { href: '/form-loading', icon: 'cached', title: 'Form Loading' } + { href: '/form', icon: 'poll', title: 'Form' } ]}, { href: '/login', icon: 'vpn_key', title: 'Login' }, - { href: '/trashcan', icon: 'delete', title: 'Trashcan' }, - { href: '/dl-custom-sources', icon: 'extension', title: 'Custom Sources' }, { href: '/settings-layout', icon: 'settings', title: 'Settings' }, - { href: '/config-editor', icon: 'code', title: 'Configuration Editor' }, - { href: '/treeview', icon: 'nature', title: 'Tree View' }, - { href: '/about', icon: 'info_outline', title: 'About' } + { href: '/treeview', icon: 'nature', title: 'Tree View' } ]; enableRedirect = true; 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 a86088732e..2fd59bec94 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,6 +1,5 @@
- - +

Error log:

-

Error {{ error.name }} {{error.validationSummary.message | - translate}}

+

Error {{ error.name }} {{error.validationSummary.message | translate}}

@@ -26,15 +24,9 @@ (onInit)="onInitFormEditor($event)">
- - -
- -
diff --git a/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.scss b/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.scss index 0d1fb39d22..1e8697df81 100644 --- a/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.scss +++ b/demo-shell/src/app/components/app-layout/cloud/form-demo/cloud-form-demo.component.scss @@ -6,11 +6,6 @@ padding: 0 15px; } -.app-card-view { - width: 30%; - display: inline-block; -} - .app-console { width: 60%; display: inline-block; @@ -36,22 +31,18 @@ } .app-form-editor-buttons { - display: flex; - justify-content: space-evenly; + & > .mat-raised-button { + margin-right: 5px; + } } .app-upload-config-button { - display: flex; - justify-content: center; - input { cursor: pointer; - height: 100%; right: 0; opacity: 0; position: absolute; top: 0; - width: 300px; z-index: 4; } } diff --git a/demo-shell/src/app/components/card-view/card-view.component.html b/demo-shell/src/app/components/card-view/card-view.component.html index 159e957f4b..e9800ff9bd 100644 --- a/demo-shell/src/app/components/card-view/card-view.component.html +++ b/demo-shell/src/app/components/card-view/card-view.component.html @@ -49,6 +49,4 @@

- - -
+ diff --git a/demo-shell/src/app/components/cloud/community/community-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-cloud.component.html deleted file mode 100644 index 63e0e88a6d..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-cloud.component.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - arrow_drop_down -
- -
-
- -
-
- -
-
- - - - - -
-
- - - -
diff --git a/demo-shell/src/app/components/cloud/community/community-cloud.component.scss b/demo-shell/src/app/components/cloud/community/community-cloud.component.scss deleted file mode 100644 index 7ed4c30e56..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-cloud.component.scss +++ /dev/null @@ -1,20 +0,0 @@ -.app-cloud-layout-overflow { - overflow: auto; -} - -.app-cloud-layout-tab-body { - height: 100%; - min-height: 100%; - min-width: 100%; - width: 100%; - - .mat-tab-body-wrapper { - height: 100%; - } - - adf-sidenav-layout { - min-height: 100%; - min-width: 100%; - } -} - diff --git a/demo-shell/src/app/components/cloud/community/community-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-cloud.component.ts deleted file mode 100644 index 9de5f8a779..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-cloud.component.ts +++ /dev/null @@ -1,59 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnInit, ViewEncapsulation } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { CloudLayoutService } from '../services/cloud-layout.service'; - -@Component({ - templateUrl: './community-cloud.component.html', - styleUrls: ['./community-cloud.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class CommunityCloudComponent implements OnInit { - - constructor( - private router: Router, - private route: ActivatedRoute, - private cloudLayoutService: CloudLayoutService - ) { } - - ngOnInit() { - let root: string = ''; - if (this.route.snapshot && this.route.snapshot.firstChild) { - root = this.route.snapshot.firstChild.url[0].path; - } - - this.route.queryParams.subscribe((params) => { - if (root === 'tasks' && params.id) { - this.cloudLayoutService.setCurrentTaskFilterParam({ id: params.id }); - } - - if (root === 'processes' && params.id) { - this.cloudLayoutService.setCurrentProcessFilterParam({ id: params.id }); - } - }); - } - - onStartTask() { - this.router.navigate([`/cloud/community/start-task/`]); - } - - onStartProcess() { - this.router.navigate([`/cloud/community/start-process/`]); - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-filters.component.html b/demo-shell/src/app/components/cloud/community/community-filters.component.html deleted file mode 100644 index 510c7e3ac9..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-filters.component.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Task Filters - - - - - - - - - - Process Filters - - - - - - diff --git a/demo-shell/src/app/components/cloud/community/community-filters.component.ts b/demo-shell/src/app/components/cloud/community/community-filters.component.ts deleted file mode 100644 index b55dfb5181..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-filters.component.ts +++ /dev/null @@ -1,92 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewEncapsulation, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { Router, ActivatedRoute } from '@angular/router'; -import { CloudLayoutService } from '../services/cloud-layout.service'; -@Component({ - selector: 'app-community-cloud-filters-demo', - templateUrl: './community-filters.component.html', - encapsulation: ViewEncapsulation.None -}) -export class CommunityCloudFiltersDemoComponent implements OnInit { - - currentTaskFilter$: Observable; - currentProcessFilter$: Observable; - - toggleTaskFilter = true; - toggleProcessFilter = true; - - expandTaskFilter = true; - expandProcessFilter = false; - - constructor( - private cloudLayoutService: CloudLayoutService, - private router: Router, - private route: ActivatedRoute - ) {} - - ngOnInit() { - this.currentTaskFilter$ = this.cloudLayoutService.taskFilter$; - this.currentProcessFilter$ = this.cloudLayoutService.processFilter$; - - let root = ''; - if (this.route.snapshot && this.route.snapshot.firstChild) { - root = this.route.snapshot.firstChild.url[0].path; - if (root === 'tasks') { - this.expandTaskFilter = true; - this.expandProcessFilter = false; - } else if (root === 'processes') { - this.expandProcessFilter = true; - this.expandTaskFilter = false; - } - } - } - - onTaskFilterSelected(filter) { - this.cloudLayoutService.setCurrentTaskFilterParam({id: filter.id}); - const currentFilter = Object.assign({}, filter); - this.router.navigate([`/cloud/community/tasks/`], { queryParams: currentFilter }); - } - - onProcessFilterSelected(filter) { - this.cloudLayoutService.setCurrentProcessFilterParam({id: filter.id}); - const currentFilter = Object.assign({}, filter); - this.router.navigate([`/cloud/community/processes/`], { queryParams: currentFilter }); - } - - onTaskFilterOpen(): boolean { - this.expandTaskFilter = true; - this.expandProcessFilter = false; - return this.toggleTaskFilter; - } - - onTaskFilterClose(): boolean { - return !this.toggleTaskFilter; - } - - onProcessFilterOpen(): boolean { - this.expandProcessFilter = true; - this.expandTaskFilter = false; - return this.toggleProcessFilter; - } - - onProcessFilterClose(): boolean { - return !this.toggleProcessFilter; - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.html deleted file mode 100644 index 85df0380a4..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.html +++ /dev/null @@ -1,21 +0,0 @@ - - - -

Simple page to show the process instance: {{ processInstanceId }}

- -
- - - - - - -
- diff --git a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.scss b/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.scss deleted file mode 100644 index 8f9530490d..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.scss +++ /dev/null @@ -1,17 +0,0 @@ -app-community-process-details-cloud { - .app { - &-process-cloud-container { - display: flex; - } - - &-cloud-layout-overflow { - width: 67%; - flex: 1; - } - - &-process-cloud-header { - margin-left: 10px; - width: 25%; - } - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.ts deleted file mode 100644 index 4d5c178533..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-process-details-cloud.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewEncapsulation } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -@Component({ - selector: 'app-community-process-details-cloud', - templateUrl: './community-process-details-cloud.component.html', - styleUrls: ['./community-process-details-cloud.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class CommunityProcessDetailsCloudDemoComponent { - - processInstanceId: string; - - constructor(private route: ActivatedRoute, private router: Router) { - this.route.params.subscribe((params) => { - this.processInstanceId = params.processInstanceId; - }); - } - - onGoBack() { - this.router.navigate([`/cloud/community/`]); - } - - onRowClick(taskId: string) { - if (taskId) { - this.router.navigate([`/cloud/community/task-details/${taskId}`]); - } - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.html deleted file mode 100644 index e7e0b54682..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.html +++ /dev/null @@ -1,42 +0,0 @@ - - -
- - - - -
- Selected rows: -
    -
  • {{ row.id }}
  • -
-
-
diff --git a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.scss b/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.scss deleted file mode 100644 index c8838cf2a5..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.scss +++ /dev/null @@ -1,21 +0,0 @@ -app-community-processes-cloud-demo { - height: 100%; - min-height: 100%; - min-width: 100%; - width: 100%; - - .app-cloud-process-list-container { - place-content: stretch space-between; - align-items: stretch; - margin-top: 2px; - } - - &, .app-cloud-process-list-container { - flex-direction: column; - display: flex; - } - - .app-cloud-layout-overflow, .app-cloud-process-list-container { - flex: 1; - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.ts deleted file mode 100644 index 2e70645191..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-processes-cloud.component.ts +++ /dev/null @@ -1,153 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; -import { - ProcessFilterCloudModel, - ProcessFilterCloudService, - ProcessFiltersCloudComponent, - ProcessListCloudComponent, - ProcessListCloudSortingModel -} from '@alfresco/adf-process-services-cloud'; - -import { ActivatedRoute, Router } from '@angular/router'; -import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core'; -import { CloudLayoutService } from '../services/cloud-layout.service'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; -import { Pagination } from '@alfresco/js-api'; - -const PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter'; -const ACTION_SAVE_AS = 'saveAs'; - -@Component({ - selector: 'app-community-processes-cloud-demo', - templateUrl: './community-processes-cloud.component.html', - styleUrls: ['./community-processes-cloud.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class CommunityProcessesCloudDemoComponent implements OnInit, OnDestroy { - @ViewChild('processCloud') - processCloud: ProcessListCloudComponent; - - @ViewChild('processFiltersCloud') - processFiltersCloud: ProcessFiltersCloudComponent; - - isFilterLoaded: boolean; - filterId: string = ''; - sortArray: any = []; - selectedRow: any; - multiselect: boolean; - selectionMode: string; - selectedRows: any[] = []; - testingMode: boolean; - processFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] }; - - editedFilter: ProcessFilterCloudModel; - - private onDestroy$ = new Subject(); - - constructor( - private route: ActivatedRoute, - private router: Router, - private cloudLayoutService: CloudLayoutService, - private userPreference: UserPreferencesService, - private processFilterCloudService: ProcessFilterCloudService, - private appConfig: AppConfigService) { - const properties = this.appConfig.get>( - PROCESS_FILTER_PROPERTY_KEYS - ); - - if (properties) { - this.processFilterProperties = properties; - } - } - - ngOnInit() { - this.isFilterLoaded = false; - - this.route.queryParams.subscribe((params) => { - if (Object.keys(params).length > 0) { - this.isFilterLoaded = true; - this.onFilterChange(params); - this.filterId = params.id; - } else { - this.loadDefaultFilters(); - } - }); - - this.cloudLayoutService - .settings$ - .pipe(takeUntil(this.onDestroy$)) - .subscribe(settings => this.setCurrentSettings(settings)); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - loadDefaultFilters() { - this.processFilterCloudService - .getProcessFilters('community') - .subscribe((filters: ProcessFilterCloudModel[]) => { - this.onFilterChange(filters[0]); - }); - } - - setCurrentSettings(settings) { - if (settings) { - this.multiselect = settings.multiselect; - this.testingMode = settings.testingMode; - this.selectionMode = settings.selectionMode; - } - } - - onChangePageSize(event: Pagination) { - this.userPreference.paginationSize = event.maxItems; - } - - resetSelectedRows() { - this.selectedRows = []; - } - - onRowClick(processInstanceId: string) { - this.router.navigate([`/cloud/community/process-details/${processInstanceId}`]); - } - - onFilterChange(query: any) { - this.editedFilter = Object.assign({}, query); - this.sortArray = [ - new ProcessListCloudSortingModel({ - orderBy: this.editedFilter.sort, - direction: this.editedFilter.order - }) - ]; - } - - onProcessFilterAction(filterAction: any) { - this.cloudLayoutService.setCurrentProcessFilterParam({ id: filterAction.filter.id }); - if (filterAction.actionType === ACTION_SAVE_AS) { - this.router.navigate([`/cloud/community/processes/`], { queryParams: filterAction.filter }); - } - } - - onRowsSelected(nodes) { - this.resetSelectedRows(); - this.selectedRows = nodes.map((node) => node.obj); - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.html deleted file mode 100644 index d5aeaec39d..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.html +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.ts deleted file mode 100644 index b9331547e2..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-start-process-cloud.component.ts +++ /dev/null @@ -1,55 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { NotificationService, AppConfigService } from '@alfresco/adf-core'; -import { CloudLayoutService } from '../services/cloud-layout.service'; - -@Component({ - templateUrl: './community-start-process-cloud.component.html' -}) -export class CommunityStartProcessCloudDemoComponent implements OnInit { - - processName: string; - - constructor(private appConfig: AppConfigService, - private cloudLayoutService: CloudLayoutService, - private notificationService: NotificationService, - private router: Router) { - } - - ngOnInit() { - this.processName = this.appConfig.get('adf-start-process-cloud.name'); - } - - onStartProcessSuccess() { - this.cloudLayoutService.setCurrentProcessFilterParam({ key: 'running-processes' }); - this.router.navigate([`/cloud/community/processes`]); - } - - onCancelStartProcess() { - this.cloudLayoutService.setCurrentProcessFilterParam({ key: 'all-processes' }); - this.router.navigate([`/cloud/community/processes`]); - } - - openSnackMessage(event: any) { - this.notificationService.openSnackMessage( - event.response.body.message - ); - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.html deleted file mode 100644 index 9975b99cc6..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.html +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.ts deleted file mode 100644 index 58853869af..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-start-task-cloud.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component } from '@angular/core'; -import { Router } from '@angular/router'; -import { NotificationService } from '@alfresco/adf-core'; -import { CloudLayoutService } from '../services/cloud-layout.service'; -@Component({ - templateUrl: './community-start-task-cloud.component.html' -}) -export class CommunityStartTaskCloudDemoComponent { - - constructor( - private cloudLayoutService: CloudLayoutService, - private notificationService: NotificationService, - private router: Router) { - } - - onStartTaskSuccess() { - this.cloudLayoutService.setCurrentTaskFilterParam({key: 'community'}); - this.router.navigate([`/cloud/community/tasks`]); - } - - onCancelStartTask() { - this.cloudLayoutService.setCurrentTaskFilterParam({key: 'community'}); - this.router.navigate([`/cloud/community/tasks`]); - } - - openSnackMessage(event: any) { - this.notificationService.openSnackMessage( - event.response.body.message - ); - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-task-cloud.component.html deleted file mode 100644 index 627724258b..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.html +++ /dev/null @@ -1,46 +0,0 @@ - - -
- - - - -
- Selected rows: -
    -
  • {{ row.name }}
  • -
-
-
diff --git a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.scss b/demo-shell/src/app/components/cloud/community/community-task-cloud.component.scss deleted file mode 100644 index 221d8cb05f..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.scss +++ /dev/null @@ -1,27 +0,0 @@ -app-community-tasks-cloud-demo { - height: 100%; - min-height: 100%; - min-width: 100%; - width: 100%; - - .adf-cloud-layout-tab-body { - .mat-tab-body-wrapper { - height: 100%; - } - } - - .app-cloud-task-list-container { - place-content: stretch space-between; - align-items: stretch; - margin-top: 2px; - } - - &, .app-cloud-task-list-container { - flex-direction: column; - display: flex; - } - - .app-cloud-layout-overflow, .app-cloud-task-list-container { - flex: 1; - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-task-cloud.component.ts deleted file mode 100644 index 9abb95e4ae..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-cloud.component.ts +++ /dev/null @@ -1,148 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; -import { - TaskFilterCloudModel, - TaskFilterCloudService, - TaskListCloudComponent, - TaskListCloudSortingModel -} from '@alfresco/adf-process-services-cloud'; -import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { CloudLayoutService } from '../services/cloud-layout.service'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; -import { Pagination } from '@alfresco/js-api'; - -const ACTION_SAVE_AS = 'saveAs'; -const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter'; - -@Component({ - selector: 'app-community-tasks-cloud-demo', - templateUrl: './community-task-cloud.component.html', - styleUrls: ['./community-task-cloud.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class CommunityTasksCloudDemoComponent implements OnInit, OnDestroy { - @ViewChild('taskCloud') - taskCloud: TaskListCloudComponent; - - isFilterLoaded = false; - - selectedRow: any; - - sortArray: TaskListCloudSortingModel[]; - editedFilter: TaskFilterCloudModel; - taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] }; - - filterId; - multiselect: boolean; - selectedRows: any[] = []; - testingMode: boolean; - selectionMode: string; - taskDetailsRedirection: boolean; - - private onDestroy$ = new Subject(); - - constructor( - private cloudLayoutService: CloudLayoutService, - private route: ActivatedRoute, - private router: Router, - private taskFilterCloudService: TaskFilterCloudService, - private userPreference: UserPreferencesService, - private appConfig: AppConfigService) { - - const properties = this.appConfig.get>(TASK_FILTER_PROPERTY_KEYS); - if (properties) { - this.taskFilterProperties = properties; - } - } - - ngOnInit() { - this.isFilterLoaded = false; - this.route.queryParams.subscribe((params) => { - if (Object.keys(params).length > 0) { - this.isFilterLoaded = true; - this.onFilterChange(params); - this.filterId = params.id; - } else { - setTimeout( () => { - this.loadDefaultFilters(); - }); - } - }); - - this.cloudLayoutService - .settings$ - .pipe(takeUntil(this.onDestroy$)) - .subscribe(settings => this.setCurrentSettings(settings)); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - loadDefaultFilters() { - this.taskFilterCloudService - .getTaskListFilters('community') - .subscribe((filters: TaskFilterCloudModel[]) => { - this.onFilterChange(filters[0]); - }); - } - - setCurrentSettings(settings) { - if (settings) { - this.multiselect = settings.multiselect; - this.testingMode = settings.testingMode; - this.selectionMode = settings.selectionMode; - this.taskDetailsRedirection = settings.taskDetailsRedirection; - } - } - - onChangePageSize(event: Pagination) { - this.userPreference.paginationSize = event.maxItems; - } - - resetSelectedRows() { - this.selectedRows = []; - } - - onRowClick(taskId: string) { - if (!this.multiselect && this.selectionMode !== 'multiple' && this.taskDetailsRedirection) { - this.router.navigate([`/cloud/community/task-details/${taskId}`]); - } - } - - onRowsSelected(nodes) { - this.resetSelectedRows(); - this.selectedRows = nodes.map((node) => node.obj); - } - - onFilterChange(filter: any) { - this.editedFilter = Object.assign({}, filter); - this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })]; - } - - onTaskFilterAction(filterAction: any) { - this.cloudLayoutService.setCurrentTaskFilterParam({ id: filterAction.filter.id }); - if (filterAction.actionType === ACTION_SAVE_AS) { - this.router.navigate([`/cloud/community/tasks/`], { queryParams: filterAction.filter }); - } - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.html b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.html deleted file mode 100644 index c38c857090..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.html +++ /dev/null @@ -1,16 +0,0 @@ -

Simple page to show the taskId: {{ taskId }}

- -
-
- - - -
-
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 deleted file mode 100644 index d8ae2accaf..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.scss +++ /dev/null @@ -1,48 +0,0 @@ -app-community-task-details-cloud { - .app { - &-task-detail-container { - display: flex; - } - - &-task-title { - margin-left: 15px; - } - - &-task-control { - width: 70%; - } - - &-demop-card-container { - width: 30%; - font-family: inherit; - } - - &-community-task-details-cloud-column { - margin: 0; - flex-direction: column; - - .app-community-task-details-cloud-row { - flex-direction: row; - - adf-cloud-task-form { - flex: 1 1 100%; - flex-direction: column; - display: flex; - max-width: 80%; - } - - adf-cloud-task-header { - flex: 1; - } - } - } - - &-community-task-details-cloud-column, &-community-task-details-cloud-row { - height: 100%; - min-height: 100%; - min-width: 100%; - width: 100%; - display: flex; - } - } -} diff --git a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts deleted file mode 100644 index 1c0a23f0a1..0000000000 --- a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewEncapsulation } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationService } from '@alfresco/adf-core'; - -@Component({ - selector: 'app-community-task-details-cloud', - templateUrl: './community-task-details-cloud.component.html', - styleUrls: ['./community-task-details-cloud.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class CommunityTaskDetailsCloudDemoComponent { - - taskId: string; - - constructor( - private route: ActivatedRoute, - private router: Router, - private notificationService: NotificationService - ) { - this.route.params.subscribe((params) => { - this.taskId = params.taskId; - }); - } - - isTaskValid(): boolean { - return this.taskId !== undefined; - } - - goBack() { - this.router.navigate([`/cloud/community/`]); - } - - onCompletedTask() { - this.goBack(); - } - - onUnclaimTask() { - this.goBack(); - } - - onClaimTask() { - this.goBack(); - } - - onTaskCompleted() { - this.goBack(); - } - - onFormSaved() { - this.notificationService.openSnackMessage('Task has been saved successfully'); - } - - onError({ message: error }: Error) { - let errorMessage; - try { - errorMessage = JSON.parse(error).message || JSON.parse(error).entry?.message; - errorMessage = JSON.parse(errorMessage).message; - } catch {} - this.notificationService.showError(errorMessage || error); - } -} diff --git a/demo-shell/src/app/components/cloud/community/community.module.ts b/demo-shell/src/app/components/cloud/community/community.module.ts deleted file mode 100644 index 548ce84b37..0000000000 --- a/demo-shell/src/app/components/cloud/community/community.module.ts +++ /dev/null @@ -1,95 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { - ProcessServicesCloudModule, - LocalPreferenceCloudService, - PROCESS_FILTERS_SERVICE_TOKEN, - TASK_FILTERS_SERVICE_TOKEN -} from '@alfresco/adf-process-services-cloud'; - -import { CommunityCloudComponent } from './community-cloud.component'; -import { CommunityTasksCloudDemoComponent } from './community-task-cloud.component'; -import { CommunityCloudFiltersDemoComponent } from './community-filters.component'; -import { CommunityProcessesCloudDemoComponent } from './community-processes-cloud.component'; -import { CommunityStartProcessCloudDemoComponent } from './community-start-process-cloud.component'; -import { CommunityStartTaskCloudDemoComponent } from './community-start-task-cloud.component'; -import { CommunityProcessDetailsCloudDemoComponent } from './community-process-details-cloud.component'; -import { CommunityTaskDetailsCloudDemoComponent } from './community-task-details-cloud.component'; -import { AppCloudSharedModule } from '../shared/cloud.shared.module'; - -const routes: Routes = [ - { - path: '', - component: CommunityCloudComponent, - children: [ - { - path: 'tasks', - component: CommunityTasksCloudDemoComponent - }, - { - path: 'processes', - component: CommunityProcessesCloudDemoComponent - }, - { - path: 'start-task', - component: CommunityStartTaskCloudDemoComponent - }, - { - path: 'start-process', - component: CommunityStartProcessCloudDemoComponent - }, - { - path: 'task-details/:taskId', - component: CommunityTaskDetailsCloudDemoComponent - }, - { - path: 'process-details/:processInstanceId', - component: CommunityProcessDetailsCloudDemoComponent - } - ] - } -]; - -@NgModule({ - imports: [ - CommonModule, - CoreModule, - ProcessServicesCloudModule, - RouterModule.forChild(routes), - AppCloudSharedModule - ], - declarations: [ - CommunityCloudComponent, - CommunityTasksCloudDemoComponent, - CommunityCloudFiltersDemoComponent, - CommunityProcessesCloudDemoComponent, - CommunityStartProcessCloudDemoComponent, - CommunityStartTaskCloudDemoComponent, - CommunityProcessDetailsCloudDemoComponent, - CommunityTaskDetailsCloudDemoComponent - ], - providers: [ - { provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }, - { provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService } - ] -}) -export class AppCommunityModule {} diff --git a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.html b/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.html deleted file mode 100644 index 31e66d05fe..0000000000 --- a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.html +++ /dev/null @@ -1,128 +0,0 @@ - - People Cloud Component - - -
- - Single Selection - Multiple Selection - -
- - Application Name - - - - Roles: ["ACTIVITI_ADMIN", "ACTIVITI_USER"] - - - - Groups Restriction ["hr", "sales"] - - - - Preselect: {{ defaultPeoplePlaceholder }} - - - Preselect validation - Read-only Mode -
-
- -
- -
-

All Preselected Users

- - - person - {{item | fullName}} - - - -
-

Invalid Users warning

- - - person - {{invalidUser | fullName}} - - -
-
-
-
- - - Groups Cloud Component - - -
- - Single Selection - Multiple Selection - -
- - Application Name - - - - Roles: ["ACTIVITI_ADMIN", "ACTIVITI_USER"] - - - - Preselect: {{ defaultGroupPlaceholder }} - - - Preselect validation - - Read-only Mode - -
-
- -
- -
-

All Preselected Groups

- - - group - {{ item.name }} - - - -
-

Invalid Groups warning

- - - group - {{invalidGroup?.name}} - - -
-
-
-
diff --git a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.scss b/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.scss deleted file mode 100644 index 0f371aaf2e..0000000000 --- a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.scss +++ /dev/null @@ -1,31 +0,0 @@ -.app { - &-section { - mat-card-title { - font-size: 18px; - font-weight: bold; - } - - mat-radio-group { - margin: 7px 10px; - - mat-radio-button { - margin: 0 3px; - } - } - - mat-card-content { - .app-preselect-value { - margin-right: 15px; - min-width: 25%; - - &-big { - width: 60%; - } - - &-full { - width: 100%; - } - } - } - } -} diff --git a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts deleted file mode 100644 index ad1c0760e7..0000000000 --- a/demo-shell/src/app/components/cloud/people-groups-cloud-demo.component.ts +++ /dev/null @@ -1,164 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewEncapsulation } from '@angular/core'; -import { ComponentSelectionMode, IdentityUserModel, IdentityGroupModel } from '@alfresco/adf-process-services-cloud'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MatRadioChange } from '@angular/material/radio'; - -@Component({ - selector: 'app-people-groups-cloud', - templateUrl: './people-groups-cloud-demo.component.html', - styleUrls: ['./people-groups-cloud-demo.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class PeopleGroupCloudDemoComponent { - - defaultFilterMode: string = 'appName'; - defaultGroupPlaceholder: string = `[{"id": "1", "name":"activitiUserGroup"}]`; - defaultPeoplePlaceholder: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`; - - peopleMode: ComponentSelectionMode = 'single'; - preSelectUsers: IdentityUserModel[] = []; - invalidUsers: IdentityUserModel[] = []; - peopleRoles: string[] = []; - groupsRestriction: string[] = []; - peopleAppName: string; - peopleFilterMode: string = this.defaultFilterMode; - peoplePreselectValidation = false; - groupPreselectValidation = false; - peopleReadonly = false; - groupReadonly = false; - - groupMode: ComponentSelectionMode = 'single'; - preSelectGroup: IdentityGroupModel[] = []; - invalidGroups: IdentityGroupModel[] = []; - groupRoles: string[]; - groupAppName: string; - groupFilterMode: string = this.defaultFilterMode; - - setPeoplePreselectValue(value: string): void { - this.preSelectUsers = this.getArrayFromString(value); - } - - setGroupsPreselectValue(value: string): void { - this.preSelectGroup = this.getArrayFromString(value); - } - - setPeopleRoles(value: string): void { - this.peopleRoles = this.getArrayFromString(value); - } - - setGroupRoles(value: string): void { - this.groupRoles = this.getArrayFromString(value); - } - - setPeopleAppName(value: string): void { - this.peopleAppName = value; - } - - setGroupAppName(value: string): void { - this.groupAppName = value; - } - - setPeopleGroupsRestriction(value: string): void { - this.groupsRestriction = this.getArrayFromString(value); - } - - onChangePeopleMode(event: MatRadioChange): void { - this.peopleMode = event.value; - } - - onChangePeopleReadonly(event: MatCheckboxChange): void { - this.peopleReadonly = event.checked; - } - - onChangeGroupReadonly(event: MatCheckboxChange): void { - this.groupReadonly = event.checked; - } - - onChangeGroupsMode(event: MatRadioChange): void { - this.groupMode = event.value; - } - - onChangePeopleFilterMode(event: MatRadioChange): void { - this.peopleFilterMode = event.value; - this.resetPeopleFilter(); - } - - onChangeGroupsFilterMode(event: MatRadioChange): void { - this.groupFilterMode = event.value; - this.restGroupFilter(); - } - - isPeopleAppNameSelected(): boolean { - return this.peopleFilterMode === 'appName'; - } - - isGroupAppNameSelected(): boolean { - return this.groupFilterMode === 'appName'; - } - - resetPeopleFilter(): void { - if (this.isPeopleAppNameSelected()) { - this.peopleRoles = []; - } else { - this.peopleAppName = ''; - } - } - - restGroupFilter(): void { - if (this.isGroupAppNameSelected()) { - this.groupRoles = []; - } else { - this.groupAppName = ''; - } - } - - onChangePeopleValidation(event: MatCheckboxChange): void { - this.peoplePreselectValidation = event.checked; - } - - onChangeGroupValidation(event: MatCheckboxChange): void { - this.groupPreselectValidation = event.checked; - } - - onGroupsWarning(warning: any): void { - this.invalidGroups = warning.groups; - } - - onUsersWarning(warning: any): void { - this.invalidUsers = warning.users; - } - - isStringArray(str: string): boolean { - try { - const result = JSON.parse(str); - return Array.isArray(result); - } catch (e) { - return false; - } - } - - private getArrayFromString(value: string): T[] { - if (this.isStringArray(value)) { - return JSON.parse(value); - } else { - return []; - } - } -} diff --git a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html deleted file mode 100644 index 66b125ff69..0000000000 --- a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.html +++ /dev/null @@ -1,38 +0,0 @@ - - -
- - -
- - - - -
-
diff --git a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.scss b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.scss deleted file mode 100644 index 76cb774450..0000000000 --- a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -app-service-task-list-cloud-demo { - min-height: 100%; - min-width: 100%; - display: flex; - - .app-task-list-with-filter, .app-task-list-container { - flex-direction: column; - display: flex; - flex: 1; - } - - &, .app-task-list-container { - height: 100%; - width: 100%; - } - - .app-task-list-container { - place-content: stretch space-between; - align-items: stretch; - - .app-cloud-layout-overflow { - flex: 1; - } - } -} diff --git a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts deleted file mode 100644 index ce88cd9dc6..0000000000 --- a/demo-shell/src/app/components/cloud/service-task-list-cloud-demo.component.ts +++ /dev/null @@ -1,114 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; -import { - ServiceTaskFilterCloudModel, - ServiceTaskListCloudComponent, - TaskListCloudSortingModel -} from '@alfresco/adf-process-services-cloud'; -import { AppConfigService, PaginationModel, UserPreferencesService } from '@alfresco/adf-core'; -import { CloudLayoutService, CloudServiceSettings } from './services/cloud-layout.service'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-service-task-filter'; - -@Component({ - selector: 'app-service-task-list-cloud-demo', - templateUrl: './service-task-list-cloud-demo.component.html', - styleUrls: ['./service-task-list-cloud-demo.component.scss'], - encapsulation: ViewEncapsulation.None -}) -export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy { - @ViewChild('taskCloud') - taskCloud: ServiceTaskListCloudComponent; - - appName = 'simpleapp'; - - isFilterLoaded = false; - - selectedRow: any; - - sortArray: TaskListCloudSortingModel[]; - editedFilter: ServiceTaskFilterCloudModel; - taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] }; - - multiselect: boolean; - selectedRows: string[] = []; - actionMenu: boolean; - contextMenu: boolean; - actions: any[] = []; - selectedAction: { id: number; name: string; actionType: string}; - selectedContextAction: { id: number; name: string; actionType: string}; - selectionMode: string; - filterId: string; - - private onDestroy$ = new Subject(); - - constructor( - private cloudLayoutService: CloudLayoutService, - private userPreference: UserPreferencesService, - private appConfig: AppConfigService) { - - const properties = this.appConfig.get>(TASK_FILTER_PROPERTY_KEYS); - if (properties === this.taskFilterProperties) { - this.taskFilterProperties = properties; - } - } - - ngOnInit() { - this.isFilterLoaded = false; - this.cloudLayoutService.settings$ - .pipe(takeUntil(this.onDestroy$)) - .subscribe(settings => this.setCurrentSettings(settings)); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - setCurrentSettings(settings: CloudServiceSettings) { - if (settings) { - this.multiselect = settings.multiselect; - this.selectionMode = settings.selectionMode; - this.actionMenu = settings.actionMenu; - this.contextMenu = settings.contextMenu; - this.actions = settings.actions; - } - } - - onTaskFilterSelected(filter: ServiceTaskFilterCloudModel) { - this.filterId = filter.id; - this.editedFilter = filter; - } - - onChangePageSize(event: PaginationModel) { - this.userPreference.paginationSize = event.maxItems; - } - - resetSelectedRows() { - this.selectedRows = []; - } - - onFilterChange(filter: ServiceTaskFilterCloudModel) { - this.appName = filter.appName; - this.editedFilter = Object.assign({}, filter); - this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })]; - } -} diff --git a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.html b/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.html deleted file mode 100644 index c5629072f1..0000000000 --- a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.html +++ /dev/null @@ -1,27 +0,0 @@ -

Task Header Cloud

- - - App name - - - - - Task id - - - -{{errorMessage}} - -
- - -
diff --git a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.scss b/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.scss deleted file mode 100644 index 36628ccec7..0000000000 --- a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.scss +++ /dev/null @@ -1,15 +0,0 @@ -.app { - &-appName-input { - width: 500px; - margin-right: 50px; - } - - &-taskId-input { - width: 500px; - } - - &-find-task-button { - background-color: #ff9800; - margin-left: 30px; - } -} diff --git a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.ts deleted file mode 100644 index 164b2e9f2a..0000000000 --- a/demo-shell/src/app/components/cloud/task-header-cloud-demo.component.ts +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewChild } from '@angular/core'; -import { TaskHeaderCloudComponent } from '@alfresco/adf-process-services-cloud'; -import { UntypedFormControl } from '@angular/forms'; - -@Component({ - templateUrl: './task-header-cloud-demo.component.html', - styleUrls: ['./task-header-cloud-demo.component.scss'] -}) -export class TaskHeaderCloudDemoComponent { - @ViewChild('taskHeader', { static: true }) - taskHeader: TaskHeaderCloudComponent; - - appName: string; - taskId: string; - - errorMessage; - - appNameFormControl = new UntypedFormControl(''); - taskIdFormControl = new UntypedFormControl(''); - - constructor() {} - - updateTaskHeader() { - this.errorMessage = undefined; - this.appName = this.appNameFormControl.value; - this.taskId = this.taskIdFormControl.value; - } - - onError(error) { - this.errorMessage = error; - } -} diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.html b/demo-shell/src/app/components/config-editor/config-editor.component.html deleted file mode 100644 index 7681121354..0000000000 --- a/demo-shell/src/app/components/config-editor/config-editor.component.html +++ /dev/null @@ -1,49 +0,0 @@ -
- - - - App Config Editor - - - - - Infinite pagination - - - - - Supported Page Sizes - - - - - Page Orientation - - - - -
- - -
- - -
-
-
diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.scss b/demo-shell/src/app/components/config-editor/config-editor.component.scss deleted file mode 100644 index 156a8841c8..0000000000 --- a/demo-shell/src/app/components/config-editor/config-editor.component.scss +++ /dev/null @@ -1,16 +0,0 @@ -.app-file-editor { - height: 500px; - width: 65%; - float: left; -} - -.app-list-configurations { - float: left; - width: 30%; -} - -.app-list-configurations-buttons { - width: 200px; - margin-left: 30%; - float: left; -} diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.ts b/demo-shell/src/app/components/config-editor/config-editor.component.ts deleted file mode 100644 index 4442eab6e1..0000000000 --- a/demo-shell/src/app/components/config-editor/config-editor.component.ts +++ /dev/null @@ -1,143 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, OnDestroy } from '@angular/core'; -import { - AppConfigService, - NotificationService, - UserPreferencesService, - UserPreferenceValues -} from '@alfresco/adf-core'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -@Component({ - selector: 'app-config-editor', - templateUrl: './config-editor.component.html', - styleUrls: ['./config-editor.component.scss'] -}) -export class ConfigEditorComponent implements OnDestroy { - - private onDestroy$ = new Subject(); - - editor: any; - code: any; - field: string; - invalidJson = false; - isUserPreference = false; - userPreferenceProperty: string; - - editorOptions = { - theme: 'vs-dark', - language: 'json', - autoIndent: true, - formatOnPaste: true, - formatOnType: true - }; - - onInit(editor) { - this.editor = editor; - this.indentCode(); - } - - constructor(private appConfig: AppConfigService, - private userPreferencesService: UserPreferencesService, - private notificationService: NotificationService) { - this.code = JSON.stringify(appConfig.config); - } - - onSave() { - try { - if (this.isUserPreference) { - this.userPreferencesService.set(this.userPreferenceProperty, JSON.parse(this.editor.getValue())); - } else { - this.appConfig.config = JSON.parse(this.editor.getValue()); - } - } catch (error) { - this.invalidJson = true; - this.notificationService.openSnackMessage('Wrong Code configuration ' + error); - } finally { - if (!this.invalidJson) { - this.notificationService.openSnackMessage('Saved'); - } - } - } - - onClear() { - this.code = ''; - } - - appConfigClick() { - this.isUserPreference = false; - this.code = JSON.stringify(this.appConfig.config); - this.indentCode(); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - textOrientationClick() { - this.isUserPreference = true; - this.userPreferenceProperty = 'textOrientation'; - - this.userPreferencesService - .select(this.userPreferenceProperty) - .pipe(takeUntil(this.onDestroy$)) - .subscribe((textOrientation: number) => { - this.code = JSON.stringify(textOrientation); - this.field = 'textOrientation'; - this.indentCode(); - }); - - this.indentCode(); - } - - infinitePaginationConfClick() { - this.isUserPreference = true; - this.userPreferenceProperty = UserPreferenceValues.PaginationSize; - this.userPreferencesService - .select(this.userPreferenceProperty) - .pipe(takeUntil(this.onDestroy$)) - .subscribe((pageSize: number) => { - this.code = JSON.stringify(pageSize); - this.field = 'adf-infinite-pagination'; - this.indentCode(); - }); - } - - supportedPageSizesClick() { - this.isUserPreference = true; - this.userPreferenceProperty = UserPreferenceValues.SupportedPageSizes; - this.userPreferencesService - .select(this.userPreferenceProperty) - .pipe(takeUntil(this.onDestroy$)) - .subscribe((supportedPageSizes: number) => { - this.code = JSON.stringify(supportedPageSizes); - this.field = 'adf-supported-page-size'; - this.indentCode(); - }); - } - - indentCode() { - setTimeout(() => { - this.editor.getAction('editor.action.formatDocument').run(); - }, 300); - } - -} diff --git a/demo-shell/src/app/components/config-editor/config-editor.module.ts b/demo-shell/src/app/components/config-editor/config-editor.module.ts deleted file mode 100644 index 48026ac05e..0000000000 --- a/demo-shell/src/app/components/config-editor/config-editor.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { NgModule } from '@angular/core'; -import { ConfigEditorComponent } from './config-editor.component'; -import { Routes, RouterModule } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { MonacoEditorModule } from 'ngx-monaco-editor-v2'; - -const routes: Routes = [ - { - path: '', - component: ConfigEditorComponent - } -]; - -@NgModule({ - imports: [ - CommonModule, - CoreModule, - RouterModule.forChild(routes), - MonacoEditorModule - ], - declarations: [ConfigEditorComponent] -}) -export class AppConfigEditorModule {} diff --git a/demo-shell/src/app/components/files/custom-sources.component.html b/demo-shell/src/app/components/files/custom-sources.component.html deleted file mode 100644 index a0e235969c..0000000000 --- a/demo-shell/src/app/components/files/custom-sources.component.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - {{ source.title }} - - - - - - - - - diff --git a/demo-shell/src/app/components/files/custom-sources.component.ts b/demo-shell/src/app/components/files/custom-sources.component.ts deleted file mode 100644 index 7c66215407..0000000000 --- a/demo-shell/src/app/components/files/custom-sources.component.ts +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, Input, ViewChild, ViewEncapsulation } from '@angular/core'; -import { DocumentListComponent } from '@alfresco/adf-content-services'; - -@Component({ - selector: 'app-custom-sources', - templateUrl: './custom-sources.component.html', - encapsulation: ViewEncapsulation.None -}) -export class CustomSourcesComponent { - - @Input() - selectedSource = '-recent-'; - - @ViewChild('customSourcesDocumentList', { static: true }) - documentList: DocumentListComponent; - - sources = [ - { title: 'Favorites', value: '-favorites-' }, - { title: 'Recent', value: '-recent-' }, - { title: 'Shared Links', value: '-sharedlinks-' }, - { title: 'Sites', value: '-sites-' }, - { title: 'My Sites', value: '-mysites-' }, - { title: 'Trashcan', value: '-trashcan-' }, - { title: 'Root', value: '-root-' }, - { title: 'My', value: '-my-' }, - { title: 'Shared', value: '-shared-' } - ]; - - hasSelection(selection: any[]): boolean { - return selection && selection.length > 0; - } -} diff --git a/demo-shell/src/app/components/files/custom-sources.module.ts b/demo-shell/src/app/components/files/custom-sources.module.ts deleted file mode 100644 index 9dbd9194c8..0000000000 --- a/demo-shell/src/app/components/files/custom-sources.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { NgModule } from '@angular/core'; -import { CustomSourcesComponent } from './custom-sources.component'; -import { Routes, RouterModule } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { ContentModule } from '@alfresco/adf-content-services'; - -const routes: Routes = [ - { - path: '', - component: CustomSourcesComponent - } -]; - -@NgModule({ - imports: [ - CommonModule, - RouterModule.forChild(routes), - CoreModule, - ContentModule.forChild() - ], - declarations: [CustomSourcesComponent] -}) -export class AppCustomSourcesModule {} diff --git a/demo-shell/src/app/components/files/files.component.html b/demo-shell/src/app/components/files/files.component.html index f7b4fc547e..273b030f69 100644 --- a/demo-shell/src/app/components/files/files.component.html +++ b/demo-shell/src/app/components/files/files.component.html @@ -50,23 +50,6 @@ [adf-create-folder]="currentFolderId"> create_new_folder - - - -
- - -
- Show Validation Icon -
diff --git a/demo-shell/src/app/components/form/form-list.component.scss b/demo-shell/src/app/components/form/form-list.component.scss deleted file mode 100644 index 4a323097bd..0000000000 --- a/demo-shell/src/app/components/form/form-list.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -.app-form-container { - padding: 10px; -} - -.app-store-form-container { - width: 80%; - height: 80%; -} - -.app-form-list-margin { - margin-left: 26px; -} diff --git a/demo-shell/src/app/components/form/form-list.component.ts b/demo-shell/src/app/components/form/form-list.component.ts deleted file mode 100644 index 26c11e808e..0000000000 --- a/demo-shell/src/app/components/form/form-list.component.ts +++ /dev/null @@ -1,100 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewChild, OnDestroy, OnInit } from '@angular/core'; -import { FormModel, FormService, LogService, FormOutcomeEvent } from '@alfresco/adf-core'; -import { FormComponent, EditorService } from '@alfresco/adf-process-services'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -@Component({ - selector: 'app-form-list', - templateUrl: './form-list.component.html', - styleUrls: ['./form-list.component.scss'] -}) -export class FormListComponent implements OnInit, OnDestroy { - - @ViewChild('adfForm') - activitiForm: FormComponent; - - formList: any [] = []; - - form: FormModel; - formId: string; - - storedData: any = {}; - restoredData: any = {}; - - showValidationIcon = false; - private onDestroy$ = new Subject(); - - constructor(private formService: FormService, private editorService: EditorService, private logService: LogService) { - } - - ngOnInit() { - // Prevent default outcome actions - this.formService.executeOutcome - .pipe(takeUntil(this.onDestroy$)) - .subscribe((formOutcomeEvent: FormOutcomeEvent) => { - formOutcomeEvent.preventDefault(); - this.logService.log(formOutcomeEvent.outcome); - }); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - onRowDblClick(event: CustomEvent) { - const rowForm = event.detail.value.obj; - - this.editorService.getFormDefinitionById(rowForm.id).subscribe((formModel) => { - const form = this.formService.parseForm(formModel.formDefinition); - this.form = form; - }); - - this.logService.log(rowForm); - } - - isEmptyForm() { - return this.form === null || this.form === undefined; - } - - store() { - this.clone(this.activitiForm.form.values, this.storedData); - this.logService.log('DATA SAVED'); - this.logService.log(this.storedData); - this.logService.log('DATA SAVED'); - this.restoredData = null; - } - - clone(objToCopyFrom, objToCopyTo) { - for (const attribute in objToCopyFrom) { - if (objToCopyFrom.hasOwnProperty(attribute)) { - objToCopyTo[attribute] = objToCopyFrom[attribute]; - } - } - return objToCopyTo; - } - - restore() { - this.restoredData = this.storedData; - this.storedData = {}; - } - -} diff --git a/demo-shell/src/app/components/form/form-loading.component.html b/demo-shell/src/app/components/form/form-loading.component.html deleted file mode 100644 index ce0d686ddc..0000000000 --- a/demo-shell/src/app/components/form/form-loading.component.html +++ /dev/null @@ -1,31 +0,0 @@ -
- - - - Form Data - Enter values to populate the form - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/demo-shell/src/app/components/form/form-loading.component.scss b/demo-shell/src/app/components/form/form-loading.component.scss deleted file mode 100644 index 3e3bab76af..0000000000 --- a/demo-shell/src/app/components/form/form-loading.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -.app-form-container { - padding: 10px; -} diff --git a/demo-shell/src/app/components/form/form-loading.component.ts b/demo-shell/src/app/components/form/form-loading.component.ts deleted file mode 100644 index e9d7f4d8f4..0000000000 --- a/demo-shell/src/app/components/form/form-loading.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, Inject, OnInit, OnDestroy } from '@angular/core'; -import { - FormModel, - FormService, - FormOutcomeEvent, - CoreAutomationService -} from '@alfresco/adf-core'; -import { - TaskFormService -} from '@alfresco/adf-process-services'; -import { InMemoryFormService } from '../../services/in-memory-form.service'; -import { FakeTaskFormService } from './fake-tak-form.service'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -@Component({ - selector: 'app-form-loading', - templateUrl: './form-loading.component.html', - styleUrls: ['./form-loading.component.scss'], - providers: [{ provide: FakeTaskFormService, useClass: TaskFormService }] -}) -export class FormLoadingComponent implements OnInit, OnDestroy { - form: FormModel; - typeaheadFieldValue = ''; - selectFieldValue = ''; - radioButtonFieldValue = ''; - formattedData = {}; - - private onDestroy$ = new Subject(); - - constructor( - @Inject(FormService) private formService: InMemoryFormService, - private automationService: CoreAutomationService - ) {} - - ngOnInit() { - this.formService.executeOutcome - .pipe(takeUntil(this.onDestroy$)) - .subscribe((formOutcomeEvent: FormOutcomeEvent) => { - formOutcomeEvent.preventDefault(); - }); - - this.formattedData = {}; - const formDefinitionJSON: any = this.automationService.forms.getSimpleFormDefinition(); - this.form = this.formService.parseForm(formDefinitionJSON); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - onLoadButtonClicked() { - this.formattedData = { - typeaheadField: this.typeaheadFieldValue, - selectBox: this.selectFieldValue, - radioButton: this.radioButtonFieldValue - }; - } -} diff --git a/demo-shell/src/app/components/form/form.component.html b/demo-shell/src/app/components/form/form.component.html index ec7de5cb18..42761e82b6 100644 --- a/demo-shell/src/app/components/form/form.component.html +++ b/demo-shell/src/app/components/form/form.component.html @@ -1,20 +1,18 @@
- +

Error log:

-

Error {{ error.name }} {{error.validationSummary.message | - translate}}

+

Error {{ error.name }} {{error.validationSummary.message | translate}}

@@ -26,15 +24,11 @@ (onInit)="onInitFormEditor($event)">
- - + +
-
- - - Keep prefixed space for hidden field - - -
diff --git a/demo-shell/src/app/components/form/form.component.ts b/demo-shell/src/app/components/form/form.component.ts index bbf711dfae..f70a8ceb6a 100644 --- a/demo-shell/src/app/components/form/form.component.ts +++ b/demo-shell/src/app/components/form/form.component.ts @@ -33,12 +33,10 @@ import { takeUntil } from 'rxjs/operators'; encapsulation: ViewEncapsulation.None }) export class FormComponent implements OnInit, OnDestroy { - form: FormModel; errorFields: FormFieldModel[] = []; formConfig: string; editor: any; - keepPrefixedSpace = true; editorOptions = { theme: 'vs-dark', @@ -86,7 +84,7 @@ export class FormComponent implements OnInit, OnDestroy { } parseForm() { - this.form = this.formService.parseForm(JSON.parse(this.formConfig), null, false, this.keepPrefixedSpace); + this.form = this.formService.parseForm(JSON.parse(this.formConfig), null, false, true); } onSaveFormConfig() { @@ -114,8 +112,4 @@ export class FormComponent implements OnInit, OnDestroy { $event.target.value = ''; } - - togglePrefixedSpace() { - this.keepPrefixedSpace = !this.keepPrefixedSpace; - } } diff --git a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.html b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.html index da3ec4acd8..d23b18befa 100644 --- a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.html +++ b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.html @@ -64,9 +64,7 @@ -
- -
+ diff --git a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.scss b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.scss index f2f19d5641..6a37d4404f 100644 --- a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.scss +++ b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.scss @@ -7,14 +7,3 @@ width: calc(100% * (1 / 4) - 10px); } } - -.app-reset-button { - margin-bottom: 50px; - display: flex; - justify-content: center; -} - -.app-process-list-error-message { - color: var(--theme-warn-color); - text-align: center; -} diff --git a/demo-shell/src/app/components/process-service/process-service.component.html b/demo-shell/src/app/components/process-service/process-service.component.html index 01af5393a7..5b4f3ea667 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.html +++ b/demo-shell/src/app/components/process-service/process-service.component.html @@ -1,288 +1,174 @@ - -
-
-
-
- - arrow_drop_down -
- -
-
-
- - - - - assignment -
Tasks
-
-
- - -
-
-
-
- - - - - -
-
- - - -
- Task Audit log - - -
- - - - - -
-
- - -
-
-
-
- -
-
-
-
- - arrow_drop_down -
- -
-
-
- - - - - assessment -
Processes
-
-
- - -
-
-
-
- - - - -
-
- - - -
- Process Audit log - - -
- - - - - - -
-
- - -
-
-
-
- + data-automation-id="navigation-bar" [animationDuration]="'0'"> +
-
-

Settings Menu

+
+ + arrow_drop_down +
+ +
+
+ +
-
-
- Show task filters icons - +
+ + + + + +
+
+ + + +
+ Task Audit log +
-
- Show process filters icons - + +
+ +
+ + +
+
+ + + +
+
+ + arrow_drop_down +
+ +
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+ Process Audit log +
-
- Show details header - -
-
- Multiselect Process List - -
-
- Multiselect Task List - -
-
- Show Task list Context menu -
-
- Show Process list Context menu -
-
- Show Application dropdown on start process - - - Filter Process definitions - - - - ApplicationId - - - - ProcessDefinitionName - - - - -
-
- - multiple - single - none - + + +
+
+ +
diff --git a/demo-shell/src/app/components/process-service/process-service.component.scss b/demo-shell/src/app/components/process-service/process-service.component.scss index fb41b96c8e..3227a47832 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.scss +++ b/demo-shell/src/app/components/process-service/process-service.component.scss @@ -1,88 +1,16 @@ -.app-no-form-container { - text-align: center; - font-weight: 600; - font-size: 18px; -} - .app-grid { flex-direction: row; display: flex; max-height: 100%; place-content: stretch flex-start; align-items: stretch; + background-color: white; .app-grid-item { flex: 1; margin: 4px; - box-shadow: - 0 2px 2px 0 rgba(0, 0, 0, 0.14), - 0 3px 1px -2px rgba(0, 0, 0, 0.2), - 0 1px 5px 0 rgba(0, 0, 0, 0.12); + border: 1px solid rgba(0, 0, 0, 0.14); padding: 10px; - - .app-filter-process-definitions-inputs { - flex-direction: column; - display: flex; - max-width: 100%; - place-content: stretch space-around; - align-items: stretch; - } - } - - .app-list-buttons { - margin-bottom: 24px; - } - - .app-tasks-list.app-small-pagination, - .app-processes-list.app-small-pagination { - .app-pagination { - flex-wrap: wrap; - padding-bottom: 24px; - padding-top: 8px; - - &__range-block.app-pagination__block:first-child { - order: 1; - width: 60%; - flex: 0 0 auto; - box-sizing: border-box; - padding-left: 2px; - justify-content: flex-start; - } - - &__perpage-block { - order: 3; - width: 60%; - box-sizing: border-box; - padding-left: 2px; - justify-content: flex-start; - } - - &__actualinfo-block { - order: 2; - width: 40%; - box-sizing: border-box; - padding-right: 2px; - justify-content: flex-end; - } - - &__controls-block { - order: 4; - width: 40%; - box-sizing: border-box; - padding-right: 2px; - justify-content: flex-end; - } - } - } - - .app-list { - .app-datatable-list { - border: none; - } - } - - mat-slide-toggle { - margin: 10px; } @media screen and (min-width: 1280px) { @@ -104,13 +32,7 @@ min-width: 225px; } - .app-settings-menu { - flex: 1 1 300px; - max-width: 300px; - min-width: 300px; - } - - .app-tasks-details, .app-tasks-start, .app-processes-details, .app-processes-start, .app-settings-details { + .app-tasks-details, .app-tasks-start, .app-processes-details, .app-processes-start { flex: 1 1 auto; min-width: auto; } @@ -130,24 +52,3 @@ max-height: initial; } } - -.app-accordion-panel { - .mat-expansion-panel { - background: inherit; - } - - .mat-expansion-panel-header-title, - .mat-expansion-panel-header-description { - flex-basis: 0; - align-items: center; - } - - .mat-expansion-panel-header-description { - justify-content: space-between; - align-items: center; - } - - .app-accordion-title-padding { - padding-left: 20px; - } -} diff --git a/demo-shell/src/app/components/process-service/process-service.component.ts b/demo-shell/src/app/components/process-service/process-service.component.ts index ddfc4ff507..a05e3ff633 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.ts +++ b/demo-shell/src/app/components/process-service/process-service.component.ts @@ -29,14 +29,10 @@ import { Output } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { - Pagination, - UserProcessInstanceFilterRepresentation, - ScriptFilesApi -} from '@alfresco/js-api'; +import { Pagination, UserProcessInstanceFilterRepresentation, ScriptFilesApi } from '@alfresco/js-api'; import { FORM_FIELD_VALIDATORS, FormRenderingService, FormService, AppConfigService, PaginationComponent, UserPreferenceValues, - AlfrescoApiService, UserPreferencesService, LogService, DataCellEvent, NotificationService + AlfrescoApiService, UserPreferencesService, NotificationService } from '@alfresco/adf-core'; import { ProcessFiltersComponent, @@ -114,24 +110,15 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit @Output() changePageSize = new EventEmitter(); - multiSelectTask = false; - multiSelectProcess = false; - selectionMode = 'single'; - taskContextMenu = false; - processContextMenu = false; - private tabs = { tasks: 0, processes: 1, reports: 2 }; layoutType: string; currentTaskId: string; currentProcessInstanceId: string; - taskSchemaColumns: any[] = []; taskPage = 0; processPage = 0; paginationPageSize = 0; - processSchemaColumns: any[] = []; - showHeaderContent = true; defaultProcessDefinitionName: string; defaultProcessName: string; @@ -146,11 +133,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit presetColumn = 'default'; - showTaskTab: boolean; - showProcessTab: boolean; - - showProcessFilterIcon: boolean; - showTaskFilterIcon: boolean; showApplications: boolean; applicationId: number; processDefinitionName: string; @@ -167,7 +149,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit private route: ActivatedRoute, private router: Router, private apiService: AlfrescoApiService, - private logService: LogService, private appConfig: AppConfigService, private preview: PreviewService, formRenderingService: FormRenderingService, @@ -187,18 +168,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit // Uncomment this line to map 'custom_stencil_01' to local editor component formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true); - formService.formLoaded - .pipe(takeUntil(this.onDestroy$)) - .subscribe(formEvent => { - this.logService.log(`Form loaded: ${formEvent.form.id}`); - }); - - formService.formFieldValueChanged - .pipe(takeUntil(this.onDestroy$)) - .subscribe(formFieldEvent => { - this.logService.log(`Field value changed. Form: ${formFieldEvent.form.id}, Field: ${formFieldEvent.field.id}, Value: ${formFieldEvent.field.value}`); - }); - this.preferenceService .select(UserPreferenceValues.PaginationSize) .pipe(takeUntil(this.onDestroy$)) @@ -224,30 +193,12 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit .subscribe((content) => { this.showContentPreview(content); }); - - formService.validateForm - .pipe(takeUntil(this.onDestroy$)) - .subscribe(validateFormEvent => { - this.logService.log('Error form:' + validateFormEvent.errorsField); - }); - - // Uncomment this block to see form event handling in action - /* - formService.formEvents - .pipe(takeUntil(this.onDestroy$)) - .subscribe((event: Event) => { - this.logService.log('Event fired:' + event.type); - this.logService.log('Event Target:' + event.target); - }); - */ } ngOnInit() { if (this.router.url.includes('processes')) { this.activeTab = this.tabs.processes; } - this.showProcessTab = this.activeTab === this.tabs.processes; - this.showTaskTab = this.activeTab === this.tabs.tasks; this.route.params.subscribe((params) => { const applicationId = params['appId']; @@ -273,24 +224,14 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit onTaskFilterClick(filter: FilterRepresentationModel): void { this.applyTaskFilter(filter); - this.resetTaskPaginationPage(); - } - - resetTaskPaginationPage() { this.taskPage = 0; } - toggleHeaderContent(): void { - this.showHeaderContent = !this.showHeaderContent; - } - onTabChange(event: any): void { const index = event.index; if (index === TASK_ROUTE) { - this.showTaskTab = event.index === this.tabs.tasks; this.relocateLocationToTask(); } else if (index === PROCESS_ROUTE) { - this.showProcessTab = event.index === this.tabs.processes; this.relocateLocationToProcess(); if (this.processList) { this.processList.reload(); @@ -445,14 +386,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit } } - onAuditClick(event: any) { - this.logService.log(event); - } - - onAuditError(event: any): void { - this.logService.error('My custom error message' + event); - } - onTaskCreated(data: any): void { this.currentTaskId = data.parentTaskId; this.taskList.reload(); @@ -466,7 +399,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit this.loadStencilScriptsInPageFromProcessService(); } - loadStencilScriptsInPageFromProcessService() { + private loadStencilScriptsInPageFromProcessService() { this.scriptFileApi.getControllers().then((response) => { if (response) { const stencilScript = document.createElement('script'); @@ -507,46 +440,8 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit this.activitiFilter.selectFilter(this.activitiFilter.getCurrentFilter()); } - onRowClick(event): void { - this.logService.log(event); - } - - onRowDblClick(event): void { - this.logService.log(event); - } - onAssignTask() { this.taskList.reload(); this.currentTaskId = null; } - - onShowTaskRowContextMenu(event: DataCellEvent) { - event.value.actions = [ - { - data: event.value.row['obj'], - model: { - key: 'taskDetails', - icon: 'open', - title: 'Task List Context Menu', - visible: true - }, - subject: new Subject() - } - ]; - } - - onShowProcessRowContextMenu(event: DataCellEvent) { - event.value.actions = [ - { - data: event.value.row['obj'], - model: { - key: 'processDetails', - icon: 'open', - title: 'Process List Context Menu', - visible: true - }, - subject: new Subject() - } - ]; - } } diff --git a/demo-shell/src/app/components/process-service/show-diagram.component.css b/demo-shell/src/app/components/process-service/show-diagram.component.css deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/demo-shell/src/app/components/process-service/show-diagram.component.html b/demo-shell/src/app/components/process-service/show-diagram.component.html index e368bcb5a1..5d3c4d4ff0 100644 --- a/demo-shell/src/app/components/process-service/show-diagram.component.html +++ b/demo-shell/src/app/components/process-service/show-diagram.component.html @@ -1,4 +1,6 @@
- +
diff --git a/demo-shell/src/app/components/process-service/show-diagram.component.ts b/demo-shell/src/app/components/process-service/show-diagram.component.ts index da2433fd68..4fa7318baf 100644 --- a/demo-shell/src/app/components/process-service/show-diagram.component.ts +++ b/demo-shell/src/app/components/process-service/show-diagram.component.ts @@ -20,8 +20,7 @@ import { ActivatedRoute, Router, Params } from '@angular/router'; @Component({ selector: 'app-show-diagram', - templateUrl: './show-diagram.component.html', - styleUrls: ['./show-diagram.component.css'] + templateUrl: './show-diagram.component.html' }) export class ShowDiagramComponent { diff --git a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.html b/demo-shell/src/app/components/shared-link-view/shared-link-view.component.html deleted file mode 100644 index 6483c22865..0000000000 --- a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.scss b/demo-shell/src/app/components/shared-link-view/shared-link-view.component.scss deleted file mode 100644 index 39982fce39..0000000000 --- a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.app-shared-link-view { - width: 100%; - height: 100%; -} diff --git a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.ts b/demo-shell/src/app/components/shared-link-view/shared-link-view.component.ts deleted file mode 100644 index af3a5d063e..0000000000 --- a/demo-shell/src/app/components/shared-link-view/shared-link-view.component.ts +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewEncapsulation, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -@Component({ - selector: 'app-shared-link-view', - templateUrl: './shared-link-view.component.html', - styleUrls: [ './shared-link-view.component.scss' ], - encapsulation: ViewEncapsulation.None, - // eslint-disable-next-line - host: { 'class': 'app-shared-link-view' } -}) -export class SharedLinkViewComponent implements OnInit { - - sharedLinkId: string = null; - - constructor(private route: ActivatedRoute, private router: Router) {} - - ngOnInit() { - this.route.params.subscribe((params) => { - this.sharedLinkId = params.id; - }); - } - - redirectTo404() { - this.router.navigate(['error/404']); - } - -} diff --git a/demo-shell/src/app/components/trashcan/trashcan.component.html b/demo-shell/src/app/components/trashcan/trashcan.component.html deleted file mode 100644 index 3757530d1c..0000000000 --- a/demo-shell/src/app/components/trashcan/trashcan.component.html +++ /dev/null @@ -1,95 +0,0 @@ -
-
- - - - - - - -
- -
- - - - - -
Items you delete are moved to the Trash.
-
Empty Trash to permanently delete items.
-
-
- - - - - - - - - {{ value }} - - - - - - - - - {{ value | adfTimeAgo: currentLocale }} - - - - - - - -
- - - -
-
diff --git a/demo-shell/src/app/components/trashcan/trashcan.component.ts b/demo-shell/src/app/components/trashcan/trashcan.component.ts deleted file mode 100644 index 0d91ee00af..0000000000 --- a/demo-shell/src/app/components/trashcan/trashcan.component.ts +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; -import { DocumentListComponent, RestoreMessageModel } from '@alfresco/adf-content-services'; -import { UserPreferencesService, UserPreferenceValues, NotificationService } from '@alfresco/adf-core'; -import { Router } from '@angular/router'; -import { PathInfoEntity } from '@alfresco/js-api'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -@Component({ - templateUrl: './trashcan.component.html' -}) -export class TrashcanComponent implements OnInit, OnDestroy { - @ViewChild('documentList', { static: true }) - documentList: DocumentListComponent; - - currentLocale; - - private onDestroy$ = new Subject(); - - constructor( - private preference: UserPreferencesService, - private router: Router, - private notificationService: NotificationService) { - } - - ngOnInit() { - this.preference - .select(UserPreferenceValues.Locale) - .pipe(takeUntil(this.onDestroy$)) - .subscribe(locale => this.currentLocale = locale); - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } - - onRestore(restoreMessage: RestoreMessageModel) { - this.notificationService - .openSnackMessageAction( - restoreMessage.message, - restoreMessage.action - ) - .onAction() - .subscribe(() => this.navigateLocation(restoreMessage.path)); - this.documentList.reload(); - } - - private navigateLocation(path: PathInfoEntity) { - const parent = path.elements[path.elements.length - 1]; - this.router.navigate(['files/', parent.id]); - } - - refresh() { - this.documentList.reload(); - this.documentList.resetSelection(); - } -} diff --git a/demo-shell/src/app/components/trashcan/trashcan.module.ts b/demo-shell/src/app/components/trashcan/trashcan.module.ts deleted file mode 100644 index 33eb711d13..0000000000 --- a/demo-shell/src/app/components/trashcan/trashcan.module.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { NgModule } from '@angular/core'; -import { TrashcanComponent } from './trashcan.component'; -import { Routes, RouterModule } from '@angular/router'; -import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { ContentModule } from '@alfresco/adf-content-services'; - -const routes: Routes = [ - { - path: '', - component: TrashcanComponent - } -]; - -@NgModule({ - imports: [ - CommonModule, - RouterModule.forChild(routes), - CoreModule, - ContentModule.forChild() - ], - declarations: [TrashcanComponent] -}) -export class AppTrashcanModule {} diff --git a/demo-shell/src/app/services/app-notifications-factory.ts b/demo-shell/src/app/services/app-notifications-factory.ts deleted file mode 100644 index 01a0efdbe0..0000000000 --- a/demo-shell/src/app/services/app-notifications-factory.ts +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { AppNotificationsService } from './app-notifications.service'; - -export function setupAppNotifications(appNotificationsService: AppNotificationsService) { - return () => appNotificationsService; -} diff --git a/demo-shell/src/app/services/app-notifications.service.ts b/demo-shell/src/app/services/app-notifications.service.ts deleted file mode 100644 index 1d5d9bfa4d..0000000000 --- a/demo-shell/src/app/services/app-notifications.service.ts +++ /dev/null @@ -1,134 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { - AuthenticationService, - AppConfigService, - NotificationService, - NotificationModel, - AlfrescoApiService, - IdentityUserService -} from '@alfresco/adf-core'; -import { NotificationCloudService } from '@alfresco/adf-process-services-cloud'; -import { Injectable } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { map } from 'rxjs/operators'; - -const SUBSCRIPTION_QUERY = ` - subscription { - engineEvents(eventType: [ - PROCESS_STARTED - TASK_ASSIGNED - TASK_UPDATED, - TASK_CREATED - ]) { - eventType - entity - } - } -`; - -@Injectable() -export class AppNotificationsService { - - constructor( - private appConfigService: AppConfigService, - private authenticationService: AuthenticationService, - private notificationCloudService: NotificationCloudService, - private notificationService: NotificationService, - private translateService: TranslateService, - private identityUserService: IdentityUserService, - private alfrescoApiService: AlfrescoApiService - ) { - this.alfrescoApiService.alfrescoApiInitialized.subscribe(() => { - if (this.isProcessServicesEnabled() && this.notificationsEnabled) { - this.authenticationService.once('token_received').subscribe(() => { - const deployedApps = this.appConfigService.get('alfresco-deployed-apps', []); - if (deployedApps?.length) { - deployedApps.forEach((app) => { - this.notificationCloudService - .makeGQLQuery(app.name, SUBSCRIPTION_QUERY) - .pipe(map((events: any) => events.data.engineEvents)) - .subscribe((result) => { - result.map((engineEvent) => this.notifyEvent(engineEvent)); - }); - }); - } - }); - } - }); - } - - private get notificationsEnabled(): boolean { - return this.appConfigService.get('notifications', true); - } - - private isProcessServicesEnabled(): boolean { - return this.authenticationService.isLoggedIn() && (this.authenticationService.isBPMProvider() || this.authenticationService.isALLProvider()); - } - - notifyEvent(engineEvent) { - let message; - switch (engineEvent.eventType) { - case 'TASK_ASSIGNED': - message = this.translateService.instant('NOTIFICATIONS.TASK_ASSIGNED', { - taskName: engineEvent.entity.name || '', - assignee: engineEvent.entity.assignee - }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_UPDATED': - message = this.translateService.instant('NOTIFICATIONS.TASK_UPDATED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_COMPLETED': - message = this.translateService.instant('NOTIFICATIONS.TASK_COMPLETED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_ACTIVATED': - message = this.translateService.instant('NOTIFICATIONS.TASK_ACTIVATED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_CANCELLED': - message = this.translateService.instant('NOTIFICATIONS.TASK_CANCELLED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_SUSPENDED': - message = this.translateService.instant('NOTIFICATIONS.TASK_SUSPENDED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - case 'TASK_CREATED': - message = this.translateService.instant('NOTIFICATIONS.TASK_CREATED', { taskName: engineEvent.entity.name || '' }); - this.pushNotification(engineEvent, message); - break; - default: - } - } - - pushNotification(engineEvent: any, message: string) { - if (engineEvent.entity.assignee === this.identityUserService.getCurrentUserInfo().username) { - const notification = { - messages: [message], - icon: 'info', - datetime: new Date(), - initiator: { displayName: engineEvent.entity.initiator || 'System' } - } as NotificationModel; - - this.notificationService.pushToNotificationHistory(notification); - } - } -} diff --git a/demo-shell/src/assets/app.extensions.json b/demo-shell/src/assets/app.extensions.json index 73c7d3d174..04dd7ce556 100644 --- a/demo-shell/src/assets/app.extensions.json +++ b/demo-shell/src/assets/app.extensions.json @@ -1,9 +1,6 @@ { "$schema": "../../../lib/extensions/src/lib/config/schema/app-extension.schema.json", - "$references": [ - "plugin1.json", - "plugin2.json" - ], + "$references": [], "$dependencies": [], "features": { diff --git a/demo-shell/src/assets/images/adf-move-file-24px.svg b/demo-shell/src/assets/images/adf-move-file-24px.svg deleted file mode 100644 index 1430edb2cc..0000000000 --- a/demo-shell/src/assets/images/adf-move-file-24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/demo-shell/src/assets/plugins/plugin1.json b/demo-shell/src/assets/plugins/plugin1.json deleted file mode 100644 index 63991be786..0000000000 --- a/demo-shell/src/assets/plugins/plugin1.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "../../../lib/extensions/config/schema/plugin-extension.schema.json", - "$name": "plugin1", - "$version": "1.0.0", - "$vendor": "Alfresco", - "$license": "Apache-2.0", - "$runtime": "2.7.0", - "$description": "example plugin", - "features": { - "custom": { - "key": "value" - } - } -} diff --git a/demo-shell/src/assets/plugins/plugin2.json b/demo-shell/src/assets/plugins/plugin2.json deleted file mode 100644 index 508f7c82ec..0000000000 --- a/demo-shell/src/assets/plugins/plugin2.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "../../../lib/extensions/config/schema/plugin-extension.schema.json", - "$name": "plugin2", - "$version": "1.1.0", - "$vendor": "Alfresco", - "$license": "Apache-2.0", - "$runtime": "2.7.0", - "$description": "another example plugin", - "features": { - "extra": { - "key": "value" - } - } -} diff --git a/demo-shell/src/favicon.ico b/demo-shell/src/favicon.ico deleted file mode 100644 index 8081c7ceaf..0000000000 Binary files a/demo-shell/src/favicon.ico and /dev/null differ diff --git a/demo-shell/src/typings.d.ts b/demo-shell/src/typings.d.ts deleted file mode 100644 index 1071374cd0..0000000000 --- a/demo-shell/src/typings.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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. - */ - -/* SystemJS module definition */ -declare const module: NodeModule; -interface NodeModule { - id: string; -} diff --git a/e2e/content-services/components/lock-file.e2e.ts b/e2e/content-services/components/lock-file.e2e.ts deleted file mode 100644 index d8eae33dc0..0000000000 --- a/e2e/content-services/components/lock-file.e2e.ts +++ /dev/null @@ -1,354 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - LoginPage, - StringUtil, - UploadActions, - UserModel, - UsersActions, - WaitActions -} from '@alfresco/adf-testing'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { LockFilePage } from '../../content-services/pages/lock-file.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { browser } from 'protractor'; -import { NodeEntry, NodesApi, SitesApi } from '@alfresco/js-api'; -import CONSTANTS = require('../../util/constants'); - -describe('Lock File', () => { - - const loginPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const lockFilePage = new LockFilePage(); - const contentServices = new ContentServicesPage(); - - const adminUser = new UserModel(); - const managerUser = new UserModel(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const uploadActions = new UploadActions(apiService); - const waitActions = new WaitActions(apiService); - const nodesApi = new NodesApi(apiService.getInstance()); - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - const pngFileToLock = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path - }); - - const pngFileToLockAdmin = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_path - }); - - let site; let documentLibrary; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - - await usersActions.createUser(adminUser); - await usersActions.createUser(managerUser); - - await apiService.login(adminUser.username, adminUser.password); - - const sitesApi = new SitesApi(apiService.getInstance()); - - site = await sitesApi.createSite({ - title: StringUtil.generateRandomString(), - visibility: 'PRIVATE' - }); - - const resultNode = await nodesApi.listNodeChildren(site.entry.guid); - - documentLibrary = resultNode.list.entries[0].entry.id; - - await sitesApi.createSiteMembership(site.entry.id, { - id: managerUser.username, - role: CONSTANTS.CS_USER_ROLES.MANAGER - }); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - try { - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(site.entry.id, { permanent: true }); - } catch (e) { - } - }); - - describe('Lock file interaction with the UI', () => { - - let pngLockedUploadedFile: NodeEntry; - let pngUploadedFile: NodeEntry; - - beforeAll(async () => { - pngLockedUploadedFile = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary); - - await loginPage.login(adminUser.username, adminUser.password); - - pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary); - - await navigationBarPage.openContentServicesFolder(documentLibrary); - await contentServices.waitForTableBody(); - }); - - afterEach(async () => { - await apiService.login(adminUser.username, adminUser.password); - try { - await nodesApi.unlockNode(pngUploadedFile.entry.id); - await waitActions.nodeIsUnlock(pngUploadedFile.entry.id); - } catch (e) { - } - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - try { - await nodesApi.unlockNode(pngLockedUploadedFile.entry.id); - } catch (e) { - } - try { - await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id); - } catch (e) { - } - try { - await uploadActions.deleteFileOrFolder(pngLockedUploadedFile.entry.id); - } catch (e) { - } - await navigationBarPage.clickLogoutButton(); - }); - - it('[C286604] Should be able to open Lock file option by clicking the lock image', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.cancelButton.waitVisible(); - await lockFilePage.saveButton.waitVisible(); - }); - - it('[C286625] Should be able to click Cancel to cancel lock file operation', async () => { - await contentServices.lockContent(pngFileModel.name); - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.cancelButton.click(); - - await contentServices.checkUnlockedIcon(pngFileModel.name); - }); - - it('[C286603] Should be able to click on Lock file checkbox and lock a file', async () => { - await contentServices.lockContent(pngFileToLock.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - await contentServices.checkLockedIcon(pngFileToLock.name); - }); - - it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - await contentServices.checkLockedIcon(pngFileModel.name); - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - await contentServices.checkUnlockedIcon(pngFileModel.name); - }); - }); - - describe('Locked file without owner permissions', () => { - - let pngUploadedFile: NodeEntry; - - beforeEach(async () => { - await apiService.login(adminUser.username, adminUser.password); - pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary); - - await loginPage.login(managerUser.username, managerUser.password); - - await navigationBarPage.openContentServicesFolder(documentLibrary); - }); - - afterEach(async () => { - await apiService.login(adminUser.username, adminUser.password); - - try { - await nodesApi.unlockNode(pngUploadedFile.entry.id); - await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id); - } catch (error) { - } - await navigationBarPage.clickLogoutButton(); - }); - - it('[C286610] Should not be able to delete a locked file', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await nodesApi.deleteNode(pngUploadedFile.entry.id); - } catch (error) { - await expect(error.status).toEqual(409); - } - }); - - it('[C286611] Should not be able to rename a locked file', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' }); - - } catch (error) { - await expect(error.status).toEqual(409); - } - }); - - it('[C286612] Should not be able to move a locked file', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' }); - - } catch (error) { - await expect(error.status).toEqual(409); - } - }); - - it('[C286613] Should not be able to update a new version on a locked file', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT'); - } catch (error) { - await expect(error.status).toEqual(409); - } - }); - }); - - describe('Locked file with owner permissions', () => { - let pngFileToBeLocked: NodeEntry; - let pngUploadedFile: NodeEntry; - - beforeEach(async () => { - await apiService.login(adminUser.username, adminUser.password); - pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLockAdmin.location, pngFileToLockAdmin.name, documentLibrary); - pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary); - await loginPage.login(adminUser.username, adminUser.password); - await navigationBarPage.openContentServicesFolder(documentLibrary); - await contentServices.getDocumentList().dataTable.waitTillContentLoaded(); - }); - - afterEach(async () => { - await apiService.login(adminUser.username, adminUser.password); - try { - await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id); - await uploadActions.deleteFileOrFolder(pngFileToBeLocked.entry.id); - } catch (e) { - } - await navigationBarPage.clickLogoutButton(); - }); - - it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.allowOwnerCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await apiService.login(adminUser.username, adminUser.password); - - const response = await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT'); - await expect(response.entry.modifiedAt.getTime()).toBeGreaterThan(response.entry.createdAt.getTime()); - } catch (error) { - } - }); - - it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.allowOwnerCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - await apiService.login(adminUser.username, adminUser.password); - await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' }); - - const movedFile = await nodesApi.getNode(pngUploadedFile.entry.id); - - await expect(movedFile.entry.parentId).not.toEqual(documentLibrary); - } catch (error) { - } - }); - - it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => { - await contentServices.lockContent(pngFileToLockAdmin.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.allowOwnerCheckbox.click(); - await lockFilePage.saveButton.click(); - - await contentServices.deleteContent(pngFileToBeLocked.entry.name); - await contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name); - }); - - it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => { - await contentServices.lockContent(pngFileModel.name); - - await lockFilePage.lockFileCheckboxText.waitVisible(); - await lockFilePage.lockFileCheckbox.click(); - await lockFilePage.allowOwnerCheckbox.click(); - await lockFilePage.saveButton.click(); - - try { - const response = await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' }); - await expect(response.entry.name).toEqual('My new name'); - } catch (error) { - } - }); - }); -}); diff --git a/e2e/content-services/components/permissions-component.e2e.ts b/e2e/content-services/components/permissions-component.e2e.ts index 8e9372d345..211e2d4759 100644 --- a/e2e/content-services/components/permissions-component.e2e.ts +++ b/e2e/content-services/components/permissions-component.e2e.ts @@ -22,7 +22,6 @@ import { createApiService, BrowserActions, Logger, LoginPage, - NotificationHistoryPage, PermissionActions, SearchService, StringUtil, @@ -37,7 +36,7 @@ import { FolderModel } from '../../models/ACS/folder.model'; import { MetadataViewPage } from '../../core/pages/metadata-view.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page'; -import { GroupsApi } from '@alfresco/js-api'; +import { GroupsApi, NodeEntry } from '@alfresco/js-api'; describe('Permissions Component', () => { @@ -56,7 +55,6 @@ describe('Permissions Component', () => { const contentList = contentServicesPage.getDocumentList(); const viewerPage = new ViewerPage(); const metadataViewPage = new MetadataViewPage(); - const notificationHistoryPage = new NotificationHistoryPage(); const uploadDialog = new UploadDialogPage(); let file; const fileModel = new FileModel({ @@ -89,11 +87,11 @@ describe('Permissions Component', () => { const roleContributorFolderModel = new FolderModel({ name: 'roleContributor' + StringUtil.generateRandomString() }); const roleEditorFolderModel = new FolderModel({ name: 'roleEditor' + StringUtil.generateRandomString() }); - let roleConsumerFolder; - let roleCoordinatorFolder; - let roleContributorFolder; - let roleCollaboratorFolder; - let roleEditorFolder; + let roleConsumerFolder: NodeEntry; + let roleCoordinatorFolder: NodeEntry; + let roleContributorFolder: NodeEntry; + let roleCollaboratorFolder: NodeEntry; + let roleEditorFolder: NodeEntry; beforeAll(async () => { try { @@ -305,11 +303,9 @@ describe('Permissions Component', () => { await contentList.checkActionMenuIsNotDisplayed(); await contentServicesPage.metadataContent('RoleConsumer' + fileModel.name); await expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have access to do this.'); - await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.'); await browser.sleep(3000); await contentServicesPage.uploadFile(fileLocation); await expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have the create permission to upload the content'); - await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content'); }); it('[C276996] Role Contributor', async () => { @@ -324,7 +320,6 @@ describe('Permissions Component', () => { await BrowserActions.closeMenuAndDialogs(); await contentList.checkActionMenuIsNotDisplayed(); await contentServicesPage.metadataContent('RoleContributor' + fileModel.name); - await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.'); await contentServicesPage.uploadFile(testFileModel.location); await contentServicesPage.checkContentIsDisplayed(testFileModel.name); await uploadDialog.fileIsUploaded(testFileModel.name); @@ -351,7 +346,6 @@ describe('Permissions Component', () => { await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1'); await metadataViewPage.clickCloseButton(); await contentServicesPage.uploadFile(fileLocation); - await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content'); }); it('[C277003] Role Collaborator', async () => { diff --git a/e2e/content-services/components/share-file.e2e.ts b/e2e/content-services/components/share-file.e2e.ts deleted file mode 100644 index 2b92e972f3..0000000000 --- a/e2e/content-services/components/share-file.e2e.ts +++ /dev/null @@ -1,221 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - ApiUtil, - BrowserActions, - LocalStorageUtil, - LoginPage, - NotificationHistoryPage, - UploadActions, - UserModel, - UsersActions, - ViewerPage -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { browser } from 'protractor'; -import { SharedLinkEntry, SharedLinkPaging, SharedlinksApi } from '@alfresco/js-api'; -import { CustomSourcesPage } from '../../core/pages/custom-sources.page'; - -describe('Share file', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const contentListPage = contentServicesPage.getDocumentList(); - const shareDialog = new ShareDialogPage(); - const navigationBarPage = new NavigationBarPage(); - const customSourcesPage = new CustomSourcesPage(); - const viewerPage = new ViewerPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - - let acsUser: UserModel; - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const uploadActions = new UploadActions(apiService); - const sharedLinksApi = new SharedlinksApi(apiService.getInstance()); - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - let nodeId; - - const waitForShareLink = async (nodeIdSharedFile: string) => { - const predicate = (sharedLinkPaging: SharedLinkPaging) => { - const sharedLink = sharedLinkPaging.list.entries.find((sharedLinkEntry: SharedLinkEntry) => sharedLinkEntry.entry.nodeId === nodeIdSharedFile); - - return !!sharedLink; - }; - - const apiCall = async () => { - await apiService.login(acsUser.username, acsUser.password); - return sharedLinksApi.listSharedLinks(); - }; - - return ApiUtil.waitForApi(apiCall, predicate, 10, 2000); - }; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - - const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-'); - - nodeId = pngUploadedFile.entry.id; - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(nodeId); - }); - - describe('Shared link dialog', () => { - beforeAll(async () => { - await loginPage.login(acsUser.username, acsUser.password); - await navigationBarPage.navigateToContentServices(); - await contentListPage.selectRow(pngFileModel.name); - await BrowserActions.closeMenuAndDialogs(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C286549] Should check automatically toggle button in Share dialog', async () => { - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.shareToggleButtonIsChecked(); - await BrowserActions.closeMenuAndDialogs(); - }); - - it('[C286544] Should display notification when clicking URL copy button', async () => { - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - await BrowserActions.closeMenuAndDialogs(); - await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard'); - }); - - it('[C286543] Should be possible to close Share dialog', async () => { - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.checkShareLinkIsDisplayed(); - await BrowserActions.closeMenuAndDialogs(); - }); - - it('[C286578] Should disable today option in expiration day calendar', async () => { - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickExpireToggle(); - await shareDialog.clickDateTimePickerButton(); - await shareDialog.calendarTodayDayIsDisabled(); - await BrowserActions.closeMenuAndDialogs(); - }); - - it('[C310329] Should be possible to set expiry date only for link', async () => { - await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date')); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickExpireToggle(); - await shareDialog.setDefaultDay(); - await shareDialog.dateTimePickerDialogIsClosed(); - const value = await shareDialog.getExpirationDate(); - await shareDialog.clickCloseButton(); - await shareDialog.dialogIsClosed(); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.expirationDateInputHasValue(value); - await BrowserActions.closeMenuAndDialogs(); - }); - }); - - describe('Shared link preview', () => { - - beforeEach(async () => { - await loginPage.login(acsUser.username, acsUser.password); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - }); - - afterEach(async () => { - await BrowserActions.getUrl('/'); - await navigationBarPage.clickLogoutButton(); - }); - - it('[C286565] Should open file when logged user access shared link', async () => { - await contentListPage.selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - const sharedLink = await shareDialog.getShareLink(); - await BrowserActions.closeMenuAndDialogs(); - await BrowserActions.getUrl(sharedLink); - await viewerPage.checkFileNameIsDisplayed(pngFileModel.name); - }); - - it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => { - await contentListPage.selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - const sharedLink = await shareDialog.getShareLink(); - await shareDialog.clickCloseButton(); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - const secondSharedLink = await shareDialog.getShareLink(); - await BrowserActions.closeMenuAndDialogs(); - await expect(sharedLink).toEqual(secondSharedLink); - await BrowserActions.getUrl(sharedLink); - await viewerPage.checkFileNameIsDisplayed(pngFileModel.name); - }); - - it('[C286539] Should open file when non-logged user access shared link', async () => { - await contentListPage.selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.checkShareLinkIsDisplayed(); - const sharedLink = await shareDialog.getShareLink(); - await shareDialog.clickCloseButton(); - await navigationBarPage.clickLogoutButton(); - - await BrowserActions.getUrl(sharedLink); - await viewerPage.checkFileNameIsDisplayed(pngFileModel.name); - }); - - it('[C260153] Should shared files listed in share files custom resources', async () => { - await contentListPage.selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - - await BrowserActions.closeMenuAndDialogs(); - - await waitForShareLink(nodeId); - - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectSharedLinksSourceType(); - await customSourcesPage.checkRowIsDisplayed(pngFileModel.name); - }); - }); -}); diff --git a/e2e/content-services/components/site-permissions.e2e.ts b/e2e/content-services/components/site-permissions.e2e.ts deleted file mode 100644 index 835902fbf7..0000000000 --- a/e2e/content-services/components/site-permissions.e2e.ts +++ /dev/null @@ -1,397 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { PermissionsPage } from '../../content-services/pages/permissions.page'; -import { - createApiService, - BrowserActions, Logger, - LoginPage, - NotificationHistoryPage, SearchService, - StringUtil, - UploadActions, - UserModel, - UsersActions, - ViewerPage, - SnackbarPage -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { browser } from 'protractor'; -import { MetadataViewPage } from '../../core/pages/metadata-view.page'; -import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { VersionManagePage } from '../../core/pages/version-manager.page'; -import CONSTANTS = require('../../util/constants'); -import { NodesApi, SitesApi } from '@alfresco/js-api'; - -describe('Permissions Component', () => { - - const apiService = createApiService(); - const uploadActions = new UploadActions(apiService); - const searchService = new SearchService(apiService); - const nodesApi = new NodesApi(apiService.getInstance()); - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const permissionsPage = new PermissionsPage(); - const viewerPage = new ViewerPage(); - const navigationBarPage = new NavigationBarPage(); - const metadataViewPage = new MetadataViewPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - const snackbarPage = new SnackbarPage(); - const uploadDialog = new UploadDialogPage(); - const versionManagePage = new VersionManagePage(); - - const contentList = contentServicesPage.getDocumentList(); - - let publicSite; - let privateSite; - let folderName; - - const fileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path - }); - - const testFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_location - }); - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location - }); - - const newVersionFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_location - }); - - let siteFolder; - let privateSiteFile; - - const folderOwnerUser = new UserModel(); - const consumerUser: UserModel = new UserModel(); - const siteConsumerUser: UserModel = new UserModel(); - const collaboratorUser: UserModel = new UserModel(); - const contributorUser: UserModel = new UserModel(); - const managerUser: UserModel = new UserModel(); - const usersActions = new UsersActions(apiService); - - beforeAll(async () => { - try { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(folderOwnerUser); - await usersActions.createUser(siteConsumerUser); - await usersActions.createUser(consumerUser); - await usersActions.createUser(contributorUser); - await usersActions.createUser(collaboratorUser); - await usersActions.createUser(managerUser); - await apiService.login(folderOwnerUser.username, folderOwnerUser.password); - - const publicSiteName = `PUBLIC_TEST_SITE_${StringUtil.generateRandomString(5)}`; - - const privateSiteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`; - - folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}`; - - const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName }; - const privateSiteBody = { visibility: 'PRIVATE', title: privateSiteName }; - - const sitesApi = new SitesApi(apiService.getInstance()); - - publicSite = await sitesApi.createSite(publicSiteBody); - privateSite = await sitesApi.createSite(privateSiteBody); - - await sitesApi.createSiteMembership(publicSite.entry.id, { - id: siteConsumerUser.username, - role: CONSTANTS.CS_USER_ROLES.CONSUMER - }); - - await sitesApi.createSiteMembership(publicSite.entry.id, { - id: collaboratorUser.username, - role: CONSTANTS.CS_USER_ROLES.COLLABORATOR - }); - - await sitesApi.createSiteMembership(publicSite.entry.id, { - id: contributorUser.username, - role: CONSTANTS.CS_USER_ROLES.CONTRIBUTOR - }); - - await sitesApi.createSiteMembership(publicSite.entry.id, { - id: managerUser.username, - role: CONSTANTS.CS_USER_ROLES.MANAGER - }); - - await sitesApi.createSiteMembership(privateSite.entry.id, { - id: managerUser.username, - role: CONSTANTS.CS_USER_ROLES.MANAGER - }); - - siteFolder = await uploadActions.createFolder(folderName, publicSite.entry.guid); - privateSiteFile = await uploadActions.uploadFile(fileModel.location, 'privateSite' + fileModel.name, privateSite.entry.guid); - - await nodesApi.updateNode(privateSiteFile.entry.id, - { - permissions: { - locallySet: [{ - authorityId: managerUser.username, - name: 'SiteConsumer', - accessStatus: 'ALLOWED' - }] - } - }); - - await uploadActions.uploadFile(fileModel.location, 'Site' + fileModel.name, siteFolder.entry.id); - - // to sync user in acs - try { - await searchService.isUserSearchable(consumerUser); - } catch (e) { - Logger.error(`*****\n Failed to sync user \n*****`); - } - await browser.sleep(browser.params.testConfig.timeouts.index_search); - } catch (error) { - fail('Failed to setup site permission : ' + JSON.stringify(error, null, 2)); - } - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(publicSite.entry.id, { permanent: true }); - await sitesApi.deleteSite(privateSite.entry.id, { permanent: true }); - }); - - describe('Role Site Dropdown', () => { - - beforeAll(async () => { - await loginPage.login(folderOwnerUser.username, folderOwnerUser.password); - - await BrowserActions.getUrl(browser.baseUrl + '/files/' + publicSite.entry.guid); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C277002] Should display the Role Site dropdown', async () => { - await contentServicesPage.checkContentIsDisplayed(folderName); - - await contentList.rightClickOnRow(folderName); - - await contentServicesPage.pressContextMenuActionNamed('Permission'); - - await permissionsPage.checkPermissionManagerDisplayed(); - await permissionsPage.addPermissionButton.waitVisible(); - - await permissionsPage.addPermissionsDialog.clickAddPermissionButton(); - await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed(); - await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed(); - - await permissionsPage.addPermissionsDialog.searchUserOrGroup(consumerUser.username); - await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed(); - - await permissionsPage.addPermissionsDialog.clickUserOrGroup(consumerUser.firstName); - await permissionsPage.addPermissionsDialog.selectRole(consumerUser.fullName, 'Site Collaborator'); - await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(consumerUser.fullName)).toEqual('Site Collaborator'); - await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'Add button should be enabled'); - await permissionsPage.addPermissionsDialog.clickAddButton(); - await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)'); - await snackbarPage.waitForSnackBarToClose(); - - await permissionsPage.checkUserIsAdded(consumerUser.username); - - await expect(await permissionsPage.getRoleCellValue(consumerUser.username)).toEqual(CONSTANTS.CS_USER_ROLES_I18N.COLLABORATOR); - - await permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.username); - - const roleDropdownOptions = permissionsPage.addPermissionsDialog.getRoleDropdownOptions(); - - await expect(await roleDropdownOptions.count()).toBe(4); - await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe(CONSTANTS.CS_USER_ROLES_I18N.COLLABORATOR); - await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe(CONSTANTS.CS_USER_ROLES_I18N.CONSUMER); - await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe(CONSTANTS.CS_USER_ROLES_I18N.CONTRIBUTOR); - await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe(CONSTANTS.CS_USER_ROLES_I18N.MANAGER); - }); - }); - - describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', () => { - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C276994] Role SiteConsumer', async () => { - await loginPage.login(siteConsumerUser.username, siteConsumerUser.password); - - await navigationBarPage.openContentServicesFolder(siteFolder.entry.id); - await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name); - - await contentList.doubleClickRow('Site' + fileModel.name); - - await viewerPage.checkFileIsLoaded(); - await viewerPage.clickCloseButton(); - - await contentList.waitForTableBody(); - - await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name); - - await BrowserActions.closeMenuAndDialogs(); - - await contentList.checkActionMenuIsNotDisplayed(); - - await contentServicesPage.metadataContent('Site' + fileModel.name); - - await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.'); - - await contentServicesPage.uploadFile(testFileModel.location); - - await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content'); - }); - - it('[C276997] Role SiteContributor', async () => { - await loginPage.login(contributorUser.username, contributorUser.password); - - await navigationBarPage.openContentServicesFolder(siteFolder.entry.id); - await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name); - - await contentList.doubleClickRow('Site' + fileModel.name); - - await viewerPage.checkFileIsLoaded(); - await viewerPage.clickCloseButton(); - - await contentList.waitForTableBody(); - - await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name); - - await BrowserActions.closeMenuAndDialogs(); - - await contentList.checkActionMenuIsNotDisplayed(); - - await contentServicesPage.metadataContent('Site' + fileModel.name); - - await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.'); - - await contentServicesPage.uploadFile(testFileModel.location); - await contentServicesPage.checkContentIsDisplayed(testFileModel.name); - - await uploadDialog.fileIsUploaded(testFileModel.name); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - }); - - it('[C277005] Role SiteCollaborator', async () => { - await loginPage.login(collaboratorUser.username, collaboratorUser.password); - - await navigationBarPage.openContentServicesFolder(siteFolder.entry.id); - await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name); - - await contentList.doubleClickRow('Site' + fileModel.name); - - await viewerPage.checkFileIsLoaded(); - await viewerPage.clickCloseButton(); - - await contentList.waitForTableBody(); - - await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name); - - await BrowserActions.closeMenuAndDialogs(); - - await contentList.checkActionMenuIsNotDisplayed(); - - await contentServicesPage.metadataContent('Site' + fileModel.name); - - await metadataViewPage.editIconIsDisplayed(); - await metadataViewPage.editIconClick(); - - await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title'); - - await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle'); - - await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle'); - await metadataViewPage.clickCloseButton(); - - await contentServicesPage.uploadFile(pngFileModel.location); - await contentServicesPage.checkContentIsDisplayed(pngFileModel.name); - - await uploadDialog.fileIsUploaded(pngFileModel.name); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - }); - - it('[C277006] Role SiteManager', async () => { - await loginPage.login(managerUser.username, managerUser.password); - - await navigationBarPage.openContentServicesFolder(siteFolder.entry.id); - await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name); - - await contentList.doubleClickRow('Site' + fileModel.name); - - await viewerPage.checkFileIsLoaded(); - await viewerPage.clickCloseButton(); - - await contentList.waitForTableBody(); - await contentServicesPage.metadataContent('Site' + fileModel.name); - - await metadataViewPage.editIconIsDisplayed(); - - await metadataViewPage.editIconClick(); - - await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description'); - await metadataViewPage.enterDescriptionText('newDescription'); - await metadataViewPage.clickSaveMetadata(); - - await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription'); - - await metadataViewPage.clickCloseButton(); - await contentServicesPage.uploadFile(testFileModel.location); - await contentServicesPage.checkContentIsDisplayed(testFileModel.name); - - await uploadDialog.fileIsUploaded(testFileModel.name); - await uploadDialog.clickOnCloseButton(); - await uploadDialog.dialogIsNotDisplayed(); - - await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name); - await contentServicesPage.deleteContent('Site' + fileModel.name); - await contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name); - }); - }); - - describe('Roles: Private site and Manager User', () => { - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C277196] should a user with Manager permissions be able to upload a new version for the created file', async () => { - await loginPage.login(managerUser.username, managerUser.password); - - await navigationBarPage.openContentServicesFolder(privateSite.entry.guid); - - await contentServicesPage.versionManagerContent('privateSite' + fileModel.name); - await versionManagePage.showNewVersionButton.click(); - await versionManagePage.uploadNewVersionFile(newVersionFile.location); - - await versionManagePage.checkFileVersionExist('1.1'); - await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name); - }); - }); -}); diff --git a/e2e/content-services/components/unshare-file.e2e.ts b/e2e/content-services/components/unshare-file.e2e.ts deleted file mode 100644 index d85cd9a67f..0000000000 --- a/e2e/content-services/components/unshare-file.e2e.ts +++ /dev/null @@ -1,199 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 CONSTANTS = require('../../util/constants'); -import { createApiService, - BrowserActions, - ErrorPage, - LoginPage, - NotificationHistoryPage, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { NodeEntry, NodesApi, SharedlinksApi, SitesApi } from '@alfresco/js-api'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { browser } from 'protractor'; - -describe('Unshare file', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navBar = new NavigationBarPage(); - const errorPage = new ErrorPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - const navigationBarPage = new NavigationBarPage(); - const shareDialog = new ShareDialogPage(); - - const apiService = createApiService(); - const uploadActions = new UploadActions(apiService); - const usersActions = new UsersActions(apiService); - const nodesApi = new NodesApi(apiService.getInstance()); - const sharedlinksApi = new SharedlinksApi(apiService.getInstance()); - - const siteName = `PRIVATE-TEST-SITE-${StringUtil.generateRandomString(5)}`; - let acsUser: UserModel; - - let nodeBody; let shareFilesSite; - let pngUploadedFile: NodeEntry; - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - - const site = { - title: siteName, - visibility: 'PRIVATE', - id: siteName - }; - - nodeBody = { - name: StringUtil.generateRandomString(5), - nodeType: 'cm:content', - properties: { - 'cm:title': StringUtil.generateRandomString(5) - } - }; - - const sitesApi = new SitesApi(apiService.getInstance()); - - shareFilesSite = await sitesApi.createSite(site); - - const docLibId = (await sitesApi.listSiteContainers(siteName)).list.entries[0].entry.id; - const testFile1Id = (await nodesApi.createNode(docLibId, nodeBody)).entry.id; - await sitesApi.createSiteMembership(siteName, { - id: acsUser.username, - role: CONSTANTS.CS_USER_ROLES.CONSUMER - }); - - await nodesApi.updateNode(testFile1Id, { - permissions: { - isInheritanceEnabled: false, - locallySet: [ - { - authorityId: acsUser.username, - name: CONSTANTS.CS_USER_ROLES.CONSUMER - } - ] - } - }); - await sharedlinksApi.createSharedLink({ nodeId: testFile1Id }); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(shareFilesSite.entry.id, { permanent: true }); - }); - - describe('with permission', () => { - - afterEach(async () => { - await apiService.loginWithProfile('admin'); - await navigationBarPage.clickLogoutButton(); - await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id); - }); - - beforeEach(async () => { - await apiService.login(acsUser.username, acsUser.password); - - pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-'); - - await loginPage.login(acsUser.username, acsUser.password); - await navBar.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - }); - - it('[C286551] Should be able to cancel unshare action', async () => { - await contentServicesPage.getDocumentList().selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickUnShareFile(); - await shareDialog.confirmationDialogIsDisplayed(); - await shareDialog.clickConfirmationDialogCancelButton(); - await shareDialog.shareToggleButtonIsChecked(); - }); - - it('[C286550] Should display unshare confirmation dialog', async () => { - await contentServicesPage.getDocumentList().selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await browser.sleep(2000); - await shareDialog.clickUnShareFile(); - await shareDialog.confirmationDialogIsDisplayed(); - }); - - it('[C286552] Should be able to confirm unshare action', async () => { - await contentServicesPage.getDocumentList().selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickUnShareFile(); - await shareDialog.confirmationDialogIsDisplayed(); - await shareDialog.clickConfirmationDialogRemoveButton(); - await shareDialog.dialogIsClosed(); - }); - - it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => { - await contentServicesPage.getDocumentList().selectRow(pngFileModel.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await browser.sleep(2000); - - const sharedLink = await shareDialog.getShareLink(); - await shareDialog.clickUnShareFile(); - await shareDialog.confirmationDialogIsDisplayed(); - await shareDialog.clickConfirmationDialogRemoveButton(); - await shareDialog.dialogIsClosed(); - await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.appConfig.ecmHost, `${browser.baseUrl}`)); - await errorPage.checkErrorCode(); - }); - }); - - describe('without permission', () => { - - beforeEach(async () => { - await loginPage.login(acsUser.username, acsUser.password); - }); - - it('[C286555] Should NOT be able to unshare file without permission', async () => { - await navBar.goToSite(shareFilesSite); - await contentServicesPage.openFolder('documentLibrary'); - await contentServicesPage.getDocumentList().selectRow(nodeBody.name); - await contentServicesPage.clickShareButton(); - - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.shareToggleButtonIsChecked(); - await shareDialog.clickUnShareFile(); - await shareDialog.confirmationDialogIsDisplayed(); - await shareDialog.clickConfirmationDialogRemoveButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.shareToggleButtonIsChecked(); - - await notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`); - }); - }); -}); diff --git a/e2e/content-services/directives/create-folder-directive.e2e.ts b/e2e/content-services/directives/create-folder-directive.e2e.ts deleted file mode 100644 index da71be377c..0000000000 --- a/e2e/content-services/directives/create-folder-directive.e2e.ts +++ /dev/null @@ -1,147 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - LoginPage, - NotificationHistoryPage, - StringUtil, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FolderDialogPage } from '../../core/pages/dialog/folder-dialog.page'; -import { MetadataViewPage } from '../../core/pages/metadata-view.page'; -import { browser, Key } from 'protractor'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; - -describe('Create folder directive', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const createFolderDialog = new FolderDialogPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - const metadataViewPage = new MetadataViewPage(); - let acsUser: UserModel; - const navigationBarPage = new NavigationBarPage(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - - acsUser = await usersActions.createUser(); - - await loginPage.login(acsUser.username, acsUser.password); - - await contentServicesPage.goToDocumentList(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - beforeEach(async () => { - await browser.actions().sendKeys(Key.ESCAPE).perform(); - }); - - afterEach(async () => { - await browser.actions().sendKeys(Key.ESCAPE).perform(); - }); - - it('[C260154] Should not create the folder if cancel button is clicked', async () => { - const folderName = 'cancelFolder'; - await contentServicesPage.clickOnCreateNewFolder(); - - await createFolderDialog.addFolderName(folderName); - await createFolderDialog.clickOnCancelButton(); - - await contentServicesPage.checkContentIsNotDisplayed(folderName); - }); - - it('[C260155] Should enable the Create button only when a folder name is present', async () => { - const folderName = 'NotEnableFolder'; - await contentServicesPage.clickOnCreateNewFolder(); - - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - - await createFolderDialog.addFolderName(folderName); - - await createFolderDialog.checkCreateUpdateBtnIsEnabled(); - }); - - it('[C260156] Should not be possible create two folder with the same name', async () => { - const folderName = 'duplicate'; - await contentServicesPage.createNewFolder(folderName); - - await contentServicesPage.checkContentIsDisplayed(folderName); - - await contentServicesPage.createNewFolder(folderName); - - await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.'); - }); - - it('[C260157] Should be possible create a folder under a folder with the same name', async () => { - const folderName = 'sameSubFolder'; - - await contentServicesPage.createNewFolder(folderName); - await contentServicesPage.checkContentIsDisplayed(folderName); - - await contentServicesPage.openFolder(folderName); - - await contentServicesPage.createNewFolder(folderName); - await contentServicesPage.checkContentIsDisplayed(folderName); - }); - - it('[C260158] Should be possible add a folder description when create a new folder', async () => { - const folderName = StringUtil.generateRandomString(); - const description = 'this is the description'; - - await contentServicesPage.clickOnCreateNewFolder(); - - await createFolderDialog.addFolderName(folderName); - await createFolderDialog.addFolderDescription(description); - - await createFolderDialog.clickOnCreateUpdateButton(); - - await contentServicesPage.checkContentIsDisplayed(folderName); - - await contentServicesPage.metadataContent(folderName); - - await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description'); - }); - - it('[C260159] Should not be possible create a folder with banned character', async () => { - await contentServicesPage.clickOnCreateNewFolder(); - - await createFolderDialog.addFolderName('*'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('<'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('>'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('\\'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('/'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('?'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName(':'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - await createFolderDialog.addFolderName('|'); - await expect(await createFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - }); -}); diff --git a/e2e/content-services/directives/create-library-directive.e2e.ts b/e2e/content-services/directives/create-library-directive.e2e.ts deleted file mode 100644 index a38ba26bde..0000000000 --- a/e2e/content-services/directives/create-library-directive.e2e.ts +++ /dev/null @@ -1,266 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, BrowserActions, LoginPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { CreateLibraryDialogPage } from '../../core/pages/dialog/create-library-dialog.page'; -import { CustomSourcesPage } from '../../core/pages/custom-sources.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { SitesApi } from '@alfresco/js-api'; - -describe('Create library directive', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const createLibraryDialog = new CreateLibraryDialogPage(); - const customSourcesPage = new CustomSourcesPage(); - const navigationBarPage = new NavigationBarPage(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - const visibility = { - public: 'Public', - private: 'Private', - moderated: 'Moderated' - }; - - let createSite; - - let acsUser: UserModel; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - - acsUser = await usersActions.createUser(); - - const sitesApi = new SitesApi(apiService.getInstance()); - createSite = await sitesApi.createSite({ - title: StringUtil.generateRandomString(20).toLowerCase(), - visibility: 'PUBLIC' - }); - - await loginPage.login(acsUser.username, acsUser.password); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(createSite.entry.id, { permanent: true }); - - await navigationBarPage.clickLogoutButton(); - }); - - beforeEach(async () => { - await contentServicesPage.goToDocumentList(); - await contentServicesPage.openCreateLibraryDialog(); - }); - - afterEach(async () => { - await BrowserActions.closeMenuAndDialogs(); - }); - - it('[C290158] Should display the Create Library defaults', async () => { - await expect(await createLibraryDialog.libraryTitle.getText()).toMatch('Create Library'); - await expect(await createLibraryDialog.libraryNameField.isDisplayed()).toBe(true, 'Name input field is not displayed'); - await expect(await createLibraryDialog.libraryIdField.isDisplayed()).toBe(true, 'Library ID field is not displayed'); - await expect(await createLibraryDialog.libraryDescriptionField.isDisplayed()).toBe(true, 'Library description is not displayed'); - await expect(await createLibraryDialog.publicRadioButton.isDisplayed()).toBe(true, 'Public radio button is not displayed'); - await expect(await createLibraryDialog.privateRadioButton.isDisplayed()).toBe(true, 'Private radio button is not displayed'); - await expect(await createLibraryDialog.moderatedRadioButton.isDisplayed()).toBe(true, 'Moderated radio button is not displayed'); - await expect(await createLibraryDialog.createButton.isEnabled()).toBe(false, 'Create button is not disabled'); - await expect(await createLibraryDialog.cancelButton.isEnabled()).toBe(true, 'Cancel button is disabled'); - await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public'); - }); - - it('[C290159] Should close the dialog when clicking Cancel button', async () => { - const libraryName = 'cancelLibrary'; - - await createLibraryDialog.libraryNameField.typeText(libraryName); - await createLibraryDialog.cancelButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - }); - - it('[C290160] Should create a public library', async () => { - const libraryName = StringUtil.generateRandomString(); - const libraryDescription = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(libraryName); - await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription); - await createLibraryDialog.publicRadioButton.click(); - - await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public'); - - await createLibraryDialog.createButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectMySitesSourceType(); - await customSourcesPage.checkRowIsDisplayed(libraryName); - - await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.'); - }); - - it('[C290173] Should create a private library', async () => { - const libraryName = StringUtil.generateRandomString(); - const libraryDescription = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(libraryName); - await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription); - await createLibraryDialog.privateRadioButton.click(); - - await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private'); - - await createLibraryDialog.createButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectMySitesSourceType(); - await customSourcesPage.checkRowIsDisplayed(libraryName); - - await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.'); - }); - - it('[C290174, C290175] Should create a moderated library with a given Library ID', async () => { - const libraryName = StringUtil.generateRandomString(); - const libraryId = StringUtil.generateRandomString(); - const libraryDescription = StringUtil.generateRandomString(); - await createLibraryDialog.libraryNameField.typeText(libraryName); - await createLibraryDialog.libraryIdField.typeText(libraryId); - await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription); - await createLibraryDialog.moderatedRadioButton.click(); - - await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated'); - - await createLibraryDialog.createButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectMySitesSourceType(); - await customSourcesPage.checkRowIsDisplayed(libraryName); - - await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.'); - }); - - it('[C290163] Should disable Create button when a mandatory field is not filled in', async () => { - const inputValue = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(inputValue); - await createLibraryDialog.libraryIdField.clearInput(); - await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled'); - await createLibraryDialog.libraryNameField.clearInput(); - - await createLibraryDialog.libraryIdField.typeText(inputValue); - await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled'); - await createLibraryDialog.libraryIdField.clearInput(); - - await createLibraryDialog.libraryDescriptionField.typeText(inputValue); - await expect(await createLibraryDialog.createButton.isEnabled()).not.toBe(true, 'The Create button is enabled'); - }); - - it('[C290164] Should auto-fill in the Library Id built from library name', async () => { - const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*']; - const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link']; - - for (let i = 0; i < 3; i++) { - await createLibraryDialog.libraryNameField.typeText(name[i]); - await createLibraryDialog.libraryIdField.waitHasValue(libraryId[i]); - await createLibraryDialog.libraryNameField.clearInput(); - } - }); - - it('[C290176] Should not accept special characters for Library Id', async () => { - const name = 'My Library'; - const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>']; - - await createLibraryDialog.libraryNameField.typeText(name); - - for (let i = 0; i < 3; i++) { - await createLibraryDialog.libraryIdField.typeText(libraryId[i]); - await createLibraryDialog.errorMessage.waitVisible(60000); - await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Use numbers and letters only'); - } - }); - - it('[C291985] Should not accept less than 2 characters for Library name', async () => { - const name = 'x'; - const libraryId = 'my-library-id'; - - await createLibraryDialog.libraryNameField.typeText(name); - await createLibraryDialog.libraryIdField.typeText(libraryId); - await createLibraryDialog.errorMessage.waitVisible(60000); - await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Title must be at least 2 characters long'); - }); - - it('[C291793] Should display error for Name field filled in with spaces only', async () => { - const name = ' '; - const libraryId = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(name); - await createLibraryDialog.libraryIdField.typeText(libraryId); - - await createLibraryDialog.errorMessage.waitVisible(60000); - await expect(await createLibraryDialog.errorMessage.getText()).toMatch('Library name can\'t contain only spaces'); - }); - - it('[C290177] Should not accept a duplicate Library Id', async () => { - const name = 'My Library'; - const libraryId = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(name); - await createLibraryDialog.libraryIdField.typeText(libraryId); - await createLibraryDialog.createButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - - await contentServicesPage.openCreateLibraryDialog(); - - await createLibraryDialog.libraryNameField.typeText(name); - await createLibraryDialog.libraryIdField.typeText(libraryId); - await createLibraryDialog.errorMessage.waitVisible(60000); - await expect(await createLibraryDialog.errorMessage.getText()).toMatch('This Library ID isn\'t available. Try a different Library ID.'); - }); - - it('[C290178] Should accept the same library name but different Library Ids', async () => { - const name = createSite.entry.title; - const libraryId = StringUtil.generateRandomString(); - - await createLibraryDialog.libraryNameField.typeText(name.toUpperCase()); - await createLibraryDialog.libraryIdField.typeText(libraryId); - - await createLibraryDialog.libraryNameHint.waitVisible(); - await expect(await createLibraryDialog.libraryNameHint.getText()).toMatch('Library name already in use', 'The library name hint is wrong'); - - await createLibraryDialog.createButton.click(); - await createLibraryDialog.libraryDialog.waitNotPresent(60000); - }); - - it('[C290179] Should not accept more than the expected characters for input fields', async () => { - const name = StringUtil.generateRandomString(257); - const libraryId = StringUtil.generateRandomString(73); - const libraryDescription = StringUtil.generateRandomString(513); - - await createLibraryDialog.libraryNameField.typeText(name); - await createLibraryDialog.libraryIdField.typeText(libraryId); - await createLibraryDialog.libraryDescriptionField.typeText(libraryDescription); - - await createLibraryDialog.publicRadioButton.click(); - - await expect(await createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title'); - await expect(await createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name'); - await expect(await createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description'); - }); -}); diff --git a/e2e/content-services/directives/delete-directive.e2e.ts b/e2e/content-services/directives/delete-directive.e2e.ts deleted file mode 100644 index 7c2c426e7b..0000000000 --- a/e2e/content-services/directives/delete-directive.e2e.ts +++ /dev/null @@ -1,271 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { createApiService, - BrowserActions, - LoginPage, - PaginationPage, - PermissionActions, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { FolderModel } from '../../models/ACS/folder.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { SitesApi } from '@alfresco/js-api'; - -describe('Delete Directive', () => { - - let baseFolderUploaded; - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const paginationPage = new PaginationPage(); - const navigationBarPage = new NavigationBarPage(); - - const contentListPage = contentServicesPage.getDocumentList(); - const acsUser = new UserModel(); - const secondAcsUser = new UserModel(); - - const apiService = createApiService(); - const uploadActions = new UploadActions(apiService); - const permissionActions = new PermissionActions(apiService); - const usersActions = new UsersActions(apiService); - - const txtFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path - }); - - const file0BytesModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path - }); - - const pdfFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const secondPdfFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path - }); - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - const secondPngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path - }); - - const folderInfo = new FolderModel({ - name: 'myFolder', - location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_path - }); - - const folderSecond = new FolderModel({ - name: 'myrSecondFolder', - location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location - }); - - const baseFolder = new FolderModel({ - name: 'BASE_FOLDER', - location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location - }); - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(acsUser); - await usersActions.createUser(secondAcsUser); - }); - - beforeEach(async () => { - await apiService.login(acsUser.username, acsUser.password); - baseFolderUploaded = await uploadActions.createFolder( - baseFolder.name, - '-my-' - ); - }); - - afterEach(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(baseFolderUploaded.entry.id); - }); - - describe('Handling multiselection', () => { - - beforeEach(async () => { - await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id); - const textFolderUploaded = await uploadActions.createFolder(folderInfo.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFolder(folderInfo.location, textFolderUploaded.entry.id); - await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, textFolderUploaded.entry.id); - await uploadActions.createFolder(folderSecond.name, baseFolderUploaded.entry.id); - - await loginPage.login(acsUser.username, acsUser.password); - await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`); - await contentServicesPage.waitForTableBody(); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260188] Delete multiple content', async () => { - await contentListPage.selectRowsWithKeyboard(txtFileModel.name, file0BytesModel.name, folderSecond.name, folderInfo.name); - await contentServicesPage.clickDeleteOnToolbar(); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderSecond.name); - }); - - it('[C260192] Delete file and folder with hierarchy', async () => { - await contentListPage.selectRowsWithKeyboard(txtFileModel.name, folderInfo.name); - await contentServicesPage.clickDeleteOnToolbar(); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name); - }); - - it('[C260193] Delete file when different selections are set', async () => { - await contentServicesPage.chooseSelectionMode('None'); - await contentListPage.selectRow(txtFileModel.name); - await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name); - await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true); - - await contentServicesPage.chooseSelectionMode('Single'); - await contentListPage.selectRow(txtFileModel.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name); - await contentListPage.selectRowsWithKeyboard(folderInfo.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', folderInfo.name); - await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name); - await contentServicesPage.clickDeleteOnToolbar(); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name); - await contentListPage.dataTable.checkContentIsDisplayed('Display name', txtFileModel.name); - - await contentServicesPage.chooseSelectionMode('Multiple'); - await contentListPage.selectRowsWithKeyboard(txtFileModel.name, file0BytesModel.name); - await contentServicesPage.clickDeleteOnToolbar(); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', txtFileModel.name); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name); - }); - }); - - describe('When selection on multiple pages', () => { - beforeEach(async () => { - await apiService.login(acsUser.username, acsUser.password); - - await uploadActions.uploadFile( txtFileModel.location, txtFileModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(secondPdfFileModel.location, secondPdfFileModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, baseFolderUploaded.entry.id); - await uploadActions.uploadFile(secondPngFileModel.location, secondPngFileModel.name, baseFolderUploaded.entry.id); - - await loginPage.login(acsUser.username, acsUser.password); - await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`); - await contentServicesPage.waitForTableBody(); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260191] Delete content selected from different pages', async () => { - await contentServicesPage.sortByName('ASC'); - await paginationPage.selectItemsPerPage('5'); - - await contentListPage.selectRowWithKeyboard(txtFileModel.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name); - await paginationPage.clickOnNextPage(); - await contentListPage.selectRowWithKeyboard(file0BytesModel.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', file0BytesModel.name); - await contentServicesPage.clickDeleteOnToolbar(); - await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', file0BytesModel.name); - await contentListPage.dataTable.checkContentIsDisplayed('Display name', txtFileModel.name); - }); - }); - - describe('when user does not have `delete` permission', () => { - let createdSite = null; - let fileTxt; let filePdf; let folderA; let folderB; - - beforeAll(async () => { - await apiService.login(acsUser.username, acsUser.password); - - const sitesApi = new SitesApi(apiService.getInstance()); - - createdSite = await sitesApi.createSite({ - title: StringUtil.generateRandomString(20).toLowerCase(), - visibility: 'PRIVATE' - }); - - await sitesApi.createSiteMembership(createdSite.entry.id, { - id: secondAcsUser.username, - role: 'SiteCollaborator' - }); - - fileTxt = await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, createdSite.entry.guid); - filePdf = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, createdSite.entry.guid); - folderA = await uploadActions.createFolder(StringUtil.generateRandomString(5), createdSite.entry.guid); - folderB = await uploadActions.createFolder(StringUtil.generateRandomString(5), createdSite.entry.guid); - - await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteManager', folderA); - await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteManager', fileTxt); - await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteConsumer', folderB); - await permissionActions.addRoleForUser(secondAcsUser.username, 'SiteConsumer', filePdf); - - await permissionActions.disableInheritedPermissionsForNode(folderA.entry.id); - await permissionActions.disableInheritedPermissionsForNode(folderB.entry.id); - await permissionActions.disableInheritedPermissionsForNode(fileTxt.entry.id); - await permissionActions.disableInheritedPermissionsForNode(filePdf.entry.id); - - await loginPage.login(secondAcsUser.username, secondAcsUser.password); - await BrowserActions.getUrl(`${browser.baseUrl}/files/${createdSite.entry.guid}`); - await contentServicesPage.waitForTableBody(); - }); - - afterAll(async () => { - try { - await apiService.login(acsUser.username, acsUser.password); - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(createdSite.entry.id, { permanent: true }); - } catch (error) {} - await navigationBarPage.clickLogoutButton(); - }); - - it('[C216426] Delete file without delete permissions', async () => { - await contentListPage.selectRowWithKeyboard(filePdf.entry.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', filePdf.entry.name); - await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true); - await contentListPage.selectRowWithKeyboard(folderB.entry.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', folderB.entry.name); - await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true); - await contentListPage.selectRowWithKeyboard(fileTxt.entry.name); - await contentListPage.dataTable.checkRowIsSelected('Display name', fileTxt.entry.name); - await expect(await contentServicesPage.checkToolbarDeleteIsDisabled()).toEqual(true); - }); - }); -}); diff --git a/e2e/content-services/directives/download-directive.e2e.ts b/e2e/content-services/directives/download-directive.e2e.ts deleted file mode 100644 index f6898f3eb7..0000000000 --- a/e2e/content-services/directives/download-directive.e2e.ts +++ /dev/null @@ -1,138 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { createApiService, - BrowserVisibility, - FileBrowserUtil, - LoginPage, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FolderModel } from '../../models/ACS/folder.model'; - -describe('Version component actions', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const contentListPage = contentServicesPage.getDocumentList(); - - let acsUser: UserModel; - - const txtFileComma = new FileModel({ - name: 'comma,name', - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path - }); - - const txtFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path - }); - - const file0BytesModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path - }); - - const folderInfo = new FolderModel({ - name: 'myFolder', - location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_path - }); - - const folderSecond = new FolderModel({ - name: 'myrSecondFolder', - location: browser.params.resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location - }); - - const apiService = createApiService(); - const uploadActions = new UploadActions(apiService); - const usersActions = new UsersActions(apiService); - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - - await uploadActions.uploadFile( txtFileModel.location, txtFileModel.name, '-my-'); - await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-'); - await uploadActions.uploadFile(txtFileComma.location, txtFileComma.name, '-my-'); - - const textFolderUploaded = await uploadActions.createFolder(folderInfo.name, '-my-'); - await uploadActions.uploadFolder(folderInfo.location, textFolderUploaded.entry.id); - - await uploadActions.createFolder(folderSecond.name, '-my-'); - - await loginPage.login(acsUser.username, acsUser.password); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - afterEach(async () => { - await BrowserVisibility.waitUntilDialogIsClose(); - }); - - it('[C260083] Download files - Different size values', async () => { - await contentListPage.selectRow(txtFileModel.name); - await contentServicesPage.clickDownloadButton(); - await FileBrowserUtil.isFileDownloaded(txtFileModel.name); - await BrowserVisibility.waitUntilDialogIsClose(); - - await contentListPage.selectRow(file0BytesModel.name); - await contentServicesPage.clickDownloadButton(); - await FileBrowserUtil.isFileDownloaded(file0BytesModel.name); - }); - - it('[C260084] Download folder', async () => { - await contentListPage.selectRow(folderInfo.name); - await contentServicesPage.clickDownloadButton(); - await FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip'); - }); - - it('[C261032] File and Folder', async () => { - await contentServicesPage.clickMultiSelectToggle(); - await contentServicesPage.checkAcsContainer(); - await contentListPage.dataTablePage().checkAllRows(); - await contentServicesPage.clickDownloadButton(); - await FileBrowserUtil.isFileDownloaded('archive.zip'); - }); - - it('[C261033] Folder and Folder', async () => { - await contentListPage.selectRow(folderInfo.name); - await contentListPage.selectRow(folderSecond.name); - - await contentServicesPage.clickDownloadButton(); - - await FileBrowserUtil.isFileDownloaded('archive.zip'); - await BrowserVisibility.waitUntilDialogIsClose(); - }); - - it('[C277757] Download file - Comma in file name', async () => { - await contentListPage.selectRow(txtFileComma.name); - await contentServicesPage.clickDownloadButton(); - await FileBrowserUtil.isFileDownloaded(txtFileComma.name); - }); -}); diff --git a/e2e/content-services/directives/edit-folder-directive.e2e.ts b/e2e/content-services/directives/edit-folder-directive.e2e.ts deleted file mode 100644 index ad62f6adf8..0000000000 --- a/e2e/content-services/directives/edit-folder-directive.e2e.ts +++ /dev/null @@ -1,252 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - BrowserActions, - LoginPage, - NotificationHistoryPage, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { FolderDialogPage } from '../../core/pages/dialog/folder-dialog.page'; -import { browser, protractor } from 'protractor'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { NodesApi } from '@alfresco/js-api'; - -describe('Edit folder directive', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const editFolderDialog = new FolderDialogPage(); - const acsUser = new UserModel(); - const anotherAcsUser = new UserModel(); - const navigationBarPage = new NavigationBarPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const nodesApi = new NodesApi(apiService.getInstance()); - - const pdfFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const uploadActions = new UploadActions(apiService); - const updateFolderName = StringUtil.generateRandomString(5); - let editFolder; let anotherFolder; let filePdfNode; let subFolder; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(acsUser); - await usersActions.createUser(anotherAcsUser); - await apiService.login(acsUser.username, acsUser.password); - - editFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - anotherFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), editFolder.entry.id); - filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-'); - - await nodesApi.updateNode(editFolder.entry.id, - - { - permissions: { - locallySet: [{ - authorityId: anotherAcsUser.username, - name: 'Consumer', - accessStatus: 'ALLOWED' - }] - } - }); - - await loginPage.login(acsUser.username, acsUser.password); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(editFolder.entry.id); - await uploadActions.deleteFileOrFolder(anotherFolder.entry.id); - await uploadActions.deleteFileOrFolder(filePdfNode.entry.id); - }); - - beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - }); - - afterEach(async () => { - await BrowserActions.closeMenuAndDialogs(); - }); - - it('[C260161] Update folder - Cancel button', async () => { - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - await contentServicesPage.clickOnEditFolder(); - await editFolderDialog.checkFolderDialogIsDisplayed(); - await expect(await editFolderDialog.getDialogTitle()).toBe('Edit folder'); - await expect(await editFolderDialog.getFolderName()).toBe(editFolder.entry.name); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.checkCancelBtnIsEnabled(); - await editFolderDialog.clickOnCancelButton(); - await editFolderDialog.checkFolderDialogIsNotDisplayed(); - }); - - it('[C260162] Update folder - Introducing letters', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true); - - await contentServicesPage.clickOnEditFolder(); - - await editFolderDialog.checkFolderDialogIsDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.addFolderName(editFolder.entry.name + 'a'); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.clickOnCancelButton(); - await editFolderDialog.checkFolderDialogIsNotDisplayed(); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name); - }); - - it('[C260163] Update folder name with an existing one', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true); - await contentServicesPage.clickOnEditFolder(); - await editFolderDialog.checkFolderDialogIsDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.addFolderName(anotherFolder.entry.name); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.clickOnCreateUpdateButton(); - await editFolderDialog.checkFolderDialogIsDisplayed(); - - await browser.sleep(3000); // The error needs time to come back - - await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.'); - }); - - it('[C260164] Edit Folder - Unsupported characters', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - await contentServicesPage.clickOnEditFolder(); - await editFolderDialog.checkFolderDialogIsDisplayed(); - - await editFolderDialog.addFolderName('a*"<>\\/?:|'); - await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |'); - await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - - await editFolderDialog.addFolderName('a.a'); - await editFolderDialog.checkValidationMessageIsNotDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - - await editFolderDialog.addFolderName('a.'); - await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .'); - await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - - await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE); - await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces'); - await expect(await editFolderDialog.checkCreateUpdateBtnIsEnabled()).toEqual(false); - - await editFolderDialog.addFolderName(editFolder.entry.name); - await editFolderDialog.addFolderDescription('a*"<>\\/?:|'); - await editFolderDialog.checkValidationMessageIsNotDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - - await editFolderDialog.addFolderDescription('a.'); - await editFolderDialog.checkValidationMessageIsNotDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - - await editFolderDialog.addFolderDescription('a.a'); - await editFolderDialog.checkValidationMessageIsNotDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - - await editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE); - await editFolderDialog.checkValidationMessageIsNotDisplayed(); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.clickOnCancelButton(); - await editFolderDialog.checkFolderDialogIsNotDisplayed(); - }); - - it('[C260166] Enable/Disable edit folder icon - when file selected', async () => { - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false); - }); - - it('[C260166] Enable/Disable edit folder icon - when multiple folders selected', async () => { - await contentServicesPage.clickMultiSelectToggle(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().checkAllRowsButtonIsDisplayed(); - await contentServicesPage.getDocumentList().dataTablePage().checkAllRows(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false); - }); - - it('[C260166] Enable/Disable edit folder icon - when single folder selected', async () => { - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true); - }); - - it('[C260165] Update folder name with non-existing one', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name); - await contentServicesPage.clickOnEditFolder(); - await editFolderDialog.checkFolderDialogIsDisplayed(); - await editFolderDialog.addFolderName(updateFolderName); - await editFolderDialog.checkCreateUpdateBtnIsEnabled(); - await editFolderDialog.clickOnCreateUpdateButton(); - await editFolderDialog.checkFolderDialogIsNotDisplayed(); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName); - }); - - describe('Edit Folder - no permission', () => { - beforeEach(async () => { - await navigationBarPage.clickLogoutButton(); - await loginPage.login(anotherAcsUser.username, anotherAcsUser.password); - await BrowserActions.getUrl(browser.baseUrl + '/files/' + editFolder.entry.id); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - }); - - it('[C260167] Edit folder without permission', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', subFolder.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name); - await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false); - }); - }); -}); diff --git a/e2e/content-services/directives/favorite-directive.e2e.ts b/e2e/content-services/directives/favorite-directive.e2e.ts deleted file mode 100644 index 8e65d19364..0000000000 --- a/e2e/content-services/directives/favorite-directive.e2e.ts +++ /dev/null @@ -1,227 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - ContentNodeSelectorDialogPage, - LoginPage, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; - -import { browser } from 'protractor'; -import { FileModel } from '../../models/ACS/file.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { CustomSourcesPage } from '../../core/pages/custom-sources.page'; -import { TrashcanPage } from '../../core/pages/trashcan.page'; - -describe('Favorite directive', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - let acsUser: UserModel; - const customSourcesPage = new CustomSourcesPage(); - const trashcanPage = new TrashcanPage(); - const contentListPage = contentServicesPage.getDocumentList(); - const contentNodeSelector = new ContentNodeSelectorDialogPage(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - const pdfFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const uploadActions = new UploadActions(apiService); - let testFolder1; let testFolder2; let testFolder3; let testFolder4; let testFile; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - - testFolder1 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - testFolder2 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - testFolder3 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - testFolder4 = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - testFile = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-'); - - await browser.sleep(browser.params.testConfig.timeouts.index_search); - - await loginPage.login(acsUser.username, acsUser.password); - await contentServicesPage.goToDocumentList(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(testFolder1.entry.id); - await uploadActions.deleteFileOrFolder(testFolder2.entry.id); - await uploadActions.deleteFileOrFolder(testFolder3.entry.id); - await uploadActions.deleteFileOrFolder(testFolder4.entry.id); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - }); - - it('[C260247] Should be able to mark a file as favorite', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsDisplayed(testFile.entry.name); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsNotMarkedFavorite(); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name); - }); - - it('[C260249] Should be able to mark a folder as favorite', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsNotMarkedFavorite(); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name); - }); - - it('[C260251] Should retain the restored file as favorite', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - await contentListPage.rightClickOnRow(testFile.entry.name); - await contentServicesPage.pressContextMenuActionNamed('Delete'); - await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name); - - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - - await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1); - - await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name); - await trashcanPage.clickRestore(); - await trashcanPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await trashcanPage.checkTrashcanIsEmpty(); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.checkIsMarkedFavorite(); - await customSourcesPage.navigateToCustomSources(); - await customSourcesPage.selectFavoritesSourceType(); - await customSourcesPage.checkRowIsDisplayed(testFile.entry.name); - }); - - it('[C260252] Should retain the moved file as favorite', async () => { - await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - - await contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name); - await contentNodeSelector.clickMoveCopyButton(); - - await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name); - await contentServicesPage.openFolder(testFolder1.entry.name); - await contentServicesPage.checkContentIsDisplayed(testFile.entry.name); - - await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name); - await contentServicesPage.checkIsMarkedFavorite(); - }); - - it('[C217216] Should be able to mark and unmark multiple folders as favorite', async () => { - await contentServicesPage.clickMultiSelectToggle(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2); - - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name); - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsMarkedFavorite(); - - await contentServicesPage.clickOnFavoriteButton(); - await contentServicesPage.checkIsNotMarkedFavorite(); - await contentServicesPage.getDocumentList().dataTablePage().checkAllRows(); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4); - await contentServicesPage.getDocumentList().dataTablePage().uncheckAllRows(); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0); - - await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name); - await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1); - await contentServicesPage.checkIsMarkedFavorite(); - }); -}); diff --git a/e2e/content-services/directives/restore-content-directive.e2e.ts b/e2e/content-services/directives/restore-content-directive.e2e.ts deleted file mode 100644 index 151b965e33..0000000000 --- a/e2e/content-services/directives/restore-content-directive.e2e.ts +++ /dev/null @@ -1,286 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { ContentServicesPage } from '../../core/pages/content-services.page'; -import { browser } from 'protractor'; -import { NodeEntry } from '@alfresco/js-api'; -import { FileModel } from '../../models/ACS/file.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TrashcanPage } from '../../core/pages/trashcan.page'; -import { createApiService, - BreadcrumbPage, - LoginPage, - NotificationHistoryPage, - StringUtil, - UploadActions, - UserModel, - UsersActions, - WaitActions -} from '@alfresco/adf-testing'; - -describe('Restore content directive', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const acsUser = new UserModel(); - const anotherAcsUser = new UserModel(); - const trashcanPage = new TrashcanPage(); - const breadCrumbPage = new BreadcrumbPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const waitActions = new WaitActions(apiService); - - const pdfFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const testFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path - }); - - const pngFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - let testFolder: NodeEntry; - - const uploadActions = new UploadActions(apiService); - let folderWithContent; let folderWithFolder; let subFolder; let subFile; let testFile; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(acsUser); - await usersActions.createUser(anotherAcsUser); - await apiService.login(acsUser.username, acsUser.password); - - testFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - folderWithContent = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - subFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, folderWithContent.entry.id); - testFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-'); - folderWithFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - subFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), folderWithFolder.entry.id); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(folderWithContent.entry.id); - await uploadActions.deleteFileOrFolder(folderWithFolder.entry.id); - }); - - describe('Restore same name folders', () => { - - beforeAll(async () => { - await loginPage.login(acsUser.username, acsUser.password); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name); - await contentServicesPage.deleteContent(testFolder.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(testFolder.entry.name); - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFolder.entry.name); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260227] Should validate when restoring Folders with same name', async () => { - await uploadActions.createFolder(testFolder.entry.name, '-my-'); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name); - await contentServicesPage.deleteContent(testFolder.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(testFolder.entry.name); - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFolder.entry.name); - - await trashcanPage.getDocumentList().dataTablePage().checkAllRows(); - - await trashcanPage.clickRestore(); - await waitActions.nodeIsPresent(testFolder.entry.id); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - await contentServicesPage.checkContentIsDisplayed(testFolder.entry.name); - - await notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + testFolder.entry.name + ' item already exists'); - }); - }); - - describe('Validate', () => { - - beforeAll(async () => { - await loginPage.login(acsUser.username, acsUser.password); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - }); - - it('[C260238] Should restore a file', async () => { - await contentServicesPage.checkContentIsDisplayed(testFile.entry.name); - await contentServicesPage.deleteContent(testFile.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name); - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name); - await trashcanPage.clickRestore(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name); - - await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored'); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(testFile.entry.name); - await contentServicesPage.deleteContent(testFile.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name); - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name); - }); - - it('[C260239] Should restore folder with content', async () => { - await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name); - await contentServicesPage.deleteContent(folderWithContent.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name); - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name); - await trashcanPage.clickRestore(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name); - await contentServicesPage.getDocumentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name); - await contentServicesPage.checkContentIsDisplayed(subFile.entry.name); - await notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored'); - }); - - it('[C260240] Should validate restore when the original location no longer exists', async () => { - await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name); - await contentServicesPage.openFolder(folderWithFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - await contentServicesPage.deleteContent(subFolder.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name); - await breadCrumbPage.chooseBreadCrumb(acsUser.username); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name); - await contentServicesPage.deleteContent(folderWithFolder.entry.name); - await contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name); - - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name); - await trashcanPage.clickRestore(); - await notificationHistoryPage.checkNotifyContains(`Can't restore ${subFolder.entry.name} item, the original location no longer exists`); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name); - await trashcanPage.clickRestore(); - await notificationHistoryPage.checkNotifyContains('Restore successful'); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name); - await contentServicesPage.openFolder(folderWithFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - }); - }); - - describe('Restore with folder hierarchies', () => { - let parentFolder; let folderWithin; let pdfFile; let pngFile; let mainFile; let mainFolder; - - beforeAll(async () => { - await apiService.login(anotherAcsUser.username, anotherAcsUser.password); - await uploadActions.createFolder(testFolder.entry.name, '-my-'); - parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - folderWithin = await uploadActions.createFolder(StringUtil.generateRandomString(5), parentFolder.entry.id); - pdfFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, folderWithin.entry.id); - pngFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folderWithin.entry.id); - mainFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-'); - mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - - await loginPage.login(anotherAcsUser.username, anotherAcsUser.password); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(parentFolder.entry.id); - await uploadActions.deleteFileOrFolder(mainFolder.entry.id); - await uploadActions.deleteFileOrFolder(mainFile.entry.id); - }); - - it('[C216431] Should restore hierarchy of folders', async () => { - await contentServicesPage.deleteContent(parentFolder.entry.name); - await contentServicesPage.deleteContent(mainFolder.entry.name); - await contentServicesPage.deleteContent(mainFile.entry.name); - - await navigationBarPage.clickTrashcanButton(); - await trashcanPage.waitForTableBody(); - await trashcanPage.checkRestoreButtonIsNotDisplayed(); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name); - await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name); - await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name); - await trashcanPage.clickRestore(); - - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(mainFile.entry.name); - await contentServicesPage.openFolder(parentFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name); - await contentServicesPage.openFolder(folderWithin.entry.name); - await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name); - await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name); - }); - }); - -}); diff --git a/e2e/content-services/document-list/document-list-actions.e2e.ts b/e2e/content-services/document-list/document-list-actions.e2e.ts deleted file mode 100644 index 355a8bc9c0..0000000000 --- a/e2e/content-services/document-list/document-list-actions.e2e.ts +++ /dev/null @@ -1,249 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - ContentNodeSelectorDialogPage, - LoginPage, - StringUtil, - UploadActions, - UsersActions, - ViewerPage -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { FolderModel } from '../../models/ACS/folder.model'; - -describe('Document List Component - Actions', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const contentNodeSelector = new ContentNodeSelectorDialogPage(); - const viewerPage = new ViewerPage(); - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - const uploadActions = new UploadActions(apiService); - - describe('Document List Component - Check Actions', () => { - let uploadedFolder; let secondUploadedFolder; - let acsUser = null; - let pdfUploadedNode; - let folderName; - let fileNames = []; - const nrOfFiles = 5; - - const pdfFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - const testFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path - }); - - const files = { - base: 'newFile', - extension: '.txt' - }; - - beforeAll(async () => { - folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`; - await apiService.loginWithProfile('admin'); - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-'); - await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-'); - uploadedFolder = await uploadActions.createFolder(folderName, '-my-'); - secondUploadedFolder = await uploadActions.createFolder('secondFolder', '-my-'); - - fileNames = StringUtil.generateFilesNames(1, nrOfFiles, files.base, files.extension); - await uploadActions.createEmptyFiles(fileNames, uploadedFolder.entry.id); - - await loginPage.login(acsUser.username, acsUser.password); - - await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); - }); - - describe('File Actions', () => { - it('[C213257] Should be able to copy a file', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.clickContentNodeSelectorResult(folderName); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.openFolder(uploadedFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - }); - - it('[C260131] Copy - Destination picker search', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - }); - - it('[C297491] Should be able to move a file', async () => { - await contentServicesPage.checkContentIsDisplayed(testFileModel.name); - - await contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.clickContentNodeSelectorResult(folderName); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name); - await contentServicesPage.openFolder(uploadedFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(testFileModel.name); - }); - - it('[C260127] Move - Destination picker search', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - }); - - it('[C280561] Should be able to delete a file via dropdown menu', async () => { - await contentServicesPage.openFolder(uploadedFolder.entry.name); - - await contentServicesPage.checkContentIsDisplayed(fileNames[0]); - await contentServicesPage.deleteContent(fileNames[0]); - await contentServicesPage.checkContentIsNotDisplayed(fileNames[0]); - }); - - it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => { - await contentServicesPage.openFolder(uploadedFolder.entry.name); - - await contentServicesPage.getDocumentList().selectRow(fileNames[1]); - await contentServicesPage.getDocumentList().selectRow(fileNames[2]); - await contentServicesPage.deleteContent(fileNames[1]); - await contentServicesPage.checkContentIsNotDisplayed(fileNames[1]); - await contentServicesPage.checkContentIsDisplayed(fileNames[2]); - }); - - it('[C280565] Should be able to delete a file using context menu', async () => { - await contentServicesPage.openFolder(uploadedFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(fileNames[2]); - await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]); - await contentServicesPage.pressContextMenuActionNamed('Delete'); - await contentServicesPage.checkContentIsNotDisplayed(fileNames[2]); - }); - - it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => { - await contentServicesPage.openFolder(uploadedFolder.entry.name); - - await contentServicesPage.getDocumentList().selectRow(fileNames[3]); - await contentServicesPage.getDocumentList().selectRow(fileNames[4]); - await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[3]); - await contentServicesPage.pressContextMenuActionNamed('Delete'); - await contentServicesPage.checkContentIsNotDisplayed(fileNames[3]); - await contentServicesPage.checkContentIsDisplayed(fileNames[4]); - }); - - it('[C280566] Should be able to open context menu with right click', async () => { - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.checkContextActionIsVisible('Download'); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.checkContextActionIsVisible('Delete'); - await contentServicesPage.checkContextActionIsVisible('Info'); - await contentServicesPage.checkContextActionIsVisible('Manage versions'); - await contentServicesPage.checkContextActionIsVisible('Permission'); - await contentServicesPage.checkContextActionIsVisible('Lock'); - await contentServicesPage.closeActionContext(); - }); - - it('[C260060] Should be able to open a file/folder through double click action - file', async () => { - await contentServicesPage.doubleClickRow(pdfFileModel.name); - await expect(await viewerPage.getDisplayedFileName()).toEqual(pdfFileModel.name); - await viewerPage.checkPreviewFileDefaultOptionsAreDisplayed(); - await viewerPage.clickCloseButton(); - }); - }); - - describe('Folder Actions', () => { - it('[C260138] Should be able to copy a folder', async () => { - await contentServicesPage.copyContent(folderName); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsDisplayed(folderName); - await contentServicesPage.openFolder(secondUploadedFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(folderName); - }); - - it('[C260060] Should be able to open a file/folder through double click action - folder', async () => { - const folderTwoModel = new FolderModel({ name: 'folderTwo' }); - const numberOfSubFolders = 3; - - await contentServicesPage.createNewFolder(folderTwoModel.name); - const nodeIdSubFolderTwo = await contentServicesPage.getAttributeValueForElement(folderTwoModel.name, 'Node id'); - await contentServicesPage.openFolder(folderTwoModel.name); - - for (let i = 0; i < numberOfSubFolders; i++) { - await uploadActions.createFolder('subfolder' + (i + 1), nodeIdSubFolderTwo); - } - - await browser.refresh(); - - await contentServicesPage.checkContentsAreDisplayed(numberOfSubFolders); - }); - - it('[C260123] Should be able to delete a folder using context menu', async () => { - await contentServicesPage.deleteContent(folderName); - await contentServicesPage.checkContentIsNotDisplayed(folderName); - }); - - it('[C280568] Should be able to open context menu with right click', async () => { - await contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name); - - await contentServicesPage.getDocumentList().rightClickOnRow(secondUploadedFolder.entry.name); - await contentServicesPage.checkContextActionIsVisible('Download'); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.checkContextActionIsVisible('Delete'); - await contentServicesPage.checkContextActionIsVisible('Info'); - await contentServicesPage.checkContextActionIsVisible('Permission'); - }); - }); - }); - -}); diff --git a/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts b/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts deleted file mode 100644 index f13da2e2bf..0000000000 --- a/e2e/content-services/document-list/document-list-copy-move-actions.e2e.ts +++ /dev/null @@ -1,295 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - BrowserActions, - ContentNodeSelectorDialogPage, - LoginPage, - NotificationHistoryPage, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FileModel } from '../../models/ACS/file.model'; -import CONSTANTS = require('../../util/constants'); -import { NodesApi, SitesApi } from '@alfresco/js-api'; - -describe('Document List Component', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBarPage = new NavigationBarPage(); - const contentNodeSelector = new ContentNodeSelectorDialogPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const nodesApi = new NodesApi(apiService.getInstance()); - const uploadActions = new UploadActions(apiService); - - let uploadedFolder; let uploadedFile; let sourceFolder; let destinationFolder; let subFolder; let subFolder2; let copyFolder; let subFile; - let duplicateFolderName; - const acsUser = new UserModel(); - const anotherAcsUser = new UserModel(); - let folderName; let sameNameFolder; let site; - - const pdfFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path - }); - - const testFileModel = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path - }); - - beforeAll(async () => { - folderName = StringUtil.generateRandomString(5); - sameNameFolder = StringUtil.generateRandomString(5); - await apiService.loginWithProfile('admin'); - await usersActions.createUser(acsUser); - await usersActions.createUser(anotherAcsUser); - - const sitesApi = new SitesApi(apiService.getInstance()); - site = await sitesApi.createSite({ - title: StringUtil.generateRandomString(8), - visibility: 'PUBLIC' - }); - await sitesApi.createSiteMembership(site.entry.id, { - id: anotherAcsUser.username, - role: CONSTANTS.CS_USER_ROLES.COLLABORATOR - }); - await apiService.login(acsUser.username, acsUser.password); - uploadedFolder = await uploadActions.createFolder(folderName, '-my-'); - destinationFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - sourceFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-'); - subFolder = await uploadActions.createFolder(sameNameFolder, sourceFolder.entry.id); - subFolder2 = await uploadActions.createFolder(StringUtil.generateRandomString(5), subFolder.entry.id); - copyFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), sourceFolder.entry.id); - duplicateFolderName = await uploadActions.createFolder(sameNameFolder, '-my-'); - subFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, subFolder.entry.id); - await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id); - await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, sourceFolder.entry.id); - uploadedFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-'); - await nodesApi.updateNode(sourceFolder.entry.id, - { - permissions: { - locallySet: [{ - authorityId: anotherAcsUser.username, - name: 'Consumer', - accessStatus: 'ALLOWED' - }] - } - }); - - await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id); - await uploadActions.deleteFileOrFolder(uploadedFile.entry.id); - await uploadActions.deleteFileOrFolder(sourceFolder.entry.id); - await uploadActions.deleteFileOrFolder(destinationFolder.entry.id); - - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(site.entry.id, { permanent: true }); - }); - - describe('Document List Component - Actions Move and Copy', () => { - - beforeAll(async () => { - await loginPage.login(acsUser.username, acsUser.password); - }); - - beforeEach(async () => { - await BrowserActions.closeMenuAndDialogs(); - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260128] Move - Same name file', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.clickContentNodeSelectorResult(folderName); - await contentNodeSelector.clickMoveCopyButton(); - await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.'); - }); - - it('[C260134] Move - folder with subfolder and file within it', async () => { - await contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name); - await contentServicesPage.openFolder(destinationFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name); - await contentServicesPage.openFolder(sourceFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - await contentServicesPage.openFolder(subFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(subFile.entry.name); - }); - - it('[C260135] Move - Same name folder', async () => { - await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name); - await contentNodeSelector.clickMoveCopyButton(); - await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.'); - }); - - it('[C260129] Copy - Same name file', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName); - await contentNodeSelector.clickContentNodeSelectorResult(folderName); - await contentNodeSelector.clickMoveCopyButton(); - await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.'); - }); - - it('[C260136] Copy - Same name folder', async () => { - await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name); - await contentNodeSelector.clickMoveCopyButton(); - await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.'); - }); - - it('[C260124] should be able to move file using action menu and content node selector', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.moveContent(pdfFileModel.name); - await contentNodeSelector.checkDialogIsDisplayed(); - await expect(await contentNodeSelector.getDialogHeaderText()).toBe(`Move '${pdfFileModel.name}' to...`); - await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name); - await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name); - await contentNodeSelector.checkCopyMoveButtonIsEnabled(); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - - await contentServicesPage.moveContent(pdfFileModel.name); - await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name); - await contentNodeSelector.checkSelectedFolder(destinationFolder.entry.name); - await contentNodeSelector.checkCopyMoveButtonIsEnabled(); - await contentNodeSelector.clickMoveCopyButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name); - }); - }); - - describe('Document List actions - Move, Copy on no permission folder', () => { - - beforeAll(async () => { - await loginPage.login(anotherAcsUser.username, anotherAcsUser.password); - await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - }); - - afterAll(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - it('[C260133] Move - no permission folder', async () => { - await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await expect(await contentServicesPage.isContextActionEnabled('Move')).toBe(false); - await contentServicesPage.closeActionContext(); - }); - - it('[C260140] Copy - No permission folder', async () => { - await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name); - await contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await expect(await contentServicesPage.isContextActionEnabled('Copy')).toBe(true); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name); - await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name); - await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false); - await contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name); - await contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded(); - await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name); - }); - - it('[C261160] should disable copy/move button when user is not allowed in a specific folder', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.copyContent(pdfFileModel.name); - await contentNodeSelector.checkDialogIsDisplayed(); - await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name); - await contentNodeSelector.checkSelectedFolder(subFolder.entry.name); - await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - }); - - it('[C261990] should enable copy/move button when user selects own site\'s documentLibrary', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.copyContent(pdfFileModel.name); - await contentNodeSelector.checkDialogIsDisplayed(); - await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false); - await contentNodeSelector.typeIntoNodeSelectorSearchField(site.entry.title); - await contentNodeSelector.doubleClickContentNodeSelectorResult(site.entry.id); - await contentNodeSelector.clickContentNodeSelectorResult('documentLibrary'); - await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - }); - - it('[C260137] should disable delete action when user has no permission', async () => { - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.checkDeleteIsDisabled(pdfFileModel.name); - - await navigationBarPage.clickLogoutButton(); - await loginPage.login(acsUser.username, acsUser.password); - await BrowserActions.getUrl(`${browser.baseUrl}/files/${sourceFolder.entry.id}`); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - - await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); - await contentServicesPage.deleteContent(pdfFileModel.name); - await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name); - }); - }); -}); diff --git a/e2e/content-services/document-list/document-list-folder-actions.e2e.ts b/e2e/content-services/document-list/document-list-folder-actions.e2e.ts deleted file mode 100644 index fe675aaa52..0000000000 --- a/e2e/content-services/document-list/document-list-folder-actions.e2e.ts +++ /dev/null @@ -1,191 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { $ } from 'protractor'; -import { createApiService, - BreadcrumbPage, - BreadcrumbDropdownPage, - ContentNodeSelectorDialogPage, - LoginPage, - PaginationPage, - StringUtil, - UploadActions, - UserModel, - UsersActions -} from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { InfinitePaginationPage } from '../../core/pages/infinite-pagination.page'; -import { FolderModel } from '../../models/ACS/folder.model'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; - -describe('Document List Component - Actions', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const contentListPage = contentServicesPage.getDocumentList(); - const contentNodeSelector = new ContentNodeSelectorDialogPage(); - const paginationPage = new PaginationPage(); - const breadCrumbDropdownPage = new BreadcrumbDropdownPage(); - const breadCrumbPage = new BreadcrumbPage(); - const navigationBarPage = new NavigationBarPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - - const uploadActions = new UploadActions(apiService); - const infinitePaginationPage = new InfinitePaginationPage($('adf-content-node-selector')); - - describe('Folder Actions - Copy and Move', () => { - const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() }); - const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() }); - - let folder1; let folder2; let folder3; let folder4; let folder5; let folder6; - - let folders; - const contentServicesUser = new UserModel(); - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(contentServicesUser); - await apiService.login(contentServicesUser.username, contentServicesUser.password); - folder1 = await uploadActions.createFolder('A' + folderModel1.name, '-my-'); - folder2 = await uploadActions.createFolder('B' + folderModel2.name, '-my-'); - folder3 = await uploadActions.createFolder('C' + folderModel3.name, '-my-'); - folder4 = await uploadActions.createFolder('D' + folderModel4.name, '-my-'); - folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-'); - folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-'); - folders = [folder1, folder2, folder3, folder4, folder5, folder6]; - }); - - beforeEach(async () => { - await loginPage.login(contentServicesUser.username, contentServicesUser.password); - await contentServicesPage.goToDocumentList(); - await paginationPage.selectItemsPerPage('5'); - await contentServicesPage.checkAcsContainer(); - await contentListPage.waitForTableBody(); - }); - - afterEach(async () => { - await navigationBarPage.clickLogoutButton(); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - for (const folder of folders) { - await uploadActions.deleteFileOrFolder(folder.entry.id); - } - }); - - it('[C260132] Move action on folder with - Load more', async () => { - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - - await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...'); - await contentNodeSelector.checkSearchInputIsDisplayed(); - await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); - await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); - await contentNodeSelector.checkCancelButtonIsDisplayed(); - await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); - - await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE'); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); - await infinitePaginationPage.clickLoadMoreButton(); - - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); - await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await infinitePaginationPage.clickLoadMoreButton(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); - await contentServicesPage.openFolder('F' + folderModel6.name); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Move'); - await contentServicesPage.pressContextMenuActionNamed('Move'); - await contentNodeSelector.checkDialogIsDisplayed(); - await breadCrumbDropdownPage.clickParentFolder(); - await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed(); - await breadCrumbDropdownPage.choosePath(contentServicesUser.username); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name); - - await breadCrumbPage.chooseBreadCrumb(contentServicesUser.username); - await contentServicesPage.waitForTableBody(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - }); - - it('[C305051] Copy action on folder with - Load more', async () => { - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6); - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...'); - await contentNodeSelector.checkSearchInputIsDisplayed(); - await expect(await contentNodeSelector.getSearchLabel()).toBe('Search'); - await contentNodeSelector.checkSelectedSiteIsDisplayed('My files'); - await contentNodeSelector.checkCancelButtonIsDisplayed(); - await contentNodeSelector.checkMoveCopyButtonIsDisplayed(); - await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY'); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5); - await infinitePaginationPage.clickLoadMoreButton(); - await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6); - await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickCancelButton(); - await contentNodeSelector.checkDialogIsNotDisplayed(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - - await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name); - await contentServicesPage.checkContextActionIsVisible('Copy'); - await contentServicesPage.pressContextMenuActionNamed('Copy'); - await contentNodeSelector.checkDialogIsDisplayed(); - await infinitePaginationPage.clickLoadMoreButton(); - await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name); - await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name); - await contentNodeSelector.clickMoveCopyButton(); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - await paginationPage.clickOnNextPage(); - await contentServicesPage.getDocumentList().dataTable.waitTillContentLoaded(); - await contentServicesPage.openFolder('F' + folderModel6.name); - await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name); - }); - }); -}); diff --git a/e2e/content-services/document-list/document-list-gallery.e2e.ts b/e2e/content-services/document-list/document-list-gallery.e2e.ts index 097df78aa5..717be50629 100644 --- a/e2e/content-services/document-list/document-list-gallery.e2e.ts +++ b/e2e/content-services/document-list/document-list-gallery.e2e.ts @@ -17,7 +17,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page'; import { browser } from 'protractor'; -import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; @@ -29,7 +29,7 @@ describe('Document List Component', () => { const usersActions = new UsersActions(apiService); const uploadActions = new UploadActions(apiService); - let acsUser = null; + let acsUser: UserModel; const navigationBarPage = new NavigationBarPage(); describe('Gallery View', () => { @@ -90,10 +90,9 @@ describe('Document List Component', () => { if (folderNode) { await uploadActions.deleteFileOrFolder(folderNode.entry.id); } - }); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); await contentServicesPage.goToDocumentList(); await contentServicesPage.clickGridViewButton(); await contentServicesPage.checkCardViewContainerIsDisplayed(); @@ -146,21 +145,6 @@ describe('Document List Component', () => { await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); }); - // eslint-disable-next-line ban/ban - xit('[C280129] Should keep Gallery View when accessing a folder', async () => { - await contentServicesPage.navigateToCardFolder(folderName); - - await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(1); - await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg'); - }); - - it('[C280130] Should be able to go back to List View', async () => { - await contentServicesPage.clickGridViewButton(); - await contentServicesPage.checkAcsContainer(); - await contentServicesPage.openFolder(folderName); - await contentServicesPage.checkRowIsDisplayed(pdfFile.name); - }); - it('[C261993] Should be able to sort Gallery Cards by display name', async () => { await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME); await contentServicesPage.checkListIsSortedByNameColumn('asc'); diff --git a/e2e/content-services/document-list/document-list-pagination.e2e.ts b/e2e/content-services/document-list/document-list-pagination.e2e.ts index 4b71a10dde..97bf66840c 100644 --- a/e2e/content-services/document-list/document-list-pagination.e2e.ts +++ b/e2e/content-services/document-list/document-list-pagination.e2e.ts @@ -50,8 +50,6 @@ describe('Document List - Pagination', () => { let acsUser: UserModel; let fileNames = []; - - let currentPage = 1; let secondSetOfFiles = []; const nrOfFiles = 20; @@ -130,6 +128,7 @@ describe('Document List - Pagination', () => { }); it('[C260069] Should be able to set Items per page to 5', async () => { + let currentPage = 1; await contentServicesPage.openFolder(newFolderModel.name); await paginationPage.selectItemsPerPage('5'); await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); @@ -178,7 +177,7 @@ describe('Document List - Pagination', () => { }); it('[C260067] Should be able to set Items per page to 10', async () => { - currentPage = 1; + let currentPage = 1; await contentServicesPage.openFolder(newFolderModel.name); await paginationPage.selectItemsPerPage('10'); await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); @@ -207,9 +206,8 @@ describe('Document List - Pagination', () => { }); it('[C260065] Should be able to set Items per page to 15', async () => { - currentPage = 1; + let currentPage = 1; await contentServicesPage.openFolder(newFolderModel.name); - await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name); await paginationPage.selectItemsPerPage('15'); await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); @@ -236,7 +234,6 @@ describe('Document List - Pagination', () => { it('[C91320] Pagination should preserve sorting', async () => { await contentServicesPage.openFolder(newFolderModel.name); - await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name); await paginationPage.selectItemsPerPage('20'); await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); @@ -269,7 +266,6 @@ describe('Document List - Pagination', () => { await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); await contentServicesPage.openFolder(newFolderModel.name); - await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); await contentServicesPage.createAndOpenNewFolder(folderTwoModel.name); @@ -280,9 +276,8 @@ describe('Document List - Pagination', () => { }); it('[C260071] Should be able to change pagination when having 25 files', async () => { - currentPage = 1; + let currentPage = 1; await contentServicesPage.openFolder(folderThreeModel.name); - await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name); await paginationPage.selectItemsPerPage('15'); await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); @@ -370,7 +365,6 @@ describe('Document List - Pagination', () => { await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded(); await contentServicesPage.openFolder(newFolderModel.name); - await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5'); await apiService.login(acsUser.username, acsUser.password); @@ -436,5 +430,4 @@ describe('Document List - Pagination', () => { await contentServicesPage.deleteSubFolderUnderRoot(newFolderModel.name, folderTwoModel.name); }); - }); diff --git a/e2e/content-services/document-list/document-list-properties.e2e.ts b/e2e/content-services/document-list/document-list-properties.e2e.ts deleted file mode 100644 index 8ba2ec3958..0000000000 --- a/e2e/content-services/document-list/document-list-properties.e2e.ts +++ /dev/null @@ -1,92 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, DropActions, LoginPage, UploadActions, UsersActions } from '@alfresco/adf-testing'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { browser } from 'protractor'; -import { FileModel } from '../../models/ACS/file.model'; - -describe('Document List Component - Properties', () => { - - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const navigationBar = new NavigationBarPage(); - - let subFolder; let parentFolder; - const apiService = createApiService(); - const uploadActions = new UploadActions(apiService); - let acsUser = null; - const usersActions = new UsersActions(apiService); - - const pngFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location - }); - - describe('Allow drop files property', () => { - - beforeEach(async () => { - await apiService.loginWithProfile('admin'); - - acsUser = await usersActions.createUser(); - await apiService.login(acsUser.username, acsUser.password); - - parentFolder = await uploadActions.createFolder('parentFolder', '-my-'); - subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id); - - await loginPage.login(acsUser.username, acsUser.password); - - await navigationBar.navigateToContentServices(); - await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded(); - }); - - afterEach(async () => { - await apiService.loginWithProfile('admin'); - await uploadActions.deleteFileOrFolder(subFolder.entry.id); - await uploadActions.deleteFileOrFolder(parentFolder.entry.id); - await navigationBar.clickLogoutButton(); - }); - - it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => { - await contentServicesPage.openFolder(parentFolder.entry.name); - await contentServicesPage.disableDropFilesInAFolder(); - await browser.sleep(1000); - - const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name); - - await DropActions.dropFile(dragAndDropArea, pngFile.location); - await contentServicesPage.checkContentIsDisplayed(pngFile.name); - await contentServicesPage.openFolder(subFolder.entry.name); - await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty'); - }); - - it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => { - await contentServicesPage.openFolder(parentFolder.entry.name); - await contentServicesPage.enableDropFilesInAFolder(); - await browser.sleep(1000); - - const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name); - - await DropActions.dropFile(dragAndDropArea, pngFile.location); - - await contentServicesPage.checkContentIsNotDisplayed(pngFile.name); - await contentServicesPage.openFolder(subFolder.entry.name); - await contentServicesPage.checkContentIsDisplayed(pngFile.name); - }); - }); -}); diff --git a/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts b/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts index bb69e9a92a..b866ee4037 100644 --- a/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts +++ b/e2e/content-services/document-list/document-list-thumbnails-tooltips.e2e.ts @@ -17,38 +17,31 @@ import { ContentServicesPage } from '../../core/pages/content-services.page'; import { browser } from 'protractor'; -import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { NodeEntry } from '@alfresco/js-api'; describe('Document List Component', () => { - const loginPage = new LoginPage(); const contentServicesPage = new ContentServicesPage(); const apiService = createApiService(); const uploadActions = new UploadActions(apiService); - let acsUser = null; const navigationBarPage = new NavigationBarPage(); const usersActions = new UsersActions(apiService); + let acsUser: UserModel; + describe('Thumbnails and tooltips', () => { const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_path }); - const testFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path - }); - - const docxFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path - }); const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`; - let filePdfNode; let fileTestNode; let fileDocxNode; let folderNode; + let filePdfNode: NodeEntry; + let folderNode: NodeEntry; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -57,8 +50,6 @@ describe('Document List Component', () => { await apiService.login(acsUser.username, acsUser.password); filePdfNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-'); - fileTestNode = await uploadActions.uploadFile(testFile.location, testFile.name, '-my-'); - fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-'); folderNode = await uploadActions.createFolder(folderName, '-my-'); }); @@ -69,12 +60,6 @@ describe('Document List Component', () => { if (filePdfNode) { await uploadActions.deleteFileOrFolder(filePdfNode.entry.id); } - if (fileTestNode) { - await uploadActions.deleteFileOrFolder(fileTestNode.entry.id); - } - if (fileDocxNode) { - await uploadActions.deleteFileOrFolder(fileDocxNode.entry.id); - } if (folderNode) { await uploadActions.deleteFileOrFolder(folderNode.entry.id); } @@ -97,26 +82,6 @@ describe('Document List Component', () => { await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName); }); - it('[C260119] Should have a specific thumbnail for folders', async () => { - const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName); - await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg'); - }); - - it('[C280066] Should have a specific thumbnail PDF files', async () => { - const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); - await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg'); - }); - - it('[C280067] Should have a specific thumbnail DOCX files', async () => { - const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name); - await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg'); - }); - - it('[C280068] Should have a specific thumbnail files', async () => { - const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name); - await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg'); - }); - it('[C274701] Should be able to enable thumbnails', async () => { await contentServicesPage.enableThumbnails(); await contentServicesPage.checkAcsContainer(); diff --git a/e2e/content-services/pages/lock-file.page.ts b/e2e/content-services/pages/lock-file.page.ts deleted file mode 100644 index 8a3354b918..0000000000 --- a/e2e/content-services/pages/lock-file.page.ts +++ /dev/null @@ -1,27 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { TestElement } from '@alfresco/adf-testing'; - -export class LockFilePage { - - cancelButton = TestElement.byCss('button[data-automation-id="lock-dialog-btn-cancel"]'); - saveButton = TestElement.byText('button span', 'Save'); - lockFileCheckboxText = TestElement.byText('mat-checkbox label span', ' Lock file '); - lockFileCheckbox = TestElement.byCss('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'); - allowOwnerCheckbox = TestElement.byText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '); -} diff --git a/e2e/content-services/upload/uploader-component.e2e.ts b/e2e/content-services/upload/uploader-component.e2e.ts index d627fa368b..f61a66d915 100644 --- a/e2e/content-services/upload/uploader-component.e2e.ts +++ b/e2e/content-services/upload/uploader-component.e2e.ts @@ -99,8 +99,6 @@ describe('Upload component', () => { }); it('[C272788] Should display upload button', async () => { - await expect(await contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip'); - await contentServicesPage.checkUploadButton(); await contentServicesPage.checkContentIsDisplayed(firstPdfFileModel.name); }); @@ -133,13 +131,6 @@ describe('Upload component', () => { await uploadDialog.dialogIsNotDisplayed(); }); - it('[C272794] Should display tooltip for uploading files', async () => { - await uploadToggles.enableMultipleFileUpload(); - await uploadToggles.checkMultipleFileUploadToggleIsEnabled(); - await expect(await contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip'); - await uploadToggles.disableMultipleFileUpload(); - }); - it('[C279920] Should rename a file uploaded twice', async () => { await contentServicesPage.uploadFile(pdfFileModel.location); await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name); diff --git a/e2e/content-services/upload/user-permission.e2e.ts b/e2e/content-services/upload/user-permission.e2e.ts index 31a1fb0691..ac9fe598a9 100644 --- a/e2e/content-services/upload/user-permission.e2e.ts +++ b/e2e/content-services/upload/user-permission.e2e.ts @@ -16,13 +16,13 @@ */ import { browser } from 'protractor'; -import { createApiService, LoginPage, NotificationHistoryPage, StringUtil, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, LoginPage, SnackbarPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing'; import { ContentServicesPage } from '../../core/pages/content-services.page'; import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { FileModel } from '../../models/ACS/file.model'; import CONSTANTS = require('../../util/constants'); -import { SitesApi } from '@alfresco/js-api'; +import { SiteEntry, SitesApi } from '@alfresco/js-api'; describe('Upload - User permission', () => { @@ -30,7 +30,6 @@ describe('Upload - User permission', () => { const uploadDialog = new UploadDialogPage(); const loginPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); - const notificationHistoryPage = new NotificationHistoryPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -39,17 +38,10 @@ describe('Upload - User permission', () => { location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_location }); - const pngFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location - }); - - const pdfFile = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_location - }); - - let acsUser; let acsUserTwo; let consumerSite; let managerSite; + let acsUser: UserModel; + let acsUserTwo: UserModel; + let consumerSite: SiteEntry; + let managerSite: SiteEntry; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -125,7 +117,8 @@ describe('Upload - User permission', () => { await contentServicesPage.uploadFile(emptyFile.location); - await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content'); + const message = await new SnackbarPage().getSnackBarMessage(); + expect(message).toEqual('You don\'t have the create permission to upload the content'); }); }); @@ -141,38 +134,4 @@ describe('Upload - User permission', () => { await uploadDialog.fileIsUploaded(emptyFile.name); }); }); - - describe('multiple users', () => { - beforeEach(async () => { - await contentServicesPage.goToDocumentList(); - }); - - it('[C260175] Should two different user upload files in the proper User Home', async () => { - await contentServicesPage.uploadFile(emptyFile.location); - - await uploadDialog.fileIsUploaded(emptyFile.name); - - await contentServicesPage.checkContentIsDisplayed(emptyFile.name); - - await navigationBarPage.clickLogoutButton(); - await loginPage.login(acsUserTwo.username, acsUserTwo.password); - await contentServicesPage.goToDocumentList(); - - await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name); - - await contentServicesPage.uploadFile(pngFile.location); - - await contentServicesPage.checkContentIsDisplayed(pngFile.name); - - await navigationBarPage.clickLogoutButton(); - await loginPage.login(acsUser.username, acsUser.password); - await contentServicesPage.goToDocumentList(); - - await contentServicesPage.checkContentIsNotDisplayed(pngFile.name); - - await contentServicesPage.uploadFile(pdfFile.location); - - await contentServicesPage.checkContentIsDisplayed(pdfFile.name); - }); - }); }); diff --git a/e2e/content-services/upload/version-permissions.e2e.ts b/e2e/content-services/upload/version-permissions.e2e.ts index 8cfb93448c..5203df7963 100644 --- a/e2e/content-services/upload/version-permissions.e2e.ts +++ b/e2e/content-services/upload/version-permissions.e2e.ts @@ -16,9 +16,10 @@ */ import { browser, by, element } from 'protractor'; -import { createApiService, +import { + createApiService, LoginPage, - NotificationHistoryPage, + SnackbarPage, StringUtil, UploadActions, UserModel, @@ -38,7 +39,6 @@ describe('Version component permissions', () => { const versionManagePage = new VersionManagePage(); const navigationBarPage = new NavigationBarPage(); const uploadDialog = new UploadDialogPage(); - const notificationHistoryPage = new NotificationHistoryPage(); const contentServices = new ContentServicesPage(); let site; @@ -194,7 +194,8 @@ describe('Version component permissions', () => { it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', async () => { await contentServices.versionManagerContent(differentCreatorFile.name); - await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`); + const message = await new SnackbarPage().getSnackBarMessage(); + expect(message).toEqual(`You don't have access to do this.`); }); it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', async () => { @@ -249,7 +250,8 @@ describe('Version component permissions', () => { it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', async () => { await contentServices.versionManagerContent(differentCreatorFile.name); - await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`); + const message = await new SnackbarPage().getSnackBarMessage(); + expect(message).toEqual(`You don't have access to do this.`); }); it('[C277202] Should be disabled the option for a locked file', async () => { diff --git a/e2e/core/infinite-scrolling.e2e.ts b/e2e/core/infinite-scrolling.e2e.ts index ad298b05af..0507ed30fb 100644 --- a/e2e/core/infinite-scrolling.e2e.ts +++ b/e2e/core/infinite-scrolling.e2e.ts @@ -24,12 +24,12 @@ import { createApiService, UsersActions } from '@alfresco/adf-testing'; import { FolderModel } from '../models/ACS/folder.model'; -import { ContentServicesPage } from '../core/pages/content-services.page'; +import { ContentServicesPage } from './pages/content-services.page'; import { InfinitePaginationPage } from './pages/infinite-pagination.page'; -import { NavigationBarPage } from '../core/pages/navigation-bar.page'; +import { NavigationBarPage } from './pages/navigation-bar.page'; +import { NodeEntry } from '@alfresco/js-api'; describe('Enable infinite scrolling', () => { - const loginPage = new LoginPage(); const contentServicesPage = new ContentServicesPage(); const infinitePaginationPage = new InfinitePaginationPage(); @@ -45,9 +45,9 @@ describe('Enable infinite scrolling', () => { const nrOfFiles = 30; let deleteFileNames = []; const nrOfDeletedFiles = 22; - let deleteUploaded; + let deleteUploaded: NodeEntry; const pageSize = 20; - let emptyFolderModel; + let emptyFolderModel: NodeEntry; const files = { base: 'newFile', diff --git a/e2e/core/pages/content-services.page.ts b/e2e/core/pages/content-services.page.ts index 9817f1acaa..05f01a8eb9 100644 --- a/e2e/core/pages/content-services.page.ts +++ b/e2e/core/pages/content-services.page.ts @@ -21,12 +21,10 @@ import { BrowserVisibility, DateUtil, DocumentListPage, - TogglePage, DropdownPage, Logger } from '@alfresco/adf-testing'; -import { $$, browser, by, element, ElementFinder, protractor, $ } from 'protractor'; -import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page'; +import { $$, browser, by, element, protractor, $ } from 'protractor'; import { FolderDialogPage } from './dialog/folder-dialog.page'; import { NavigationBarPage } from './navigation-bar.page'; @@ -43,18 +41,10 @@ export class ContentServicesPage { }; contentList = new DocumentListPage($$('adf-upload-drag-area adf-document-list').first()); - togglePage = new TogglePage(); createFolderDialog = new FolderDialogPage(); - createLibraryDialog = new CreateLibraryDialogPage(); - - multipleFileUploadToggle = $('#adf-document-list-enable-drop-files'); uploadBorder = $('#document-list-container'); currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div'); createFolderButton = $('button[data-automation-id="create-new-folder"]'); - editFolderButton = $('button[data-automation-id="edit-folder"]'); - deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]'); - createLibraryButton = $('button[data-automation-id="create-new-library"]'); - activeBreadcrumb = $('div[class*="active"]'); uploadFileButton = $('.adf-upload-button-file-container button'); uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]'); uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]'); @@ -69,21 +59,14 @@ export class ContentServicesPage { emptyFolderImage = $('.adf-empty-folder-image'); gridViewButton = $('button[data-automation-id="document-list-grid-view"]'); cardViewContainer = $('div.app-document-list-container div.adf-datatable-card'); - shareNodeButton = element(by.cssContainingText('mat-icon', 'share')); nameColumnHeader = 'name'; createdByColumnHeader = 'createdByUser.displayName'; createdColumnHeader = 'createdAt'; deleteContentElement = $('button[data-automation-id="Delete"]'); metadataAction = $('button[data-automation-id="Info"]'); versionManagerAction = $('button[data-automation-id="Manage versions"]'); - moveContentElement = $('button[data-automation-id="Move"]'); - copyContentElement = $('button[data-automation-id="Copy"]'); - lockContentElement = $('button[data-automation-id="Lock"]'); downloadContent = $('button[data-automation-id="Download"]'); downloadButton = $('button[title="Download"]'); - favoriteButton = $('button[data-automation-id="favorite"]'); - markedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star')); - notMarkedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border')); multiSelectToggle = $('[data-automation-id="multiSelectToggle"]'); selectAllCheckbox = $$('.adf-checkbox-sr-only').first(); selectionModeDropdown = $('.mat-select[placeholder="Selection Mode"]'); @@ -95,11 +78,6 @@ export class ContentServicesPage { await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`); } - async checkContextActionIsVisible(actionName) { - const actionButton = $(`button[data-automation-id="context-${actionName}"`); - await BrowserVisibility.waitUntilElementIsVisible(actionButton); - } - async isContextActionEnabled(actionName): Promise { const actionButton = $(`button[data-automation-id="context-${actionName}"`); await BrowserVisibility.waitUntilElementIsVisible(actionButton); @@ -110,18 +88,6 @@ export class ContentServicesPage { return this.contentList; } - async closeActionContext(): Promise { - await BrowserActions.closeMenuAndDialogs(); - } - - async checkLockedIcon(content): Promise { - return this.contentList.checkLockedIcon(content); - } - - async checkUnlockedIcon(content): Promise { - return this.contentList.checkUnlockedIcon(content); - } - async checkDeleteIsDisabled(content): Promise { await this.contentList.clickOnActionMenu(content); const disabledDelete = $(`button[data-automation-id='Delete'][disabled='true']`); @@ -134,14 +100,6 @@ export class ContentServicesPage { await this.checkContentIsNotDisplayed(content); } - async clickDeleteOnToolbar(): Promise { - await BrowserActions.click(this.deleteNodesButton); - } - - async checkToolbarDeleteIsDisabled(): Promise { - return !(await this.deleteNodesButton.isEnabled()); - } - async metadataContent(content): Promise { await this.contentList.clickOnActionMenu(content); await BrowserActions.click(this.metadataAction); @@ -152,21 +110,6 @@ export class ContentServicesPage { await BrowserActions.click(this.versionManagerAction); } - async copyContent(content): Promise { - await this.contentList.clickOnActionMenu(content); - await BrowserActions.click(this.copyContentElement); - } - - async moveContent(content): Promise { - await this.contentList.clickOnActionMenu(content); - await BrowserActions.click(this.moveContentElement); - } - - async lockContent(content): Promise { - await this.contentList.clickOnActionMenu(content); - await BrowserActions.click(this.lockContentElement); - } - async clickFileHyperlink(fileName): Promise { const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName); await BrowserActions.click(hyperlink); @@ -182,15 +125,6 @@ export class ContentServicesPage { await BrowserActions.click(hyperlinkToggle); } - async enableDropFilesInAFolder(): Promise { - await this.togglePage.enableToggle(this.multipleFileUploadToggle); - } - - async disableDropFilesInAFolder(): Promise { - await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle); - await this.togglePage.disableToggle(this.multipleFileUploadToggle); - } - async getElementsDisplayedId() { return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId); } @@ -313,31 +247,6 @@ export class ContentServicesPage { await BrowserActions.click(this.createFolderButton); } - async clickOnFavoriteButton(): Promise { - await BrowserActions.click(this.favoriteButton); - } - - async checkIsMarkedFavorite(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite); - } - - async checkIsNotMarkedFavorite(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite); - } - - async clickOnEditFolder(): Promise { - await BrowserActions.click(this.editFolderButton); - } - - async isEditFolderButtonEnabled(): Promise { - return this.editFolderButton.isEnabled(); - } - - async openCreateLibraryDialog(): Promise { - await BrowserActions.click(this.createLibraryButton); - await this.createLibraryDialog.libraryDialog.waitVisible(); - } - async createNewFolder(folderName: string): Promise { await this.clickOnCreateNewFolder(); await this.createFolderDialog.addFolderName(folderName); @@ -355,17 +264,17 @@ export class ContentServicesPage { await this.contentList.dataTablePage().waitTillContentLoaded(); } - async checkContentIsDisplayed(content): Promise { + async checkContentIsDisplayed(content: string): Promise { await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content); } - async checkContentsAreDisplayed(content): Promise { - for (let i = 0; i < content.length; i++) { - await this.checkContentIsDisplayed(content[i]); + async checkContentsAreDisplayed(content: string[]): Promise { + for (const item of content) { + await this.checkContentIsDisplayed(item); } } - async checkContentIsNotDisplayed(content): Promise { + async checkContentIsNotDisplayed(content: string): Promise { await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content); } @@ -380,17 +289,13 @@ export class ContentServicesPage { await this.deleteAndCheckFolderNotDisplayed(subFolderName); } - async getActiveBreadcrumb(): Promise { - return BrowserActions.getAttribute(this.activeBreadcrumb, 'title'); - } - - async uploadFile(fileLocation): Promise { + async uploadFile(fileLocation: string): Promise { await this.checkUploadButton(); await this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation))); await this.checkUploadButton(); } - async uploadMultipleFile(files): Promise { + async uploadMultipleFile(files: string[]): Promise { await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton); let allFiles = path.resolve(path.join(browser.params.testConfig.main.rootPath, files[0])); for (let i = 1; i < files.length; i++) { @@ -405,16 +310,6 @@ export class ContentServicesPage { await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folderLocation))); } - async getSingleFileButtonTooltip(): Promise { - await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton); - return BrowserActions.getAttribute(this.uploadFileButtonInput, 'title'); - } - - async getMultipleFileButtonTooltip(): Promise { - await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton); - return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title'); - } - async checkUploadButton(): Promise { await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton); } @@ -514,27 +409,27 @@ export class ContentServicesPage { return $$('div.app-document-list-container div.adf-datatable-card div.adf-cell-value img').count(); } - async getDocumentCardIconForElement(elementName): Promise { + async getDocumentCardIconForElement(elementName: string): Promise { const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`); return BrowserActions.getAttribute(elementIcon, 'src'); } - async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise { + async checkDocumentCardPropertyIsShowed(elementName: string, propertyName: string): Promise { const elementProperty = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`); await BrowserVisibility.waitUntilElementIsVisible(elementProperty); } - async getAttributeValueForElement(elementName, propertyName): Promise { + async getAttributeValueForElement(elementName: string, propertyName: string): Promise { const elementSize = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`); return BrowserActions.getText(elementSize); } - async checkMenuIsShowedForElementIndex(elementIndex): Promise { + async checkMenuIsShowedForElementIndex(elementIndex: number): Promise { const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`); await BrowserVisibility.waitUntilElementIsVisible(elementMenu); } - async navigateToCardFolder(folderName): Promise { + async navigateToCardFolder(folderName: string): Promise { await BrowserActions.closeMenuAndDialogs(); const folderCard = $(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`); await BrowserActions.click(folderCard); @@ -543,22 +438,16 @@ export class ContentServicesPage { await browser.actions().sendKeys(protractor.Key.ENTER).perform(); } - async selectGridSortingFromDropdown(sortingOption): Promise { + async selectGridSortingFromDropdown(sortingOption: string): Promise { await this.sortingDropdown.selectDropdownOption(sortingOption); } - async checkRowIsDisplayed(rowName): Promise { + async checkRowIsDisplayed(rowName: string): Promise { const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName); await BrowserVisibility.waitUntilElementIsVisible(row); } - async clickShareButton(): Promise { - await browser.sleep(2000); - await BrowserActions.closeMenuAndDialogs(); - await BrowserActions.click(this.shareNodeButton); - } - - async checkSelectedSiteIsDisplayed(siteName): Promise { + async checkSelectedSiteIsDisplayed(siteName: string): Promise { await this.siteListDropdown.checkOptionIsSelected(siteName); } @@ -580,10 +469,6 @@ export class ContentServicesPage { await BrowserActions.click(this.selectAllCheckbox); } - getRowByName(rowName: string): ElementFinder { - return this.contentList.dataTable.getRow(this.columns.name, rowName); - } - async selectFolder(folderName: string): Promise { const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`); await BrowserVisibility.waitUntilElementIsVisible(folderSelected); diff --git a/e2e/core/pages/custom-sources.page.ts b/e2e/core/pages/custom-sources.page.ts deleted file mode 100644 index e709b322fb..0000000000 --- a/e2e/core/pages/custom-sources.page.ts +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing'; -import { $ } from 'protractor'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; - -const source = { - favorites: 'Favorites', - recent: 'Recent', - sharedLinks: 'Shared Links', - sites: 'Sites', - mySites: 'My Sites', - trashcan: 'Trashcan', - root: 'Root', - my: 'My', - shared: 'Shared' -}; - -const column = { - status: 'Status' -}; - -export class CustomSourcesPage { - dataTable = new DataTableComponentPage(); - navigationBarPage = new NavigationBarPage(); - - toolbar = $('app-custom-sources .adf-toolbar-title'); - selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]')); - - async waitForToolbarToBeVisible(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.toolbar); - } - - async navigateToCustomSources(): Promise { - await this.navigationBarPage.clickCustomSources(); - await this.waitForToolbarToBeVisible(); - } - - async selectMySitesSourceType(): Promise { - await this.selectModeDropdown.selectDropdownOption(source.mySites); - } - - async selectFavoritesSourceType(): Promise { - await this.selectModeDropdown.selectDropdownOption(source.favorites); - } - - async selectSharedLinksSourceType(): Promise { - await this.selectModeDropdown.selectDropdownOption(source.sharedLinks); - } - - checkRowIsDisplayed(rowName: string): Promise { - return this.dataTable.checkContentIsDisplayed('Name', rowName); - } - - checkRowIsNotDisplayed(rowName: string): Promise { - return this.dataTable.checkContentIsNotDisplayed('Name', rowName); - } - - async getStatusCell(rowName: string): Promise { - const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status); - return BrowserActions.getText(cell); - } - -} diff --git a/e2e/core/pages/dialog/create-library-dialog.page.ts b/e2e/core/pages/dialog/create-library-dialog.page.ts deleted file mode 100644 index 3bceefc009..0000000000 --- a/e2e/core/pages/dialog/create-library-dialog.page.ts +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { $, $$ } from 'protractor'; -import { BrowserActions, TestElement } from '@alfresco/adf-testing'; - -export class CreateLibraryDialogPage { - libraryDialog = TestElement.byCss('[role="dialog"]'); - libraryTitle = TestElement.byCss('.adf-library-dialog>h2'); - libraryNameField = TestElement.byCss('input[formcontrolname="title"]'); - libraryIdField = TestElement.byCss('input[formcontrolname="id"]'); - libraryDescriptionField = TestElement.byCss('textarea[formcontrolname="description"]'); - publicRadioButton = TestElement.byCss('[data-automation-id="PUBLIC"]>label'); - privateRadioButton = TestElement.byCss('[data-automation-id="PRIVATE"]>label'); - moderatedRadioButton = TestElement.byCss('[data-automation-id="MODERATED"]>label'); - cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]'); - createButton = TestElement.byCss('button[data-automation-id="create-library-id"]'); - errorMessage = TestElement.byCss('.mat-dialog-content .mat-error'); - errorMessages = $$('.mat-dialog-content .mat-error'); - libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint'); - - async getSelectedRadio(): Promise { - const radio = $('.mat-radio-button[class*="checked"]'); - return BrowserActions.getText(radio); - } - - async getErrorMessages(position: number): Promise { - return BrowserActions.getText(this.errorMessages.get(position)); - } -} diff --git a/e2e/core/pages/dialog/folder-dialog.page.ts b/e2e/core/pages/dialog/folder-dialog.page.ts index 00960c5dba..4a14195e12 100644 --- a/e2e/core/pages/dialog/folder-dialog.page.ts +++ b/e2e/core/pages/dialog/folder-dialog.page.ts @@ -15,73 +15,21 @@ * limitations under the License. */ -import { $$, ElementFinder } from 'protractor'; -import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; +import { $$ } from 'protractor'; +import { BrowserActions } from '@alfresco/adf-testing'; export class FolderDialogPage { folderDialog = $$('adf-folder-dialog').first(); folderNameField = this.folderDialog.$('#adf-folder-name-input'); - folderDescriptionField = this.folderDialog.$('#adf-folder-description-input'); createUpdateButton = this.folderDialog.$('#adf-folder-create-button'); cancelButton = this.folderDialog.$('#adf-folder-cancel-button'); - folderTitle = this.folderDialog.$('h2.mat-dialog-title'); - validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span'); - - async getDialogTitle(): Promise { - return BrowserActions.getText(this.folderTitle); - } - - async checkFolderDialogIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.folderDialog); - } - - async checkFolderDialogIsNotDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog); - } async clickOnCreateUpdateButton(): Promise { await BrowserActions.click(this.createUpdateButton); } - async clickOnCancelButton(): Promise { - await BrowserActions.click(this.cancelButton); - } - async addFolderName(folderName): Promise { await BrowserActions.clearSendKeys(this.folderNameField, folderName); } - - async addFolderDescription(folderDescription): Promise { - await BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription); - } - - async getFolderName(): Promise { - return BrowserActions.getInputValue(this.folderNameField); - } - - async getValidationMessage(): Promise { - return BrowserActions.getText(this.validationMessage); - } - - async checkValidationMessageIsNotDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage); - } - - getFolderNameField(): ElementFinder { - return this.folderNameField; - } - - getFolderDescriptionField(): ElementFinder { - return this.folderDescriptionField; - } - - async checkCreateUpdateBtnIsEnabled(): Promise { - return this.createUpdateButton.isEnabled(); - } - - async checkCancelBtnIsEnabled(): Promise { - await this.cancelButton.isEnabled(); - } - } diff --git a/e2e/core/pages/dialog/share-dialog.page.ts b/e2e/core/pages/dialog/share-dialog.page.ts deleted file mode 100644 index fdef929519..0000000000 --- a/e2e/core/pages/dialog/share-dialog.page.ts +++ /dev/null @@ -1,114 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { $$, $ } from 'protractor'; -import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing'; -import { format, add } from 'date-fns'; -export class ShareDialogPage { - - togglePage = new TogglePage(); - dateTimePickerPage = new DateTimePickerPage(); - shareDialog = $('adf-share-dialog'); - dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first(); - shareToggle = $('[data-automation-id="adf-share-toggle"] label'); - expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`); - shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked'); - shareLink = $('[data-automation-id="adf-share-link"]'); - closeButton = $('button[data-automation-id="adf-share-dialog-close"]'); - copySharedLinkButton = $('.adf-input-action'); - expirationDateInput = $('input[formcontrolname="time"]'); - confirmationDialog = $('adf-confirm-dialog'); - confirmationCancelButton = $('#adf-confirm-cancel'); - confirmationRemoveButton = $('#adf-confirm-accept'); - - async checkDialogIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle); - } - - async clickUnShareFile() { - await this.togglePage.enableToggle(this.shareToggle); - } - - async clickExpireToggle() { - await this.togglePage.enableToggle(this.expireToggle); - } - - async clickConfirmationDialogCancelButton(): Promise { - await BrowserActions.click(this.confirmationCancelButton); - } - - async clickConfirmationDialogRemoveButton(): Promise { - await BrowserActions.click(this.confirmationRemoveButton); - } - - async checkShareLinkIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.shareLink); - } - - async getShareLink(): Promise { - return BrowserActions.getInputValue(this.shareLink); - } - - async clickCloseButton(): Promise { - await BrowserActions.click(this.closeButton); - } - - async clickShareLinkButton(): Promise { - await BrowserActions.click(this.copySharedLinkButton); - } - - async shareToggleButtonIsChecked(): Promise { - await BrowserVisibility.waitUntilElementIsPresent(this.shareToggleChecked); - } - - async dialogIsClosed(): Promise { - await BrowserVisibility.waitUntilElementIsStale(this.shareDialog); - } - - async clickDateTimePickerButton(): Promise { - await this.dateTimePickerPage.clickDateTimePicker(); - } - - async calendarTodayDayIsDisabled(): Promise { - const tomorrow = format(add(new Date(), {days: 1}), 'd'); - - if (tomorrow !== '1') { - await this.dateTimePickerPage.checkCalendarTodayDayIsDisabled(); - } - } - - async setDefaultDay(): Promise { - const tomorrow = format(add(new Date(), {days: 1}), 'd'); - await this.dateTimePickerPage.setDate(tomorrow); - } - - async dateTimePickerDialogIsClosed(): Promise { - await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content')); - } - - async getExpirationDate(): Promise { - return BrowserActions.getInputValue(this.expirationDateInput); - } - - async expirationDateInputHasValue(value): Promise { - await BrowserVisibility.waitUntilElementHasValue(this.expirationDateInput, value); - } - - async confirmationDialogIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialog); - } -} diff --git a/e2e/core/pages/dialog/upload-dialog.page.ts b/e2e/core/pages/dialog/upload-dialog.page.ts index 6317e4086b..f98e3169e2 100644 --- a/e2e/core/pages/dialog/upload-dialog.page.ts +++ b/e2e/core/pages/dialog/upload-dialog.page.ts @@ -26,7 +26,6 @@ export class UploadDialogPage { uploadedStatusIcon = 'mat-icon[class*="status--done"]'; cancelledStatusIcon = 'div[class*="status--cancelled"]'; errorStatusIcon = 'div[class*="status--error"] mat-icon'; - errorTooltip = $('div.mat-tooltip'); rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row'); title = $('span[class*="upload-dialog__title"]'); minimizeButton = $('mat-icon[title="Minimize"]'); @@ -121,6 +120,6 @@ export class UploadDialogPage { } async getTooltip(): Promise { - return BrowserActions.getText(this.errorTooltip); + return BrowserActions.getAttribute($(this.errorStatusIcon), 'title'); } } diff --git a/e2e/core/pages/navigation-bar.page.ts b/e2e/core/pages/navigation-bar.page.ts index 96c3694a08..af9b719aa8 100644 --- a/e2e/core/pages/navigation-bar.page.ts +++ b/e2e/core/pages/navigation-bar.page.ts @@ -90,18 +90,6 @@ export class NavigationBarPage { await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer); } - async clickTrashcanButton(): Promise { - await this.clickNavigationBarItem('Trashcan'); - } - - async clickCustomSources(): Promise { - await this.clickNavigationBarItem('Custom Sources'); - } - - async clickOverlayViewerButton(): Promise { - await this.clickNavigationBarItem('Overlay Viewer'); - } - async clickTreeViewButton(): Promise { await this.clickNavigationBarItem('Tree View'); } diff --git a/e2e/core/pagination-empty-current-page.e2e.ts b/e2e/core/pagination-empty-current-page.e2e.ts index b5c93e06cf..d4b5f28ed3 100644 --- a/e2e/core/pagination-empty-current-page.e2e.ts +++ b/e2e/core/pagination-empty-current-page.e2e.ts @@ -25,13 +25,13 @@ import { createApiService, UsersActions, ViewerPage } from '@alfresco/adf-testing'; +import { NodeEntry } from '@alfresco/js-api'; import { browser } from 'protractor'; import { FileModel } from '../models/ACS/file.model'; import { FolderModel } from '../models/ACS/folder.model'; -import { ContentServicesPage } from '../core/pages/content-services.page'; +import { ContentServicesPage } from './pages/content-services.page'; describe('Pagination - returns to previous page when current is empty', () => { - const loginPage = new LoginPage(); const contentServicesPage = new ContentServicesPage(); const paginationPage = new PaginationPage(); @@ -48,8 +48,8 @@ describe('Pagination - returns to previous page when current is empty', () => { const nrOfFiles = 6; const nrOfFolders = 5; const lastFile = 'newFile6.txt'; - let lastFolderResponse; - let pngFileUploaded; + let lastFolderResponse: NodeEntry; + let pngFileUploaded: any; const folderNames = ['t1', 't2', 't3', 't4', 't5', 't6']; const itemsPerPage = { diff --git a/e2e/core/user-info-component-cloud.e2e.ts b/e2e/core/user-info-component-cloud.e2e.ts index 107717274b..cea825224b 100644 --- a/e2e/core/user-info-component-cloud.e2e.ts +++ b/e2e/core/user-info-component-cloud.e2e.ts @@ -15,11 +15,10 @@ * limitations under the License. */ -import { createApiService, LoginPage, SettingsPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, LoginPage, SettingsPage, UserInfoPage, UserModel, UsersActions } from '@alfresco/adf-testing'; import { browser } from 'protractor'; describe('User Info - SSO', () => { - const settingsPage = new SettingsPage(); const loginSSOPage = new LoginPage(); const userInfoPage = new UserInfoPage(); @@ -27,16 +26,21 @@ describe('User Info - SSO', () => { const apiService = createApiService({ authType: 'OAUTH', provider: 'ECM' }); const usersActions = new UsersActions(apiService); - let identityUser; + let identityUser: UserModel; beforeAll(async () => { await apiService.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password); identityUser = await usersActions.createUser(); - await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost, + await settingsPage.setProviderEcmSso( + browser.params.testConfig.appConfig.ecmHost, browser.params.testConfig.appConfig.oauth2.host, - browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId); + browser.params.testConfig.appConfig.identityHost, + false, + true, + browser.params.testConfig.appConfig.oauth2.clientId + ); await loginSSOPage.loginSSOIdentityService(identityUser.username, identityUser.password); }); diff --git a/e2e/core/viewer/viewer-content-services-component.e2e.ts b/e2e/core/viewer/viewer-content-services-component.e2e.ts index 429467809e..f0aadfd7fb 100644 --- a/e2e/core/viewer/viewer-content-services-component.e2e.ts +++ b/e2e/core/viewer/viewer-content-services-component.e2e.ts @@ -39,8 +39,6 @@ describe('Content Services Viewer', () => { const versionManagePage = new VersionManagePage(); const metadataViewPage = new MetadataViewPage(); - let zoom; - const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, firstPageText: browser.params.resources.Files.ADF_DOCUMENTS.PDF.first_page_text, @@ -241,7 +239,7 @@ describe('Content Services Viewer', () => { await viewerPage.checkPercentageIsDisplayed(); - zoom = await viewerPage.getZoom(); + let zoom = await viewerPage.getZoom(); await viewerPage.clickZoomInButton(); await viewerPage.checkZoomedIn(zoom); @@ -401,36 +399,6 @@ describe('Content Services Viewer', () => { await viewerPage.checkCloseButtonIsDisplayed(); await viewerPage.clickCloseButton(); }); - - it('[C268901] Should need a password when opening a protected file', async () => { - await contentServicesPage.doubleClickRow(protectedFile.name); - await viewerPage.waitTillContentLoaded(); - - await viewerPage.checkZoomInButtonIsDisplayed(); - await viewerPage.checkPasswordDialogIsDisplayed(); - await viewerPage.checkPasswordSubmitDisabledIsDisplayed(); - - await viewerPage.enterPassword('random password'); - await viewerPage.clickPasswordSubmit(); - await viewerPage.checkPasswordErrorIsDisplayed(); - await viewerPage.checkPasswordInputIsDisplayed(); - - await viewerPage.enterPassword(protectedFile.password); - await viewerPage.clickPasswordSubmit(); - await viewerPage.checkFileContent('1', protectedFile.firstPageText); - - await viewerPage.clickCloseButton(); - }); - - it('[C307985] Should close the viewer when password dialog is cancelled', async () => { - await contentServicesPage.doubleClickRow(protectedFile.name); - await viewerPage.waitTillContentLoaded(); - - await viewerPage.checkPasswordDialogIsDisplayed(); - await viewerPage.clickClosePasswordDialog(); - await contentServicesPage.checkContentIsDisplayed(protectedFile.name); - }); - }); describe('Viewer - version update with unsupported file', () => { diff --git a/e2e/core/viewer/viewer-share-content.ts b/e2e/core/viewer/viewer-share-content.ts deleted file mode 100644 index fa561db0e3..0000000000 --- a/e2e/core/viewer/viewer-share-content.ts +++ /dev/null @@ -1,133 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - BrowserActions, - LoginPage, - StringUtil, - UploadActions, - UserModel, - UsersActions, - ViewerPage -} from '@alfresco/adf-testing'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ContentServicesPage } from '../../core/pages/content-services.page'; -import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page'; -import { FileModel } from '../../models/ACS/file.model'; -import { browser } from 'protractor'; -import CONSTANTS = require('../../util/constants'); -import { SharedlinksApi, SitesApi } from '@alfresco/js-api'; - -describe('Viewer', () => { - - const viewerPage = new ViewerPage(); - const navigationBarPage = new NavigationBarPage(); - const loginPage = new LoginPage(); - const contentServicesPage = new ContentServicesPage(); - const shareDialog = new ShareDialogPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const uploadActions = new UploadActions(apiService); - const sharedlinksApi = new SharedlinksApi(apiService); - - let site; - const acsUser = new UserModel(); - let pngFileUploaded; - const contentList = contentServicesPage.getDocumentList(); - - const pngFileInfo = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path - }); - - const wordFileInfo = new FileModel({ - name: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_name, - location: browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_path - }); - - let pngFileShared; let wordFileUploaded; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.createUser(acsUser); - - const sitesApi = new SitesApi(apiService.getInstance()); - - site = await sitesApi.createSite({ - title: StringUtil.generateRandomString(8), - visibility: 'PUBLIC' - }); - - await sitesApi.createSiteMembership(site.entry.id, { - id: acsUser.username, - role: CONSTANTS.CS_USER_ROLES.MANAGER - }); - - await apiService.login(acsUser.username, acsUser.password); - - pngFileUploaded = await uploadActions.uploadFile(pngFileInfo.location, pngFileInfo.name, site.entry.guid); - - await apiService.login(acsUser.username, acsUser.password); - - wordFileUploaded = await uploadActions.uploadFile(wordFileInfo.location, wordFileInfo.name, '-my-'); - - pngFileShared = await sharedlinksApi.createSharedLink({ nodeId: pngFileUploaded.entry.id }); - }); - - afterAll(async () => { - await apiService.loginWithProfile('admin'); - const sitesApi = new SitesApi(apiService.getInstance()); - await sitesApi.deleteSite(site.entry.id, { permanent: true }); - await apiService.login(acsUser.username, acsUser.password); - await uploadActions.deleteFileOrFolder(wordFileUploaded.entry.id); - }); - - beforeEach(async () => { - await loginPage.login(acsUser.username, acsUser.password); - }); - - it('[C260105] Should be able to open an image file shared via API', async () => { - await BrowserActions.getUrl(browser.baseUrl + '/preview/s/' + pngFileShared.entry.id); - await viewerPage.checkImgContainerIsDisplayed(); - await BrowserActions.getUrl(browser.baseUrl); - await navigationBarPage.clickLogoutButton(); - await BrowserActions.getUrl(browser.baseUrl + '/preview/s/' + pngFileShared.entry.id); - await viewerPage.checkImgContainerIsDisplayed(); - }); - - it('[C260106] Should be able to open a Word file shared via API', async () => { - await navigationBarPage.navigateToContentServices(); - await contentServicesPage.waitForTableBody(); - - await contentList.selectRow(wordFileInfo.name); - await contentServicesPage.clickShareButton(); - await shareDialog.checkDialogIsDisplayed(); - await shareDialog.clickShareLinkButton(); - const sharedLink = await shareDialog.getShareLink(); - - await BrowserActions.getUrl(sharedLink); - await viewerPage.checkFileIsLoaded(); - await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name); - - await BrowserActions.getUrl(browser.baseUrl); - await navigationBarPage.clickLogoutButton(); - await BrowserActions.getUrl(sharedLink); - await viewerPage.checkFileIsLoaded(); - await viewerPage.checkFileNameIsDisplayed(wordFileInfo.name); - }); -}); diff --git a/e2e/process-services-cloud/access/user-access-cloud.e2e.ts b/e2e/process-services-cloud/access/user-access-cloud.e2e.ts deleted file mode 100644 index 0ba37ce618..0000000000 --- a/e2e/process-services-cloud/access/user-access-cloud.e2e.ts +++ /dev/null @@ -1,50 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, ErrorPage, IdentityService, LoginPage } from '@alfresco/adf-testing'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; - -describe('User Access Cloud', () => { - const loginSSOPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const errorPage = new ErrorPage(); - - const apiService = createApiService(); - const identityService = new IdentityService(apiService); - - let testUser; - - beforeAll( async () => { - await apiService.loginWithProfile('identityAdmin'); - testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_DEVOPS]); - - await loginSSOPage.login(testUser.username, testUser.password); - await apiService.login(testUser.username, testUser.password); - }); - - afterAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - await identityService.deleteIdentityUser(testUser.idIdentityService); - }); - - it('[C299206] Should redirect the user without the right access role on a forbidden page', async () => { - await navigationBarPage.navigateToProcessServicesCloudPage(); - await expect(await errorPage.getErrorCode()).toBe('403'); - await expect(await errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.'); - await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.'); - }); -}); 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 7d01e2a8ca..e1cdba1638 100644 --- a/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts +++ b/e2e/process-services-cloud/form-field/dropdown-widget.e2e.ts @@ -15,10 +15,11 @@ * limitations under the License. */ -import { createApiService, AppListCloudPage, GroupIdentityService, IdentityService, - LoginPage, NotificationHistoryPage, ProcessCloudWidgetPage, ProcessDefinitionsService, +import { + createApiService, AppListCloudPage, GroupIdentityService, IdentityService, + LoginPage, ProcessCloudWidgetPage, ProcessDefinitionsService, ProcessInstancesService, QueryService, TaskFormCloudComponent, TaskHeaderCloudPage, - TasksService + TasksService, SnackbarPage } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { TasksCloudDemoPage } from '.././pages/tasks-cloud-demo.page'; @@ -35,7 +36,6 @@ describe('Form Field Component - Dropdown Widget', () => { const taskList = tasksCloudDemoPage.taskListCloudComponent(); const taskFormCloudComponent = new TaskFormCloudComponent(); - const notificationHistoryPage = new NotificationHistoryPage(); const taskHeaderCloudPage = new TaskHeaderCloudPage(); const widget = new ProcessCloudWidgetPage(); @@ -148,7 +148,9 @@ describe('Form Field Component - Dropdown Widget', () => { await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks'); await taskList.checkContentIsNotDisplayedByName(dropdownOptionTaskName); - await notificationHistoryPage.checkNotifyContains('Task has been saved successfully'); + + const message = await new SnackbarPage().getSnackBarMessage(); + expect(message).toEqual('Task has been saved successfully'); await taskFilter.clickTaskFilter('completed-tasks'); await taskList.getDataTable().waitTillContentLoaded(); diff --git a/e2e/process-services-cloud/task-list/task-counters-cloud.e2e.ts b/e2e/process-services-cloud/task-list/task-counters-cloud.e2e.ts deleted file mode 100644 index 80ff0165ea..0000000000 --- a/e2e/process-services-cloud/task-list/task-counters-cloud.e2e.ts +++ /dev/null @@ -1,126 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { - LoginPage, - TasksService, createApiService, - AppListCloudPage, - StringUtil, - IdentityService, - GroupIdentityService, - NotificationHistoryPage, - ProcessInstancesService, - ProcessDefinitionsService, - QueryService -} from '@alfresco/adf-testing'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page'; - -describe('Task counters cloud', () => { - - describe('Task Counters', () => { - - const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name; - - const loginSSOPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const appListCloudComponent = new AppListCloudPage(); - const tasksCloudDemoPage = new TasksCloudDemoPage(); - const notificationHistoryPage = new NotificationHistoryPage(); - const taskFilter = tasksCloudDemoPage.taskFilterCloudComponent; - - const apiService = createApiService(); - const identityService = new IdentityService(apiService); - const groupIdentityService = new GroupIdentityService(apiService); - const tasksService = new TasksService(apiService); - const processDefinitionService = new ProcessDefinitionsService(apiService); - const processInstancesService = new ProcessInstancesService(apiService); - const queryService = new QueryService(apiService); - - let testUser; let groupInfo; - - const createdTaskName = StringUtil.generateRandomString(); - - beforeAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - - testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]); - groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); - await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); - - await apiService.login(testUser.username, testUser.password); - await loginSSOPage.login(testUser.username, testUser.password); - }); - - afterAll(async () => { - await apiService.loginWithProfile('identityAdmin'); - await identityService.deleteIdentityUser(testUser.idIdentityService); - }); - - beforeEach(async () => { - await navigationBarPage.navigateToProcessServicesCloudPage(); - await appListCloudComponent.checkApsContainer(); - await appListCloudComponent.goToApp(simpleApp); - }); - - it('[C593065] Should display notification in counter when process started', async () => { - await taskFilter.checkTaskFilterCounter('my-tasks'); - await expect(await taskFilter.getTaskFilterCounter('my-tasks')).toBe('0'); - - const processDefinition = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.uploadSingleMultipleFiles, simpleApp); - const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { name: StringUtil.generateRandomString() }); - const task = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp); - await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp); - - await notificationHistoryPage.checkNotificationCenterHasNewNotifications(); - await notificationHistoryPage.clickNotificationButton(); - await notificationHistoryPage.checkNotificationIsPresent(`task has been assigned`); - - await notificationHistoryPage.clickMarkAsRead(); - await processInstancesService.deleteProcessInstance(processInstance.entry.id, simpleApp); - }); - - it('[C593066] Should display notification in counter when task assigned', async () => { - await taskFilter.checkTaskFilterCounter('my-tasks'); - await expect(await taskFilter.getTaskFilterCounter('my-tasks')).toBe('0'); - - const taskCounter = await taskFilter.getTaskFilterCounter('my-tasks'); - const assigneeTask = await tasksService.createStandaloneTask(createdTaskName, simpleApp); - await tasksService.claimTask(assigneeTask.entry.id, simpleApp); - - await taskFilter.checkNotificationCounterValue('my-tasks', (parseInt(taskCounter, 10) + 1).toString()); - - await notificationHistoryPage.clickNotificationButton(); - await notificationHistoryPage.clickMarkAsRead(); - await tasksService.deleteTask(assigneeTask.entry.id, simpleApp); - }); - - it('[C290009] Should display notification in task center', async () => { - await taskFilter.checkTaskFilterCounter('my-tasks'); - const assigneeTask = await tasksService.createStandaloneTask(createdTaskName, simpleApp); - await tasksService.claimTask(assigneeTask.entry.id, simpleApp); - - await notificationHistoryPage.checkNotificationCenterHasNewNotifications(); - await notificationHistoryPage.clickNotificationButton(); - await notificationHistoryPage.checkNotificationIsPresent(`${assigneeTask.entry.name} task has been assigned`); - - await notificationHistoryPage.clickMarkAsRead(); - await tasksService.deleteTask(assigneeTask.entry.id, simpleApp); - }); - }); -}); diff --git a/e2e/process-services-cloud/task-list/task-form-cloud-component.e2e.ts b/e2e/process-services-cloud/task-list/task-form-cloud-component.e2e.ts index 35b3c3f88b..0cbd3f187e 100644 --- a/e2e/process-services-cloud/task-list/task-form-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/task-list/task-form-cloud-component.e2e.ts @@ -204,7 +204,6 @@ describe('Task form cloud component', () => { await taskFormCloudComponent.checkSaveButtonIsDisplayed(); await taskFormCloudComponent.clickSaveButton(); - await navigationBarPage.clickHomeButton(); await navigationBarPage.navigateToProcessServicesCloudPage(); await appListCloudComponent.checkApsContainer(); await goToAppOpenDropdownTaskByNameFromFilters(myTasksFilter, dropdownOptionsTask.entry.name); diff --git a/e2e/process-services-cloud/task-list/task-header-cloud.e2e.ts b/e2e/process-services-cloud/task-list/task-header-cloud.e2e.ts index 0fb3b41541..547aeecc1b 100644 --- a/e2e/process-services-cloud/task-list/task-header-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-list/task-header-cloud.e2e.ts @@ -225,8 +225,8 @@ describe('Task Header cloud component', () => { it('[C291991] Should be able to assign a task only to the users that have access to the selected app', async () => { await tasksCloudDemoPage.clickStartNewTaskButton(); const currentAssignee = await peopleCloudComponentPage.getChipAssignee(); - await expect(currentAssignee).toContain(testUser.firstName, 'Invalid Assignee first name set for the new task'); - await expect(currentAssignee).toContain(testUser.lastName, 'Invalid Assignee last name set for the new task'); + await expect(currentAssignee).toContain(testUser.firstName); + await expect(currentAssignee).toContain(testUser.lastName); await peopleCloudComponentPage.searchAssignee('hrUser'); await peopleCloudComponentPage.selectAssigneeFromList('HR User'); diff --git a/e2e/process-services/form/apps-section.e2e.ts b/e2e/process-services/form/apps-section.e2e.ts index 642aa4af3e..16aabaedac 100644 --- a/e2e/process-services/form/apps-section.e2e.ts +++ b/e2e/process-services/form/apps-section.e2e.ts @@ -17,10 +17,10 @@ import { browser } from 'protractor'; import { ModelsActions, createApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing'; -import { ProcessServicesPage } from './../pages/process-services.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import CONSTANTS = require('../../util/constants'); -import { AppDefinitionsApi } from '@alfresco/js-api'; +import { AppDefinitionRepresentation, AppDefinitionsApi } from '@alfresco/js-api'; describe('Modify applications', () => { @@ -39,7 +39,8 @@ describe('Modify applications', () => { const applicationService = new ApplicationsUtil(apiService); const appsApi = new AppDefinitionsApi(apiService.getInstance()); - let firstApp; let appVersionToBeDeleted; + let firstApp: AppDefinitionRepresentation; + let appVersionToBeDeleted: AppDefinitionRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -131,7 +132,7 @@ describe('Modify applications', () => { name: appToBeDeleted.title, description: newDescription, definition: { - models: [firstApp.definition.models[0]], + models: [firstApp['definition'].models[0]], theme: 'theme-4', icon: 'glyphicon-user' } diff --git a/e2e/process-services/form/checklist-component.e2e.ts b/e2e/process-services/form/checklist-component.e2e.ts index 2ddb1934ab..8cdfeb3381 100644 --- a/e2e/process-services/form/checklist-component.e2e.ts +++ b/e2e/process-services/form/checklist-component.e2e.ts @@ -15,16 +15,15 @@ * limitations under the License. */ -import { createApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions } from '@alfresco/adf-testing'; -import { TasksPage } from './../pages/tasks.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page'; +import { createApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; +import { TasksPage } from '../pages/tasks.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); describe('Checklist component', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -38,11 +37,16 @@ describe('Checklist component', () => { const applicationService = new ApplicationsUtil(apiService); const taskUtil = new TaskUtil(apiService); - let processUserModel; + let processUserModel: UserModel; const tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy']; const checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist']; - const removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist']; + const removeChecklist = [ + 'removeFirstRunningChecklist', + 'removeSecondRunningChecklist', + 'removeFirstCompletedChecklist', + 'removeSecondCompletedChecklist' + ]; const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild']; beforeAll(async () => { @@ -54,19 +58,18 @@ describe('Checklist component', () => { await apiService.login(processUserModel.username, processUserModel.password); - for (let i = 0; i < tasks.length; i++) { - await taskUtil.createStandaloneTask(tasks[i]); + for (const item of tasks) { + await taskUtil.createStandaloneTask(item); } await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); await navigationBarPage.navigateToProcessServicesPage(); await (await processServices.goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); - }); + }); it('[C279976] Should no checklist be created when no title is typed', async () => { await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]); @@ -93,7 +96,7 @@ describe('Checklist component', () => { await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]); await taskPage.tasksListPage().selectRow(tasks[0]); - await (await taskPage.clickOnAddChecklistButton()); + await await taskPage.clickOnAddChecklistButton(); await taskPage.checkChecklistDialogIsDisplayed(); await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check'); await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name'); @@ -122,7 +125,7 @@ describe('Checklist component', () => { await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]); await taskPage.tasksListPage().selectRow(tasks[2]); - await (await taskPage.clickOnAddChecklistButton()); + await await taskPage.clickOnAddChecklistButton(); await taskPage.checkChecklistDialogIsDisplayed(); await checklistDialog.addName(removeChecklist[0]); await checklistDialog.clickCreateChecklistButton(); diff --git a/e2e/process-services/form/dynamic-table-date-picker.e2e.ts b/e2e/process-services/form/dynamic-table-date-picker.e2e.ts index 541c589077..9ac1b99a4c 100644 --- a/e2e/process-services/form/dynamic-table-date-picker.e2e.ts +++ b/e2e/process-services/form/dynamic-table-date-picker.e2e.ts @@ -15,21 +15,23 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, DatePickerCalendarPage, DateUtil, - LoginPage, ModelsActions, + LoginPage, + ModelsActions, UsersActions, - Widget + Widget, + UserModel } from '@alfresco/adf-testing'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { browser } from 'protractor'; describe('Dynamic Table', () => { - const loginPage = new LoginPage(); const processFiltersPage = new ProcessFiltersPage(); const processServiceTabBarPage = new ProcessServiceTabBarPage(); @@ -41,18 +43,20 @@ describe('Dynamic Table', () => { const usersActions = new UsersActions(apiService); const modelsActions = new ModelsActions(apiService); - let user; let tenantId; let appId; + let user: UserModel; + let tenantId: number; + let appId: number; beforeAll(async () => { await apiService.loginWithProfile('admin'); user = await usersActions.createUser(); tenantId = user.tenantId; - }); + }); afterAll(async () => { await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(tenantId); - }); + }); describe('Date Picker', () => { const app = browser.params.resources.Files.DYNAMIC_TABLE_APP; diff --git a/e2e/process-services/form/form-component.e2e.ts b/e2e/process-services/form/form-component.e2e.ts index 538d05fbec..fbe54b6606 100644 --- a/e2e/process-services/form/form-component.e2e.ts +++ b/e2e/process-services/form/form-component.e2e.ts @@ -15,11 +15,10 @@ * limitations under the License. */ -import { createApiService, FormPage, LoginPage, UsersActions, Widget } from '@alfresco/adf-testing'; +import { createApiService, FormPage, LoginPage, UserModel, UsersActions, Widget } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; describe('Form Component', () => { - const loginPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); const formPage = new FormPage(); @@ -28,7 +27,8 @@ describe('Form Component', () => { const apiService = createApiService(); const usersActions = new UsersActions(apiService); - let tenantId; let user; + let tenantId: number; + let user: UserModel; const fields = { dateWidgetId: 'label7', @@ -92,5 +92,5 @@ describe('Form Component', () => { await formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate); await formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate); await formPage.checkErrorLogMessage(message.errorLabel); - }); + }); }); diff --git a/e2e/process-services/pages/dialog/app-settings-toggles.page.ts b/e2e/process-services/pages/dialog/app-settings-toggles.page.ts deleted file mode 100644 index f8881c942e..0000000000 --- a/e2e/process-services/pages/dialog/app-settings-toggles.page.ts +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { TogglePage } from '@alfresco/adf-testing'; -import { $ } from 'protractor'; - -export class AppSettingsTogglesPage { - - togglePage = new TogglePage(); - - showDetailsHeaderToggle = $('#adf-show-header'); - showTaskFilterIconsToggle = $('#adf-show-task-filter-icon'); - showProcessFilterIconsToggle = $('#adf-show-process-filter-icon'); - - async enableShowHeader(): Promise { - await this.togglePage.enableToggle(this.showDetailsHeaderToggle); - } - - async disableShowHeader(): Promise { - await this.togglePage.disableToggle(this.showDetailsHeaderToggle); - } - - async enableTaskFiltersIcon(): Promise { - await this.togglePage.enableToggle(this.showTaskFilterIconsToggle); - } - - async enableProcessFiltersIcon(): Promise { - await this.togglePage.enableToggle(this.showProcessFilterIconsToggle); - } - -} diff --git a/e2e/process-services/pages/process-details.page.ts b/e2e/process-services/pages/process-details.page.ts index 1939c0dfe6..49e90214f4 100644 --- a/e2e/process-services/pages/process-details.page.ts +++ b/e2e/process-services/pages/process-details.page.ts @@ -26,7 +26,7 @@ export class ProcessDetailsPage { propertiesList = TestElement.byCss('.adf-property-list'); showDiagramButton = TestElement.byId('show-diagram-button'); diagramCanvas = TestElement.byCss('svg[xmlns="http://www.w3.org/2000/svg"]'); - backButton = TestElement.byCss('app-show-diagram button.mat-mini-fab.mat-accent'); + backButton = TestElement.byCss('#btn-diagram-back'); commentInput = TestElement.byId('comment-input'); auditLogButton = TestElement.byCss('button[adf-process-audit]'); cancelProcessButton = TestElement.byCss('div[data-automation-id="header-status"] > button'); diff --git a/e2e/process-services/pages/process-filters.page.ts b/e2e/process-services/pages/process-filters.page.ts index 99e1ef04be..727b39f0b7 100644 --- a/e2e/process-services/pages/process-filters.page.ts +++ b/e2e/process-services/pages/process-filters.page.ts @@ -19,16 +19,13 @@ import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcess import { $, $$ } from 'protractor'; export class ProcessFiltersPage { - dataTable = new DataTableComponentPage(); createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span'); newProcessButton = $('div > button[data-automation-id="btn-start-process"]'); processesPage = $('#app-processes-menu'); - accordionMenu = $('.app-processes-menu mat-accordion'); buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div'); noContentMessage = $$('.adf-empty-content__title').first(); rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]'); - processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]'; startProcessEl = $('adf-start-process .adf-start-process'); getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`); @@ -57,7 +54,6 @@ export class ProcessFiltersPage { async clickCreateProcessButton(): Promise { await BrowserActions.closeMenuAndDialogs(); - await BrowserVisibility.waitUntilElementIsVisible(this.accordionMenu); await BrowserVisibility.waitUntilElementIsVisible(this.processesPage); await BrowserActions.click(this.createProcessButton); } @@ -81,11 +77,6 @@ export class ProcessFiltersPage { await BrowserActions.click(processName); } - async checkFilterIsHighlighted(filterName: string): Promise { - const processNameHighlighted = $(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`); - await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted); - } - async numberOfProcessRows(): Promise { await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first()); return this.rows.count(); @@ -95,53 +86,13 @@ export class ProcessFiltersPage { await this.dataTable.waitForTableBody(); } - /** - * Sort the list by name column. - * - * @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant - */ - async sortByName(sortOrder: string) { - await this.dataTable.sortByColumn(sortOrder, 'name'); - } - - async getAllRowsNameColumn() { - return this.dataTable.getAllRowsColumnValues('Name'); - } - async checkFilterIsDisplayed(name: string): Promise { const filterName = await this.getButtonFilterLocatorByName(name); await BrowserVisibility.waitUntilElementIsVisible(filterName); } - async checkFilterHasNoIcon(name: string): Promise { - const filterName = await this.getButtonFilterLocatorByName(name); - await BrowserVisibility.waitUntilElementIsVisible(filterName); - await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon)); - } - - async getFilterIcon(name: string): Promise { - const filterName = await this.getButtonFilterLocatorByName(name); - await BrowserVisibility.waitUntilElementIsVisible(filterName); - const icon = filterName.$(this.processIcon); - return BrowserActions.getText(icon); - } - async checkFilterIsNotDisplayed(name: string): Promise { const filterName = await this.getButtonFilterLocatorByName(name); await BrowserVisibility.waitUntilElementIsNotVisible(filterName); } - - async checkProcessesSortedByNameAsc(): Promise { - const list = await this.getAllRowsNameColumn(); - for (let i = 1; i < list.length; i++) { - await expect(JSON.stringify(list[i]) > JSON.stringify(list[i - 1])).toEqual(true); - } - } - - async checkProcessesSortedByNameDesc(): Promise { - const list = await this.getAllRowsNameColumn(); - for (let i = 1; i < list.length; i++) { - await expect(JSON.stringify(list[i]) < JSON.stringify(list[i - 1])).toEqual(true); - } - } } diff --git a/e2e/process-services/pages/process-list-demo.page.ts b/e2e/process-services/pages/process-list-demo.page.ts index f68b8247c2..f6d1794085 100644 --- a/e2e/process-services/pages/process-list-demo.page.ts +++ b/e2e/process-services/pages/process-list-demo.page.ts @@ -43,7 +43,7 @@ export class ProcessListDemoPage { await this.stateDropdown.selectDropdownOption(stateOption); } - async addAppId(appId: string): Promise { + async addAppId(appId: string | number): Promise { await BrowserActions.click(this.appIdInput); await this.appIdInput.sendKeys(protractor.Key.ENTER); await this.appIdInput.clear(); diff --git a/e2e/process-services/pages/process-service-tab-bar.page.ts b/e2e/process-services/pages/process-service-tab-bar.page.ts index 12c97f2a49..b35a13c215 100644 --- a/e2e/process-services/pages/process-service-tab-bar.page.ts +++ b/e2e/process-services/pages/process-service-tab-bar.page.ts @@ -23,7 +23,6 @@ export class ProcessServiceTabBarPage { tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first(); processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first(); reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first(); - settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first(); reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first(); async clickTasksButton(): Promise { @@ -36,11 +35,6 @@ export class ProcessServiceTabBarPage { await browser.sleep(500); } - async clickSettingsButton(): Promise { - await BrowserActions.click(this.settingsButton); - await browser.sleep(500); - } - async clickReportsButton(): Promise { await BrowserActions.click(this.reportsButton); await BrowserVisibility.waitUntilElementIsVisible(this.reportsButtonSelected); diff --git a/e2e/process-services/pages/process-services.page.ts b/e2e/process-services/pages/process-services.page.ts index 8bb0a02377..f0b2c170ac 100644 --- a/e2e/process-services/pages/process-services.page.ts +++ b/e2e/process-services/pages/process-services.page.ts @@ -47,7 +47,7 @@ export class ProcessServicesPage { return new ProcessServiceTabBarPage(); } - async goToAppByAppId(appId: string): Promise { + async goToAppByAppId(appId: string | number): Promise { const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${appId}/tasks/`; await BrowserActions.getUrl(urlToNavigateTo); const taskPage = new TasksPage(); diff --git a/e2e/process-services/pages/task-details.page.ts b/e2e/process-services/pages/task-details.page.ts index d4029ed0a5..7cff096543 100644 --- a/e2e/process-services/pages/task-details.page.ts +++ b/e2e/process-services/pages/task-details.page.ts @@ -17,14 +17,9 @@ import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing'; import { browser, by, element, Key, $, $$ } from 'protractor'; -import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page'; export class TaskDetailsPage { - - appSettingsTogglesClass = new AppSettingsTogglesPage(); - formContent = $('adf-form'); - formNameField = $('[data-automation-id="card-textitem-value-formName"]'); formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]'); assigneeField = $('[data-automation-id="card-textitem-value-assignee"]'); @@ -45,7 +40,6 @@ export class TaskDetailsPage { involvePeopleButton = $('div[class*="add-people"]'); addPeopleField = $('input[data-automation-id="adf-people-search-input"]'); addInvolvedUserButton = $('button[id="add-people"]'); - taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer')); taskDetailsSection = $('div[data-automation-id="app-tasks-details"]'); taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]'); completeTask = $('button[id="adf-no-form-complete-button"]'); @@ -304,18 +298,6 @@ export class TaskDetailsPage { await BrowserActions.click(this.auditLogButton); } - appSettingsToggles(): AppSettingsTogglesPage { - return this.appSettingsTogglesClass; - } - - async taskInfoDrawerIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.taskDetailsInfoDrawer); - } - - async taskInfoDrawerIsNotDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(this.taskDetailsInfoDrawer); - } - async checkNoPeopleIsInvolved(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.noPeopleInvolved); } diff --git a/e2e/process-services/pages/task-filters.page.ts b/e2e/process-services/pages/task-filters.page.ts index e388c9a7c8..94c3a1bc0b 100644 --- a/e2e/process-services/pages/task-filters.page.ts +++ b/e2e/process-services/pages/task-filters.page.ts @@ -19,9 +19,7 @@ import { ElementFinder } from 'protractor'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; export class TaskFiltersPage { - filter: ElementFinder; - taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]'; constructor(filter: ElementFinder) { this.filter = filter; @@ -31,17 +29,6 @@ export class TaskFiltersPage { await BrowserVisibility.waitUntilElementIsVisible(this.filter); } - async getTaskFilterIcon(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.filter); - const icon = this.filter.$(this.taskIcon); - return BrowserActions.getText(icon); - } - - async checkTaskFilterHasNoIcon(): Promise { - await BrowserVisibility.waitUntilElementIsVisible(this.filter); - await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon)); - } - async clickTaskFilter(): Promise { return BrowserActions.click(this.filter); } diff --git a/e2e/process-services/process/comment-component-processes.e2e.ts b/e2e/process-services/process/comment-component-processes.e2e.ts index 5bdd1bcfd7..f55fd14646 100644 --- a/e2e/process-services/process/comment-component-processes.e2e.ts +++ b/e2e/process-services/process/comment-component-processes.e2e.ts @@ -16,20 +16,13 @@ */ import { browser } from 'protractor'; -import { createApiService, - ApplicationsUtil, - LoginPage, - ModelsActions, - ProcessUtil, - UsersActions -} from '@alfresco/adf-testing'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; +import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; import { CommentsPage } from '../../core/pages/comments.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ActivitiCommentsApi, TasksApi } from '@alfresco/js-api'; +import { ActivitiCommentsApi, ResultListDataRepresentationCommentRepresentation, TasksApi } from '@alfresco/js-api'; describe('Comment component for Processes', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -44,7 +37,10 @@ describe('Comment component for Processes', () => { const commentsApi = new ActivitiCommentsApi(apiService.getInstance()); const taskApi = new TasksApi(apiService.getInstance()); - let user; let appId; let processInstanceId; let addedComment; + let user: UserModel; + let appId: number; + let processInstanceId: string; + let addedComment: ResultListDataRepresentationCommentRepresentation; const processName = 'Comment APS'; beforeAll(async () => { @@ -82,7 +78,9 @@ describe('Comment component for Processes', () => { await commentsPage.getTotalNumberOfComments('Comments (' + addedComment.total + ')'); await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message); - await expect(await commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName); + await expect(await commentsPage.getUserName(0)).toEqual( + addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName + ); await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/); }); @@ -120,7 +118,9 @@ describe('Comment component for Processes', () => { await commentsPage.getTotalNumberOfComments('Comments (' + addedTaskComment.total + ')'); await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message); - await expect(await commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName); + await expect(await commentsPage.getUserName(0)).toEqual( + addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName + ); await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/); }); }); diff --git a/e2e/process-services/process/custom-process-filters-sorting.e2e.ts b/e2e/process-services/process/custom-process-filters-sorting.e2e.ts index 51105f2b1c..011801ddeb 100644 --- a/e2e/process-services/process/custom-process-filters-sorting.e2e.ts +++ b/e2e/process-services/process/custom-process-filters-sorting.e2e.ts @@ -17,20 +17,18 @@ import { browser } from 'protractor'; -import { createApiService, - ApplicationsUtil, - LoginPage, - ModelsActions, - ProcessUtil, - UsersActions -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { FiltersPage } from './../pages/filters.page'; -import { ProcessInstancesApi, UserFiltersApi } from '@alfresco/js-api'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { FiltersPage } from '../pages/filters.page'; +import { + AppDefinitionRepresentation, + ProcessInstancesApi, + ResultListDataRepresentationProcessInstanceRepresentation, + UserFiltersApi +} from '@alfresco/js-api'; describe('Sorting for process filters', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -44,8 +42,11 @@ describe('Sorting for process filters', () => { const userFiltersApi = new UserFiltersApi(apiService.getInstance()); const processInstancesApi = new ProcessInstancesApi(apiService.getInstance()); - let tenantId, appId, user, processesQuery; - let importedApp; + let tenantId: number; + let appId: number; + let user: UserModel; + let processesQuery: ResultListDataRepresentationProcessInstanceRepresentation; + let importedApp: AppDefinitionRepresentation; const processFilter = { running_old_first: 'Running - Oldest first', @@ -79,16 +80,17 @@ describe('Sorting for process filters', () => { await modelsActions.deleteModel(appId); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(tenantId); - } catch (e) { - } + } catch (e) {} await navigationBarPage.clickLogoutButton(); }); it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' } + appId: null, + name: processFilter.running_old_first, + icon: 'glyphicon-random', + filter: { sort: 'created-asc', name: '', state: 'running' } }); const processUtil = new ProcessUtil(apiService); const firstProc = await processUtil.startProcessOfApp(importedApp.name); @@ -100,7 +102,10 @@ describe('Sorting for process filters', () => { await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first); await filtersPage.goToFilter(processFilter.running_old_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc' + processDefinitionId: null, + appDefinitionId: null, + state: 'running', + sort: 'created-asc' }); await expect(processesQuery.data[0].name).toEqual(firstProc.name); await expect(processesQuery.data[1].name).toEqual(secondProc.name); @@ -109,8 +114,10 @@ describe('Sorting for process filters', () => { it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' } + appId: null, + name: processFilter.completed_old_first, + icon: 'glyphicon-random', + filter: { sort: 'created-asc', name: '', state: 'completed' } }); const processUtil = new ProcessUtil(apiService); @@ -129,7 +136,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.completed_old_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc' + processDefinitionId: null, + appDefinitionId: null, + state: 'completed', + sort: 'created-asc' }); await expect(processesQuery.data[0].name).toEqual(firstProc.name); await expect(processesQuery.data[1].name).toEqual(secondProc.name); @@ -138,8 +148,10 @@ describe('Sorting for process filters', () => { it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' } + appId: null, + name: processFilter.all_old_first, + icon: 'glyphicon-random', + filter: { sort: 'created-asc', name: '', state: 'all' } }); const processUtil = new ProcessUtil(apiService); @@ -162,7 +174,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.all_old_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc' + processDefinitionId: null, + appDefinitionId: null, + state: 'all', + sort: 'created-asc' }); await expect(processesQuery.data[0].name).toEqual(firstProc.name); await expect(processesQuery.data[1].name).toEqual(secondProc.name); @@ -174,8 +189,10 @@ describe('Sorting for process filters', () => { it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' } + appId: null, + name: processFilter.running_new_first, + icon: 'glyphicon-random', + filter: { sort: 'created-desc', name: '', state: 'running' } }); const processUtil = new ProcessUtil(apiService); @@ -190,7 +207,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.running_new_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc' + processDefinitionId: null, + appDefinitionId: null, + state: 'running', + sort: 'created-desc' }); await expect(processesQuery.data[0].name).toEqual(thirdProc.name); await expect(processesQuery.data[1].name).toEqual(secondProc.name); @@ -199,8 +219,10 @@ describe('Sorting for process filters', () => { it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' } + appId: null, + name: processFilter.completed_new_first, + icon: 'glyphicon-random', + filter: { sort: 'created-desc', name: '', state: 'completed' } }); const processUtil = new ProcessUtil(apiService); @@ -218,7 +240,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.completed_new_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc' + processDefinitionId: null, + appDefinitionId: null, + state: 'completed', + sort: 'created-desc' }); await expect(processesQuery.data[0].name).toEqual(thirdProc.name); await expect(processesQuery.data[1].name).toEqual(secondProc.name); @@ -227,8 +252,10 @@ describe('Sorting for process filters', () => { it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' } + appId: null, + name: processFilter.all_new_first, + icon: 'glyphicon-random', + filter: { sort: 'created-desc', name: '', state: 'all' } }); const processUtil = new ProcessUtil(apiService); @@ -251,7 +278,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.all_new_first); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc' + processDefinitionId: null, + appDefinitionId: null, + state: 'all', + sort: 'created-desc' }); await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name); await expect(processesQuery.data[1].name).toEqual(deleteSecondProc.name); @@ -263,8 +293,10 @@ describe('Sorting for process filters', () => { it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' } + appId: null, + name: processFilter.completed_most_recently, + icon: 'glyphicon-random', + filter: { sort: 'ended-asc', name: '', state: 'completed' } }); const processUtil = new ProcessUtil(apiService); @@ -283,7 +315,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.completed_most_recently); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc' + processDefinitionId: null, + appDefinitionId: null, + state: 'completed', + sort: 'ended-asc' }); await expect(processesQuery.data[0].name).toEqual(secondProc.name); await expect(processesQuery.data[1].name).toEqual(firstProc.name); @@ -292,8 +327,10 @@ describe('Sorting for process filters', () => { it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => { await userFiltersApi.createUserProcessInstanceFilter({ - 'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random', - 'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' } + appId: null, + name: processFilter.completed_least_recently, + icon: 'glyphicon-random', + filter: { sort: 'ended-desc', name: '', state: 'completed' } }); const processUtil = new ProcessUtil(apiService); @@ -312,7 +349,10 @@ describe('Sorting for process filters', () => { await filtersPage.goToFilter(processFilter.completed_least_recently); processesQuery = await processInstancesApi.getProcessInstances({ - 'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc' + processDefinitionId: null, + appDefinitionId: null, + state: 'completed', + sort: 'ended-desc' }); await expect(processesQuery.data[0].name).toEqual(thirdProc.name); await expect(processesQuery.data[1].name).toEqual(firstProc.name); diff --git a/e2e/process-services/process/custom-process-filters.e2e.ts b/e2e/process-services/process/custom-process-filters.e2e.ts index f77acf3457..c18a84d8b9 100644 --- a/e2e/process-services/process/custom-process-filters.e2e.ts +++ b/e2e/process-services/process/custom-process-filters.e2e.ts @@ -15,26 +15,24 @@ * limitations under the License. */ -import { createApiService, LoginPage, UsersActions } from '@alfresco/adf-testing'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page'; +import { createApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { UserFiltersApi } from '@alfresco/js-api'; +import { UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; describe('New Process Filters', () => { - const loginPage = new LoginPage(); const processFiltersPage = new ProcessFiltersPage(); - const processServiceTabBarPage = new ProcessServiceTabBarPage(); - const appSettingsToggles = new AppSettingsTogglesPage(); const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const userFiltersApi = new UserFiltersApi(apiService.getInstance()); - let tenantId; let user; let filterId; let customProcessFilter; + let tenantId: number; + let user: UserModel; + let filterId: number; + let customProcessFilter: UserProcessInstanceFilterRepresentation; const processFilter = { running: 'Running', @@ -87,28 +85,6 @@ describe('New Process Filters', () => { await processFiltersPage.checkFilterIsDisplayed(processFilter.new_filter); }); - it('[C286450] Should display the process filter icon when a custom filter is added', async () => { - customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({ - appId: null, - name: processFilter.new_icon, - icon: 'glyphicon-cloud', - filter: { sort: 'created-desc', name: '', state: 'running' } - }); - - filterId = customProcessFilter.id; - - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon); - - await processServiceTabBarPage.clickSettingsButton(); - await appSettingsToggles.enableProcessFiltersIcon(); - await processServiceTabBarPage.clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon); - await expect(await processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud'); - }); - it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => { customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({ appId: null, @@ -131,51 +107,6 @@ describe('New Process Filters', () => { await processFiltersPage.checkFilterIsDisplayed(processFilter.edited); }); - it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => { - customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({ - appId: null, - name: processFilter.edit_icon, - icon: 'glyphicon-random', - filter: { sort: 'created-desc', name: '', state: 'running' } - }); - - filterId = customProcessFilter.id; - - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon); - - await userFiltersApi.updateUserProcessInstanceFilter(filterId, { - appId: null, - name: processFilter.edit_icon, - icon: 'glyphicon-cloud', - filter: { sort: 'created-desc', name: '', state: 'running' } - }); - - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon); - - await processServiceTabBarPage.clickSettingsButton(); - await appSettingsToggles.enableProcessFiltersIcon(); - await processServiceTabBarPage.clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon); - await expect(await processFiltersPage.getFilterIcon(processFilter.edit_icon)).toEqual('cloud'); - }); - - it('[C286452] Should display process filter icons only when showIcon property is set on true', async () => { - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - await processFiltersPage.checkFilterHasNoIcon(processFilter.all); - - await processServiceTabBarPage.clickSettingsButton(); - await appSettingsToggles.enableProcessFiltersIcon(); - await processServiceTabBarPage.clickProcessButton(); - - await processFiltersPage.checkFilterIsDisplayed(processFilter.all); - await expect(await processFiltersPage.getFilterIcon(processFilter.all)).toEqual('dashboard'); - }); - it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => { customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({ appId: null, diff --git a/e2e/process-services/process/empty-process-list-component.e2e.ts b/e2e/process-services/process/empty-process-list-component.e2e.ts index 0012143984..ba4029c0d0 100644 --- a/e2e/process-services/process/empty-process-list-component.e2e.ts +++ b/e2e/process-services/process/empty-process-list-component.e2e.ts @@ -16,15 +16,14 @@ */ import { browser } from 'protractor'; -import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions, UserModel } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { ProcessListPage } from './../pages/process-list.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; +import { ProcessListPage } from '../pages/process-list.page'; describe('Empty Process List Test', () => { - const appWithProcess = browser.params.resources.Files.APP_WITH_PROCESSES; const simpleAppWithUserForm = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; @@ -37,7 +36,7 @@ describe('Empty Process List Test', () => { const startProcessPage = new StartProcessPage(); const apiService = createApiService(); - let user; + let user: UserModel; beforeAll(async () => { const usersActions = new UsersActions(apiService); @@ -54,7 +53,7 @@ describe('Empty Process List Test', () => { await applicationsService.importPublishDeployApp(simpleAppWithUserForm.file_path); await loginPage.login(user.username, user.password); - }); + }); it('[C260494] Should add process to list when a process is created', async () => { await navigationBarPage.navigateToProcessServicesPage(); diff --git a/e2e/process-services/process/pagination-processlist-adding-processes.e2e.ts b/e2e/process-services/process/pagination-processlist-adding-processes.e2e.ts index 2bed00d8d3..fc0fac1a8e 100644 --- a/e2e/process-services/process/pagination-processlist-adding-processes.e2e.ts +++ b/e2e/process-services/process/pagination-processlist-adding-processes.e2e.ts @@ -15,20 +15,14 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - PaginationPage, - ProcessUtil, - UsersActions -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; +import { AppDefinitionRepresentation } from '@alfresco/js-api'; import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; describe('Process List - Pagination when adding processes', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -46,8 +40,8 @@ describe('Process List - Pagination when adding processes', () => { fifteenValue: 15 }; - let processUserModel; - let resultApp; + let processUserModel: UserModel; + let resultApp: AppDefinitionRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -80,7 +74,7 @@ describe('Process List - Pagination when adding processes', () => { await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20' ); + await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20'); await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue); await paginationPage.checkNextPageButtonIsEnabled(); await paginationPage.checkPreviousPageButtonIsDisabled(); @@ -96,7 +90,7 @@ describe('Process List - Pagination when adding processes', () => { await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25' ); + await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25'); await expect(await processFiltersPage.numberOfProcessRows()).toBe(10); await paginationPage.checkNextPageButtonIsDisabled(); await paginationPage.checkPreviousPageButtonIsEnabled(); diff --git a/e2e/process-services/process/process-attachment-list-action-menu.e2e.ts b/e2e/process-services/process/process-attachment-list-action-menu.e2e.ts index 189a08f744..4be399c19f 100644 --- a/e2e/process-services/process/process-attachment-list-action-menu.e2e.ts +++ b/e2e/process-services/process/process-attachment-list-action-menu.e2e.ts @@ -24,9 +24,9 @@ import { createApiService, ViewerPage, ModelsActions } from '@alfresco/adf-testing'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { AttachmentListPage } from './../pages/attachment-list.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; +import { AttachmentListPage } from '../pages/attachment-list.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { FileModel } from '../../models/ACS/file.model'; import { browser } from 'protractor'; @@ -53,7 +53,9 @@ describe('Attachment list action menu for processes', () => { }); const downloadedPngFile = pngFile.name; - let tenantId; let appId; + let tenantId: number; + let appId: number; + const processName = { active: 'Active Process', completed: 'Completed Process', diff --git a/e2e/process-services/process/process-filters-component.e2e.ts b/e2e/process-services/process/process-filters-component.e2e.ts index c813e85770..6e508e4768 100644 --- a/e2e/process-services/process/process-filters-component.e2e.ts +++ b/e2e/process-services/process/process-filters-component.e2e.ts @@ -15,26 +15,17 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - BrowserActions, - LoginPage, - StartProcessPage, - UsersActions -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { ProcessListPage } from './../pages/process-list.page'; -import { RuntimeAppDefinitionsApi, UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; +import { ProcessListPage } from '../pages/process-list.page'; import { browser } from 'protractor'; -import { ProcessListDemoPage } from './../pages/process-list-demo.page'; -import CONSTANTS = require('../../util/constants'); +import { ProcessListDemoPage } from '../pages/process-list-demo.page'; describe('Process Filters Test', () => { - const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; const loginPage = new LoginPage(); @@ -50,10 +41,6 @@ describe('Process Filters Test', () => { const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); - const userFiltersApi = new UserFiltersApi(apiService.getInstance()); - const appsApi = new RuntimeAppDefinitionsApi(apiService.getInstance()); - - let appModel; let user; const processTitle = { running: 'Test_running', @@ -62,18 +49,12 @@ describe('Process Filters Test', () => { one: 'Test fake process one', two: 'Test fake process two' }; - const processFilter = { - running: 'Running', - all: 'All', - completed: 'Completed' - }; beforeAll(async () => { - await apiService.loginWithProfile('admin'); - user = await usersActions.createUser(); + const user = await usersActions.createUser(); await apiService.login(user.username, user.password); - appModel = await applicationsService.importPublishDeployApp(app.file_path); + await applicationsService.importPublishDeployApp(app.file_path); await loginPage.login(user.username, user.password); }); @@ -107,7 +88,6 @@ describe('Process Filters Test', () => { await startProcessPage.enterProcessName(processTitle.running); await startProcessPage.clickFormStartProcessButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.running); await processFiltersPage.selectFromProcessList(processTitle.running); await processDetailsPage.propertiesList.waitVisible(); @@ -119,7 +99,6 @@ describe('Process Filters Test', () => { await expect(await processListPage.isProcessListDisplayed()).toEqual(true); await processFiltersPage.clickAllFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.all); await processFiltersPage.selectFromProcessList(processTitle.running); await processFiltersPage.selectFromProcessList(processTitle.completed); await processDetailsPage.propertiesList.waitVisible(); @@ -131,32 +110,10 @@ describe('Process Filters Test', () => { await expect(await processListPage.isProcessListDisplayed()).toEqual(true); await processFiltersPage.clickCompletedFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.completed); await processFiltersPage.selectFromProcessList(processTitle.completed); await processDetailsPage.propertiesList.waitVisible(); }); - it('[C280407] Should be able to access the filters with URL', async () => { - const defaultFiltersNumber = 3; - let processFilterUrl; - - const deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - - processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedAppId + '/processes/'; - const taskAppFilters = await userFiltersApi.getUserProcessInstanceFilters({ appId: deployedAppId }); - - await processServicesPage.goToApp(app.title); - await processServiceTabBarPage.clickProcessButton(); - await expect(await processListPage.isProcessListDisplayed()).toEqual(true); - - await expect(taskAppFilters.size).toBe(defaultFiltersNumber); - for (const filter of taskAppFilters.data) { - await BrowserActions.getUrl(processFilterUrl + filter.id); - await expect(await processListPage.isProcessListDisplayed()).toEqual(true); - await processFiltersPage.checkFilterIsHighlighted(filter.name); - } - }); - it('[C260463] Should Cancel process be displayed in Completed process filters', async () => { await processServicesPage.goToApp(app.title); await processServiceTabBarPage.clickProcessButton(); @@ -172,86 +129,8 @@ describe('Process Filters Test', () => { await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled); await processFiltersPage.clickCompletedFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.completed); await processListDemoPage.checkProcessIsDisplayed(processTitle.canceled); await processFiltersPage.selectFromProcessList(processTitle.canceled); await processDetailsPage.propertiesList.waitVisible(); }); - - it('[C213262] Default process filters', async () => { - await processServicesPage.goToApp(app.title); - await processServiceTabBarPage.clickProcessButton(); - await expect(await processListPage.isProcessListDisplayed()).toEqual(true); - - await processFiltersPage.clickCreateProcessButton(); - await processFiltersPage.clickNewProcessDropdown(); - await startProcessPage.enterProcessName(processTitle.one); - await startProcessPage.clickFormStartProcessButton(); - await expect(await processListPage.isProcessListDisplayed()).toEqual(true); - - await processListDemoPage.checkProcessIsDisplayed(processTitle.one); - await processFiltersPage.checkFilterIsHighlighted(processFilter.running); - await processDetailsPage.propertiesList.waitVisible(); - await checkProcessInfoDrawer({ name: processTitle.one }); - - await processFiltersPage.clickCreateProcessButton(); - await processFiltersPage.clickNewProcessDropdown(); - await startProcessPage.enterProcessName(processTitle.two); - await startProcessPage.clickFormStartProcessButton(); - await expect(await processListPage.isProcessListDisplayed()).toEqual(true); - - await processListDemoPage.checkProcessIsDisplayed(processTitle.one); - await processListDemoPage.checkProcessIsDisplayed(processTitle.two); - - await processDetailsPage.cancelProcessButton.click(); - await processListDemoPage.checkProcessIsNotDisplayed(processTitle.canceled); - - await processFiltersPage.clickCompletedFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.completed); - await processListDemoPage.checkProcessIsDisplayed(processTitle.two); - await processFiltersPage.selectFromProcessList(processTitle.two); - - await processFiltersPage.clickAllFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilter.all); - await processListDemoPage.checkProcessIsDisplayed(processTitle.two); - await processFiltersPage.selectFromProcessList(processTitle.two); - }); - - it('[C260384] Edit default filter', async () => { - const runningFilter = (await getFilter()).find(filter => filter.name === 'Running'); - await userFiltersApi - .updateUserProcessInstanceFilter(runningFilter.id, { ...runningFilter, name: 'Edited Running' }); - - await processServicesPage.goToApp(app.title); - await processServiceTabBarPage.clickProcessButton(); - await processFiltersPage.checkFilterIsNotDisplayed('Running'); - await processFiltersPage.checkFilterIsDisplayed('Edited Running'); - }); - - it('[C260385] Delete default filter', async () => { - const allFilter = (await getFilter()).find(filter => filter.name === 'All'); - await userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id); - - await processServicesPage.goToApp(app.title); - await processServiceTabBarPage.clickProcessButton(); - await processFiltersPage.checkFilterIsNotDisplayed('All'); - }); - - async function getFilter(): Promise { - const apps = await appsApi.getAppDefinitions(); - const { id: appId = 0 } = apps.data.find((application) => application.name === appModel.name); - - const filters = await userFiltersApi.getUserProcessInstanceFilters({ appId }); - return filters.data; - } - - async function checkProcessInfoDrawer({ name }) { - await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(name); - await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING); - await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE); - await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY); - await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY); - await expect(await processDetailsPage.getCreatedBy()).toEqual(`${user.firstName} ${user.lastName}`); - await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION); - } }); diff --git a/e2e/process-services/process/process-instance-details.e2e.ts b/e2e/process-services/process/process-instance-details.e2e.ts index 0bdde9da89..51d1525385 100644 --- a/e2e/process-services/process/process-instance-details.e2e.ts +++ b/e2e/process-services/process/process-instance-details.e2e.ts @@ -16,23 +16,16 @@ */ import { browser } from 'protractor'; -import { createApiService, - ApplicationsUtil, - LoginPage, - ModelsActions, - ProcessUtil, - UsersActions -} from '@alfresco/adf-testing'; -import { ProcessServicesPage } from './../pages/process-services.page'; +import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; +import { ProcessServicesPage } from '../pages/process-services.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { ProcessListPage } from './../pages/process-list.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; +import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page'; +import { ProcessListPage } from '../pages/process-list.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; import * as moment from 'moment'; -import { ProcessInstancesApi } from '@alfresco/js-api'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation, ProcessInstancesApi } from '@alfresco/js-api'; describe('Process Instance Details', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -48,7 +41,10 @@ describe('Process Instance Details', () => { const modelsActions = new ModelsActions(apiService); const processApi = new ProcessInstancesApi(apiService.getInstance()); - let appModel; let process; let user; + let appModel: AppDefinitionRepresentation; + let process: ProcessInstanceRepresentation; + let user: UserModel; + const PROCESS_DATE_FORMAT = 'll'; beforeAll(async () => { @@ -70,13 +66,13 @@ describe('Process Instance Details', () => { await expect(await processListPage.isProcessListDisplayed()).toEqual(true); process = await processApi.getProcessInstance(processModel.id); - }); + }); afterAll(async () => { await modelsActions.deleteModel(appModel.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(user.tenantId); - }); + }); it('[C307031] Should display the created date in the default format', async () => { await processDetailsPage.checkProcessHeaderDetailsAreVisible(); diff --git a/e2e/process-services/process/process-list-component.e2e.ts b/e2e/process-services/process/process-list-component.e2e.ts index 64f48cd3dd..904acd0f85 100644 --- a/e2e/process-services/process/process-list-component.e2e.ts +++ b/e2e/process-services/process/process-list-component.e2e.ts @@ -15,19 +15,21 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, BrowserActions, - LoginPage, ModelsActions, + LoginPage, + ModelsActions, ProcessUtil, - UsersActions + UsersActions, + UserModel } from '@alfresco/adf-testing'; -import { ProcessListDemoPage } from './../pages/process-list-demo.page'; +import { ProcessListDemoPage } from '../pages/process-list-demo.page'; import { browser } from 'protractor'; -import { TaskFormsApi } from '@alfresco/js-api'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation, TaskFormsApi } from '@alfresco/js-api'; describe('Process List Test', () => { - const appWithDateField = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; const appWithUserWidget = browser.params.resources.Files.APP_WITH_USER_WIDGET; @@ -40,7 +42,9 @@ describe('Process List Test', () => { const modelsActions = new ModelsActions(apiService); const taskFormsApi = new TaskFormsApi(apiService.getInstance()); - let appDateModel; let appUserWidgetModel; let user; + let appDateModel: AppDefinitionRepresentation; + let appUserWidgetModel: AppDefinitionRepresentation; + let user: UserModel; const processList = ['Process With Date', 'Process With Date 2', 'Process With User Widget', 'Process With User Widget 2']; @@ -56,8 +60,10 @@ describe('Process List Test', () => { insertAppId: 'Insert App ID' }; - let appWithDateFieldId; - let procWithDate; let completedProcWithDate; let completedProcWithUserWidget; + let appWithDateFieldId: string | number; + let procWithDate: ProcessInstanceRepresentation; + let completedProcWithDate: ProcessInstanceRepresentation; + let completedProcWithUserWidget: ProcessInstanceRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -87,7 +93,7 @@ describe('Process List Test', () => { await taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } }); await loginPage.login(user.username, user.password); - }); + }); afterAll(async () => { await modelsActions.deleteModel(appDateModel.id); @@ -96,11 +102,11 @@ describe('Process List Test', () => { await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(user.tenantId); - }); + }); beforeEach(async () => { await BrowserActions.getUrl(browser.baseUrl + '/process-list'); - }); + }); it('[C286638] Should display all process by default', async () => { await processListDemoPage.checkAppIdFieldIsDisplayed(); diff --git a/e2e/process-services/process/processlist-pagination.e2e.ts b/e2e/process-services/process/processlist-pagination.e2e.ts deleted file mode 100644 index bb2ad41740..0000000000 --- a/e2e/process-services/process/processlist-pagination.e2e.ts +++ /dev/null @@ -1,381 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { createApiService, - ApplicationsUtil, - LoginPage, - PaginationPage, - ProcessUtil, - UsersActions -} from '@alfresco/adf-testing'; -import { browser } from 'protractor'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; - -describe('Process List - Pagination', () => { - - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; - - const loginPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const paginationPage = new PaginationPage(); - const processFiltersPage = new ProcessFiltersPage(); - const processDetailsPage = new ProcessDetailsPage(); - - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const applicationsService = new ApplicationsUtil(apiService); - - const itemsPerPage = { - five: '5', - fiveValue: 5, - ten: '10', - tenValue: 10, - fifteen: '15', - fifteenValue: 15, - twenty: '20', - twentyValue: 20, - default: '25' - }; - - const processFilterRunning = 'Running'; - - let deployedTestApp; - let processUserModel; - const nrOfProcesses = 20; - let page; - let totalPages; - - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - - processUserModel = await usersActions.createUser(); - - await apiService.login(processUserModel.username, processUserModel.password); - - deployedTestApp = await applicationsService.importPublishDeployApp(app.file_path); - - await loginPage.login(processUserModel.username, processUserModel.password); - }); - - describe('With processes Pagination', () => { - beforeAll(async () => { - await apiService.login(processUserModel.username, processUserModel.password); - - for (let i = 0; i < nrOfProcesses; i++) { - await new ProcessUtil(apiService).startProcessOfApp(deployedTestApp.name); - } - }); - - beforeEach(async () => { - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - }); - - it('[C261042] Should display default pagination', async () => { - page = 1; - totalPages = 1; - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - }); - - it('[C261043] Should be possible to Items per page to 15', async () => { - page = 1; - totalPages = 2; - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await paginationPage.selectItemsPerPage(itemsPerPage.fifteen); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - - page++; - await paginationPage.clickOnNextPage(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - page = 1; - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen); - }); - - it('[C261044] Should be possible to Items per page to 10', async () => { - page = 1; - totalPages = 2; - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await paginationPage.selectItemsPerPage(itemsPerPage.ten); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - - page++; - await paginationPage.clickOnNextPage(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - page = 1; - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - }); - - it('[C261047] Should be possible to Items per page to 20', async () => { - page = 1; - totalPages = 1; - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await paginationPage.selectItemsPerPage(itemsPerPage.twenty); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty); - }); - - it('[C261045] Should be possible to Items per page to 5', async () => { - let showing; - page = 1; - totalPages = 4; - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await paginationPage.selectItemsPerPage(itemsPerPage.five); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - - showing = (itemsPerPage.fiveValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - - page++; - await paginationPage.clickOnNextPage(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - - showing = (itemsPerPage.fiveValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - page++; - await paginationPage.clickOnNextPage(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - - showing = (itemsPerPage.fiveValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - page++; - await paginationPage.clickOnNextPage(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - - showing = (itemsPerPage.fiveValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - page = 1; - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton(); - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five); - }); - - it('[C261049] Should be possible to open page number dropdown', async () => { - let showing; - page = 1; - totalPages = 2; - await processFiltersPage.clickRunningFilterButton(); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await paginationPage.selectItemsPerPage(itemsPerPage.ten); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - - showing = (itemsPerPage.tenValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - - await paginationPage.clickOnPageDropdown(); - await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']); - page = 2; - await paginationPage.clickOnPageDropdownOption('2'); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - - showing = (itemsPerPage.tenValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue); - await paginationPage.checkNextPageButtonIsDisabled(); - await paginationPage.checkPreviousPageButtonIsEnabled(); - - await paginationPage.clickOnPageDropdown(); - await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']); - page = 1; - await paginationPage.clickOnPageDropdownOption('1'); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page); - await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages); - await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten); - - showing = (itemsPerPage.tenValue * page); - await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses); - await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue); - await paginationPage.checkNextPageButtonIsEnabled(); - await paginationPage.checkPreviousPageButtonIsDisabled(); - }); - - it('[C261048] Should be possible to sort processes by name', async () => { - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - - await paginationPage.selectItemsPerPage(itemsPerPage.twenty); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - - await processFiltersPage.sortByName('ASC'); - await processFiltersPage.waitForTableBody(); - await processFiltersPage.checkProcessesSortedByNameAsc(); - - await processFiltersPage.sortByName('DESC'); - await processFiltersPage.waitForTableBody(); - await processFiltersPage.checkProcessesSortedByNameDesc(); - }); - - it('[C286260] Should keep sorting when changing \'Items per page\'', async () => { - await processFiltersPage.clickRunningFilterButton(); - await processFiltersPage.checkFilterIsHighlighted(processFilterRunning); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - - await paginationPage.selectItemsPerPage(itemsPerPage.twenty); - await processDetailsPage.checkProcessTitleIsDisplayed(); - await processFiltersPage.waitForTableBody(); - - await processFiltersPage.sortByName('ASC'); - await processFiltersPage.waitForTableBody(); - await processFiltersPage.checkProcessesSortedByNameAsc(); - - await paginationPage.selectItemsPerPage(itemsPerPage.five); - await processFiltersPage.waitForTableBody(); - await processFiltersPage.checkProcessesSortedByNameAsc(); - }); - }); -}); diff --git a/e2e/process-services/process/start-process-component.e2e.ts b/e2e/process-services/process/start-process-component.e2e.ts index e54f08d5d9..83495359b9 100644 --- a/e2e/process-services/process/start-process-component.e2e.ts +++ b/e2e/process-services/process/start-process-component.e2e.ts @@ -30,15 +30,14 @@ import { createApiService, import { browser } from 'protractor'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { AttachmentListPage } from './../pages/attachment-list.page'; -import { ProcessDetailsPage } from './../pages/process-details.page'; -import { ProcessFiltersPage } from './../pages/process-filters.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { ProcessInstancesApi } from '@alfresco/js-api'; +import { AttachmentListPage } from '../pages/attachment-list.page'; +import { ProcessDetailsPage } from '../pages/process-details.page'; +import { ProcessFiltersPage } from '../pages/process-filters.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { ProcessServiceTabBarPage } from '../pages/process-service-tab-bar.page'; +import { AppDefinitionRepresentation, ProcessInstancesApi } from '@alfresco/js-api'; describe('Start Process Component', () => { - const app = browser.params.resources.Files.APP_WITH_PROCESSES; const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST; const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; @@ -62,7 +61,9 @@ describe('Start Process Component', () => { let procUserModel: UserModel; let secondProcUserModel: UserModel; - let appCreated; let simpleAppCreated; let dateFormAppCreated; + let appCreated: AppDefinitionRepresentation; + let simpleAppCreated: AppDefinitionRepresentation; + let dateFormAppCreated: AppDefinitionRepresentation; const processName255Characters = StringUtil.generateRandomString(255); const processNameBiggerThen255Characters = StringUtil.generateRandomString(256); @@ -77,7 +78,6 @@ describe('Start Process Component', () => { }); describe('Provider: BPM', () => { - beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -121,7 +121,6 @@ describe('Start Process Component', () => { }); describe(' Once logged with user with app', () => { - beforeEach(async () => { await loginPage.login(secondProcUserModel.username, secondProcUserModel.password); await navigationBarPage.navigateToProcessServicesPage(); @@ -264,7 +263,9 @@ describe('Start Process Component', () => { await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name); await startProcessPage.enterProcessName('Type'); await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true); - await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name); + await expect(await startProcessPage.getProcessDefinitionValue()).toBe( + browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name + ); await startProcessPage.clickStartProcessButton(); await processFiltersPage.clickRunningFilterButton(); await processFiltersPage.selectFromProcessList('Type'); @@ -278,7 +279,9 @@ describe('Start Process Component', () => { await startProcessPage.typeProcessDefinition('process'); await startProcessPage.pressDownArrowAndEnter(); - await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name); + await expect(await startProcessPage.getProcessDefinitionValue()).toBe( + browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name + ); }); it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => { @@ -288,7 +291,9 @@ describe('Start Process Component', () => { await processFiltersPage.clickNewProcessDropdown(); await startProcessPage.typeProcessDefinition('process'); await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name); - await expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name); + await expect(await startProcessPage.getProcessDefinitionValue()).toBe( + browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name + ); await startProcessPage.clickProcessDropdownArrow(); await expect(await startProcessPage.getProcessDefinitionValue()).toBe(''); diff --git a/e2e/process-services/tasks/comment-component-tasks.e2e.ts b/e2e/process-services/tasks/comment-component-tasks.e2e.ts index bbc2a88a37..f83fc2402a 100644 --- a/e2e/process-services/tasks/comment-component-tasks.e2e.ts +++ b/e2e/process-services/tasks/comment-component-tasks.e2e.ts @@ -25,7 +25,7 @@ import { createApiService, UserModel, UsersActions } from '@alfresco/adf-testing'; -import { TasksPage } from './../pages/tasks.page'; +import { TasksPage } from '../pages/tasks.page'; import { CommentsPage } from '../../core/pages/comments.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api'; @@ -47,7 +47,9 @@ describe('Comment component for Processes', () => { const activitiCommentsApi = new ActivitiCommentsApi(apiService.getInstance()); const taskActionsApi = new TaskActionsApi(apiService.getInstance()); - let user; let appId; let secondUser; + let user: UserModel; + let appId: number; + let secondUser: UserModel; const taskName = { completed_task: 'Test Completed', diff --git a/e2e/process-services/tasks/sort-tasklist-pagination.e2e.ts b/e2e/process-services/tasks/sort-tasklist-pagination.e2e.ts index 3ecb650af3..416df56233 100644 --- a/e2e/process-services/tasks/sort-tasklist-pagination.e2e.ts +++ b/e2e/process-services/tasks/sort-tasklist-pagination.e2e.ts @@ -15,20 +15,13 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - PaginationPage, - StringUtil, TaskUtil, - UsersActions -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, StringUtil, TaskUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TasksPage } from './../pages/tasks.page'; +import { TasksPage } from '../pages/tasks.page'; import CONSTANTS = require('../../util/constants'); describe('Task List Pagination - Sorting', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -41,9 +34,8 @@ describe('Task List Pagination - Sorting', () => { const taskUtil = new TaskUtil(apiService); const nrOfTasks = 20; - let processUserModel; - const taskNameBase = 'Task'; - const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, taskNameBase, ''); + let processUserModel: UserModel; + const taskNames = StringUtil.generateFilesNames(10, nrOfTasks + 9, 'Task', ''); const itemsPerPage = { five: '5', diff --git a/e2e/process-services/tasks/standalone-task.e2e.ts b/e2e/process-services/tasks/standalone-task.e2e.ts index e5fe8f51c1..3d5438bc35 100644 --- a/e2e/process-services/tasks/standalone-task.e2e.ts +++ b/e2e/process-services/tasks/standalone-task.e2e.ts @@ -25,7 +25,7 @@ import { UsersActions, Widget } from '@alfresco/adf-testing'; -import { TasksPage } from './../pages/tasks.page'; +import { TasksPage } from '../pages/tasks.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { TaskActionsApi, TasksApi } from '@alfresco/js-api'; import CONSTANTS = require('../../util/constants'); @@ -40,8 +40,8 @@ describe('Start Task - Task App', () => { const taskPage = new TasksPage(); const widget = new Widget(); - let processUserModel; let anotherUser; - const noFormMessage = 'No forms attached'; + let processUserModel: UserModel; + let anotherUser: UserModel; const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -81,7 +81,7 @@ describe('Start Task - Task App', () => { await taskPage.taskDetails().checkAttachFormButtonIsDisplayed(); await taskPage.taskDetails().checkAttachFormButtonIsEnabled(); await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); - await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage); + await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached'); }); it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => { @@ -139,7 +139,7 @@ describe('Start Task - Task App', () => { await taskPage.formFields().noFormIsDisplayed(); await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); - await expect(await taskDetails.getNoFormMessage()).toEqual(noFormMessage); + await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached'); }); it('[C329799] Form actions are enabled in assigned task', async () => { diff --git a/e2e/process-services/tasks/start-task-custom-app.e2e.ts b/e2e/process-services/tasks/start-task-custom-app.e2e.ts index f1e1c28c1e..4dc5bfa9f9 100644 --- a/e2e/process-services/tasks/start-task-custom-app.e2e.ts +++ b/e2e/process-services/tasks/start-task-custom-app.e2e.ts @@ -20,32 +20,29 @@ import { browser } from 'protractor'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { AttachmentListPage } from './../pages/attachment-list.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { TasksPage } from './../pages/tasks.page'; +import { AttachmentListPage } from '../pages/attachment-list.page'; +import { TasksPage } from '../pages/tasks.page'; import CONSTANTS = require('../../util/constants'); +import { AppDefinitionRepresentation } from '@alfresco/js-api'; describe('Start Task - Custom App', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); const attachmentListPage = new AttachmentListPage(); - const processServiceTabBarPage = new ProcessServiceTabBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); - let processUserModel; let assigneeUserModel; - const formTextField = app.form_fields.form_fieldId; - const formFieldValue = 'First value '; + let processUserModel: UserModel; + let assigneeUserModel: UserModel; + const taskPage = new TasksPage(); - const firstComment = 'comm1'; const firstChecklist = 'checklist1'; const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner']; - const showHeaderTask = 'Show Header'; - let appModel; + let appModel: AppDefinitionRepresentation; + const pngFile = new FileModel({ location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location, name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name @@ -62,7 +59,7 @@ describe('Start Task - Custom App', () => { appModel = await applicationsService.importPublishDeployApp(app.file_path); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); it('[C263942] Should be possible to modify a task', async () => { await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton(); @@ -86,14 +83,19 @@ describe('Start Task - Custom App', () => { await taskDetails.clickAddInvolvedUserButton(); - await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName) - ).toEqual(assigneeUserModel.email); + await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual( + assigneeUserModel.email + ); await taskDetails.selectActivityTab(); + + const firstComment = 'comm1'; await taskDetails.addComment(firstComment); await taskDetails.checkCommentIsDisplayed(firstComment); const checklistDialog = await taskPage.clickOnAddChecklistButton(); + const firstChecklist = 'checklist1'; + await checklistDialog.addName(firstChecklist); await checklistDialog.clickCreateChecklistButton(); @@ -137,6 +139,8 @@ describe('Start Task - Custom App', () => { }); it('[C263949] Should be possible to save filled form', async () => { + const formFieldValue = 'First value '; + await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); @@ -146,22 +150,15 @@ describe('Start Task - Custom App', () => { await task.addName(tasks[4]); await task.clickStartButton(); + const formTextField = app.form_fields.form_fieldId; await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]); - await taskPage.formFields().setFieldValue(formTextField, formFieldValue); - await taskPage.formFields().refreshForm(); - await taskPage.formFields().checkFieldValue(formTextField, ''); - await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]); - await taskPage.formFields().setFieldValue(formTextField, formFieldValue); - await taskPage.formFields().checkFieldValue(formTextField, formFieldValue); - await taskPage.formFields().saveForm(); - await taskPage.formFields().checkFieldValue(formTextField, formFieldValue); }); @@ -198,25 +195,4 @@ describe('Start Task - Custom App', () => { await attachmentListPage.clickAttachFileButton(pngFile.location); await attachmentListPage.checkFileIsAttached(pngFile.name); }); - - it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', async () => { - await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton(); - await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); - const task = await taskPage.createNewTask(); - await task.addName(showHeaderTask); - await task.clickStartButton(); - await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask); - - await processServiceTabBarPage.clickSettingsButton(); - await taskPage.taskDetails().appSettingsToggles().disableShowHeader(); - await processServiceTabBarPage.clickTasksButton(); - - await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed(); - - await processServiceTabBarPage.clickSettingsButton(); - await taskPage.taskDetails().appSettingsToggles().enableShowHeader(); - await processServiceTabBarPage.clickTasksButton(); - - await taskPage.taskDetails().taskInfoDrawerIsDisplayed(); - }); }); diff --git a/e2e/process-services/tasks/start-task-task-app.e2e.ts b/e2e/process-services/tasks/start-task-task-app.e2e.ts index 654176075d..bfb4a235cb 100644 --- a/e2e/process-services/tasks/start-task-task-app.e2e.ts +++ b/e2e/process-services/tasks/start-task-task-app.e2e.ts @@ -26,19 +26,16 @@ import { createApiService, import { browser } from 'protractor'; import { FileModel } from '../../models/ACS/file.model'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { AttachmentListPage } from './../pages/attachment-list.page'; -import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { TasksPage } from './../pages/tasks.page'; +import { AttachmentListPage } from '../pages/attachment-list.page'; +import { ChecklistDialog } from '../pages/dialog/create-checklist-dialog.page'; +import { TasksPage } from '../pages/tasks.page'; import * as CONSTANTS from '../../util/constants'; describe('Start Task - Task App', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); const attachmentListPage = new AttachmentListPage(); - const processServiceTabBarPage = new ProcessServiceTabBarPage(); const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); @@ -46,16 +43,11 @@ describe('Start Task - Task App', () => { const taskUtil = new TaskUtil(apiService); const applicationsUtil = new ApplicationsUtil(apiService); - let processUserModel; let assigneeUserModel; + let processUserModel: UserModel; + let assigneeUserModel: UserModel; const formTextField = app.form_fields.form_fieldId; - const formFieldValue = 'First value '; const taskPage = new TasksPage(); - const firstComment = 'comm1'; const firstChecklist = 'checklist1'; - const taskName255Characters = StringUtil.generateRandomString(255); - const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256); - const lengthValidationError = 'Length exceeded, 255 characters max.'; const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; - const showHeaderTask = 'Show Header'; const jpgFile = new FileModel({ location: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_location, name: browser.params.resources.Files.ADF_DOCUMENTS.JPG.file_name @@ -72,7 +64,7 @@ describe('Start Task - Task App', () => { await applicationsUtil.importApplication(app.file_path); - await taskUtil.createStandaloneTask(showHeaderTask); + await taskUtil.createStandaloneTask('Show Header'); await loginPage.login(processUserModel.username, processUserModel.password); }); @@ -101,9 +93,11 @@ describe('Start Task - Task App', () => { .toEqual(assigneeUserModel.email); await taskDetails.selectActivityTab(); + const firstComment = 'comm1'; await taskDetails.addComment(firstComment); await taskDetails.checkCommentIsDisplayed(firstComment); + const firstChecklist = 'checklist1'; await (await taskPage.clickOnAddChecklistButton()).addName(firstChecklist); const checklistDialog = new ChecklistDialog(); @@ -133,6 +127,7 @@ describe('Start Task - Task App', () => { await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]); const formFields = await taskPage.formFields(); + const formFieldValue = 'First value '; await formFields.setFieldValue(formTextField, formFieldValue); await formFields.refreshForm(); @@ -169,29 +164,16 @@ describe('Start Task - Task App', () => { await attachmentListPage.checkFileIsAttached(jpgFile.name); }); - it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', async () => { - await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask); - - await processServiceTabBarPage.clickSettingsButton(); - await taskPage.taskDetails().appSettingsToggles().disableShowHeader(); - await processServiceTabBarPage.clickTasksButton(); - - await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed(); - - await processServiceTabBarPage.clickSettingsButton(); - await taskPage.taskDetails().appSettingsToggles().enableShowHeader(); - await processServiceTabBarPage.clickTasksButton(); - - await taskPage.taskDetails().taskInfoDrawerIsDisplayed(); - }); - it('[C291780] Should be displayed an error message if task name exceed 255 characters', async () => { const startDialog = await taskPage.createNewTask(); + const taskName255Characters = StringUtil.generateRandomString(255); await startDialog.addName(taskName255Characters); await startDialog.checkStartButtonIsEnabled(); + const taskNameBiggerThen255Characters = StringUtil.generateRandomString(256); await startDialog.addName(taskNameBiggerThen255Characters); await startDialog.blur(startDialog.name); + const lengthValidationError = 'Length exceeded, 255 characters max.'; await startDialog.checkValidationErrorIsDisplayed(lengthValidationError); await startDialog.checkStartButtonIsDisabled(); }); diff --git a/e2e/process-services/tasks/task-assignee.e2e.ts b/e2e/process-services/tasks/task-assignee.e2e.ts index ffa35fc33b..afc266e93b 100644 --- a/e2e/process-services/tasks/task-assignee.e2e.ts +++ b/e2e/process-services/tasks/task-assignee.e2e.ts @@ -71,8 +71,7 @@ describe('Task Assignee', () => { tenantId: user.tenantId, type: 1 }); - } catch (e) { - } + } catch {} await apiService.login(user.username, user.password); await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true }); diff --git a/e2e/process-services/tasks/task-attachment-list-action-menu.e2e.ts b/e2e/process-services/tasks/task-attachment-list-action-menu.e2e.ts index 60c0610d58..f9d053da53 100644 --- a/e2e/process-services/tasks/task-attachment-list-action-menu.e2e.ts +++ b/e2e/process-services/tasks/task-attachment-list-action-menu.e2e.ts @@ -24,17 +24,16 @@ import { createApiService, ViewerPage } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TasksPage } from './../pages/tasks.page'; -import { AttachmentListPage } from './../pages/attachment-list.page'; +import { TasksPage } from '../pages/tasks.page'; +import { AttachmentListPage } from '../pages/attachment-list.page'; import * as fs from 'fs'; import * as path from 'path'; import { FileModel } from '../../models/ACS/file.model'; import CONSTANTS = require('../../util/constants'); -import { Activiti } from '@alfresco/js-api'; +import { Activiti, RelatedContentRepresentation } from '@alfresco/js-api'; import ContentApi = Activiti.ContentApi; describe('Attachment list action menu for tasks', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -55,7 +54,10 @@ describe('Attachment list action menu for tasks', () => { name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name }); const downloadedPngFile = pngFile.name; - let tenantId; let appId; let relatedContent; let relatedContentId; + let tenantId: number; + let appId: number; + let relatedContent: RelatedContentRepresentation; + let relatedContentId: number; const taskName = { active: 'Active Task', completed: 'Completed Task', @@ -64,7 +66,6 @@ describe('Attachment list action menu for tasks', () => { }; beforeAll(async () => { - await apiService.loginWithProfile('admin'); const user = await usersActions.createUser(); tenantId = user.tenantId; diff --git a/e2e/process-services/tasks/task-audit.e2e.ts b/e2e/process-services/tasks/task-audit.e2e.ts index 2e318359b0..ff47f252e7 100644 --- a/e2e/process-services/tasks/task-audit.e2e.ts +++ b/e2e/process-services/tasks/task-audit.e2e.ts @@ -19,17 +19,18 @@ import { LoginPage, BrowserActions, FileBrowserUtil, - ApplicationsUtil, createApiService, + ApplicationsUtil, + createApiService, UsersActions, - TaskUtil + TaskUtil, + UserModel } from '@alfresco/adf-testing'; -import { TasksPage } from './../pages/tasks.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; +import { TasksPage } from '../pages/tasks.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; import CONSTANTS = require('../../util/constants'); import { browser } from 'protractor'; describe('Task Audit', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -40,11 +41,10 @@ describe('Task Audit', () => { const usersActions = new UsersActions(apiService); const taskUtil = new TaskUtil(apiService); - let processUserModel; + let processUserModel: UserModel; const taskTaskApp = 'Audit task task app'; const taskCustomApp = 'Audit task custom app'; - const taskCompleteCustomApp = 'Audit completed task custom app'; const auditLogFile = 'Audit.pdf'; beforeAll(async () => { @@ -59,7 +59,7 @@ describe('Task Audit', () => { await loginPage.login(processUserModel.username, processUserModel.password); }); - afterAll( async () => { + afterAll(async () => { await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); }); @@ -96,7 +96,8 @@ describe('Task Audit', () => { it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', async () => { await (await processServices.goToTaskApp()).clickTasksButton(); - await taskPage.createTask({name: taskCompleteCustomApp}); + const taskCompleteCustomApp = 'Audit completed task custom app'; + await taskPage.createTask({ name: taskCompleteCustomApp }); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp); @@ -113,7 +114,7 @@ describe('Task Audit', () => { it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', async () => { await (await processServices.goToTaskApp()).clickTasksButton(); - await taskPage.createTask({name: taskCustomApp}); + await taskPage.createTask({ name: taskCustomApp }); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp); diff --git a/e2e/process-services/tasks/task-details-form.e2e.ts b/e2e/process-services/tasks/task-details-form.e2e.ts index 780f0cb355..5395b51809 100644 --- a/e2e/process-services/tasks/task-details-form.e2e.ts +++ b/e2e/process-services/tasks/task-details-form.e2e.ts @@ -15,27 +15,30 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, - LoginPage, ModelsActions, + LoginPage, + ModelsActions, ProcessUtil, - StringUtil, TaskUtil, + StringUtil, + TaskUtil, UsersActions, Widget, - FormUtil + FormUtil, + UserModel } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { FiltersPage } from './../pages/filters.page'; -import { TaskDetailsPage } from './../pages/task-details.page'; -import { TasksListPage } from './../pages/tasks-list.page'; -import { TasksPage } from './../pages/tasks.page'; -import { AttachFormPage } from './../pages/attach-form.page'; +import { FiltersPage } from '../pages/filters.page'; +import { TaskDetailsPage } from '../pages/task-details.page'; +import { TasksListPage } from '../pages/tasks-list.page'; +import { TasksPage } from '../pages/tasks.page'; +import { AttachFormPage } from '../pages/attach-form.page'; import CONSTANTS = require('../../util/constants'); -import { TaskActionsApi, TasksApi } from '@alfresco/js-api'; +import { ModelRepresentation, TaskActionsApi, TaskRepresentation, TasksApi } from '@alfresco/js-api'; describe('Task Details - Form', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const loginPage = new LoginPage(); @@ -56,7 +59,12 @@ describe('Task Details - Form', () => { const taskActionsApi = new TaskActionsApi(apiService.getInstance()); const tasksApi = new TasksApi(apiService.getInstance()); - let task; let otherTask; let user; let newForm; let attachedForm; let otherAttachedForm; + let task: TaskRepresentation; + let otherTask: TaskRepresentation; + let user: UserModel; + let newForm: ModelRepresentation; + let attachedForm: ModelRepresentation; + let otherAttachedForm: ModelRepresentation; beforeAll(async () => { const attachedFormModel = { @@ -183,7 +191,8 @@ describe('Task Details - Form', () => { tabFieldVar: 'tabBasicFieldVar' }; - let newTask; let appModel; + let newTask; + let appModel; beforeAll(async () => { appModel = await applicationsService.importPublishDeployApp(app.file_path); diff --git a/e2e/process-services/tasks/task-details-no-form.e2e.ts b/e2e/process-services/tasks/task-details-no-form.e2e.ts index 9c0f57ab84..386eddd610 100644 --- a/e2e/process-services/tasks/task-details-no-form.e2e.ts +++ b/e2e/process-services/tasks/task-details-no-form.e2e.ts @@ -15,14 +15,14 @@ * limitations under the License. */ -import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TasksPage } from './../pages/tasks.page'; +import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); +import { AppDefinitionRepresentation } from '@alfresco/js-api'; describe('Task Details - No form', () => { - const app = browser.params.resources.Files.NO_FORM_APP; const loginPage = new LoginPage(); @@ -32,9 +32,8 @@ describe('Task Details - No form', () => { const apiService = createApiService(); const usersActions = new UsersActions(apiService); - let processUserModel; - const noFormMessage = 'No forms attached'; - let importedApp; + let processUserModel: UserModel; + let importedApp: AppDefinitionRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -45,9 +44,9 @@ describe('Task Details - No form', () => { importedApp = await applicationsService.importPublishDeployApp(app.file_path); await new ProcessUtil(apiService).startProcessOfApp(importedApp.name); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); - afterAll( async () => { + afterAll(async () => { await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); }); @@ -63,6 +62,8 @@ describe('Task Details - No form', () => { await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled(); await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed(); await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM); + + const noFormMessage = 'No forms attached'; await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage); - }); + }); }); diff --git a/e2e/process-services/tasks/task-details.e2e.ts b/e2e/process-services/tasks/task-details.e2e.ts index 867fcb114b..9e2a0ced66 100644 --- a/e2e/process-services/tasks/task-details.e2e.ts +++ b/e2e/process-services/tasks/task-details.e2e.ts @@ -15,18 +15,22 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, BrowserActions, - LoginPage, ModelsActions, + LoginPage, + ModelsActions, ProcessUtil, - StringUtil, TaskUtil, - UsersActions + StringUtil, + TaskUtil, + UsersActions, + UserModel } from '@alfresco/adf-testing'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { TasksPage } from './../pages/tasks.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; -import { TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api'; +import { AppDefinitionRepresentation, TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api'; import Task = require('../../models/APS/Task'); import TaskModel = require('../../models/APS/TaskModel'); import FormModel = require('../../models/APS/FormModel'); @@ -34,7 +38,6 @@ import CONSTANTS = require('../../util/constants'); import * as moment from 'moment'; describe('Task Details component', () => { - const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; const processServices = new ProcessServicesPage(); @@ -49,10 +52,11 @@ describe('Task Details component', () => { const taskActionsApi = new TaskActionsApi(apiService.getInstance()); const taskFormsApi = new TaskFormsApi(apiService.getInstance()); - let processUserModel; let appModel; + let processUserModel: UserModel; + let appModel: AppDefinitionRepresentation; const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; const TASK_DATE_FORMAT = 'll'; - let formModel; + let formModel: any; const taskFormModel = { name: StringUtil.generateRandomString(), @@ -162,7 +166,7 @@ describe('Task Details component', () => { await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName()); await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY); await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE); - await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name); + await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name); await expect(await taskPage.taskDetails().getDuration()).toEqual(''); await expect(await taskPage.taskDetails().getEndDate()).toEqual(''); await expect(await taskPage.taskDetails().getParentTaskId()).toEqual(''); @@ -193,7 +197,7 @@ describe('Task Details component', () => { await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName()); await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY); await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE); - await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[1].name); + await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name); await expect(await taskPage.taskDetails().getDuration()).toEqual(''); await expect(await taskPage.taskDetails().getEndDate()).toEqual(''); await expect(await taskPage.taskDetails().getParentTaskId()).toEqual(''); @@ -310,7 +314,7 @@ describe('Task Details component', () => { await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED); }); - it('[C260321] Should not be able to edit a completed task\'s details', async () => { + it('[C260321] Should not be able to edit a completed task details', async () => { const taskName = 'TaskCompleted'; const form = await modelsActions.modelsApi.createModel(taskFormModel); const task = await taskUtil.createStandaloneTask(taskName); diff --git a/e2e/process-services/tasks/task-filters-component.e2e.ts b/e2e/process-services/tasks/task-filters-component.e2e.ts index cdca37b69a..95f56a5e1d 100644 --- a/e2e/process-services/tasks/task-filters-component.e2e.ts +++ b/e2e/process-services/tasks/task-filters-component.e2e.ts @@ -18,248 +18,155 @@ import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, - UserFiltersUtil, UserModel, UsersActions } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { TasksPage } from './../pages/tasks.page'; -import { TasksListPage } from './../pages/tasks-list.page'; -import { TaskDetailsPage } from './../pages/task-details.page'; -import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; -import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page'; -import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page'; -import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { TasksPage } from '../pages/tasks.page'; +import { TasksListPage } from '../pages/tasks-list.page'; +import { TaskDetailsPage } from '../pages/task-details.page'; +import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page'; import { browser } from 'protractor'; describe('Task', () => { + const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; - describe('Filters', () => { + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const tasksPage = new TasksPage(); + const tasksListPage = new TasksListPage(); + const taskDetailsPage = new TaskDetailsPage(); + const taskFiltersDemoPage = new TaskFiltersDemoPage(); - const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; + const apiService = createApiService(); + const usersActions = new UsersActions(apiService); + const modelsActions = new ModelsActions(apiService); - const loginPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const processServicesPage = new ProcessServicesPage(); - const tasksPage = new TasksPage(); - const tasksListPage = new TasksListPage(); - const taskDetailsPage = new TaskDetailsPage(); - const taskFiltersDemoPage = new TaskFiltersDemoPage(); + let appId: number; + let user: UserModel; - const apiService = createApiService(); - const usersActions = new UsersActions(apiService); - const modelsActions = new ModelsActions(apiService); + beforeEach(async () => { + await apiService.loginWithProfile('admin'); + user = await usersActions.createUser(); - let appId: number; let user: UserModel; + await apiService.login(user.username, user.password); + const applicationsService = new ApplicationsUtil(apiService); + const { id } = await applicationsService.importPublishDeployApp(app.file_path); + appId = id; - beforeEach(async () => { - await apiService.loginWithProfile('admin'); - user = await usersActions.createUser(); - - await apiService.login(user.username, user.password); - const applicationsService = new ApplicationsUtil(apiService); - const { id } = await applicationsService.importPublishDeployApp(app.file_path); - appId = id; - - await loginPage.login(user.username, user.password); - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); - await processServicesPage.goToApp(app.title); - }); - - afterEach(async () => { - await modelsActions.deleteModel(appId); - await apiService.loginWithProfile('admin'); - await usersActions.deleteTenant(user.tenantId); - await navigationBarPage.clickLogoutButton(); - }); - - it('[C279967] Should display default filters when an app is deployed', async () => { - await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed(); - }); - - it('[C260330] Should display Task Filter List when app is in Task Tab', async () => { - await tasksPage.createTask({ name: 'Test' }); - await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); - await tasksListPage.checkContentIsDisplayed('Test'); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks'); - await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - - await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks'); - await tasksListPage.checkContentIsNotDisplayed('Test'); - await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined(); - - await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks'); - await tasksListPage.checkContentIsDisplayed('Test'); - await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - - await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks'); - await tasksListPage.checkContentIsNotDisplayed('Test'); - await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined(); - }); - - it('[C260348] Should display task in Complete Tasks List when task is completed', async () => { - await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed(); - await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed(); - - const task = await tasksPage.createNewTask(); - await task.addName('Test'); - await task.clickStartButton(); - await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); - await tasksListPage.checkContentIsDisplayed('Test'); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks'); - await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - - await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks'); - await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found'); - await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found'); - - await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks'); - await tasksListPage.checkContentIsDisplayed('Test'); - await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - - await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); - await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks'); - await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found'); - await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found'); - }); - - it('[C260349] Should sort task by name when Name sorting is clicked', async () => { - await tasksPage.createTask({ name: 'Test1' }); - await taskDetailsPage.clickCompleteTask(); - - await tasksPage.createTask({ name: 'Test2' }); - await taskDetailsPage.clickCompleteTask(); - - await tasksPage.createTask({ name: 'Test3' }); - await tasksPage.createTask({ name: 'Test4' }); - - await tasksListPage.checkContentIsDisplayed('Test4'); - await tasksListPage.checkRowIsSelected('Test4'); - await tasksListPage.checkContentIsDisplayed('Test3'); - await taskDetailsPage.checkTaskDetailsDisplayed(); - - await tasksPage.clickSortByNameAsc(); - await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3'); - await tasksPage.clickSortByNameDesc(); - await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4'); - - await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); - await tasksListPage.checkContentIsDisplayed('Test1'); - await tasksListPage.checkContentIsDisplayed('Test2'); - await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2'); - - await tasksPage.clickSortByNameAsc(); - await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1'); - - await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); - await tasksListPage.checkContentIsDisplayed('Test3'); - await tasksListPage.checkContentIsDisplayed('Test4'); - }); - - it('[C277264] Should display task filter results when task filter is selected', async () => { - await tasksPage.createTask({ name: 'Test' }); - - await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); - await tasksListPage.checkContentIsDisplayed('Test'); - await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test'); - }); + await loginPage.login(user.username, user.password); + await navigationBarPage.navigateToProcessServicesPage(); + await processServicesPage.checkApsContainer(); + await processServicesPage.goToApp(app.title); }); - describe('Custom Filters', () => { - const loginPage = new LoginPage(); - const navigationBarPage = new NavigationBarPage(); - const processServicesPage = new ProcessServicesPage(); - const processServiceTabBarPage = new ProcessServiceTabBarPage(); - const appSettingsToggles = new AppSettingsTogglesPage(); - const taskFiltersDemoPage = new TaskFiltersDemoPage(); + afterEach(async () => { + await modelsActions.deleteModel(appId); + await apiService.loginWithProfile('admin'); + await usersActions.deleteTenant(user.tenantId); + await navigationBarPage.clickLogoutButton(); + }); - const apiService = createApiService(); - const userFiltersApi = new UserFiltersUtil(apiService); - const usersActions = new UsersActions(apiService); + it('[C279967] Should display default filters when an app is deployed', async () => { + await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed(); + }); - let user; - let appId: number; + it('[C260330] Should display Task Filter List when app is in Task Tab', async () => { + await tasksPage.createTask({ name: 'Test' }); + await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); + await tasksListPage.checkContentIsDisplayed('Test'); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks'); + await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - const app = browser.params.resources.Files.APP_WITH_PROCESSES; + await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks'); + await tasksListPage.checkContentIsNotDisplayed('Test'); + await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined(); - beforeAll(async () => { - await apiService.loginWithProfile('admin'); - user = await usersActions.createUser(); + await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks'); + await tasksListPage.checkContentIsDisplayed('Test'); + await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - await apiService.login(user.username, user.password); - const applicationsService = new ApplicationsUtil(apiService); - const importedApp = await applicationsService.importPublishDeployApp(app.file_path); - appId = await applicationsService.getAppDefinitionId(importedApp.id); + await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks'); + await tasksListPage.checkContentIsNotDisplayed('Test'); + await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined(); + }); - await loginPage.login(user.username, user.password); - }); + it('[C260348] Should display task in Complete Tasks List when task is completed', async () => { + await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed(); + await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed(); - afterAll(async () => { - await apiService.loginWithProfile('admin'); - await usersActions.deleteTenant(user.tenantId); - }); + const task = await tasksPage.createNewTask(); + await task.addName('Test'); + await task.clickStartButton(); + await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); + await tasksListPage.checkContentIsDisplayed('Test'); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks'); + await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - beforeEach(async () => { - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); - await processServicesPage.goToApp(app.title); - }); + await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks'); + await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found'); + await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found'); - it('[C260350] Should display a new filter when a filter is added', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ - name: 'New Task Filter', - appId, - icon: 'glyphicon-filter', - filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } - }); - const { id } = await userFiltersApi.createUserTaskFilter(newFilter); + await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks'); + await tasksListPage.checkContentIsDisplayed('Test'); + await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined(); - await browser.refresh(); - await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed(); - await userFiltersApi.deleteUserTaskFilter(id); - }); + await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); + await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks'); + await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found'); + await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found'); + }); - it('[C286447] Should display the task filter icon when a custom filter is added', async () => { - const newFilter = new UserProcessInstanceFilterRepresentation({ - name: 'New Task Filter with icon', - appId, - icon: 'glyphicon-cloud', - filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } - }); - const { id } = await userFiltersApi.createUserTaskFilter(newFilter); + it('[C260349] Should sort task by name when Name sorting is clicked', async () => { + await tasksPage.createTask({ name: 'Test1' }); + await taskDetailsPage.clickCompleteTask(); - await browser.refresh(); - await processServiceTabBarPage.clickSettingsButton(); - await browser.sleep(500); - await appSettingsToggles.enableTaskFiltersIcon(); - await processServiceTabBarPage.clickTasksButton(); + await tasksPage.createTask({ name: 'Test2' }); + await taskDetailsPage.clickCompleteTask(); - await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed(); - await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud'); - await userFiltersApi.deleteUserTaskFilter(id); - }); + await tasksPage.createTask({ name: 'Test3' }); + await tasksPage.createTask({ name: 'Test4' }); - it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => { - await taskFiltersDemoPage.myTasksFilter().checkTaskFilterHasNoIcon(); + await tasksListPage.checkContentIsDisplayed('Test4'); + await tasksListPage.checkRowIsSelected('Test4'); + await tasksListPage.checkContentIsDisplayed('Test3'); + await taskDetailsPage.checkTaskDetailsDisplayed(); - await processServiceTabBarPage.clickSettingsButton(); - await appSettingsToggles.enableTaskFiltersIcon(); - await processServiceTabBarPage.clickTasksButton(); + await tasksPage.clickSortByNameAsc(); + await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3'); + await tasksPage.clickSortByNameDesc(); + await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4'); - await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed(); - await expect(await taskFiltersDemoPage.myTasksFilter().getTaskFilterIcon()).toEqual('inbox'); - }); + await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter(); + await tasksListPage.checkContentIsDisplayed('Test1'); + await tasksListPage.checkContentIsDisplayed('Test2'); + await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2'); + + await tasksPage.clickSortByNameAsc(); + await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1'); + + await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter(); + await tasksListPage.checkContentIsDisplayed('Test3'); + await tasksListPage.checkContentIsDisplayed('Test4'); + }); + + it('[C277264] Should display task filter results when task filter is selected', async () => { + await tasksPage.createTask({ name: 'Test' }); + + await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); + await tasksListPage.checkContentIsDisplayed('Test'); + await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test'); }); }); diff --git a/e2e/process-services/tasks/task-filters-sorting.e2e.ts b/e2e/process-services/tasks/task-filters-sorting.e2e.ts index 860b135831..446240b9de 100644 --- a/e2e/process-services/tasks/task-filters-sorting.e2e.ts +++ b/e2e/process-services/tasks/task-filters-sorting.e2e.ts @@ -15,18 +15,17 @@ * limitations under the License. */ -import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions, UserModel } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { ProcessServicesPage } from './../pages/process-services.page'; -import { TasksPage } from './../pages/tasks.page'; -import { TasksListPage } from './../pages/tasks-list.page'; -import { TaskDetailsPage } from './../pages/task-details.page'; -import { TaskFiltersDemoPage } from './../pages/task-filters-demo.page'; +import { ProcessServicesPage } from '../pages/process-services.page'; +import { TasksPage } from '../pages/tasks.page'; +import { TasksListPage } from '../pages/tasks-list.page'; +import { TaskDetailsPage } from '../pages/task-details.page'; +import { TaskFiltersDemoPage } from '../pages/task-filters-demo.page'; import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api'; import { browser } from 'protractor'; describe('Task Filters Sorting', () => { - const app = browser.params.resources.Files.APP_WITH_PROCESSES; const loginPage = new LoginPage(); @@ -41,8 +40,8 @@ describe('Task Filters Sorting', () => { const usersActions = new UsersActions(apiService); const userFiltersUtil = new UserFiltersUtil(apiService); - let user; - let appId; + let user: UserModel; + let appId: number; const tasks = [ { name: 'Task 1 Completed', dueDate: '01/01/2019' }, @@ -50,7 +49,8 @@ describe('Task Filters Sorting', () => { { name: 'Task 3 Completed', dueDate: '03/01/2019' }, { name: 'Task 4', dueDate: '01/01/2019' }, { name: 'Task 5', dueDate: '02/01/2019' }, - { name: 'Task 6', dueDate: '03/01/2019' }]; + { name: 'Task 6', dueDate: '03/01/2019' } + ]; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -67,21 +67,21 @@ describe('Task Filters Sorting', () => { await processServicesPage.checkApsContainer(); await processServicesPage.goToApp(app.title); - await tasksPage.createTask({name: tasks[0].name, dueDate: tasks[0].dueDate}); + await tasksPage.createTask({ name: tasks[0].name, dueDate: tasks[0].dueDate }); await taskDetailsPage.clickCompleteTask(); - await tasksPage.createTask({name: tasks[1].name, dueDate: tasks[1].dueDate}); + await tasksPage.createTask({ name: tasks[1].name, dueDate: tasks[1].dueDate }); await taskDetailsPage.clickCompleteTask(); - await tasksPage.createTask({name: tasks[2].name, dueDate: tasks[2].dueDate}); + await tasksPage.createTask({ name: tasks[2].name, dueDate: tasks[2].dueDate }); await taskDetailsPage.clickCompleteTask(); - await tasksPage.createTask({name: tasks[3].name, dueDate: tasks[3].dueDate}); - await tasksPage.createTask({name: tasks[4].name, dueDate: tasks[4].dueDate}); - await tasksPage.createTask({name: tasks[5].name, dueDate: tasks[5].dueDate}); + await tasksPage.createTask({ name: tasks[3].name, dueDate: tasks[3].dueDate }); + await tasksPage.createTask({ name: tasks[4].name, dueDate: tasks[4].dueDate }); + await tasksPage.createTask({ name: tasks[5].name, dueDate: tasks[5].dueDate }); }); - afterAll( async () => { + afterAll(async () => { await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(user.tenantId); }); @@ -89,7 +89,7 @@ describe('Task Filters Sorting', () => { it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Newest first', + name: 'Newest first', icon: 'glyphicon-filter', filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } }); @@ -101,12 +101,12 @@ describe('Task Filters Sorting', () => { await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name); await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name); - }); + }); it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Newest last', + name: 'Newest last', icon: 'glyphicon-filter', filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' } }); @@ -123,7 +123,7 @@ describe('Task Filters Sorting', () => { it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Due first', + name: 'Due first', icon: 'glyphicon-filter', filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' } }); @@ -140,7 +140,7 @@ describe('Task Filters Sorting', () => { it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Due last', + name: 'Due last', icon: 'glyphicon-filter', filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' } }); @@ -157,7 +157,7 @@ describe('Task Filters Sorting', () => { it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Newest first Open', + name: 'Newest first Open', icon: 'glyphicon-filter', filter: { sort: 'created-desc', state: 'open', assignment: 'involved' } }); @@ -174,7 +174,7 @@ describe('Task Filters Sorting', () => { it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Newest last Open', + name: 'Newest last Open', icon: 'glyphicon-filter', filter: { sort: 'created-asc', state: 'open', assignment: 'involved' } }); @@ -191,7 +191,7 @@ describe('Task Filters Sorting', () => { it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Due first Open', + name: 'Due first Open', icon: 'glyphicon-filter', filter: { sort: 'due-desc', state: 'open', assignment: 'involved' } }); @@ -208,7 +208,7 @@ describe('Task Filters Sorting', () => { it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => { const newFilter = new UserProcessInstanceFilterRepresentation({ appId, - name : 'Due last Open', + name: 'Due last Open', icon: 'glyphicon-filter', filter: { sort: 'due-asc', state: 'open', assignment: 'involved' } }); diff --git a/e2e/process-services/tasks/task-list-pagination.e2e.ts b/e2e/process-services/tasks/task-list-pagination.e2e.ts index 10b56eb77c..2192f6c03f 100644 --- a/e2e/process-services/tasks/task-list-pagination.e2e.ts +++ b/e2e/process-services/tasks/task-list-pagination.e2e.ts @@ -25,7 +25,7 @@ import { createApiService, } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { TasksPage } from './../pages/tasks.page'; +import { TasksPage } from '../pages/tasks.page'; import CONSTANTS = require('../../util/constants'); describe('Task List Pagination', () => { @@ -42,7 +42,7 @@ describe('Task List Pagination', () => { const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; let currentPage = 1; const nrOfTasks = 20; - let totalPages; + let totalPages: number; const itemsPerPage = { five: '5', diff --git a/e2e/process-services/widgets/amount-widget.e2e.ts b/e2e/process-services/widgets/amount-widget.e2e.ts index b43ca54f50..31baf81998 100644 --- a/e2e/process-services/widgets/amount-widget.e2e.ts +++ b/e2e/process-services/widgets/amount-widget.e2e.ts @@ -15,22 +15,23 @@ * limitations under the License. */ -import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions } from '@alfresco/adf-testing'; +import { LoginPage, BrowserActions, Widget, ApplicationsUtil, ProcessUtil, createApiService, UsersActions, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import CONSTANTS = require('../../util/constants'); import { browser } from 'protractor'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Amount Widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.AMOUNT; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; const apiService = createApiService(); const applicationsService = new ApplicationsUtil(apiService); @@ -49,7 +50,7 @@ describe('Amount Widget', () => { process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); beforeEach(async () => { const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedAppId}/tasks/`; @@ -64,7 +65,7 @@ describe('Amount Widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => { await taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id); @@ -78,12 +79,12 @@ describe('Amount Widget', () => { await expect(fieldCurrency.trim()).toBe('$'); await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4); - await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5'); + await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be less than 5`); await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false); await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id); await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101); - await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100'); + await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be greater than 100`); await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false); await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id); diff --git a/e2e/process-services/widgets/attach-file-widget.e2e.ts b/e2e/process-services/widgets/attach-file-widget.e2e.ts index 53fe959f0c..558217c2b8 100644 --- a/e2e/process-services/widgets/attach-file-widget.e2e.ts +++ b/e2e/process-services/widgets/attach-file-widget.e2e.ts @@ -15,14 +15,7 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - FileBrowserUtil, - LoginPage, - UsersActions, - ViewerPage, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, FileBrowserUtil, LoginPage, UsersActions, ViewerPage, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { FileModel } from '../../models/ACS/file.model'; import { browser } from 'protractor'; @@ -33,7 +26,6 @@ import { FiltersPage } from '../pages/filters.page'; import CONSTANTS = require('../../util/constants'); describe('Attach widget - File', () => { - const app = browser.params.resources.Files.WIDGETS_SMOKE_TEST; const loginPage = new LoginPage(); @@ -49,9 +41,8 @@ describe('Attach widget - File', () => { const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); - let processUserModel; - const pdfFile = new FileModel({name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name}); - const appFields = app.form_fields; + let processUserModel: UserModel; + const pdfFile = new FileModel({ name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name }); beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -73,8 +64,8 @@ describe('Attach widget - File', () => { await newTask.selectForm(app.formName); await newTask.clickStartButton(); - await widget.attachFileWidget().attachFile(appFields.attachFile_id, pdfFile.location); - await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().attachFile(app.form_fields.attachFile_id, pdfFile.location); + await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name); }); afterAll(async () => { @@ -83,7 +74,7 @@ describe('Attach widget - File', () => { }); it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => { - await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name); await widget.attachFileWidget().checkAttachFileOptionsActiveForm(); await widget.attachFileWidget().viewAttachedFile(); @@ -91,11 +82,11 @@ describe('Attach widget - File', () => { await viewerPage.checkCloseButtonIsDisplayed(); await viewerPage.clickCloseButton(); - await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name); await widget.attachFileWidget().downloadFile(); await FileBrowserUtil.isFileDownloaded(pdfFile.name); - await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name); await widget.attachFileWidget().removeAttachedFile(); await widget.attachFileWidget().attachFileWidgetDisplayed(); }); @@ -107,9 +98,9 @@ describe('Attach widget - File', () => { await tasksListPage.checkTaskListIsLoaded(); await filtersPage.goToFilter('Completed Tasks'); await tasksListPage.checkTaskListIsLoaded(); - await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().checkFileIsAttached(app.form_fields.attachFile_id, pdfFile.name); - await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name); await widget.attachFileWidget().checkAttachFileOptionsCompletedForm(); await widget.attachFileWidget().viewAttachedFile(); @@ -117,7 +108,7 @@ describe('Attach widget - File', () => { await viewerPage.checkCloseButtonIsDisplayed(); await viewerPage.clickCloseButton(); - await widget.attachFileWidget().toggleAttachedFileMenu(appFields.attachFile_id, pdfFile.name); + await widget.attachFileWidget().toggleAttachedFileMenu(app.form_fields.attachFile_id, pdfFile.name); await widget.attachFileWidget().downloadFile(); await FileBrowserUtil.isFileDownloaded(pdfFile.name); }); diff --git a/e2e/process-services/widgets/attach-folder-widget.e2e.ts b/e2e/process-services/widgets/attach-folder-widget.e2e.ts index b0f1ec1059..21ed8d394a 100644 --- a/e2e/process-services/widgets/attach-folder-widget.e2e.ts +++ b/e2e/process-services/widgets/attach-folder-widget.e2e.ts @@ -15,31 +15,24 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Attach Folder widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -58,11 +51,10 @@ describe('Attach Folder widget', () => { process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -72,7 +64,7 @@ describe('Attach Folder widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => { await taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id); diff --git a/e2e/process-services/widgets/checkbox-widget.e2e.ts b/e2e/process-services/widgets/checkbox-widget.e2e.ts index 03fce090b3..20df6bebbc 100644 --- a/e2e/process-services/widgets/checkbox-widget.e2e.ts +++ b/e2e/process-services/widgets/checkbox-widget.e2e.ts @@ -15,29 +15,24 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Checkbox Widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.CHECKBOX; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - let processUserModel; - let appModel; - let deployedAppId; let process; + let processUserModel: UserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -56,10 +51,10 @@ describe('Checkbox Widget', () => { process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); beforeEach(async () => { - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); }); @@ -68,7 +63,7 @@ describe('Checkbox Widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C268554] Should be able to set general settings for Checkbox widget ', async () => { await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2'); diff --git a/e2e/process-services/widgets/date-time-widget.e2e.ts b/e2e/process-services/widgets/date-time-widget.e2e.ts index d6772c3e4b..fd40899a8d 100644 --- a/e2e/process-services/widgets/date-time-widget.e2e.ts +++ b/e2e/process-services/widgets/date-time-widget.e2e.ts @@ -15,18 +15,19 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, - Widget + Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Date and time widget', () => { @@ -35,16 +36,16 @@ describe('Date and time widget', () => { const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let processUserModel; - let appModel; - let deployedAppId; let process; + let processUserModel: UserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -61,8 +62,7 @@ describe('Date and time widget', () => { }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/date-widget.e2e.ts b/e2e/process-services/widgets/date-widget.e2e.ts index c0b756d313..5f9d162b14 100644 --- a/e2e/process-services/widgets/date-widget.e2e.ts +++ b/e2e/process-services/widgets/date-widget.e2e.ts @@ -15,22 +15,23 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, BrowserActions, FormPage, LoginPage, ProcessUtil, UsersActions, - Widget + Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; -import { FormDemoPage } from '.././pages/form-demo.page'; +import { FormDemoPage } from '../pages/form-demo.page'; import { customDateFormAPS1 } from '../../resources/forms/custom-date-form'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Date widget', () => { @@ -39,12 +40,12 @@ describe('Date widget', () => { const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const dateWidget = widget.dateWidget(); - let appModel; - let processUserModel; - let deployedAppId; let process; + let appModel: AppDefinitionRepresentation; + let processUserModel: UserModel; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -73,8 +74,7 @@ describe('Date widget', () => { describe('Simple App', () => { beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -113,13 +113,11 @@ describe('Date widget', () => { await formDemoPage.setConfigToEditor(formJson); await dateWidget.setDateInput('datefield', '18-7-19'); await formPage.saveForm(); - await expect(await dateWidget.getErrorMessage('datefield')) - .toBe('Can\'t be less than 19-7-19', 'Min date validation is not working'); + await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be less than 19-7-19'); await dateWidget.clearDateInput('datefield'); await dateWidget.setDateInput('datefield', '20-7-19'); await formPage.saveForm(); - await expect(await dateWidget.getErrorMessage('datefield')) - .toBe('Can\'t be greater than 19-8-19', 'Max date validation is not working'); + await expect(await dateWidget.getErrorMessage('datefield')).toBe('Can\'t be greater than 19-8-19'); await dateWidget.clearDateInput('datefield'); await dateWidget.setDateInput('datefield', '19-7-19'); await formPage.saveForm(); diff --git a/e2e/process-services/widgets/document-template-widget.e2e.ts b/e2e/process-services/widgets/document-template-widget.e2e.ts index 9c8efabf43..6d3fef31db 100644 --- a/e2e/process-services/widgets/document-template-widget.e2e.ts +++ b/e2e/process-services/widgets/document-template-widget.e2e.ts @@ -15,54 +15,46 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Document Template widget', () => { - const app = browser.params.resources.Files.FILE_FORM_ADF; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp( app.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(app.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessOfApp(appModel.name); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessOfApp(appModel.name); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -72,10 +64,9 @@ describe('Document Template widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C260406] should check that the template contains assigned file ', async () => { - await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)) - .toEqual(app.attached_file); + await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)).toEqual(app.attached_file); }); }); diff --git a/e2e/process-services/widgets/dropdown-widget.e2e.ts b/e2e/process-services/widgets/dropdown-widget.e2e.ts index 372a16dc8c..d92d227884 100644 --- a/e2e/process-services/widgets/dropdown-widget.e2e.ts +++ b/e2e/process-services/widgets/dropdown-widget.e2e.ts @@ -15,18 +15,19 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget +import { + createApiService, + ApplicationsUtil, + LoginPage, + ProcessUtil, + UsersActions, + Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Dropdown widget', () => { const app = browser.params.resources.Files.WIDGET_CHECK_APP.DROPDOWN; @@ -34,34 +35,33 @@ describe('Dropdown widget', () => { const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts index f861bba51a..30d559b820 100644 --- a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts +++ b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts @@ -15,21 +15,22 @@ * limitations under the License. */ -import { createApiService, +import { + createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, - Widget + Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; +import { ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Dynamic Table widget ', () => { - const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); @@ -40,8 +41,9 @@ describe('Dynamic Table widget ', () => { const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let processUserModel; - let deployedAppId; let process; + let processUserModel: UserModel; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; describe('with Date Time Widget App', () => { const app = browser.params.resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE; @@ -60,8 +62,7 @@ describe('Dynamic Table widget ', () => { }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -117,8 +118,7 @@ describe('Dynamic Table widget ', () => { }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkTaskListIsLoaded(); @@ -173,8 +173,7 @@ describe('Dynamic Table widget ', () => { beforeEach(async () => { await loginPage.login(processUserModel.username, processUserModel.password); - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(`${deployedAppId}`); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkTaskListIsLoaded(); @@ -189,15 +188,15 @@ describe('Dynamic Table widget ', () => { await widget.dynamicTable().setDatatableInput('name', app.CUSTOM_VALIDATOR.FIELD.NAME); await widget.dynamicTable().clickSaveButton(); - await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Id\' is required.'); + await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Id' is required.`); await widget.dynamicTable().setDatatableInput('id', app.CUSTOM_VALIDATOR.FIELD.ID); await widget.dynamicTable().clickSaveButton(); - await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Number\' is required.'); + await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Number' is required.`); await widget.dynamicTable().setDatatableInput('12', app.CUSTOM_VALIDATOR.FIELD.NUM); await widget.dynamicTable().clickSaveButton(); - await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Address\' is required.'); + await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Address' is required.`); await widget.dynamicTable().setDatatableInput('address', app.CUSTOM_VALIDATOR.FIELD.ADDRESS); await widget.dynamicTable().clickSaveButton(); diff --git a/e2e/process-services/widgets/header-widget.e2e.ts b/e2e/process-services/widgets/header-widget.e2e.ts index db153133da..6f0014a3c2 100644 --- a/e2e/process-services/widgets/header-widget.e2e.ts +++ b/e2e/process-services/widgets/header-widget.e2e.ts @@ -15,54 +15,46 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Header widget', async () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.HEADER; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -72,7 +64,7 @@ describe('Header widget', async () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C276737] Should be able to set general and visibility properties for Header widget', async () => { await taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id); diff --git a/e2e/process-services/widgets/hyperlink-widget.e2e.ts b/e2e/process-services/widgets/hyperlink-widget.e2e.ts index 285e1e9751..d354da3053 100644 --- a/e2e/process-services/widgets/hyperlink-widget.e2e.ts +++ b/e2e/process-services/widgets/hyperlink-widget.e2e.ts @@ -15,36 +15,29 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Hyperlink widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.HYPERLINK; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let processUserModel; - let deployedAppId; let process; + let appModel: AppDefinitionRepresentation; + let processUserModel: UserModel; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -61,8 +54,7 @@ describe('Hyperlink widget', () => { }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/multi-line-widget.e2e.ts b/e2e/process-services/widgets/multi-line-widget.e2e.ts index 091ee0a894..6dc962cbe5 100644 --- a/e2e/process-services/widgets/multi-line-widget.e2e.ts +++ b/e2e/process-services/widgets/multi-line-widget.e2e.ts @@ -15,18 +15,12 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Multi-line Widget', () => { const app = browser.params.resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT; @@ -34,34 +28,33 @@ describe('Multi-line Widget', () => { const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let processUserModel; - let deployedAppId; let process; + let appModel: AppDefinitionRepresentation; + let processUserModel: UserModel; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -71,7 +64,7 @@ describe('Multi-line Widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => { const label = await widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple); diff --git a/e2e/process-services/widgets/number-widget.e2e.ts b/e2e/process-services/widgets/number-widget.e2e.ts index 2c52a14abd..bb1efe7e9c 100644 --- a/e2e/process-services/widgets/number-widget.e2e.ts +++ b/e2e/process-services/widgets/number-widget.e2e.ts @@ -15,36 +15,29 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Number widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.NUMBER; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { await apiService.loginWithProfile('admin'); @@ -58,11 +51,10 @@ describe('Number widget', () => { process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); await loginPage.login(processUserModel.username, processUserModel.password); - }); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -72,7 +64,7 @@ describe('Number widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C269111] Should be able to set general properties for Number Widget', async () => { await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false); @@ -91,12 +83,12 @@ describe('Number widget', () => { await taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible); await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2); - await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3'); + await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be less than 3`); await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false); await widget.numberWidget().clearFieldValue(app.FIELD.number_visible); await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101); - await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100'); + await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be greater than 100`); await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false); await widget.numberWidget().clearFieldValue(app.FIELD.number_visible); diff --git a/e2e/process-services/widgets/people-widget.e2e.ts b/e2e/process-services/widgets/people-widget.e2e.ts index fe18cc6a00..2b8e289d9a 100644 --- a/e2e/process-services/widgets/people-widget.e2e.ts +++ b/e2e/process-services/widgets/people-widget.e2e.ts @@ -26,7 +26,6 @@ import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; describe('People widget', () => { @@ -35,7 +34,6 @@ describe('People widget', () => { const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); @@ -61,8 +59,7 @@ describe('People widget', () => { }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts index 2727f67d65..bc991c03f3 100644 --- a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts +++ b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts @@ -15,53 +15,45 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { ProcessServicesPage } from '../pages/process-services.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Radio Buttons Widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let appId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let appId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - appId = await applicationsService.getAppDefinitionId(appModel.id); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + appId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(appId); + await new ProcessServicesPage().goToAppByAppId(appId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -71,7 +63,7 @@ describe('Radio Buttons Widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C277316] Should display empty radio buttons when no preselection is configured', async () => { await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id); diff --git a/e2e/process-services/widgets/text-widget.e2e.ts b/e2e/process-services/widgets/text-widget.e2e.ts index 6e22b17c0b..8d8be66402 100644 --- a/e2e/process-services/widgets/text-widget.e2e.ts +++ b/e2e/process-services/widgets/text-widget.e2e.ts @@ -15,54 +15,46 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { TasksPage } from '../pages/tasks.page'; import { browser } from 'protractor'; import CONSTANTS = require('../../util/constants'); import { ProcessServicesPage } from '../pages/process-services.page'; -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; describe('Text widget', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.TEXT; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); - }); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); + }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); @@ -72,7 +64,7 @@ describe('Text widget', () => { await processUtil.cancelProcessInstance(process.id); await apiService.loginWithProfile('admin'); await usersActions.deleteTenant(processUserModel.tenantId); - }); + }); it('[C268157] Should be able to set general properties for Text widget', async () => { const label = await widget.textWidget().getFieldLabel(app.FIELD.simpleText); diff --git a/e2e/process-services/widgets/widget-visibility-condition.e2e.ts b/e2e/process-services/widgets/widget-visibility-condition.e2e.ts index 45e2c3da18..977d69fb55 100644 --- a/e2e/process-services/widgets/widget-visibility-condition.e2e.ts +++ b/e2e/process-services/widgets/widget-visibility-condition.e2e.ts @@ -15,18 +15,12 @@ * limitations under the License. */ -import { createApiService, - ApplicationsUtil, - LoginPage, - ProcessUtil, - UsersActions, - Widget -} from '@alfresco/adf-testing'; +import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing'; import { browser } from 'protractor'; import { TasksPage } from '../pages/tasks.page'; import CONSTANTS = require('../../util/constants'); -import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { ProcessServicesPage } from '../pages/process-services.page'; +import { AppDefinitionRepresentation, ProcessInstanceRepresentation } from '@alfresco/js-api'; const widgets = { textOneId: 'text1', @@ -51,40 +45,38 @@ const checkbox = { }; describe('Process-Services - Visibility conditions', () => { - const app = browser.params.resources.Files.WIDGET_CHECK_APP.VISIBILITY; const loginPage = new LoginPage(); const taskPage = new TasksPage(); const widget = new Widget(); - const navigationBarPage = new NavigationBarPage(); const apiService = createApiService(); const usersActions = new UsersActions(apiService); const applicationsService = new ApplicationsUtil(apiService); const processUtil = new ProcessUtil(apiService); - let appModel; - let deployedAppId; let process; - let processUserModel; + let appModel: AppDefinitionRepresentation; + let deployedAppId: number; + let process: ProcessInstanceRepresentation; + let processUserModel: UserModel; beforeAll(async () => { - await apiService.loginWithProfile('admin'); + await apiService.loginWithProfile('admin'); - processUserModel = await usersActions.createUser(); + processUserModel = await usersActions.createUser(); - await apiService.login(processUserModel.username, processUserModel.password); - appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); + await apiService.login(processUserModel.username, processUserModel.password); + appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path); - deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); + deployedAppId = await applicationsService.getAppDefinitionId(appModel.id); - process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); - await loginPage.login(processUserModel.username, processUserModel.password); + process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName); + await loginPage.login(processUserModel.username, processUserModel.password); }); beforeEach(async () => { - await navigationBarPage.clickHomeButton(); - await (new ProcessServicesPage()).goToAppByAppId(deployedAppId); + await new ProcessServicesPage().goToAppByAppId(deployedAppId); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.formFields().checkFormIsDisplayed(); }); diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index dd77c554fe..729ca318c0 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -279,7 +279,6 @@ exports.config = { await LocalStorageUtil.setStorageItem('bpmHost', browser.params.testConfig.appConfig.bpmHost); // @ts-ignore await LocalStorageUtil.setStorageItem('providers', browser.params.testConfig.appConfig.provider); - await LocalStorageUtil.setStorageItem('baseShareUrl', `${HOST}/#`); // @ts-ignore await LocalStorageUtil.setStorageItem('authType', browser.params.testConfig.appConfig.authType); diff --git a/e2e/search/components/search-sorting-picker.e2e.ts b/e2e/search/components/search-sorting-picker.e2e.ts index 5beadb5bbf..393603d659 100644 --- a/e2e/search/components/search-sorting-picker.e2e.ts +++ b/e2e/search/components/search-sorting-picker.e2e.ts @@ -104,15 +104,12 @@ describe('Search Sorting Picker', () => { }); beforeEach(async () => { + await navigationBarPage.clickHomeButton(); await searchBarPage.clickOnSearchIcon(); await searchBarPage.enterTextAndPressEnter(search); await searchResults.dataTable.waitTillContentLoaded(); }); - afterEach(async () => { - await navigationBarPage.clickHomeButton(); - }); - it(`[C277269] Should see the "sort by" option when search results are displayed in search results page`, async () => { await searchSortingPicker.checkSortingDropdownIsDisplayed(); }); diff --git a/lib/content-services/src/lib/upload/components/file-uploading-list-row.component.html b/lib/content-services/src/lib/upload/components/file-uploading-list-row.component.html index 5be4ad2644..a1cf1cb8e0 100644 --- a/lib/content-services/src/lib/upload/components/file-uploading-list-row.component.html +++ b/lib/content-services/src/lib/upload/components/file-uploading-list-row.component.html @@ -99,7 +99,7 @@ class="adf-file-uploading-row__block adf-file-uploading-row__status--error"> + [title]="file.errorCode | adfFileUploadError"> report_problem
diff --git a/lib/core/src/lib/common/services/thumbnail.service.spec.ts b/lib/core/src/lib/common/services/thumbnail.service.spec.ts index 98ab43f022..aaa893c84b 100644 --- a/lib/core/src/lib/common/services/thumbnail.service.spec.ts +++ b/lib/core/src/lib/common/services/thumbnail.service.spec.ts @@ -17,23 +17,23 @@ import { TestBed } from '@angular/core/testing'; import { ThumbnailService } from './thumbnail.service'; -import { CoreTestingModule } from '../../testing/core.testing.module'; -import { TranslateModule } from '@ngx-translate/core'; describe('ThumbnailService', () => { let service: ThumbnailService; beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ] - }); service = TestBed.inject(ThumbnailService); }); + it('should return the correct icon for a PDF document', () => { + expect(service.getMimeTypeIcon('application/pdf')).toContain('ft_ic_pdf'); + }); + + it('should return the correct icon for a DOCX document', () => { + expect(service.getMimeTypeIcon('application/msword')).toContain('ft_ic_ms_word'); + }); + it('should return the correct icon for a plain text file', () => { expect(service.getMimeTypeIcon('text/plain')).toContain('ft_ic_document'); }); diff --git a/lib/testing/src/lib/protractor/content-services/actions/upload.actions.ts b/lib/testing/src/lib/protractor/content-services/actions/upload.actions.ts index 0eddb6a6a6..3bc90f3aa8 100644 --- a/lib/testing/src/lib/protractor/content-services/actions/upload.actions.ts +++ b/lib/testing/src/lib/protractor/content-services/actions/upload.actions.ts @@ -71,7 +71,7 @@ export class UploadActions { }, {}); } - async deleteFileOrFolder(nodeId) { + async deleteFileOrFolder(nodeId: string) { const apiCall = async () => { try { return this.nodesApi.deleteNode(nodeId, { permanent: true }); @@ -83,13 +83,12 @@ export class UploadActions { return ApiUtil.waitForApi(apiCall, () => true); } - async uploadFolder(sourcePath, folder) { + async uploadFolder(sourcePath: string, folder: string): Promise { const files = fs.readdirSync(sourcePath); - let uploadedFiles; + let uploadedFiles: any[]; const promises = []; if (files && files.length > 0) { - for (const fileName of files) { const pathFile = path.join(sourcePath, fileName); promises.push(this.uploadFile(pathFile, fileName, folder)); diff --git a/lib/testing/src/lib/protractor/content-services/pages/document-list.page.ts b/lib/testing/src/lib/protractor/content-services/pages/document-list.page.ts index 7ba985e579..f0e388c245 100644 --- a/lib/testing/src/lib/protractor/content-services/pages/document-list.page.ts +++ b/lib/testing/src/lib/protractor/content-services/pages/document-list.page.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { by, ElementFinder, browser, $$, protractor } from 'protractor'; +import { ElementFinder, browser, $$, protractor } from 'protractor'; import { DataTableComponentPage } from '../../core/pages/data-table-component.page'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; @@ -34,18 +34,6 @@ export class DocumentListPage { this.tableBody = rootElement.$$('.adf-datatable-body').first(); } - async checkLockedIcon(content: string): Promise { - const row = this.dataTable.getRow('Display name', content); - const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock')); - await BrowserVisibility.waitUntilElementIsVisible(lockIcon); - } - - async checkUnlockedIcon(content: string): Promise { - const row = this.dataTable.getRow('Display name', content); - const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open')); - await BrowserVisibility.waitUntilElementIsVisible(lockIcon); - } - async waitForTableBody(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.tableBody); } @@ -58,10 +46,7 @@ export class DocumentListPage { await this.dataTable.selectRow('Display name', nodeName); } - async selectRowWithKeyboard(nodeName: string): Promise { - await this.dataTable.selectRowWithKeyboard('Display name', nodeName); - } - + /** @deprecated Use Playwright API instead */ async selectRowsWithKeyboard(...contentNames: string[]): Promise { let option: any; await browser.actions().sendKeys(protractor.Key.COMMAND).perform(); diff --git a/lib/testing/src/lib/protractor/core/pages/notification-history.page.ts b/lib/testing/src/lib/protractor/core/pages/notification-history.page.ts deleted file mode 100644 index 9a084a2cd6..0000000000 --- a/lib/testing/src/lib/protractor/core/pages/notification-history.page.ts +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * 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 { $ } from 'protractor'; -import { BrowserActions } from '../utils/browser-actions'; -import { BrowserVisibility } from '../utils/browser-visibility'; - -export class NotificationHistoryPage { - - notificationList = $('.adf-notification-history-list'); - - async clickNotificationButton(): Promise { - await BrowserActions.clickExecuteScript('#adf-notification-history-open-button'); - } - - async clickMarkAsRead(): Promise { - await BrowserActions.click($('#adf-notification-history-mark-as-read')); - } - - async checkNotificationIsPresent(text: string): Promise { - await BrowserVisibility.waitUntilElementHasText(this.notificationList, text); - } - - async checkNotificationCenterHasNewNotifications(): Promise { - const notificationListButton = $('#adf-notification-history-open-button [class*="mat-badge-active"]'); - await BrowserVisibility.waitUntilElementIsVisible(notificationListButton); - } - - async checkNotifyContains(text: string): Promise { - await this.clickNotificationButton(); - await this.checkNotificationIsPresent(text); - await this.clickMarkAsRead(); - await BrowserVisibility.waitUntilElementIsNotVisible(this.notificationList); - } -} diff --git a/lib/testing/src/lib/protractor/core/pages/public-api.ts b/lib/testing/src/lib/protractor/core/pages/public-api.ts index 4f472baa63..0d19ad1552 100644 --- a/lib/testing/src/lib/protractor/core/pages/public-api.ts +++ b/lib/testing/src/lib/protractor/core/pages/public-api.ts @@ -26,7 +26,6 @@ export { LoginPage as LoginSSOPage } from './login.page'; export * from './data-table-component.page'; export * from './pagination.page'; export * from './error.page'; -export * from './notification-history.page'; export * from './form/public-api'; export * from './material/public-api'; export * from './card-view/public-api'; diff --git a/lib/testing/src/lib/protractor/process-services-cloud/app/app-list-cloud.page.ts b/lib/testing/src/lib/protractor/process-services-cloud/app/app-list-cloud.page.ts index 91aee4eeea..2cc3d20cee 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/app/app-list-cloud.page.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/app/app-list-cloud.page.ts @@ -45,11 +45,6 @@ export class AppListCloudPage { return BrowserActions.getArrayText(this.nameOfAllApps); } - async checkAppIsNotDisplayed(applicationName: string): Promise { - const app = this.getAppNameLocatorByAppName(applicationName); - await BrowserVisibility.waitUntilElementIsNotVisible(app); - } - async checkAppIsDisplayed(applicationName: string): Promise { const app = this.getAppNameLocatorByAppName(applicationName); await BrowserVisibility.waitUntilElementIsVisible(app); diff --git a/lib/testing/src/lib/protractor/process-services/actions/applications.util.ts b/lib/testing/src/lib/protractor/process-services/actions/applications.util.ts index 379346422f..22320a8919 100644 --- a/lib/testing/src/lib/protractor/process-services/actions/applications.util.ts +++ b/lib/testing/src/lib/protractor/process-services/actions/applications.util.ts @@ -65,7 +65,7 @@ export class ApplicationsUtil { return publishApp; } - async importPublishDeployApp(appFileLocation: string, option = {}): Promise { + async importPublishDeployApp(appFileLocation: string, option = {}): Promise { try { const appCreated = await this.importApplication(appFileLocation, option); const publishApp = await this.publishDeployApp(appCreated.id); diff --git a/lib/testing/src/lib/protractor/process-services/actions/process.util.ts b/lib/testing/src/lib/protractor/process-services/actions/process.util.ts index 0a22bfc2bf..60f577a8b0 100644 --- a/lib/testing/src/lib/protractor/process-services/actions/process.util.ts +++ b/lib/testing/src/lib/protractor/process-services/actions/process.util.ts @@ -19,7 +19,10 @@ import { ApplicationsUtil } from './applications.util'; import { Logger } from '../../core/utils/logger'; import { StringUtil } from '../../../shared/utils/string.util'; import { ApiService } from '../../../shared/api/api.service'; -import { TasksApi, ProcessInstancesApi, TaskRepresentation, ProcessDefinitionsApi } from '@alfresco/js-api'; +import { + ProcessDefinitionsApi, ProcessInstanceRepresentation, ProcessInstancesApi, TaskRepresentation, TasksApi, ProcessDefinitionRepresentation, + ResultListDataRepresentationProcessInstanceRepresentation +} from '@alfresco/js-api'; export class ProcessUtil { @@ -37,27 +40,27 @@ export class ProcessUtil { this.tasksApi = new TasksApi(apiService.getInstance()); } - async startProcessByDefinitionName(appName: string, processDefinitionName: string, processName?: string): Promise { + async startProcessByDefinitionName(appName: string, processDefinitionName: string, processName?: string): Promise { try { const appDefinition = await this.applicationsUtil.getAppDefinitionByName(appName); - const processDefinition = await this.getProcessDefinitionByName(appDefinition.deploymentId, processDefinitionName); - const startProcessOptions: any = { processDefinitionId: processDefinition.id, name: processName ? processName : processDefinitionName + StringUtil.generateRandomString(5).toLowerCase() }; - - return this.processInstancesApi.startNewProcessInstance(startProcessOptions); + return this.processInstancesApi.startNewProcessInstance({ + processDefinitionId: processDefinition.id, + name: processName ? processName : processDefinitionName + StringUtil.generateRandomString(5).toLowerCase() + }); } catch (error) { Logger.error('Start Process - Service error, Response: ', JSON.parse(JSON.stringify(error))); + return null; } } - async startProcessByDefinitionNameWithFormValues(appName: string, processDefinitionName: string, values: any, processName?: string): Promise { + async startProcessByDefinitionNameWithFormValues(appName: string, processDefinitionName: string, values: any, processName?: string): Promise { try { const appDefinition = await this.applicationsUtil.getAppDefinitionByName(appName); - const processDefinition = await this.getProcessDefinitionByName(appDefinition.deploymentId, processDefinitionName); - const startProcessOptions: any = { + const startProcessOptions = { processDefinitionId: processDefinition.id, name: processName ? processName : processDefinitionName + StringUtil.generateRandomString(5).toLowerCase(), values @@ -66,17 +69,19 @@ export class ProcessUtil { return this.processInstancesApi.startNewProcessInstance(startProcessOptions); } catch (error) { Logger.error('Start Process - Service error, Response: ', JSON.parse(JSON.stringify(error))); + return null; } } - async startProcessOfApp(appName: string, processName?: string): Promise { + async startProcessOfApp(appName: string, processName?: string): Promise { try { const appDefinition = await this.applicationsUtil.getAppDefinitionByName(appName); const processDefinitionList = await this.processDefinitionsApi.getProcessDefinitions({ deploymentId: appDefinition.deploymentId }); - const startProcessOptions: any = { processDefinitionId: processDefinitionList.data[0].id, name: processName ? processName : StringUtil.generateRandomString(5).toLowerCase() }; + const startProcessOptions = { processDefinitionId: processDefinitionList.data[0].id, name: processName ? processName : StringUtil.generateRandomString(5).toLowerCase() }; return this.processInstancesApi.startNewProcessInstance(startProcessOptions); } catch (error) { Logger.error('Start Process - Service error, Response: ', JSON.parse(JSON.stringify(error))); + return null; } } @@ -88,21 +93,22 @@ export class ProcessUtil { } } - async getProcessDefinitionByName(deploymentId: string, processName: string): Promise { + async getProcessDefinitionByName(deploymentId: string, processName: string): Promise { try { const processDefinitionList = await this.processDefinitionsApi.getProcessDefinitions({ deploymentId }); - const chosenProcess = processDefinitionList.data.find( (processDefinition) => processDefinition.name === processName); - return chosenProcess; + return processDefinitionList.data.find((processDefinition) => processDefinition.name === processName); } catch (error) { Logger.error('Get ProcessDefinitions - Service error, Response: ', JSON.parse(JSON.stringify(error))); + return null; } } - async getProcessInstanceByName(processInstanceName: string, processInstanceStatus?: string, maxNumberOfResults?: number): Promise { + async getProcessInstanceByName(processInstanceName: string, processInstanceStatus?: string, maxNumberOfResults?: number): Promise { try { return await this.processInstancesApi.filterProcessInstances({filter: {name: processInstanceName, state: processInstanceStatus}, size: maxNumberOfResults}); } catch (error) { Logger.error('List process instances using a filter - Service error, Response: ', JSON.parse(JSON.stringify(error))); + return null; } } diff --git a/lib/testing/src/lib/protractor/process-services/pages/filters.page.ts b/lib/testing/src/lib/protractor/process-services/pages/filters.page.ts index f9981121bf..731588ce67 100644 --- a/lib/testing/src/lib/protractor/process-services/pages/filters.page.ts +++ b/lib/testing/src/lib/protractor/process-services/pages/filters.page.ts @@ -21,7 +21,7 @@ import { ElementFinder, $ } from 'protractor'; export class FiltersPage { - accordionMenu = $('.app-processes-menu mat-accordion'); + accordionMenu = $('.app-processes-menu'); buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div'); processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]'; @@ -32,10 +32,6 @@ export class FiltersPage { await BrowserActions.click(filterElement); } - async isFilterEnabled(filterElement: ElementFinder): Promise { - return filterElement.isEnabled(); - } - async isFilterHighlighted(filterName: string): Promise { const filterNameHighlighted = await this.getLocatorForActiveFilterByName(filterName); try { @@ -65,17 +61,4 @@ export class FiltersPage { return false; } } - - async checkFilterHasNoIcon(name: string): Promise { - const filterName = this.getLocatorForFilterByName(name); - await BrowserVisibility.waitUntilElementIsVisible(filterName); - await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon)); - } - - async getFilterIcon(name: string): Promise { - const filterName = this.getLocatorForFilterByName(name); - await BrowserVisibility.waitUntilElementIsVisible(filterName); - const icon = filterName.$(this.processIcon); - return BrowserActions.getText(icon); - } }