Skip to content

Commit

Permalink
Feature/end to end 1190 (#1267)
Browse files Browse the repository at this point in the history
* Added beginning test for single right delegation

* Lagt til pseudokode for neste steg

* Lagt til pseudokode for neste steg

* lagt til negativ sjekk

* Fungerende test non-DelegableService

* added test that was removed by accident

* added missing test that was also deleted by accident

---------

Co-authored-by: Vegard Nyeng <[email protected]>
  • Loading branch information
ernstjonny and Nyeng authored Feb 11, 2025
1 parent 0ad514f commit fbef0ae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
16 changes: 13 additions & 3 deletions playwright/e2eTests/singleRightsDelegering.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* eslint-disable import/default */
/* eslint-disable import/no-named-as-default-member */

import { test } from './../fixture/pomFixture';

test.describe('User with DAGL/HADM role without having resource access themselves', () => {
test.describe('User with DAGL/HADM role without having resource access themselves debug', () => {
test('User A who is DAGL/HADM for org delegates resources/Altinn 3 app/Altinn 2 services to User B', async ({
login,
delegate,
Expand Down Expand Up @@ -176,4 +174,16 @@ test.describe('User with DAGL/HADM role without having resource access themselve
await login.chooseReportee('ULIK FLAT TIGER AS');
await coverebyRights.checkCoverebyRights();
});

test('Singleright delegation - Non-delegable service', async ({
login,
delegate,
delegateRights,
}) => {
await login.loginWithUser('04885299593');
await login.chooseReportee('ULIK FLAT TIGER AS');

await delegate.delegateToSSN('19856097121', 'GATE');
await delegateRights.nonDelegatebleRightsToSSN('Altinn2 non-delegable');
});
});
16 changes: 16 additions & 0 deletions playwright/pages/profile/delegationPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,23 @@ export class delegateRightsToUser {
}
}
}
async nonDelegatebleRightsToSSN(resourceName: string) {
await this.page.getByRole('link', { name: 'Gi tilgang til enkelttjenester' }).click();
await this.page.getByLabel('Søk etter skjema og tjeneste').click();
await this.page.getByLabel('Søk etter skjema og tjeneste').fill(resourceName);
await this.page.keyboard.press('Enter');
await new Promise((resolve) =>
setTimeout(() => {
resolve(null);
}, 500),
);

await this.page.getByRole('button', { name: 'Legg til' }).first().click();
var fullmaktsheader = this.page.getByRole('heading', { name: 'Du kan ikke gi fullmakt til' });
await expect(fullmaktsheader).toBeVisible();
}
}

export class coverebyUserRights {
constructor(public page: Page) {}

Expand Down

0 comments on commit fbef0ae

Please sign in to comment.