Skip to content

[tests-only][full-ci] run tests with predefined users #12572

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
merged 28 commits into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0799912
test: get token from login
saw-jan May 15, 2025
b38b83f
test: request user-id after login
saw-jan May 16, 2025
1aaaf0f
test: fetch dynamic roles with polling
saw-jan May 16, 2025
f61a1cb
test: fix langauge store
saw-jan May 16, 2025
0cbbf4f
test: fix link share and dynamic roles
saw-jan May 16, 2025
5bf1865
test: use substitute pattern
saw-jan May 16, 2025
7d49dc1
test: fix test scenarios
saw-jan May 16, 2025
46e4045
test: fix test scenarios
saw-jan May 16, 2025
c327277
test: select share role by id
saw-jan May 16, 2025
de78607
test: fix login token store
saw-jan May 19, 2025
2108bb4
test: token store fixes
saw-jan May 19, 2025
2a35962
test: fix sharing with secure viewer role
saw-jan May 19, 2025
b975f67
test: fix tests
saw-jan May 19, 2025
c06d885
test: fix shares tests
saw-jan May 19, 2025
7e22cfe
test: fix search tests
saw-jan May 20, 2025
87f572a
test: fix navigation tests
saw-jan May 20, 2025
e2087df
test: fix pagination tests
saw-jan May 20, 2025
e661fc2
test: fix copy tests
saw-jan May 20, 2025
eb87820
test: separate test scenario
saw-jan May 20, 2025
7172a23
test: separate quota test scenario
saw-jan May 20, 2025
7e3c029
test: update testing docs
saw-jan May 20, 2025
f9286e0
test: fix scenario
saw-jan May 20, 2025
b739c3e
test: fix change role steps
saw-jan May 20, 2025
cfb1896
test: fix response checks
saw-jan May 20, 2025
05957f6
test: get default setttings
saw-jan May 21, 2025
e6507eb
test: reduce required roles
saw-jan May 21, 2025
4275508
update testing docs
saw-jan May 21, 2025
80168ec
test: do not try to match invalid string
saw-jan May 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ We have a steadily growing coverage of unit tests. You can run them locally via

```shell
$ pnpm test:unit
$ pnpm -r test:unit
$ pnpm -r test:unit
```

You can also specify which package to run the test on, such as: `pnpm --filter @ownclouders/web-pkg test:unit`.
Expand Down Expand Up @@ -235,3 +235,10 @@ All tests which are related to:

- Admin Actions
- Groups

**The tests might show flakiness or fail due to the following reasons:**

- Slower network connection
- Features enabled/disabled
- Running latest tests against an older version of oCIS/Web
- Large file uploads may take longer time
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/features/app-provider/lock.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Feature: lock
| resource | type | content |
| test.odt | OpenDocument | some content |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| test.odt | Brian | user | Can edit |
| resource | recipient | type | role | resourceType |
| test.odt | Brian | user | Can edit | file |
And "Brian" logs in
And "Brian" navigates to the shared with me page
When "Brian" opens the following file in Collabora
Expand Down
22 changes: 10 additions & 12 deletions tests/e2e/cucumber/features/app-provider/secureView.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Feature: Secure view
| Alice |
| Brian |
And "Alice" logs in
And "Brian" logs in
And "Alice" opens the "files" app


Expand All @@ -29,14 +30,13 @@ Feature: Secure view
| secureDocument.odt | OpenDocument | very important document |

And "Alice" shares the following resources using the sidebar panel
| resource | recipient | type | role |
| secureDocument.odt | Brian | user | Can view (secure) |
| shared folder | Brian | user | Can view (secure) |
| resource | recipient | type | role | resourceType |
| secureDocument.odt | Brian | user | Can view (secure) | file |
| shared folder | Brian | user | Can view (secure) | folder |
And "Alice" logs out

