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

Merge pull request 'OZG-5243-E2E-bescheid-automatisch-erstellen' (#677) from...

Merge pull request 'OZG-5243-E2E-bescheid-automatisch-erstellen' (#677) from OZG-5243-E2E-bescheid-automatisch-erstellen into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/677
parents dfcc4591 96c82ec4
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ export class VorgangBescheidWizardE2EComponent {
'bescheiderstellung-abbrechen-entwurf-speichern';
private readonly uploadBescheidFileButton: string = '-single-file-upload-button';
private readonly uploadAttachmentButton: string = 'Anhang_hochladen-file-upload-button';
private readonly uploadAutomaticBescheid: string = 'create-bescheid-document-button';
private readonly mailTextArea: string = 'Text-textarea-editor';
private readonly saveBescheid: string = 'save-button';
private readonly sendBescheid: string = 'send-button';
......@@ -60,6 +61,8 @@ export class VorgangBescheidWizardE2EComponent {
private readonly fileBescheidValid: string = 'Bescheid_validpdf-file-item';
private readonly fileAnhangValid: string = 'Anhang_validpdf-file-item';
private readonly fileAutomaticBescheid: string =
'KFAS_LIVE_KI_10_Haltverbot_befristetpdf-file-item';
private readonly bescheidDocument: string = 'bescheid-document';
private readonly attachmentDocument: string = 'bescheid-attachments';
......@@ -166,6 +169,10 @@ export class VorgangBescheidWizardE2EComponent {
return cy.getTestElement(this.locatorRoot).find(`[data-test-id=${this.fileAnhangValid}]`);
}
public getAutomaticBescheidFileInWizard() {
return cy.getTestElement(this.locatorRoot).find(`[data-test-id=${this.fileAutomaticBescheid}]`);
}
public getDeleteButtonOfElement(element: string): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(element).find('[title="Anhang löschen"]');
}
......@@ -198,8 +205,8 @@ export class VorgangBescheidWizardE2EComponent {
return cy.get(this.sendenSpinner);
}
public getMailTextArea(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.get(this.mailTextArea);
public getMailText(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy.getTestElement(this.nachrichtText);
}
public getSaveButton(): Cypress.Chainable<JQuery<HTMLElement>> {
......@@ -258,6 +265,10 @@ export class VorgangBescheidWizardE2EComponent {
this.getRoot().should('not.exist');
}
public getUploadAutomaticBescheidButton() {
return cy.getTestElement(this.uploadAutomaticBescheid);
}
public uploadBescheid(fileName: string): void {
uploadFile(this.getUploadBescheidButton(), fileName);
}
......
import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
import localeDeExtra from '@angular/common/locales/extra/de';
import { VorgangBescheidWizardE2EComponent } from 'apps/alfa-e2e/src/components/vorgang/vorgang-bescheid-wizard.e2e.component';
import { VorgangFormularButtonsE2EComponent } from 'apps/alfa-e2e/src/components/vorgang/vorgang-formular-buttons.e2e.components';
import { VorgangSubnavigationE2EComponent } from 'apps/alfa-e2e/src/components/vorgang/vorgang-subnavigation';
import { SmockerMocks } from 'apps/alfa-e2e/src/model/smocker';
import {
EingangE2E,
EingangHeaderE2E,
VorgangE2E,
VorgangStatusE2E,
} from 'apps/alfa-e2e/src/model/vorgang';
import 'cypress-real-events/support';
import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
import { VorgangPage } from '../../../page-objects/vorgang.po';
import { addSmockerMock, dropCollections } from '../../../support/cypress-helper';
import { exist, haveText, notExist } from '../../../support/cypress.util';
import { initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
import {
buildVorgang,
createVorgang,
initVorgaenge,
objectIds,
} from '../../../support/vorgang-util';
registerLocaleData(localeDe, 'de', localeDeExtra);
describe('Upload automatic Bescheid', () => {
const mainPage: MainPage = new MainPage();
const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
const vorgangPage: VorgangPage = new VorgangPage();
const bescheidWizard: VorgangBescheidWizardE2EComponent = vorgangPage.getBescheidWizard();
const formIdP: string = 'KFAS_STAGE_KI_10_Haltverbot_LANDESHACKATHON';
const formEngineName: string = 'FormSolutions';
const eingangHeader: EingangHeaderE2E = { ...createVorgang().eingangs[0].header };
const eingangP: EingangE2E = {
...createVorgang().eingangs[0],
header: { ...eingangHeader, formId: formIdP, formEngineName },
};
const bescheidAutomatik: VorgangE2E = {
...createVorgang(),
status: VorgangStatusE2E.IN_BEARBEITUNG,
name: 'automatischerBescheid',
eingangs: [eingangP],
};
const standardVorgang: VorgangE2E = {
...buildVorgang(objectIds[1], 'Standard Vorgang'),
status: VorgangStatusE2E.IN_BEARBEITUNG,
};
const vorgangFormularButtons: VorgangFormularButtonsE2EComponent =
vorgangPage.getFormularButtons();
const vorgangSubnavigation: VorgangSubnavigationE2EComponent = vorgangPage.getSubnavigation();
before(() => {
initVorgaenge([bescheidAutomatik, standardVorgang]);
initUsermanagerUsers();
addSmockerMock(SmockerMocks.SMARTDOCUMENT_MOCK);
loginAsSabine();
waitForSpinnerToDisappear();
exist(vorgangList.getRoot());
});
after(() => {
dropCollections();
});
describe('Upload automatic Bescheid document', () => {
it('should show automatic Bescheid button', () => {
vorgangList.getListItem(bescheidAutomatik.name).getRoot().click();
waitForSpinnerToDisappear();
vorgangFormularButtons.getBescheidenButton().click();
bescheidWizard.getWeiterButton().click();
exist(bescheidWizard.getUploadAutomaticBescheidButton());
});
it('should upload automatic Bescheid file', () => {
waitForSpinnerToDisappear();
bescheidWizard.getUploadAutomaticBescheidButton().click();
exist(bescheidWizard.getBescheidUploadSpinner());
notExist(bescheidWizard.getBescheidUploadSpinner());
exist(bescheidWizard.getAutomaticBescheidFileInWizard());
});
it('should show automatic header and text in step 3', () => {
bescheidWizard.getWeiterButton().click();
waitForSpinnerToDisappear();
haveText(bescheidWizard.getMailText(), '');
});
});
describe('Do not show automatic upload button on other Vorgang', () => {
it('should not show button on Vorgang with different formID', () => {
bescheidWizard.getCloseButton().click();
bescheidWizard.getCloseVerwerfenButton().click();
vorgangSubnavigation.getBackButton().click();
vorgangList.getListItem(standardVorgang.name).getRoot().click();
waitForSpinnerToDisappear();
vorgangFormularButtons.getBescheidenButton().click();
bescheidWizard.getWeiterButton().click();
notExist(bescheidWizard.getUploadAutomaticBescheidButton());
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment