-
Notifications
You must be signed in to change notification settings - Fork 195
[full-ci][tests-only] Rewrite groupActions file into playwrightonly #13554
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
Open
nabim777
wants to merge
2
commits into
master
Choose a base branch
from
tests/groupActions
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.
+319
−73
Open
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
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
279 changes: 279 additions & 0 deletions
279
tests/e2e-playwright/specs/file-action/groupActions.spec.ts
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,279 @@ | ||
| import { test } from '../../support/test' | ||
| import { config } from '../../../e2e/config.js' | ||
| import { ActorsEnvironment, UsersEnvironment } from '../../../e2e/support/environment' | ||
| import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken.js' | ||
| import * as ui from '../../steps/ui/index' | ||
| import * as api from '../../steps/api/api' | ||
|
|
||
| test.describe('Group actions', { tag: '@predefined-users' }, () => { | ||
| let actorsEnvironment | ||
| const usersEnvironment = new UsersEnvironment() | ||
|
|
||
| test.beforeEach(async ({ browser }) => { | ||
| actorsEnvironment = new ActorsEnvironment({ | ||
| context: { | ||
| acceptDownloads: config.acceptDownloads, | ||
| reportDir: config.reportDir, | ||
| tracingReportDir: config.tracingReportDir, | ||
| reportHar: config.reportHar, | ||
| reportTracing: config.reportTracing, | ||
| reportVideo: config.reportVideo, | ||
| failOnUncaughtConsoleError: config.failOnUncaughtConsoleError | ||
| }, | ||
| browser: browser | ||
| }) | ||
|
|
||
| await setAccessAndRefreshToken(usersEnvironment) | ||
|
|
||
| // Given "Admin" creates following user using API | ||
| // | id | | ||
| // | Alice | | ||
| // | Brian | | ||
| // | Carol | | ||
| // | David | | ||
| // | Edith | | ||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' }) | ||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Brian' }) | ||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Carol' }) | ||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'David' }) | ||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Edith' }) | ||
|
|
||
| // And "Admin" creates following group using API | ||
| // | id | | ||
| // | sales | | ||
| // | finance | | ||
| // | security | | ||
| await api.groupsHaveBeenCreated({ | ||
| groupIds: ['sales', 'finance', 'security'], | ||
| admin: usersEnvironment.getUser({ key: 'Admin' }) | ||
| }) | ||
|
|
||
| // And "Admin" adds user to the group using API | ||
| // | user | group | | ||
| // | Brian | sales | | ||
| // | Brian | finance | | ||
| // | Brian | security | | ||
| await api.addUserToGroup({ | ||
| usersEnvironment, | ||
| stepUser: 'Admin', | ||
| groupName: 'sales', | ||
| userToAdd: 'Brian' | ||
| }) | ||
| await api.addUserToGroup({ | ||
| usersEnvironment, | ||
| stepUser: 'Admin', | ||
| groupName: 'finance', | ||
| userToAdd: 'Brian' | ||
| }) | ||
| await api.addUserToGroup({ | ||
| usersEnvironment, | ||
| stepUser: 'Admin', | ||
| groupName: 'security', | ||
| userToAdd: 'Brian' | ||
| }) | ||
|
|
||
| // And "Brian" logs in | ||
| await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' }) | ||
| }) | ||
|
|
||
| test.afterEach(async () => { | ||
| // clean up users | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Alice' }) | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Brian' }) | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Carol' }) | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'David' }) | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Edith' }) | ||
| }) | ||
|
|
||
| test('batch share a resource to multiple users and groups', async () => { | ||
| // disabling auto accepting to check accepting share | ||
| // And "Brian" disables auto-accepting using API | ||
| await api.userHasDisabledAutoAcceptingShare({ usersEnvironment, stepUser: 'Brian' }) | ||
|
|
||
| // And "Alice" creates the following folders in personal space using API | ||
| // | name | | ||
| // | sharedFolder | | ||
| // | folder1 | | ||
| // | folder2 | | ||
| // | folder3 | | ||
| // | folder4 | | ||
| // | folder5 | | ||
| // | parentFolder/SubFolder | | ||
| await api.userHasCreatedFolders({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| folderNames: [ | ||
| 'sharedFolder', | ||
| 'folder1', | ||
| 'folder2', | ||
| 'folder3', | ||
| 'folder4', | ||
| 'folder5', | ||
| 'parentFolder/SubFolder' | ||
| ] | ||
| }) | ||
| // And "Alice" shares the following resource using API | ||
| // | resource | recipient | type | role | resourceType | | ||
| // | folder1 | Brian | user | Can edit with trashbin | folder | | ||
| // | folder2 | Brian | user | Can edit with trashbin | folder | | ||
| // | folder3 | Brian | user | Can edit with trashbin | folder | | ||
| // | folder4 | Brian | user | Can edit with trashbin | folder | | ||
| // | folder5 | Brian | user | Can edit with trashbin | folder | | ||
| // | parentFolder | Brian | user | Can edit with trashbin | folder | | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder1', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder2', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder3', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder4', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder5', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await api.userHasSharedResource({ | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'parentFolder', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| // And "Alice" logs in | ||
| await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) | ||
|
|
||
| // # multiple share | ||
| // And "Alice" shares the following resources using the sidebar panel | ||
| // | resource | recipient | type | role | resourceType | | ||
| // | sharedFolder | Brian | user | Can edit with trashbin | folder | | ||
| // | sharedFolder | Carol | user | Can edit with trashbin | folder | | ||
| // | sharedFolder | David | user | Can edit with trashbin | folder | | ||
| // | sharedFolder | Edith | user | Can edit with trashbin | folder | | ||
| // | sharedFolder | sales | group | Can edit with trashbin | folder | | ||
| // | sharedFolder | finance | group | Can edit with trashbin | folder | | ||
| // | sharedFolder | security | group | Can edit with trashbin | folder | | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
nirajacharya2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'Brian', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'Carol', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'David', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'Edith', | ||
| type: 'user', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'sales', | ||
| type: 'group', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'finance', | ||
| type: 'group', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
| await ui.shareResource({ | ||
| actorsEnvironment, | ||
| usersEnvironment, | ||
| stepUser: 'Alice', | ||
| actionType: 'SIDEBAR_PANEL', | ||
| resource: 'sharedFolder', | ||
| recipient: 'security', | ||
| type: 'group', | ||
| role: 'Can edit with trashbin', | ||
| resourceType: 'folder' | ||
| }) | ||
|
|
||
| // And "Brian" navigates to the shared with me page | ||
| await ui.navigateToSharedWithMePage({ actorsEnvironment, stepUser: 'Brian' }) | ||
|
|
||
| // And "Brian" enables the sync for all shares using the batch action | ||
| await ui.userEnablesSyncForAllShares({ actorsEnvironment, stepUser: 'Brian' }) | ||
|
|
||
| // And "Alice" logs out | ||
| await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' }) | ||
| // And "Brian" logs out | ||
| await ui.logOutUser({ actorsEnvironment, stepUser: 'Brian' }) | ||
| }) | ||
| }) | ||
3 changes: 2 additions & 1 deletion
3
tests/e2e-playwright/specs/user-settings/notifications.spec.ts
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 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
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.