And "Brian" logs in
And "Brian" navigates to the shared with me page
When "Brian" opens the following file in Collabora
When "Brian" navigates to the shared with me page
And "Brian" opens the following file in Collabora
| resource |
| secureDocument.odt |

Expand Down Expand Up @@ -75,14 +75,12 @@ Feature: Secure view
| resource | type | content |
| secureDocument.odt | OpenDocument | very important document |
And "Alice" shares the following resources using the sidebar panel
| resource | recipient | type | role |
| secureDocument.odt | Brian | user | Can view (secure) |
| shared folder | Brian | user | Can view (secure) |
| resource | recipient | type | role | resourceType |
| secureDocument.odt | Brian | user | Can view (secure) | file |
| shared folder | Brian | user | Can view (secure) | fodler |
And "Alice" logs out

And "Brian" logs in
And "Brian" navigates to the shared with me page

When "Brian" navigates to the shared with me page
# .odt file
Then "Brian" should see following actions for file "secureDocument.odt"
| action |
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/features/file-action/copyMove.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: Copy
Given "Admin" creates following user using API
| id |
| Alice |
And "Alice" logs in
And "Alice" creates the following folders in personal space using API
| name |
| PARENTCopy1 |
Expand Down Expand Up @@ -37,7 +38,6 @@ Feature: Copy
| PARENT/fileToCopy3.txt | some content |
| PARENT/fileToCopy4.txt | some content |
| PARENT/fileToCopy5.txt | some content |
And "Alice" logs in

When "Alice" duplicates the following resource using sidebar-panel
| resource |
Expand Down Expand Up @@ -190,6 +190,7 @@ Feature: Copy
Given "Admin" creates following user using API
| id |
| Alice |
And "Alice" logs in
And "Alice" creates the following folders in personal space using API
| name |
| sub |
Expand All @@ -202,7 +203,6 @@ Feature: Copy
| folder1/example1.txt | folder1 location |
| sub/folder1/example1.txt | sub/folder1 location |
| sub1/folder1/example1.txt | sub1/folder1 location |
And "Alice" logs in

# copy and move file
When "Alice" copies the following resource using sidebar-panel
Expand Down
16 changes: 8 additions & 8 deletions tests/e2e/cucumber/features/file-action/download.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Feature: Download


Scenario: download resources
Given "Alice" logs in
And "Brian" logs in
And "Alice" creates the following folders in personal space using API
| name |
| folderPublic |
Expand All @@ -23,13 +25,12 @@ Feature: Download
| localFile | to |
| filesForUpload/testavatar.jpg | testavatar.jpg |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| folderPublic | Brian | user | Can edit |
| emptyFolder | Brian | user | Can edit |
| testavatar.jpg | Brian | user | Can edit |
| resource | recipient | type | role | resourceType |
| folderPublic | Brian | user | Can edit | folder |
| emptyFolder | Brian | user | Can edit | folder |
| testavatar.jpg | Brian | user | Can edit | file |

When "Alice" logs in
And "Alice" downloads the following resources using the batch action
When "Alice" downloads the following resources using the batch action
| resource | type |
| folderPublic | folder |
| emptyFolder | folder |
Expand All @@ -43,8 +44,7 @@ Feature: Download
And "Alice" closes the file viewer
And "Alice" logs out

And "Brian" logs in
And "Brian" navigates to the shared with me page
When "Brian" navigates to the shared with me page
And "Brian" downloads the following resources using the batch action
| resource | type |
| folderPublic | folder |
Expand Down
66 changes: 66 additions & 0 deletions tests/e2e/cucumber/features/file-action/fileViewer.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@predefined-users
Feature: Different file viewers


