Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix second batch of acceptance tests for owncloud#8446
Browse files Browse the repository at this point in the history
pascalwengerter committed May 5, 2023
1 parent 7e32f1f commit a546445
Showing 8 changed files with 33 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ Feature: display image in preview app on the webUI
And user "Alice" has created a public link with following settings in the server
| path | simple-empty-folder |
When the public uses the webUI to access the last public link created by user "Alice" in a new session
And the public views the file "test_video.mp4" in the preview app using the webUI
And the public views the single share file "test_video.mp4" in the preview app using the webUI
Then the file "test_video.mp4" should be displayed in the preview app webUI


Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ Feature: Create public link shares
| name | Link |
And a link named "Link" should be listed with role "Anyone with the link can view" in the public link list of resource "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share

@smokeTest @ocisSmokeTest @issue-ocis-reva-383
Scenario: simple file sharing by public link
@@ -38,7 +38,7 @@ Feature: Create public link shares
| name | Link |
And a link named "Link" should be listed with role "Anyone with the link can view" in the public link list of resource "lorem.txt" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share

@skipOnOC10 @issue-ocis-reva-383
# When this issue is fixed delete this scenario and use the one above
@@ -54,7 +54,7 @@ Feature: Create public link shares
| permissions | read |
| path | /simple-folder |
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share

@skipOnOC10 @issue-ocis-reva-383
# When this issue is fixed delete this scenario and use the one above
@@ -69,7 +69,7 @@ Feature: Create public link shares
| permissions | read |
| path | /lorem.txt |
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share

@issue-ocis-reva-389
Scenario: user shares a public link with folder longer than 64 chars and shorter link name
@@ -79,7 +79,7 @@ Feature: Create public link shares
And user "Alice" has logged in using the webUI
When the user creates a new public link for folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" using the webUI
And the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: share two files with same name but different paths by public link
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ Feature: Edit public link shares
| password | pass123 |
When the user renames the public link named "Public-link" of folder "simple-folder" to "simple-folder Share"
And the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: user edits the password of an already existing public link
@@ -167,4 +167,4 @@ Feature: Edit public link shares
And user "Alice" has logged in using the webUI
When the user tries to edit the public link named "Public-link" of folder "lorem.txt" adding a password "pass123"
And the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ Feature: Share by public link with different roles
| name | Link |
And a link named "Link" should be listed with role "<displayed-role>" in the public link list of folder "simple-folder" on the webUI
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
Examples:
| role | displayed-role | permissions |
| Viewer | Anyone with the link can view | read |
@@ -48,7 +48,7 @@ Feature: Share by public link with different roles
| permissions | <permissions> |
| path | /simple-folder |
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
Examples:
| role | permissions |
| Viewer | read |
@@ -237,7 +237,7 @@ Feature: Share by public link with different roles
And the public uploads file "'single'quotes.txt" in files-drop page
And the public uploads file "new-lorem.txt" in files-drop page
Then the following files should be listed on the files-drop page:
| new-lorem.txt |
| new-lorem.txt |
And as "Alice" the content of "simple-folder/'single'quotes.txt" in the server should be the same as the content of local file "'single'quotes.txt"
And as "Alice" the content of "simple-folder/new-lorem.txt" in the server should be the same as the content of local file "new-lorem.txt"

@@ -266,7 +266,7 @@ Feature: Share by public link with different roles
And the public uploads file "'single'quotes.txt" in files-drop page
And the public uploads file "new-lorem.txt" in files-drop page
Then the following files should be listed on the files-drop page:
| new-lorem.txt |
| new-lorem.txt |
And as "Alice" the content of "simple-folder/'single'quotes.txt" in the server should be the same as the content of local file "'single'quotes.txt"
And as "Alice" the content of "simple-folder/new-lorem.txt" in the server should be the same as the content of local file "new-lorem.txt"

Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ Feature: Public link share management
And user "Alice" has logged in using the webUI
When the user copies the url of public link named "Public-link" of folder "simple-folder" using the webUI
And the user navigates to the copied public link using the webUI
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: access details dialog of public share and check the tabs displayed
@@ -148,7 +148,7 @@ Feature: Public link share management
| name | public link |
| permissions | read |
When the public uses the webUI to access the last public link created by user "Alice" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
And the create button should not be visible on the webUI


Original file line number Diff line number Diff line change
@@ -12,46 +12,46 @@ Feature: Session storage for public link
And user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has shared folder "simple-folder" with link with "read" permissions and password "pass123" in the server
When the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
When the user reloads the current page of the webUI
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: Public accesses the public link files page in a new session after visiting once (folder share)
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has shared folder "simple-folder" with link with "read" permissions and password "pass123" in the server
When the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: Public accesses the public link files page in a new session after visiting once (file share)
Given user "Alice" has created file "lorem.txt" in the server
And user "Alice" has shared folder "lorem.txt" with link with "read" permissions and password "pass123" in the server
When the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: Public link author changes the password when the public is in public link files page session (folder share)
Given user "Alice" has created folder "simple-folder" in the server
And user "Alice" has created file "simple-folder/lorem.txt" in the server
And user "Alice" has shared folder "simple-folder" with link with "read" permissions and password "pass123" in the server
When the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
And user "Alice" changes the password of last public link to "newpass" using the Sharing API in the server
When the user reloads the current page of the webUI
Then the password input for the public link should appear on the webUI
When the user accesses the public link with password "newpass" using the webUI
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share


Scenario: Public link author changes the password when the public is in public link files page session (file share)
Given user "Alice" has created file "lorem.txt" in the server
And user "Alice" has shared folder "lorem.txt" with link with "read" permissions and password "pass123" in the server
When the public uses the webUI to access the last public link created by user "Alice" with password "pass123" in a new session
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
And user "Alice" changes the password of last public link to "newpass" using the Sharing API in the server
When the user reloads the current page of the webUI
Then the password input for the public link should appear on the webUI
When the user accesses the public link with password "newpass" using the webUI
Then file "lorem.txt" should be listed on the webUI
Then file "lorem.txt" should be listed on the webUI as single share
7 changes: 7 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
@@ -351,6 +351,10 @@ module.exports = {
await this.waitForElementPresent({ selector: '@anyAfterLoading', abortOnFailure })
return this
},
waitForFileVisibleAsSingleShare: async function (resource) {
await this.waitForElementPresent({ selector: '@sharedDetailResource' })
return this
},
/**
* Wait for a filerow with given filename to be visible
*
@@ -707,6 +711,9 @@ module.exports = {
filesListProgressBar: {
selector: '#files-list-progress'
},
sharedDetailResource: {
selector: '.resource-details .oc-resource-name'
},
anyAfterLoading: {
selector:
'//*[self::table[contains(@class, "files-table")] or self::div[contains(@class, "files-empty")] or self::div[contains(@class, "files-not-found")] or self::div[contains(@class, "resource-details")]]',
4 changes: 4 additions & 0 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
@@ -359,6 +359,10 @@ Then('folder {string} should be listed on the webUI', (folder) => {
return client.page.FilesPageElement.filesList().waitForFileVisible(folder, 'folder')
})

Then('file/folder {string} should be listed on the webUI as single share', (resource) => {
return client.page.FilesPageElement.filesList().waitForFileVisibleAsSingleShare(resource)
})

Then('file/folder with path {string} should be listed on the webUI', function (path) {
return client.page.FilesPageElement.filesList().waitForFileVisible(path)
})

0 comments on commit a546445

Please sign in to comment.