-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added helper methods for single right delegations in playwright and m…
…ade changes in cypress tests (#922) * Added helper methods for single right delegations in playwright and made changes in cypress tests * Merge conflicts resolved * Update Dockerfile * Update backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.csproj * Update backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.Tests/Altinn.AccessManagement.UI.Tests.csproj * Update backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI.csproj * Update backend/src/Altinn.AccessManagement.UI/Dockerfile * Update cypress/package.json * Update package.json * Update package.json * Update package.json * Update package.json
- Loading branch information
1 parent
714cd7c
commit 627813c
Showing
17 changed files
with
757 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export const apiDelegering = { | ||
apiAdministrationPanel: '#apiAdministrationPanelHeader', | ||
searchForOrgOrAPI: '*[class^="fds-search-field-"]', | ||
searchForOrgOrAPI: 'input[type="search"]', | ||
searchedOrgResultContainer: '*[class^="_actionBarWrapper_"]', | ||
listOfOrgsOrAPIs: '*[class^="_baseListItemContent_"]', | ||
seachedAPIResultContainer: '*[class^="_delegableApisContainer"]', | ||
seachedAPIResultContainer: ':nth-child(1) > *[class^="_delegableApisContainer"]', | ||
selectedAPIsForDelegationResultContainer: ':nth-child(2) > *[class^="_delegableApisContainer"]', | ||
apiListInConfirmationPage: '*[class^="_listContainer_"]', | ||
orgListInConfirmationPage: '*[class^="_baseListItemContent"]', | ||
orgInDelegationsOverviewPage: '*[class^="_actionBarWrapper"]', | ||
previousDelegatedOrgsContainer: '*[class^="_delegableOrgsContainer_"]', | ||
previousDelegatedOrgsContainer: '*[class^="_actionBarWrapper_"]', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
BASE_URL = "https://at21.altinn.cloud" | ||
ENV_NAME="at21" | ||
BASE_URL="https://at21.altinn.cloud" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
BASE_URL = "https://at22.altinn.cloud" | ||
ENV_NAME="at22" | ||
BASE_URL="https://at22.altinn.cloud" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
BASE_URL = "https://at23.altinn.cloud" | ||
ENV_NAME="at23" | ||
BASE_URL="https://at23.altinn.cloud" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
BASE_URL = "https://at24.altinn.cloud" | ||
ENV_NAME="at24" | ||
BASE_URL="https://at24.altinn.cloud" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* eslint-disable import/default */ | ||
/* eslint-disable import/no-named-as-default-member */ | ||
|
||
import { test } from './../fixture/pomFixture'; | ||
|
||
test('User A who is DAGL/HADM for org delegates resources/Altinn 3 app/Altinn 2 services to User B', async ({ | ||
login, | ||
delegate, | ||
delegateRights, | ||
deleteRights, | ||
logoutUser, | ||
coverebyRights, | ||
context, | ||
page, | ||
}) => { | ||
await login.gotoLoginPage('03835898554', page); | ||
await login.chooseReportee('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
|
||
//To delete rights - setup | ||
// GIVEN user without delegated rights to ROMANTISK ESKE | ||
await deleteRights.revokeRightsSSN('ROMANTISK ESKE'); | ||
|
||
//To delegate rights | ||
// WHEN user delegates to ROMANTISK ESKE | ||
await delegate.delegateToSSN('11868898854', 'ESKE'); | ||
await delegateRights.delegateRightsToSSN('Ressurs for enkeltrettigheter testing'); | ||
await delegateRights.delegateRightsToSSN('Automatiseringstest for Access Management'); | ||
await delegateRights.delegateRightsToSSN('Altinn2 reporting service for authorization tests'); | ||
await logoutUser.gotoLogoutPage('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
// await context1.close(); | ||
await context.clearCookies(); | ||
|
||
//Login with covereby User | ||
|
||
await login.gotoLoginPage('11868898854', page); | ||
await login.chooseReportee('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
await coverebyRights.checkCoverebyRights(); | ||
// await context.close(); | ||
}); | ||
|
||
test('User A who is DAGL/HADM for org delegates resources/Altinn 3 app/Altinn 2 services to Org B', async ({ | ||
login, | ||
delegate, | ||
delegateRights, | ||
deleteRights, | ||
logoutUser, | ||
coverebyRights, | ||
context, | ||
page, | ||
}) => { | ||
await login.gotoLoginPage('03835898554', page); | ||
await login.chooseReportee('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
|
||
//To delete rights - setup | ||
// GIVEN user without delegated rights to ROMANTISK ESKE | ||
await deleteRights.revokeRightsSSN('GJESTFRI RESERVERT HUND DA'); | ||
|
||
//To delegate rights | ||
// WHEN user delegates to | ||
await delegate.delegateToOrg('310832170', 'GJESTFRI RESERVERT HUND DA'); | ||
await delegateRights.delegateRightsToSSN('Ressurs for enkeltrettigheter testing'); | ||
await delegateRights.delegateRightsToSSN('Automatiseringstest for Access Management'); | ||
await delegateRights.delegateRightsToSSN('Altinn2 reporting service for authorization tests'); | ||
await logoutUser.gotoLogoutPage('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
// await context1.close(); | ||
await context.clearCookies(); | ||
|
||
//Login with covereby User | ||
|
||
await login.gotoLoginPage('21908498426', page); | ||
await login.chooseReportee('OPPKLARENDE OMKOMMEN TIGER AS', page); | ||
await coverebyRights.checkCoverebyRights(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { test as baseTest } from '@playwright/test'; | ||
import { use } from 'chai'; | ||
import { loginWithUser, logoutWithUser } from 'playwright/pages/loginPage'; | ||
import { | ||
delegateRightsToUser, | ||
delegateToUser, | ||
revokeRights, | ||
coverebyUserRights, | ||
} from 'playwright/pages/profile/delegationPage'; | ||
|
||
// Define the fixtures | ||
const test = baseTest.extend<{ | ||
login: loginWithUser; | ||
delegate: delegateToUser; | ||
delegateRights: delegateRightsToUser; | ||
deleteRights: revokeRights; | ||
logoutUser: logoutWithUser; | ||
coverebyRights: coverebyUserRights; | ||
}>({ | ||
login: async ({ page }, use) => { | ||
await use(new loginWithUser(page)); | ||
}, | ||
delegate: async ({ page }, use) => { | ||
await use(new delegateToUser(page)); | ||
}, | ||
delegateRights: async ({ page }, use) => { | ||
await use(new delegateRightsToUser(page)); | ||
}, | ||
deleteRights: async ({ page }, use) => { | ||
await use(new revokeRights(page)); | ||
}, | ||
logoutUser: async ({ page }, use) => { | ||
await use(new logoutWithUser(page)); | ||
}, | ||
coverebyRights: async ({ page }, use) => { | ||
await use(new coverebyUserRights(page)); | ||
}, | ||
}); | ||
|
||
export { test }; |
Oops, something went wrong.