Scenario: file viewers
Given "Admin" creates following user using API
| id |
| Alice |
And "Alice" logs in
When "Alice" creates the following resources
| resource | type | content |
| lorem.txt | txtFile | some text |
| lorem.md | mdFile | readme |
And "Alice" edits the following resources
| resource | content |
| lorem.txt | new content edited |
| lorem.md | new readme content edited |
And "Alice" uploads the following resource
| resource |
| simple.pdf |
| sampleGif.gif |
| testimage.mp3 |
| sampleOgg.ogg |
| sampleWebm.webm |
| test_video.mp4 |
| testavatar.jpeg |
| testavatar.png |
Then "Alice" should see thumbnail and preview for file "sampleGif.gif"
And "Alice" should see thumbnail and preview for file "testavatar.jpeg"
And "Alice" should see thumbnail and preview for file "testavatar.png"
When "Alice" opens a file "testavatar.png" in the media-viewer using the sidebar panel
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| testavatar.jpeg |
Then "Alice" is in a media-viewer
When "Alice" navigates to the next media resource
And "Alice" navigates to the previous media resource
And "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| sampleGif.gif |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| testimage.mp3 |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| sampleOgg.ogg |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| sampleWebm.webm |
Then "Alice" is in a media-viewer
When "Alice" closes the file viewer
And "Alice" opens the following file in mediaviewer
| resource |
| test_video.mp4 |
Then "Alice" is in a media-viewer
And "Alice" closes the file viewer
And "Alice" logs out
30 changes: 15 additions & 15 deletions tests/e2e/cucumber/features/file-action/groupActions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ Feature: Group actions
| folder5 |
| parentFolder/SubFolder |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| folder1 | Brian | user | Can edit without versions |
| folder2 | Brian | user | Can edit without versions |
| folder3 | Brian | user | Can edit without versions |
| folder4 | Brian | user | Can edit without versions |
| folder5 | Brian | user | Can edit without versions |
| parentFolder | Brian | user | Can edit without versions |
| resource | recipient | type | role | resourceType |
| folder1 | Brian | user | Can edit without versions | folder |
| folder2 | Brian | user | Can edit without versions | folder |
| folder3 | Brian | user | Can edit without versions | folder |
| folder4 | Brian | user | Can edit without versions | folder |
| folder5 | Brian | user | Can edit without versions | folder |
| parentFolder | Brian | user | Can edit without versions | folder |
And "Alice" logs in

# multiple share
And "Alice" shares the following resources using the sidebar panel
| resource | recipient | type | role |
| sharedFolder | Brian | user | Can edit without versions |
| sharedFolder | Carol | user | Can edit without versions |
| sharedFolder | David | user | Can edit without versions |
| sharedFolder | Edith | user | Can edit without versions |
| sharedFolder | sales | group | Can edit without versions |
| sharedFolder | finance | group | Can edit without versions |
| sharedFolder | security | group | Can edit without versions |
| resource | recipient | type | role | resourceType |
| sharedFolder | Brian | user | Can edit without versions | folder |
| sharedFolder | Carol | user | Can edit without versions | folder |
| sharedFolder | David | user | Can edit without versions | folder |
| sharedFolder | Edith | user | Can edit without versions | folder |
| sharedFolder | sales | group | Can edit without versions | folder |
| sharedFolder | finance | group | Can edit without versions | folder |
| sharedFolder | security | group | Can edit without versions | folder |

And "Brian" navigates to the shared with me page

Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/cucumber/features/file-action/rename.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ Feature: rename
| id |
| Alice |
| Brian |
And "Alice" logs in
And "Brian" logs in
And "Alice" creates the following folders in personal space using API
| name |
| folder |
And "Alice" creates the following files into personal space using API
| pathToFile | content |
| folder/example.txt | example text |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| folder | Brian | user | Can edit |
| resource | resourceType | recipient | type | role |
| folder | folder | Brian | user | Can edit |
And "Alice" creates a public link of following resource using API
| resource | role | password |
| folder | Can edit | %public% |
And "Brian" logs in

And "Brian" navigates to the shared with me page
And "Brian" opens folder "folder"

