[full-ci][tests-only] test: standardize playwright step defnitions#13625
[full-ci][tests-only] test: standardize playwright step defnitions#13625anon-pradip merged 2 commits intomasterfrom
Conversation
29bd6ed to
6efa807
Compare
tests/e2e-playwright/specs/file-action/passwordProtectedFolder.spec.ts
Outdated
Show resolved
Hide resolved
6efa807 to
e3b935d
Compare
|
|
||
| // And "Alice" enables the option to display the hidden file | ||
| await ui.showHiddenFiles({ actorsEnvironment, stepUser: 'Alice' }) | ||
| await ui.userShowsHiddenFiles({ actorsEnvironment, stepUser: 'Alice' }) |
There was a problem hiding this comment.
| await ui.userShowsHiddenFiles({ actorsEnvironment, stepUser: 'Alice' }) | |
| await ui.userEnablesShowHiddenFiles({ actorsEnvironment, stepUser: 'Alice' }) |
I think it will be suitable
There was a problem hiding this comment.
🤔 If so then userEnablesShowHiddenFilesOption would be more better? @nabim777
e3b935d to
2b7ccf2
Compare
| await ui.userShouldSeeGroupIds({ | ||
| actorsEnvironment, | ||
| stepUser: 'Admin', | ||
| expectedGroupIds: ['sales'], | ||
| shouldBePresent: false | ||
| }) |
There was a problem hiding this comment.
The function says user should see group ids, but it is expected that the user should not see. This seems kind of confusing. Maybe have different functions for assertion cases, userShouldSeeGroupIds and userShouldNotSeeGroupIds?
Let's see what others have to say on this.
There was a problem hiding this comment.
made two separate functions userShouldSeeGroupIds and userShouldNotSeeGroupIds
2b7ccf2 to
1aa11f5
Compare
da2348d to
f80ef8c
Compare
f80ef8c to
a51e8b6
Compare
|
@anon-pradip, could you refactor this method https://github.com/owncloud/web/blob/master/tests/e2e-playwright/steps/ui/application.ts#L19C7-L19C8 |
|
I think method |
|
|
||
| // When "Alice" enables flat list | ||
| await ui.toggleFlatList({ actorsEnvironment, stepUser: 'Alice' }) | ||
| await ui.userTogglesFlatList({ actorsEnvironment, stepUser: 'Alice' }) |
There was a problem hiding this comment.
| await ui.userTogglesFlatList({ actorsEnvironment, stepUser: 'Alice' }) | |
| await ui.userEnablesFlatList({ actorsEnvironment, stepUser: 'Alice' }) |
| await ui.changeItemsPerPage({ actorsEnvironment, stepUser: 'Alice', itemsPerPage: '20' }) | ||
| await ui.userChangesItemsPerPage({ actorsEnvironment, stepUser: 'Alice', itemsPerPage: '20' }) | ||
| // Then "Alice" should see the text "26 items with 223 B in total (11 files including 1 hidden, 15 folders)" at the footer of the page | ||
| await ui.expectFooterTextToBe({ |
There was a problem hiding this comment.
| await ui.expectFooterTextToBe({ | |
| await ui.userShouldSeeFooterText({ |
|
I think these method also needs to be refactored and renamed. |
|
please rename these also |
|
@nabim777 removed all expects from step defn 🚀 |
3c579e4 to
cea0845
Compare
cea0845 to
2956a71
Compare
2956a71 to
c12f2d7
Compare
|



Description
This PR standardizes Playwright E2E step definitions / naming across the test suite to make steps more consistent and readable.
Main changes:
ui.logInUser→ui.userLogsInui.logOutUser→ui.userLogsOutui.navigateToSharedWithMePage→ui.userNavigatesToSharedWithMePageui.openResourceInViewer→ui.userOpensResourceInViewerui.uploadResource→ui.userUploadsResourcesui.showHiddenFiles→ui.userShowsHiddenFilesapi.usersHasBeenCreated→api.usersHaveBeenCreatedapi.userHasAssignRolesToUsers→api.userHasAssignedRolesToUsersapi.createFilesInsideSpaceBySpaceName→api.userHasCreatedFilesInsideSpaceapi.addUserToGroup→api.usersHaveBeenAddedToGroupexpect(...)with explicit assertion-style steps, e.g.ui.checkGroupsPresenceById+expect(...).toBeTruthy()/toBeFalsy()→ui.userShouldSeeGroupIds(...)ui.groupDisplayNameExists+expect(...).toBeTruthy()→ui.userShouldSeeGroupDisplayName(...)ui.isAbleToEditFileOrFolder+expect(...).toBeFalsy()→ui.userShouldNotBeAbleToEditResource(...)Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Open tasks: