-
Notifications
You must be signed in to change notification settings - Fork 193
[tests-only][full-ci] Rewrite playwright only test for searchProjectSpace.feature #13408
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
Merged
+243
−46
Merged
Changes from all commits
Commits
Show all changes
4 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
133 changes: 133 additions & 0 deletions
133
tests/e2e-playwright/specs/search/searchProjectSpace.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,133 @@ | ||
| import { expect, test } from '@playwright/test' | ||
| import { config } from '../../../e2e/config.js' | ||
| import { | ||
| ActorsEnvironment, | ||
| UsersEnvironment, | ||
| SpacesEnvironment, | ||
| FilesEnvironment | ||
| } from '../../../e2e/support/environment' | ||
| import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken' | ||
| import * as api from '../../steps/api/api' | ||
| import * as ui from '../../steps/ui/index' | ||
|
|
||
| test.describe('Search in the project space', () => { | ||
| let actorsEnvironment | ||
| const usersEnvironment = new UsersEnvironment() | ||
| const spacesEnvironment = new SpacesEnvironment() | ||
| const filesEnvironment = new FilesEnvironment() | ||
|
|
||
| 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) | ||
|
|
||
| await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' }) | ||
|
|
||
| await api.userHasAssignRolesToUsers({ | ||
| usersEnvironment, | ||
| stepUser: 'Admin', | ||
| targetUserId: 'Alice', | ||
| role: 'Space Admin' | ||
| }) | ||
|
|
||
| await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) | ||
|
|
||
| await api.userHasCreatedProjectSpace({ | ||
| usersEnvironment, | ||
| spacesEnvironment, | ||
| stepUser: 'Alice', | ||
| name: 'team', | ||
| id: 'team.1' | ||
| }) | ||
|
|
||
| await ui.navigateToProjectSpace({ actorsEnvironment, stepUser: 'Alice', space: 'team.1' }) | ||
|
|
||
| await ui.createResource({ | ||
| actorsEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: 'folder(WithSymbols:!;_+-&)', | ||
| type: 'folder' | ||
| }) | ||
|
|
||
| await ui.uploadResource({ | ||
| actorsEnvironment, | ||
| filesEnvironment, | ||
| stepUser: 'Alice', | ||
| resource: "new-'single'quotes.txt", | ||
| to: 'folder(WithSymbols:!;_+-&)' | ||
| }) | ||
|
|
||
| await ui.navigateToPersonalSpacePage({ actorsEnvironment, stepUser: 'Alice' }) | ||
| }) | ||
|
|
||
| test.afterEach(async () => { | ||
| // clean up users | ||
| await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Alice' }) | ||
| }) | ||
|
|
||
| test('Search in the project spaces', async () => { | ||
| // search for project space objects | ||
| await ui.searchGloballyWithFilter({ | ||
| actorsEnvironment, | ||
| stepUser: 'Alice', | ||
| keyword: "-'s", | ||
| filter: 'all files' | ||
| }) | ||
|
|
||
| expect( | ||
| await ui.resourceExists({ | ||
| actorsEnvironment, | ||
| listType: 'search list', | ||
| stepUser: 'Alice', | ||
| resource: "new-'single'quotes.txt" | ||
| }) | ||
| ).toBeTruthy() | ||
|
|
||
| expect( | ||
| await ui.resourceExists({ | ||
| actorsEnvironment, | ||
| listType: 'search list', | ||
| stepUser: 'Alice', | ||
| resource: 'folder(WithSymbols:!;_+-&)' | ||
| }) | ||
| ).toBeFalsy() | ||
|
|
||
| await ui.searchGloballyWithFilter({ | ||
| actorsEnvironment, | ||
| stepUser: 'Alice', | ||
| keyword: '!;_+-&)', | ||
| filter: 'all files' | ||
| }) | ||
|
|
||
| expect( | ||
| await ui.resourceExists({ | ||
| actorsEnvironment, | ||
| listType: 'search list', | ||
| stepUser: 'Alice', | ||
| resource: 'folder(WithSymbols:!;_+-&)' | ||
| }) | ||
| ).toBeTruthy() | ||
|
|
||
| expect( | ||
| await ui.resourceExists({ | ||
| actorsEnvironment, | ||
| listType: 'search list', | ||
| stepUser: 'Alice', | ||
| resource: "new-'single'quotes.txt" | ||
| }) | ||
| ).toBeFalsy() | ||
|
|
||
| await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' }) | ||
| }) | ||
| }) |
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
38 changes: 0 additions & 38 deletions
38
tests/e2e/cucumber/features/search/searchProjectSpace.feature
This file was deleted.
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.