From 9531ea2b2258fb13d062d02bfad157c42edf0064 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Mon, 8 Nov 2021 14:25:03 +0100 Subject: [PATCH] stabilize e2e test --- .../interceptor-unauthorized.e2e-spec.ts | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts index 9961363dc5..a6efe14173 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts @@ -31,16 +31,11 @@ describe('Interceptor unauthorized', () => { const BASE_PATH: string = '*/vorgangs/'; const statusCode: number = 401; - const interceptorResponseUnauthorized: string = 'getVorgangWithEingang'; - const interceptorResponseOk: string = 'getVorgangWithEingang'; - - beforeEach(() => { - const url: string = BASE_PATH + vorgang._id.$oid; - - interceptWithResponse('GET', url, { statusCode }).as(interceptorResponseUnauthorized); - }) + const interceptorResponseUnauthorized: string = 'getVorgangWithEingangUnauthorized'; it('should reload page', () => { + interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode }).as(interceptorResponseUnauthorized); + vorgangList.getListItem(vorgang.name).getRoot().click({ force: true }); waitOfInterceptor(interceptorResponseUnauthorized).then((interception) => { @@ -48,15 +43,18 @@ describe('Interceptor unauthorized', () => { exist(vorgangPage.getSpinner()); vorgangPage.waitForSpinnerToDisappear(); + }) + }) - interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode: 200, body: vorgang }).as(interceptorResponseOk); + it('should show vorgang detail on successfully reload ', () => { + exist(vorgangPage.getSpinner()); - waitOfInterceptor(interceptorResponseOk).then((interception) => { - assert(interception.response.statusCode, '200'); - exist(vorgangHeader.getRoot()); - contains(vorgangHeader.getName(), vorgang.name); - }) - }) + interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode: 200, body: vorgang }); + + vorgangPage.waitForSpinnerToDisappear(); + + exist(vorgangHeader.getRoot()); + contains(vorgangHeader.getName(), vorgang.name); }) it('should navigate back on back button', () => { -- GitLab