diff --git a/Jenkinsfile b/Jenkinsfile index c3594e6b762cfd14b3364bda7108d640b013dc61..c3b703a317c13690030c2020cada7a8935f4d8b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -617,6 +617,8 @@ String generateCypressConfig(String stage, String bezeichner, String testFolder) environment = config.env environment.put("search", elasticsearchEnv) + + environment.put("userManager", getUserManagerEnv(namespace)); writeJSON file: configName, json: config @@ -626,6 +628,23 @@ String generateCypressConfig(String stage, String bezeichner, String testFolder) return configName } +String getUserManagerEnv(namespace){ + def secret = getSecrect(namespace, 'pluto-database-admin-user-manager-database-user'); + def secretPassword = decodeString(secret.password); + return readJSON(text: """{ + "dbUrl":"mongodb+srv://user-manager-database-user:${secretPassword}@pluto-database-svc.${namespace}.svc.cluster.local/admin?ssl=false", \ + "database":"user-manager-database"}"""); +} + +def getSecrect(namespace, secretName){ + container("k8s"){ + script { + return readJSON ( text: sh (script: "kubectl get secret ${secretName} -n ${namespace} -o jsonpath={.data}", returnStdout: true)) + } + } +} + + String getKeycloakUuid(realm, userName) { def shScript = """curl -H 'Content-Type: application/json' \ -H 'Authorization: bearer ${getKeycloakAccessToken()}' \ diff --git a/goofy-client/apps/goofy-e2e/cypress.json b/goofy-client/apps/goofy-e2e/cypress.json index a96b1ba8aca296ff98b385809c9009dbf41e9e81..a68a50042b5ccddcd75a36bc189d588be4acd137 100644 --- a/goofy-client/apps/goofy-e2e/cypress.json +++ b/goofy-client/apps/goofy-e2e/cypress.json @@ -12,6 +12,10 @@ "index": "e2e-test-index", "user": "elastic", "password": "password" + }, + "userManager": { + "dbUrl": "mongodb://localhost:27018", + "database": "usermanager" } }, "fileServerFolder": ".", diff --git a/goofy-client/apps/goofy-e2e/docker-compose.yml b/goofy-client/apps/goofy-e2e/docker-compose.yml index 26654de47c4d989400b740de163fee969ef650ca..b3efc1f9f95476e8a5a2bb6552b5b54671ee0f57 100644 --- a/goofy-client/apps/goofy-e2e/docker-compose.yml +++ b/goofy-client/apps/goofy-e2e/docker-compose.yml @@ -7,6 +7,7 @@ services: - 27018:27017 environment: - MONGODB_EXTRA_FLAGS=--profile=2 + ozg-pluto: image: docker.ozg-sh.de/pluto:snapshot-latest environment: @@ -28,10 +29,12 @@ services: environment: - GRPC_CLIENT_PLUTO_ADDRESS=static://ozg-pluto:9090 - SPRING_PROFILES_ACTIVE=remotekc, e2e + - KOP_USER-MANAGER_URL=http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:9092 ports: - 8080:8080 depends_on: - ozg-pluto + - ozg-usermanager ozg-elastic: image: docker.elastic.co/elasticsearch/elasticsearch:8.3.2 @@ -52,6 +55,7 @@ services: nofile: soft: 65536 hard: 65536 + ozg-usermanager: image: docker.ozg-sh.de/user-manager:snapshot-latest environment: @@ -62,10 +66,11 @@ services: - KOP_KEYCLOAK_API_PASSWORD= - KOP_KEYCLOAK_API_REALM=sh-e2e-dev - KOP_KEYCLOAK_API_CLIENT=sh-e2e-dev-goofy + - KOP_KEYCLOAK_SYNC_CRON=5 */5 * * * ? - KEYCLOAK_URL=https://sso.dev.ozg-sh.de - KOP_USER_MANAGER_URL=http://localhost:9092 - QUARKUS_MONGODB_CONNECTION_STRING=mongodb://ozg-mongodb:27017 - - QUARKUS_MONGODB_DATABASE=test + - QUARKUS_MONGODB_DATABASE=usermanager - quarkus.log.category."io.quarkus.oidc.runtime.OidcProvider".level=TRACE - quarkus.log.category."io.quarkus.oidc.runtime.OidcProvider".min-level=TRACE ports: diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json b/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json index f9f8399bc702dbff052e2622c62f94e8984f0451..130d36c8ec21f9bc4d8d1cc8660ebcc7153a1ae9 100644 --- a/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json +++ b/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json @@ -4,6 +4,7 @@ "firstName": "Sabine", "lastName": "Sach", "fullName": "Sabine Sach", + "email": "susanne.fischer.dataport+sabine@gmail.com", "initials": "SS", "dataTestId": "Sabine_Sach", "clientRoles": ["VERWALTUNG_USER"], diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json new file mode 100644 index 0000000000000000000000000000000000000000..7457bc3c97040afdbc7ea9d249e6312f18d90a86 --- /dev/null +++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json @@ -0,0 +1,19 @@ +{ + "_id": { + "$oid": "63284e54c39b316b2ad02e2a" + }, + "createdAt": { + "$date": "2022-08-25T08:29:45.025Z" + }, + "deleted": false, + "externalId": "108ee867-7290-466d-813f-ab1dc95d3691", + "firstName": "Emil", + "fullName": "Emil Ansprechpartner", + "lastName": "Ansprechpartner", + "lastSyncTimestamp": 1663585874687, + "organisationsEinheitIds": [], + "roles": [ + "EINHEITLICHER_ANSPRECHPARTNER" + ], + "username": "emil" + } \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json new file mode 100644 index 0000000000000000000000000000000000000000..9a68d870b86f85084f5579a8691a2e1e12fd4db1 --- /dev/null +++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json @@ -0,0 +1,19 @@ +{ + "_id": { + "$oid": "63284e55c39b316b2ad02e2c" + }, + "createdAt": { + "$date": "2022-02-18T09:21:24.340Z" + }, + "deleted": false, + "externalId": "63d42f8f-303b-4560-9b11-e9211b0ae87e", + "firstName": "Peter", + "fullName": "Peter von der Post", + "lastName": "von der Post", + "lastSyncTimestamp": 1663585874687, + "organisationsEinheitIds": [], + "roles": [ + "VERWALTUNG_POSTSTELLE" + ], + "username": "peter" + } \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json new file mode 100644 index 0000000000000000000000000000000000000000..b33ffad9ef5e23545261ca83253f388d3c47ce00 --- /dev/null +++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json @@ -0,0 +1,22 @@ +{ + "_id": { + "$oid": "63284e55c39b316b2ad02e2d" + }, + "createdAt": { + "$date": "2021-12-20T11:17:56.489Z" + }, + "deleted": false, + "email": "susanne.fischer.dataport+sabine@gmail.com", + "externalId": "203002d1-c25f-4722-a9aa-a4291e0184bc", + "firstName": "Sabine", + "fullName": "Sabine Sach", + "lastName": "Sach", + "lastSyncTimestamp": 1663585874687, + "organisationsEinheitIds": [ + "12345678" + ], + "roles": [ + "VERWALTUNG_USER" + ], + "username": "sabine" + } \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts index a59c96b3a1bc386247934a96fa1e0c0f869743f2..c0fcd0535bd473b973157f8a0d997b311fcc572c 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts @@ -5,7 +5,7 @@ import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper'; import { exist, notExist } from 'apps/goofy-e2e/src/support/cypress.util'; import { loginAsEmil } from 'apps/goofy-e2e/src/support/user-util'; -describe.skip('Navigation', () => { +describe('Navigation', () => { const mainPage: MainPage = new MainPage(); const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList(); @@ -22,7 +22,7 @@ describe.skip('Navigation', () => { dropCollections(); }) - describe('FIXME(OZG-2950 UserManager) navigation item myVorgaenge', () => { + describe('navigation item myVorgaenge', () => { it('should not exists', () => { notExist(navigation.getMyVorgaengeItem()); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts index 4108854f866fd32b2f2f85b8bfb41c15622e5a37..2173435c27c08c68e83d7ef4d58916348b7bc964 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts @@ -1,11 +1,11 @@ -import { BuildInfoE2EComponent } from "apps/goofy-e2e/src/components/buildinfo/buildinfo.e2e.component"; -import { VorgangListE2EComponent } from "apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component"; -import { MainPage, waitForSpinnerToDisappear } from "apps/goofy-e2e/src/page-objects/main.po"; -import { dropCollections } from "apps/goofy-e2e/src/support/cypress-helper"; -import { exist } from "apps/goofy-e2e/src/support/cypress.util"; -import { loginAsSabine } from "apps/goofy-e2e/src/support/user-util"; +import { BuildInfoE2EComponent } from 'apps/goofy-e2e/src/components/buildinfo/buildinfo.e2e.component'; +import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component'; +import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po'; +import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper'; +import { exist } from 'apps/goofy-e2e/src/support/cypress.util'; +import { loginAsSabine } from 'apps/goofy-e2e/src/support/user-util'; -describe.skip('FIXME(OZG-2950 UserManager) Buildinfo', () => { +describe('Buildinfo', () => { const mainPage: MainPage = new MainPage(); const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList(); const buildInfo: BuildInfoE2EComponent = mainPage.getBuildInfo(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts index 3b9116cfd10a59d4955284c5b32d34fd4a01967a..6d05a982a836cc8ef13485c8b3a00902e946e8a5 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts @@ -5,7 +5,6 @@ import { KommentarHistorieItemE2EComponent, PostfachNachrichtHistorieItemE2EComp import { CommandE2E, CommandOrderE2E } from 'apps/goofy-e2e/src/model/command'; import { HistorieAttachmentE2E, HistorieHeadlineE2E, SYSTEM_USER_NAME } from 'apps/goofy-e2e/src/model/historie'; import { PostfachE2E } from 'apps/goofy-e2e/src/model/postfach-nachricht'; -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { DirectionE2E } from 'apps/goofy-e2e/src/model/vorgang-attached-item'; import { buildCommand, createCommand, initCommands } from 'apps/goofy-e2e/src/support/command-util'; import { createKommentar } from 'apps/goofy-e2e/src/support/kommentar.util'; @@ -19,7 +18,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main. import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections } from '../../../support/cypress-helper'; import { contains, exist, notExist } from '../../../support/cypress.util'; -import { createUsermanagerUsers, getUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; registerLocaleData(localeDe, 'de', localeDeExtra); @@ -35,8 +34,6 @@ describe('Historie', () => { const vorgang: VorgangE2E = createVorgang(); - const users: UsermanagerE2E[] = createUsermanagerUsers(); - const assignUserCommand: CommandE2E = { ...buildCommand(CommandOrderE2E.ASSIGN_USER, vorgang._id.$oid, vorgang._id.$oid), bodyObject: { assignedTo: getUserSabineUuid() }, @@ -139,7 +136,7 @@ describe('Historie', () => { sendPostfachMailCommand, sendPostfachNachrichtCommand, receivePostfachNachrichtCommand, createWiedervorlageCommand, editWiedervorlageCommand, wiedervorlageErledigenCommand, wiedervorlageWiedereroeffnenCommand ]); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); @@ -175,7 +172,7 @@ describe('Historie', () => { exist(vorgangDatenFormular.getHistorieContainer().getCreatedAt()); }) - describe.skip('FIXME(OZG-2950 UserManager) should show historie item for', () => { + describe('should show historie item for', () => { const userName: string = `${getUserSabine().firstName} ${getUserSabine().lastName}`; diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts index 983619161677607646fbc5b4724acd64f901757f..233b1324209a7f1a65892737c55660ccf87c5804 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts @@ -1,4 +1,3 @@ -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { KommentareInVorgangE2EComponent } from '../../../components/kommentar/kommentar-list.e2e.component'; import { UserE2E } from '../../../model/user'; import { VorgangE2E } from '../../../model/vorgang'; @@ -6,10 +5,10 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main. import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections } from '../../../support/cypress-helper'; import { contains, exist, haveText, notExist } from '../../../support/cypress.util'; -import { createUsermanagerUsers, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; -describe.skip('FIXME(OZG-2950 UserManager) Kommentar', () => { +describe('Kommentar', () => { const mainPage: MainPage = new MainPage(); const vorgangPage: VorgangPage = new VorgangPage(); @@ -18,12 +17,11 @@ describe.skip('FIXME(OZG-2950 UserManager) Kommentar', () => { const kommentarText: string = 'Test text to test the test text test'; const vorgang: VorgangE2E = createVorgang(); - const users: UsermanagerE2E[] = createUsermanagerUsers(); const userSabine: UserE2E = getUserSabine(); before(() => { initVorgang(vorgang); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts index 75ff2775972e34356de80087434cf381bc8d4a6d..bee58f155197c4b2e473ca055d281a15b85cc168 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts @@ -1,31 +1,32 @@ import { NavigationE2EComponent } from 'apps/goofy-e2e/src/components/navigation/navigation.e2e.component'; import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component'; -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; +import { UsermanagerUserE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { VorgangE2E } from 'apps/goofy-e2e/src/model/vorgang'; import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po'; import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper'; import { CypressKeyboardActions, exist, notExist } from 'apps/goofy-e2e/src/support/cypress.util'; -import { createUsermanagerUsers, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util'; import { buildVorgang, createVorgang, initSearchIndex, initVorgaenge, objectIds } from 'apps/goofy-e2e/src/support/vorgang-util'; -describe.skip('FIXME(OZG-2950 UserManager) Navigation', () => { +describe('Navigation', () => { const mainPage: MainPage = new MainPage(); const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList(); const navigation: NavigationE2EComponent = mainPage.getNavigation(); + const usermanagerUserSabine: UsermanagerUserE2E = getUserManagerUserSabine(); + const vorgang: VorgangE2E = createVorgang(); const vorgangNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[0], 'vorgangNotBeFiltered') }; - const vorgangAssigned: VorgangE2E = { ...buildVorgang(objectIds[1], 'vorgangAssigned'), assignedTo: getUserSabineUuid() }; - const vorgangAssignedNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[2], 'vorgangAssignedNotBeFiltered'), assignedTo: getUserSabineUuid() }; + const vorgangAssigned: VorgangE2E = { ...buildVorgang(objectIds[1], 'vorgangAssigned'), assignedTo: usermanagerUserSabine.externalId }; + const vorgangAssignedNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[2], 'vorgangAssignedNotBeFiltered'), assignedTo: usermanagerUserSabine.externalId }; const searchString: string = 'NotBeFiltered'; - const users: UsermanagerE2E[] = createUsermanagerUsers(); before(() => { initVorgaenge([vorgang, vorgangNotBeFiltered, vorgangAssigned, vorgangAssignedNotBeFiltered]); initSearchIndex([vorgang, vorgangNotBeFiltered, vorgangAssigned, vorgangAssignedNotBeFiltered]); - initUsermanagerUsers(users); + initUsermanagerUsers([usermanagerUserSabine, getUserManagerUserEmil(), getUserManagerUserPeter()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts index 8f222c2543014ee47ade2d67b957b6a11bba35f1..0f50e198e0a33c200029befe48d41726b5ac73b9 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts @@ -1,4 +1,3 @@ -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e'; import { VorgangListItemE2EComponent } from '../../../components/vorgang/vorgang-item.e2e.component'; import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; @@ -8,7 +7,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main. import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections } from '../../../support/cypress-helper'; import { enterWith, exist, haveText, notExist } from '../../../support/cypress.util'; -import { createUsermanagerUsers, getUserEmil, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; +import { getUserEmil, getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; describe('User Profile im ausgewählten Vorgang', () => { @@ -19,14 +18,13 @@ describe('User Profile im ausgewählten Vorgang', () => { const userProfileContainer: UserProfileE2EComponent = vorgangPage.getVorgangDetailHeader().getUserContainer(); const vorgang: VorgangE2E = createVorgang(); - const users: UsermanagerE2E[] = createUsermanagerUsers(); const userSabine: UserE2E = getUserSabine(); const userEmil: UserE2E = getUserEmil(); before(() => { initVorgang(vorgang); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); @@ -132,7 +130,7 @@ describe('User Profile im ausgewählten Vorgang', () => { exist(userProfileContainer.getSearchContainer().getRoot()); }) - describe.skip('FIXME(OZG-2950 UserManager) on valid formular', () => { + describe('on valid formular', () => { it('should hide formular', () => { userProfileContainer.getSearchContainer().getInput().clear().type(userEmil.name); @@ -150,7 +148,7 @@ describe('User Profile im ausgewählten Vorgang', () => { }) }) - describe.skip('FIXME(OZG-2950 UserManager) navigate to list', () => { + describe('navigate to list', () => { it('should show assigned icon', () => { vorgangPage.getSubnavigation().clickBackButton(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts index 744176710b4b0966beba326e265d089839de2f04..1303ec69ddecccf0228954e7ec8a5a43056bf7b9 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts @@ -1,4 +1,3 @@ -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { PostfachMailE2EComponent } from '../../../components/postfach/postfach-mail.e2e.component'; import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; import { HttpMethodE2E, MessageCodeE2E } from '../../../model/util'; @@ -8,7 +7,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main. import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections, interceptWithResponse, waitOfInterceptor } from '../../../support/cypress-helper'; import { exist, notExist } from '../../../support/cypress.util'; -import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createPostfachNachrichtReplyItem, createVorgangAttachedItem, initVorgangAttachedItem } from '../../../support/vorgang-attached-item-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; @@ -20,7 +19,6 @@ describe('Postfach nachricht user profile on backend error', () => { const postfachNachrichtenContainer: PostfachMailE2EComponent = vorgangPage.getPostfachMailcontainer(); const vorgang: VorgangE2E = createVorgang(); - const users: UsermanagerE2E[] = createUsermanagerUsers(); const postfachMailItem: PostfachMailItemE2E = { ...createPostfachNachrichtReplyItem(), @@ -34,7 +32,7 @@ describe('Postfach nachricht user profile on backend error', () => { before(() => { initVorgang(vorgang); initVorgangAttachedItem([vorgangAttachedItem]); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts index 255c2668a9746c31fd6a119f4cedd6509839bc22..d4b0889c6f890fa081e8bc0d5f3fe5cfcc1da290 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts @@ -1,4 +1,3 @@ -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { UserProfileIconE2EComponent } from '../../../components/user-profile/user-profile-icon.component.e2e'; import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e'; import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; @@ -10,7 +9,7 @@ import { hasTooltip } from '../../../support/angular.util'; import { dropCollections, interceptWithResponse, waitOfInterceptor } from '../../../support/cypress-helper'; import { exist } from '../../../support/cypress.util'; import { MessagesE2E } from '../../../support/messages'; -import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { createVorgang, initVorgang } from '../../../support/vorgang-util'; describe('User profile assigned to vorgang', () => { @@ -21,11 +20,10 @@ describe('User profile assigned to vorgang', () => { const userProfileContainer: UserProfileE2EComponent = vorgangPage.getVorgangDetailHeader().getUserContainer(); const vorgang: VorgangE2E = { ...createVorgang(), assignedTo: '6287e7507433b51bfc87cfe9' }; - const users: UsermanagerE2E[] = createUsermanagerUsers(); before(() => { initVorgang(vorgang); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts index 884b839d2784ab57fa29a9910368fb599a7a01f9..c222078849c0007a3f42110da4dac8a7451a4df6 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts @@ -1,27 +1,25 @@ import { UserSettingsE2EComponent } from 'apps/goofy-e2e/src/components/user-settings/user-settings.component.e2e'; import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component'; -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { VorgangE2E } from 'apps/goofy-e2e/src/model/vorgang'; import { HeaderE2EComponent } from 'apps/goofy-e2e/src/page-objects/header.po'; import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po'; import { isChecked, isNotChecked } from 'apps/goofy-e2e/src/support/angular.util'; import { dropCollections, reload } from 'apps/goofy-e2e/src/support/cypress-helper'; import { exist } from 'apps/goofy-e2e/src/support/cypress.util'; -import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util'; import { createVorgang, initVorgang } from 'apps/goofy-e2e/src/support/vorgang-util'; -describe.skip('FIXME(OZG-2950 UserManager) User Settings', () => { +describe('User Settings', () => { const mainPage: MainPage = new MainPage(); const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList(); const header: HeaderE2EComponent = mainPage.getHeader(); const userSettings: UserSettingsE2EComponent = header.getUserSettings(); const vorgang: VorgangE2E = createVorgang(); - const users: UsermanagerE2E[] = createUsermanagerUsers(); before(() => { initVorgang(vorgang); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts index 70b7cc582350f587f4d28c254e07c402761c8c51..62e822e055ab25e093c5665d1ec533ff31494389 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts @@ -5,13 +5,12 @@ import { VorgangFormularButtonsE2EComponent } from 'apps/goofy-e2e/src/component import { SnackBarE2EComponent } from '../../../components/ui/snackbar.e2e.component'; import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e'; import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component'; -import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager'; import { VorgangE2E, VorgangMessagesE2E, VorgangStatusE2E, vorgangStatusLabelE2E } from '../../../model/vorgang'; import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po'; import { VorgangPage } from '../../../page-objects/vorgang.po'; import { dropCollections } from '../../../support/cypress-helper'; import { contains, exist, haveText, notExist } from '../../../support/cypress.util'; -import { getUserSabineUuid, loginAsSabine, createUsermanagerUsers, initUsermanagerUsers } from '../../../support/user-util'; +import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util'; import { buildVorgang, createVorgang, initVorgaenge, objectIds } from '../../../support/vorgang-util'; registerLocaleData(localeDe, 'de', localeDeExtra); @@ -27,12 +26,10 @@ describe('Vorgang Zurueckstellen', () => { const vorgangZurueckstellen: VorgangE2E = { ...createVorgang(), name: 'DoBescheiden', status: VorgangStatusE2E.IN_BEARBEITUNG, assignedTo: getUserSabineUuid() }; const vorgangZurueckstellenRevoke: VorgangE2E = { ...buildVorgang(objectIds[0], 'DoRevokeBescheiden'), status: VorgangStatusE2E.IN_BEARBEITUNG }; - - const users: UsermanagerE2E[] = createUsermanagerUsers(); before(() => { initVorgaenge([vorgangZurueckstellen, vorgangZurueckstellenRevoke]); - initUsermanagerUsers(users); + initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]); loginAsSabine(); diff --git a/goofy-client/apps/goofy-e2e/src/model/usermanager.ts b/goofy-client/apps/goofy-e2e/src/model/usermanager.ts index 0b2f0922fa968e878b1000df4d4463d641f235f4..85eb5fb05825448bcc08ddf1751b0a6eb5ba74e9 100644 --- a/goofy-client/apps/goofy-e2e/src/model/usermanager.ts +++ b/goofy-client/apps/goofy-e2e/src/model/usermanager.ts @@ -1,6 +1,6 @@ import { DateE2E, ObjectIdE2E } from './util'; -export interface UsermanagerE2E { +export interface UsermanagerUserE2E { _id: ObjectIdE2E; createdAt: DateE2E; deleted: boolean; diff --git a/goofy-client/apps/goofy-e2e/src/plugins/index.js b/goofy-client/apps/goofy-e2e/src/plugins/index.js index abe59cd49016b2139f8b77361cd00e82566cfc1a..232ec66bc71746d07c117e46debd59c555aa59ad 100644 --- a/goofy-client/apps/goofy-e2e/src/plugins/index.js +++ b/goofy-client/apps/goofy-e2e/src/plugins/index.js @@ -49,7 +49,7 @@ module.exports = (on, config) => { }, initUsermanagerData({collection, data}) { console.log('initUsermanagerData'); - insertIntoDatabase(config, collection, parseUserData(data)); + insertIntoUserManagerDatabase(config, collection, parseUserData(data)); return 0; }, dropCollections(collections) { @@ -216,12 +216,16 @@ function createNumberLong(numberValue){ function insertIntoDatabase(config, collection, data) { MongoClient.connect(buildDatabaseUrl(config), (error, connection) => { + console.log('connect to database...') if (!error) { + console.log('success'); var db = connection.db(config.env.database); db.collection(collection).drop(() => { db.createCollection(collection, (error) => handleCreateCollection(db, connection, collection, data, error)); }); + } else { + console.log('fail', error); } }); } @@ -267,4 +271,24 @@ function dropCollectionsFromDatabase(config, collections) { function buildDatabaseUrl(config) { return config.env.dbUrl; +} + +function insertIntoUserManagerDatabase(config, collection, data){ + MongoClient.connect(buildUsermanagerDatabaseUrl(config), (error, connection) => { + console.log('connect to database...') + if (!error) { + console.log('success'); + var db = connection.db(config.env.userManager.database); + + db.collection(collection).drop(() => { + db.createCollection(collection, (error) => handleCreateCollection(db, connection, collection, data, error)); + }); + } else { + console.log('fail', error); + } + }); +} + +function buildUsermanagerDatabaseUrl(config){ + return config.env.userManager.dbUrl; } \ No newline at end of file diff --git a/goofy-client/apps/goofy-e2e/src/support/commands.ts b/goofy-client/apps/goofy-e2e/src/support/commands.ts index 70d4bd40fa5dccc33f01e1ce10d8bb34d93646ed..08597bf6ad6a115ead5a2bea2b5098286072dc3f 100644 --- a/goofy-client/apps/goofy-e2e/src/support/commands.ts +++ b/goofy-client/apps/goofy-e2e/src/support/commands.ts @@ -116,7 +116,8 @@ function buildSearchIndexBody(vorgang) { 'antragstellerVorname': vorgang.eingangs[0].antragsteller.vorname, 'status': vorgang.status, 'organisationseinheitenId': vorgang.eingangs[0].zustaendigeStelle.organisationseinheitenId, - 'aktenzeichen': vorgang.aktenzeichen + 'aktenzeichen': vorgang.aktenzeichen, + 'assignedTo': vorgang.assignedTo }; } diff --git a/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts b/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts index fd650201d8293ce334e364af2534b1a76ed08343..91b16ab54160f3518505c814c09cd44ebdf7ea50 100644 --- a/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts +++ b/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts @@ -1,7 +1,7 @@ import { Interception, RouteHandler, RouteMatcher } from 'cypress/types/net-stubbing'; import { GridFsChunkE2E, GridFsFileDataE2E, GridFsFileE2E } from '../model/binary-file'; import { CommandE2E } from '../model/command'; -import { UsermanagerE2E } from '../model/usermanager'; +import { UsermanagerUserE2E } from '../model/usermanager'; import { VorgangE2E } from '../model/vorgang'; import { VorgangAttachedItemE2E } from '../model/vorgang-attached-item'; @@ -75,7 +75,7 @@ export function initSearchIndexData(vorgaenge: VorgangE2E[]): void { }) } -export function initUsermanagerData(data: UsermanagerE2E[]): void { +export function initUsermanagerData(data: UsermanagerUserE2E[]): void { cy.task(CypressTasks.INIT_USERMANAGER_DATA, { collection: MongoCollections.USER, data }); } diff --git a/goofy-client/apps/goofy-e2e/src/support/user-util.ts b/goofy-client/apps/goofy-e2e/src/support/user-util.ts index dabccc741fc62b3102a4ea38657639398e26b8dc..61eaf2668f42d4354da5320f92edad27e6341700 100644 --- a/goofy-client/apps/goofy-e2e/src/support/user-util.ts +++ b/goofy-client/apps/goofy-e2e/src/support/user-util.ts @@ -1,16 +1,15 @@ import { UserE2E } from '../model/user'; -import { UsermanagerE2E } from '../model/usermanager'; +import { UsermanagerUserE2E } from '../model/usermanager'; import { getCypressEnv, initUsermanagerData, login } from './cypress-helper'; const sabineFixture: UserE2E = require('../fixtures/user/user_sabine.json'); const emilFixture: UserE2E = require('../fixtures/user/user_emil.json'); -const usersFixture: UsermanagerE2E[] = require('../fixtures/usermanager/users.json'); -export function createUsermanagerUsers(): UsermanagerE2E[] { - return usersFixture; -} +const userManagerSabineFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_sabine.json'); +const userManagerPeterFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_peter.json'); +const userManagerEmilFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_emil.json'); -export function initUsermanagerUsers(users: UsermanagerE2E[]) { +export function initUsermanagerUsers(users: UsermanagerUserE2E[]) { initUsermanagerData(users); } @@ -22,10 +21,28 @@ export function getUserSabine(): UserE2E { return sabineFixture; } +export function getUserManagerUserSabine(): UsermanagerUserE2E { + var user: UsermanagerUserE2E = userManagerSabineFixture; + user.externalId = getUserSabineUuid(); + return user; +} + +export function getUserManagerUserPeter(): UsermanagerUserE2E { + return userManagerPeterFixture; +} + +export function getUserManagerUserEmil(): UsermanagerUserE2E { + return userManagerEmilFixture; +} + export function getUserSabineUuid(): string { return getCypressEnv('sabineUuid'); } +export function getUserSabineInternalId(): string { + return '63284e55c39b316b2ad02e2d'; +} + enum DatabaseUser { EMIL = 'user/user_emil.json', KFINDER = 'user/user_kfinder.json', diff --git a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh index c50c2badaafd624f187d20e43bbef3a8d39c82eb..cb35b1ea66542ef9e83406a11383b95847581ce6 100755 --- a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh +++ b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh @@ -11,7 +11,11 @@ fi echo "Using docker-compose -f ${SCRIPT_DIR}/docker-compose.yml ..." echo -docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-elastic +if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; +then + DOCKER_GATEWAY_HOST=172.17.0.1 +fi +docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-usermanager ozg-elastic echo while [[ $(curl -sw '%{http_code}' "http://localhost:9200" | grep -c 200) != 1 ]] @@ -22,12 +26,12 @@ done echo echo "Starting Pluto to init search index..." -SPRING_PROFILE=dev,e2e,initSearchIndex docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up ozg-pluto +SPRING_PROFILE=dev,e2e,initSearchIndex docker compose -f ${SCRIPT_DIR}/docker-compose.yml up ozg-pluto echo echo "Starting Pluto and Goofy for normal operations..." -SPRING_PROFILE=dev,e2e docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-pluto ozg-goofy ozg-usermanager +SPRING_PROFILE=dev,e2e docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-pluto ozg-goofy ozg-usermanager echo echo "Checking Docker Log for \"Started\" lines..." -docker-compose -f ${SCRIPT_DIR}/docker-compose.yml logs -f | egrep "(Starting|Started)" +docker compose -f ${SCRIPT_DIR}/docker-compose.yml logs -f | egrep "(Starting|Started)"