Skip to content
Snippets Groups Projects
Commit cc6caced authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' into remove-todo-use-new-statistic-dsl

parents 1dd6222f 66f970cf
Branches
Tags
No related merge requests found
Showing
with 336 additions and 1365 deletions
pipeline {
agent {
node {
label 'jenkins-build-agent-nodejs-16'
label 'jenkins-build-agent-nodejs-18'
}
}
......@@ -50,6 +50,7 @@ pipeline {
FAILED_STAGE=env.STAGE_NAME
sh 'npm --version'
sh 'node --version'
dir('goofy-client') {
sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc'
sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc'
......
node_modules
......@@ -7,7 +7,7 @@
"project": "./tsconfig.*?.json"
},
"ignorePatterns": ["**/*"],
"plugins": ["@typescript-eslint", "@nrwl/nx"],
"plugins": ["@typescript-eslint", "@nx"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
......@@ -19,7 +19,7 @@
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
......
......@@ -48,3 +48,4 @@ testem.log
Thumbs.db
.angular
.nx
16.18.1
18.18.2
tmp
/test
/build
node_modules
/package.json
/pnpm-lock.yaml
packages/workspace/src/generators/**/files/**/*.json
/.nx/cache
\ No newline at end of file
This diff is collapsed.
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
......@@ -5,7 +5,7 @@ def SKIP_RUN = false
pipeline {
agent {
node {
label 'jenkins-build-agent-nodejs-16'
label 'jenkins-build-agent-nodejs-18'
}
}
......
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
//Cypress config is generated by JenkinsFile
......@@ -11,6 +11,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
//Cypress config is generated by JenkinsFile
......@@ -11,6 +11,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
const cypressConfig = require('./cypress.config.json');
......@@ -10,6 +10,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
{
"name": "goofy-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/goofy-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/goofy-e2e/cypress.config.ts",
"tsConfig": "apps/goofy-e2e/tsconfig.e2e.json",
"devServerTarget": "goofy:serve",
"testingType": "e2e"
},
"configurations": {
"production": {
"devServerTarget": "goofy:serve:production"
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"apps/goofy-e2e/**/*.{js,ts}",
"apps/goofy-e2e/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
"implicitDependencies": ["goofy"]
}
......@@ -27,11 +27,13 @@ import { UserProfileE2EComponent } from '../user-profile/user-profile.component.
export class PostfachMailE2EComponent {
private readonly locatorCreateMailButtonWithText: string = 'create-mail-button-with-text';
private readonly locatorCreateMailButtonWithoutText: string = 'create-mail-button-without-text';
private readonly locatorList: string = 'postfach-mail-list';
private readonly locatorNoPostfachText: string = 'no-postfach-text';
private readonly locatorAttachments: string = 'postfach-nachricht-attachments-container';
private readonly createMailButtonWithText: string = 'create-mail-button-with-text';
private readonly createMailButtonWithoutText: string = 'create-mail-button-without-text';
private readonly list: string = 'postfach-mail-list';
private readonly noPostfachText: string = 'no-postfach-text';
private readonly attachments: string = 'postfach-nachricht-attachments-container';
private readonly downloadButtonWithIcon: string = 'postfach-pdf-export-button';
private readonly downloadButtonWithLabel: string = 'postfach-pdf-export-label-button';
private readonly locatorRoot: string = 'postfach-nachrichten-container-in-vorgang';
......@@ -40,19 +42,19 @@ export class PostfachMailE2EComponent {
}
public getCreateButtonWithText() {
return cy.getTestElement(this.locatorCreateMailButtonWithText);
return cy.getTestElement(this.createMailButtonWithText);
}
public getCreateButtonWithoutText() {
return cy.getTestElement(this.locatorCreateMailButtonWithoutText);
return cy.getTestElement(this.createMailButtonWithoutText);
}
public getList() {
return cy.getTestElement(this.locatorList);
return cy.getTestElement(this.list);
}
public getNoPostfachText() {
return cy.getTestElement(this.locatorNoPostfachText);
return cy.getTestElement(this.noPostfachText);
}
public getListItem(subject: string): PostfachMailListItem {
......@@ -60,7 +62,15 @@ export class PostfachMailE2EComponent {
}
public getAttachments() {
return cy.getTestElement(this.locatorAttachments);
return cy.getTestElement(this.attachments);
}
public getDownloadButtonWithIcon() {
return cy.getTestElement(this.downloadButtonWithIcon);
}
public getDownloadButtonWithLabel() {
return cy.getTestElement(this.downloadButtonWithLabel);
}
}
......
......@@ -27,21 +27,33 @@ import { HttpMethodE2E } from '../../../model/util';
import { VorgangE2E } from '../../../model/vorgang';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { VorgangPage } from '../../../page-objects/vorgang.po';
import { dropCollections, interceptWithResponse } from '../../../support/cypress-helper';
import { dropCollections, countDownloadFiles, deleteDownloadFolder, interceptWithResponse } from '../../../support/cypress-helper';
import { exist, notExist } from '../../../support/cypress.util';
import { LinkRelE2E } from '../../../support/linkrels';
import { removeLinkFromResource } from '../../../support/tech.util';
import { loginAsSabine } from '../../../support/user-util';
import { createVorgang, initVorgang } from '../../../support/vorgang-util';
import { buildVorgang, createVorgang, initVorgaenge, objectIds } from '../../../support/vorgang-util';
import { PostfachMailItemE2E, VorgangAttachedItemE2E } from '../../../model/vorgang-attached-item';
import { createPostfachNachrichtAttachedItem, createPostfachNachrichtReplyItem, initVorgangAttachedItem } from 'apps/goofy-e2e/src/support/vorgang-attached-item-util';
import { PostfachMailE2EComponent} from 'apps/goofy-e2e/src/components/postfach/postfach-mail.e2e.component';
import { PostfachMailPage } from 'apps/goofy-e2e/src/page-objects/postfach-mail.component.po';
describe('Postfach Nachrichten', () => {
const vorgangList: VorgangListE2EComponent = new MainPage().getVorgangList();
const vorgangPage: VorgangPage = new VorgangPage();
const postfachMailContainer: PostfachMailE2EComponent = vorgangPage.getPostfachMailcontainer();
const postfachMailPage: PostfachMailPage = new PostfachMailPage();
const vorgang: VorgangE2E = createVorgang();
const vorgangWithReply: VorgangE2E = { ...buildVorgang(objectIds[0], 'VorgangWithReply') };
const postfachMailReply: PostfachMailItemE2E = createPostfachNachrichtReplyItem();
const postfachNachrichtAttachedItem: VorgangAttachedItemE2E = { ...createPostfachNachrichtAttachedItem(objectIds[1], objectIds[0]), item: postfachMailReply };
before(() => {
initVorgang(vorgang);
initVorgaenge([vorgang, vorgangWithReply]);
initVorgangAttachedItem([postfachNachrichtAttachedItem]);
loginAsSabine();
......@@ -53,7 +65,7 @@ describe('Postfach Nachrichten', () => {
dropCollections();
})
describe('navigate to vorganDetail', () => {
describe('navigate to vorgangDetail', () => {
beforeEach(() => {
interceptWithResponse(HttpMethodE2E.GET, '*/vorgangs/*', (req) => modifyResponse(req));
......@@ -74,4 +86,53 @@ describe('Postfach Nachrichten', () => {
notExist(vorgangPage.getPostfachMailcontainer().getRoot());
})
})
describe('download nachrichten as pdf', () => {
describe('by download button on vorgang main page', () => {
it('should be visible as icon button', () => {
vorgangPage.getSubnavigation().getBackButton().click();
vorgangList.getListItem(vorgangWithReply.name).getRoot().click();
waitForSpinnerToDisappear();
exist(postfachMailContainer.getDownloadButtonWithLabel());
})
it('should have 1 file in download folder after click on download', () => {
postfachMailContainer.getDownloadButtonWithLabel().click();
waitForSpinnerToDisappear();
countDownloadFiles().then((count) => {
expect(count).to.eq(1);
deleteDownloadFolder();
});
})
})
describe('by download button on nachrichten details page', () => {
it ('should show an overview of all nachrichten after clicking on nachricht', () => {
postfachMailContainer.getList().click();
waitForSpinnerToDisappear();
exist(postfachMailPage.getRoot());
})
it ('should exist a pdf download button', () => {
exist(postfachMailPage.getDownloadButton());
})
it('should have 1 file in download folder after click on download', () => {
postfachMailPage.getDownloadButton().click();
waitForSpinnerToDisappear();
countDownloadFiles().then((count) => {
expect(count).to.eq(1);
deleteDownloadFolder();
});
})
})
})
})
\ No newline at end of file
......@@ -27,13 +27,14 @@ import { PostfachMailListItem } from '../components/postfach/postfach-mail.e2e.c
export class PostfachMailPage {
private readonly locatorBreadcrump: string = 'postfach-breadcrump';
private readonly locatorRoot: string = 'postfach-mail-list';
private readonly breadcrump: string = 'postfach-breadcrump';
private readonly root: string = 'postfach-mail-list';
private readonly downloadButton: string = 'postfach-pdf-export-button';
private readonly subnavigation: PostfachMailSubnavigation = new PostfachMailSubnavigation();
getRoot() {
return cy.getTestElement(this.locatorRoot);
return cy.getTestElement(this.root);
}
getSubnavigation(): PostfachMailSubnavigation {
......@@ -41,10 +42,14 @@ export class PostfachMailPage {
}
getBreadcrump() {
return cy.getTestElement(this.locatorBreadcrump);
return cy.getTestElement(this.breadcrump);
}
getListItem(subject: string): PostfachMailListItem {
return new PostfachMailListItem(subject);
}
getDownloadButton() {
return cy.getTestElement(this.downloadButton);
}
}
\ No newline at end of file
import { rmdir } from 'fs';
import { Long, MongoClient, ObjectId } from 'mongodb';
const fs = require('fs');
const Binary = require('mongodb').Binary;
......
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
......@@ -28,12 +28,7 @@ export default {
displayName: 'goofy',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/goofy',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
......@@ -41,7 +36,13 @@ export default {
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
{
"name": "goofy",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"sourceRoot": "apps/goofy/src",
"prefix": "goofy-client",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": ["file-saver"],
"outputPath": "dist/apps/goofy",
"index": "apps/goofy/src/index.html",
"main": "apps/goofy/src/main.ts",
"polyfills": "apps/goofy/src/polyfills.ts",
"tsConfig": "apps/goofy/tsconfig.app.json",
"assets": [
"apps/goofy/src/assets",
"apps/goofy/src/silent-refresh.html",
{
"input": "apps/goofy/src/favicon",
"glob": "**/*",
"output": ""
},
{
"input": "libs/ui/src/lib/assets",
"glob": "**/*",
"output": "assets/icons"
}
],
"styles": ["apps/goofy/src/styles/main.scss"],
"scripts": [],
"stylePreprocessorOptions": {
"includePaths": [
"apps/goofy/src/styles/abstracts",
"apps/goofy/src/styles/material",
"node_modules/@angular",
"node_modules/include-media",
"node_modules/typeface-roboto"
]
},
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/goofy/src/environments/environment.ts",
"with": "apps/goofy/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "goofy:build",
"proxyConfig": "proxy.conf.mjs"
},
"configurations": {
"production": {
"browserTarget": "goofy:build:production"
}
}
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "goofy:build"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"apps/goofy/src/**/*.ts",
"apps/goofy/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"tsConfig": "apps/goofy/tsconfig.spec.json",
"jestConfig": "apps/goofy/jest.config.ts",
"passWithNoTests": true
},
"outputs": ["{workspaceRoot}/coverage/apps/goofy"]
}
},
"tags": []
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment