-
Notifications
You must be signed in to change notification settings - Fork 203
[full-ci][tests-only] test: convert groups.feature test to playwright #13492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nirajacharya2
wants to merge
2
commits into
master
Choose a base branch
from
groups-2-pw
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,180 @@ | ||
| import { test } from '../../support/test' | ||
| import * as api from '../../steps/api/api.js' | ||
| import * as ui from '../../steps/ui/index' | ||
|
|
||
| // For synchronization-related details, see https://owncloud.dev/services/proxy/#claim-updates | ||
| test.describe('groups management', () => { | ||
| test('keycloak group sync with oCIS', async ({ world }) => { | ||
| // Given "Admin" creates following user using API | ||
| // | id | | ||
| // | Alice | | ||
| // | Brian | | ||
| await api.usersHaveBeenCreated({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| users: ['Alice', 'Brian'] | ||
| }) | ||
|
|
||
| // And "Alice" creates the following files into personal space using API | ||
| // | pathToFile | content | | ||
| // | shareToSales.txt | Keycloak group share | | ||
| // | shareToSecurity.txt | Keycloak group share | | ||
| await api.userHasCreatedFiles({ | ||
| world, | ||
| stepUser: 'Alice', | ||
| files: [ | ||
| { pathToFile: 'shareToSales.txt', content: 'Keycloak group share' }, | ||
| { pathToFile: 'shareToSecurity.txt', content: 'Keycloak group share' } | ||
| ] | ||
| }) | ||
|
|
||
| // When "Admin" logs in | ||
| await ui.userLogsIn({ world, stepUser: 'Admin' }) | ||
|
|
||
| // And "Admin" opens the "admin-settings" app | ||
| await ui.userOpensApplication({ world, stepUser: 'Admin', name: 'admin-settings' }) | ||
|
|
||
| // And "Admin" navigates to the groups management page | ||
| await ui.userNavigatesToGroupsManagementPage({ world, stepUser: 'Admin' }) | ||
|
|
||
| // When "Admin" creates the following groups | ||
| // | id | | ||
| // | security | | ||
| // | sales | | ||
| await ui.userCreatesGroups({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| groupIds: ['security', 'sales'] | ||
| }) | ||
|
|
||
| // Then "Admin" should see the following group | ||
| // | group | | ||
| // | security | | ||
| // | keycloak sales | | ||
| // | keycloak finance | | ||
| await ui.userShouldSeeGroupIds({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| expectedGroupIds: ['security', 'keycloak sales', 'keycloak finance'] | ||
| }) | ||
|
|
||
| // When "Admin" navigates to the users management page | ||
| await ui.userNavigatesToUserManagementPage({ world, stepUser: 'Admin' }) | ||
| // And "Admin" adds the user "Brian" to the groups "security,keycloak sales" using the sidebar panel | ||
| await ui.userAddsUserToGroup({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| action: 'adds', | ||
| groups: ['security', 'keycloak sales'], | ||
| user: 'Brian' | ||
| }) | ||
|
|
||
| // And "Admin" logs out | ||
| await ui.userLogsOut({ world, stepUser: 'Admin' }) | ||
| // And "Alice" logs in | ||
| await ui.userLogsIn({ world, stepUser: 'Alice' }) | ||
|
|
||
| // And "Alice" shares the following resource using the sidebar panel | ||
| // | resource | recipient | type | role | resourceType | | ||
| // | shareToSales.txt | keycloak sales | group | Can edit without versions | file | | ||
| // | shareToSecurity.txt | security | group | Can edit without versions | file | | ||
| await ui.userSharesResources({ | ||
| world, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| shares: [ | ||
| { | ||
| resource: 'shareToSales.txt', | ||
| recipient: 'keycloak sales', | ||
| type: 'group', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'file' | ||
| }, | ||
| { | ||
| resource: 'shareToSecurity.txt', | ||
| recipient: 'security', | ||
| type: 'group', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'file' | ||
| } | ||
| ] | ||
| }) | ||
|
|
||
| // And "Alice" logs out | ||
| await ui.userLogsOut({ world, stepUser: 'Alice' }) | ||
|
|
||
| // And "Brian" logs in | ||
| await ui.userLogsIn({ world, stepUser: 'Brian' }) | ||
| // And "Brian" navigates to the shared with me page | ||
| await ui.userNavigatesToSharedWithMePage({ world, stepUser: 'Brian' }) | ||
|
|
||
| // user should have access to unsynced shares | ||
| // When "Brian" opens the following file in texteditor | ||
| // | resource | | ||
| // | shareToSales.txt | | ||
| await ui.userOpensResourceInViewer({ | ||
| world, | ||
| stepUser: 'Brian', | ||
| resource: 'shareToSales.txt', | ||
| application: 'texteditor' | ||
| }) | ||
| // And "Brian" closes the file viewer | ||
| await ui.userClosesFileViewer({ world, stepUser: 'Brian' }) | ||
| // And "Brian" edits the following resources | ||
| // | resource | content | | ||
| // | shareToSecurity.txt | new content | | ||
| await ui.userEditsResources({ | ||
| world, | ||
| stepUser: 'Brian', | ||
| resources: [ | ||
| { | ||
| name: 'shareToSecurity.txt', | ||
| content: 'new content' | ||
| } | ||
| ] | ||
| }) | ||
| // And "Brian" logs out | ||
| await ui.userLogsOut({ world, stepUser: 'Brian' }) | ||
|
|
||
| // When "Admin" logs in | ||
| await ui.userLogsIn({ world, stepUser: 'Admin' }) | ||
|
|
||
| // And "Admin" opens the "admin-settings" app | ||
| await ui.userOpensApplication({ world, stepUser: 'Admin', name: 'admin-settings' }) | ||
|
|
||
| // And "Admin" navigates to the groups management page | ||
| await ui.userNavigatesToGroupsManagementPage({ world, stepUser: 'Admin' }) | ||
|
|
||
| // Renaming a Keycloak group results in the creation of a new group on the oCIS server (see https://github.com/owncloud/ocis/issues/10445). | ||
| // After renaming a group, it may take up to 5 minutes for the changes to sync, so avoid using the renamed group in the subsequent steps. | ||
| // And "Admin" changes displayName to "a renamed group" for group "keycloak finance" using the sidebar panel | ||
| await ui.userChangesGroup({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| attribute: 'displayName', | ||
| key: 'keycloak finance', | ||
| value: 'a renamed group', | ||
| action: 'context-menu' | ||
| }) | ||
|
|
||
| // When "Admin" deletes the following group using the context menu | ||
| // | group | | ||
| // | sales | | ||
| await ui.userDeletesGroups({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| actionType: 'context menu', | ||
| groupsToBeDeleted: ['sales'] | ||
| }) | ||
| // Then "Admin" should not see the following group | ||
| // | group | | ||
| // | sales | | ||
| await ui.userShouldNotSeeGroupIds({ | ||
| world, | ||
| stepUser: 'Admin', | ||
| expectedGroupIds: ['sales'] | ||
| }) | ||
| // And "Admin" logs out | ||
| await ui.userLogsOut({ world, stepUser: 'Admin' }) | ||
| }) | ||
| }) | ||
File renamed without changes.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.