# rename in the shares with me page
When "Brian" renames the following resource
| resource | as |
Expand All @@ -39,7 +40,6 @@ Feature: rename
| renamedByBrian.txt | renamedByAnonymous.txt |

# rename in the shares with other page
And "Alice" logs in
And "Alice" navigates to the shared with others page
And "Alice" opens folder "folder"
When "Alice" renames the following resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ Feature: check files pagination in personal space
So that I do not have to scroll deep down


Scenario: pagination
Given "Admin" creates following user using API
| id |
| Alice |
And "Alice" creates 55 folders in personal space using API
And "Alice" creates 55 files in personal space using API
And "Alice" creates the following files into personal space using API
| pathToFile | content |
| .hidden-testFile.txt | This is a hidden file. |
And "Alice" logs in
When "Alice" navigates to page "2" of the personal space files view
Then "Alice" should see the text "111 items with 1 kB in total (56 files including 1 hidden, 55 folders)" at the footer of the page
And "Alice" should see 10 resources in the personal space files view
When "Alice" enables the option to display the hidden file
Then "Alice" should see 11 resources in the personal space files view
When "Alice" changes the items per page to "500"
Then "Alice" should not see the pagination in the personal space files view
And "Alice" logs out
Scenario: pagination
Given "Admin" creates following user using API
| id |
| Alice |
And "Alice" logs in
And "Alice" creates 15 folders in personal space using API
And "Alice" creates 10 files in personal space using API
And "Alice" creates the following files into personal space using API
| pathToFile | content |
| .hidden-testFile.txt | This is a hidden file. |
When "Alice" opens the "files" app
And "Alice" changes the items per page to "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
When "Alice" navigates to page "2" of the personal space files view
Then "Alice" should see 5 resources in the personal space files view
When "Alice" enables the option to display the hidden file
Then "Alice" should see 6 resources in the personal space files view
When "Alice" changes the items per page to "500"
Then "Alice" should not see the pagination in the personal space files view
And "Alice" logs out
14 changes: 7 additions & 7 deletions tests/e2e/cucumber/features/navigation/shortcut.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Feature: Users can create shortcuts for resources and sites
| Brian |

Scenario: shortcut
When "Alice" creates the following folders in personal space using API
Given "Alice" logs in
And "Brian" logs in
And "Alice" creates the following folders in personal space using API
| name |
| docs |
And "Alice" creates the following files into personal space using API
Expand All @@ -18,14 +20,13 @@ Feature: Users can create shortcuts for resources and sites
| localFile | to |
| filesForUpload/testavatar.jpg | testavatar.jpg |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| testavatar.jpg | Brian | user | Can view |
| resource | recipient | type | role | resourceType |
| testavatar.jpg | Brian | user | Can view | file |
And "Alice" creates a public link of following resource using API
| resource | password |
| docs/notice.txt | %public% |
And "Alice" logs in
And "Alice" renames the most recently created public link of resource "docs/notice.txt" to "myPublicLink"
And "Alice" opens the "files" app
When "Alice" opens the "files" app

# create a shortcut to file folder website
And "Alice" creates a shortcut for the following resources
Expand All @@ -46,8 +47,7 @@ Feature: Users can create shortcuts for resources and sites
And "Alice" logs out

# create a shortcut to the shared file
When "Brian" logs in
And "Brian" creates a shortcut for the following resources
When "Brian" creates a shortcut for the following resources
| resource | name | type |
| testavatar.jpg | logo | file |
And "Brian" opens a shortcut "logo.url"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/features/search/fullTextSearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Feature: Search
| resource | tags |
| fileToShare.txt | alice tag |
And "Alice" shares the following resource using API
| resource | recipient | type | role |
| fileToShare.txt | Brian | user | Can edit |
| resource | recipient | type | role | resourceType |
| fileToShare.txt | Brian | user | Can edit | file |
And "Brian" creates the following folder in personal space using API
| name |
| testFolder |
Expand Down
Loading