Skip to content

Commit

Permalink
Add test to see the thumbnails in small and big preview
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Aug 2, 2022
1 parent 2eb5ea5 commit 3875d52
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUIComments/comments.feature:40](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L40)
- [webUIComments/comments.feature:41](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L41)
- [webUIComments/comments.feature:42](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L42)
- [webUIFilesDetails/fileDetails.feature:74](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L74)
- [webUIFilesDetails/fileDetails.feature:90](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L90)
- [webUIFilesDetails/fileDetails.feature:107](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L107)
- [webUIFilesDetails/fileDetails.feature:124](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L124)
- [webUIFilesDetails/fileDetails.feature:153](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L153)
- [webUIFilesDetails/fileDetails.feature:84](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L84)
- [webUIFilesDetails/fileDetails.feature:100](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L100)
- [webUIFilesDetails/fileDetails.feature:117](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L117)
- [webUIFilesDetails/fileDetails.feature:134](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L134)
- [webUIFilesDetails/fileDetails.feature:163](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L163)

### [Tags page not implemented yet](https://github.com/owncloud/web/issues/5017)
- [webUIDeleteFilesFolders/deleteFilesFolders.feature:135](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature#L135)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUIComments/comments.feature:40](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L40)
- [webUIComments/comments.feature:41](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L41)
- [webUIComments/comments.feature:42](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIComments/comments.feature#L42)
- [webUIFilesDetails/fileDetails.feature:74](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L74)
- [webUIFilesDetails/fileDetails.feature:90](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L90)
- [webUIFilesDetails/fileDetails.feature:107](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L107)
- [webUIFilesDetails/fileDetails.feature:124](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L124)
- [webUIFilesDetails/fileDetails.feature:153](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L153)
- [webUIFilesDetails/fileDetails.feature:84](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L84)
- [webUIFilesDetails/fileDetails.feature:100](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L100)
- [webUIFilesDetails/fileDetails.feature:117](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L117)
- [webUIFilesDetails/fileDetails.feature:134](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L134)
- [webUIFilesDetails/fileDetails.feature:163](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L163)

### [Deletion of a recursive folder from trashbin is not possible](https://github.com/owncloud/product/issues/188)
- [webUITrashbinDelete/trashbinDelete.feature:85](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L85)
Expand Down Expand Up @@ -299,8 +299,8 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUIUpload/upload.feature:42](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L42)

### [Favorites deactivated in ocis temporarily](https://github.com/owncloud/ocis/issues/1228)
- [webUIFilesDetails/fileDetails.feature:42](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L42)
- [webUIFilesDetails/fileDetails.feature:57](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L57)
- [webUIFilesDetails/fileDetails.feature:47](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L42)
- [webUIFilesDetails/fileDetails.feature:67](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesDetails/fileDetails.feature#L57)
- [webUIRenameFiles/renameFiles.feature:257](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIRenameFiles/renameFiles.feature#L257)

### [Copy/move not possible from and into shares in oCIS](https://github.com/owncloud/web/issues/6892)
Expand Down
44 changes: 27 additions & 17 deletions tests/acceptance/features/webUIFilesDetails/fileDetails.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@ Feature: User can open the details panel for any file or folder
And the user has browsed to the personal page
When the user opens the sidebar for file "lorem.txt" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "details" details panel should be visible
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "actions" panel in details panel using the webUI
And the "actions" details panel should be visible
Then the "actions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
And the "small" preview of thumbnail should be visible in the "people" panel
When the user switches to "versions" panel in details panel using the webUI
Then the "versions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "versions" panel

@files_versions-app-required
Scenario: View different areas of the app-sidebar for a folder in files page
Given user "Alice" has created folder "simple-folder" in the server
And the user has browsed to the personal page
When the user opens the sidebar for folder "simple-folder" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "details" details panel should be visible
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "actions" panel in details panel using the webUI
And the "actions" details panel should be visible
Then the "actions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "links" panel in details panel using the webUI
Then the "links" details panel should be visible
And the "small" preview of thumbnail should be visible in the "people" panel

@files_versions-app-required @ocis-reva-issue-39
Scenario: View different areas of the app-sidebar for a file in favorites page
Expand All @@ -46,12 +51,17 @@ Feature: User can open the details panel for any file or folder
And the user has browsed to the favorites page
When the user opens the sidebar for file "lorem.txt" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "details" details panel should be visible
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "actions" panel in details panel using the webUI
And the "actions" details panel should be visible
Then the "actions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
And the "small" preview of thumbnail should be visible in the "people" panel
When the user switches to "versions" panel in details panel using the webUI
Then the "versions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "versions" panel

@files_versions-app-required @ocis-reva-issue-39
Scenario: View different areas of the app-sidebar for a folder in favorites page
Expand All @@ -61,14 +71,14 @@ Feature: User can open the details panel for any file or folder
And the user has browsed to the favorites page
When the user opens the sidebar for folder "simple-folder" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "details" details panel should be visible
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "actions" panel in details panel using the webUI
And the "actions" details panel should be visible
Then the "actions" details panel should be visible
And the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "links" panel in details panel using the webUI
Then the "links" details panel should be visible
And the "small" preview of thumbnail should be visible in the "people" panel

@issue-1158 @comments-app-required @public_link_share-feature-required
Scenario: user shares a file through public link and then the details dialog should work in a Shared by link page
Expand All @@ -78,7 +88,7 @@ Feature: User can open the details panel for any file or folder
| path | simple-folder |
And the user has browsed to the shared-via-link page
When the user opens the actions sidebar panel of folder "simple-folder" on the webUI
Then the thumbnail should be visible in the app-sidebar
Then the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "links" panel in details panel using the webUI
Expand All @@ -95,7 +105,7 @@ Feature: User can open the details panel for any file or folder
Then folder "simple-folder" should be listed on the webUI
When the user opens the sidebar for folder "simple-folder" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "comments" panel in details panel using the webUI
Expand All @@ -112,7 +122,7 @@ Feature: User can open the details panel for any file or folder
Then folder "simple-folder" should be listed on the webUI
When the user opens the sidebar for folder "simple-folder" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "comments" panel in details panel using the webUI
Expand All @@ -130,7 +140,7 @@ Feature: User can open the details panel for any file or folder
Then folder "simple-folder" should be listed on the webUI
When the user opens the sidebar for folder "simple-folder" on the webUI
Then the app-sidebar should be visible
And the thumbnail should be visible in the app-sidebar
And the "big" preview of thumbnail should be visible in the "details" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "comments" panel in details panel using the webUI
Expand Down Expand Up @@ -159,7 +169,7 @@ Feature: User can open the details panel for any file or folder
And the user searches for tag "simple" using the webUI
Then folder "simple-folder" should be listed on the webUI
When the user opens the actions sidebar panel of folder "simple-folder" on the webUI
Then the thumbnail should be visible in the app-sidebar
And the "small" preview of thumbnail should be visible in the "actions" panel
When the user switches to "people" panel in details panel using the webUI
Then the "people" details panel should be visible
When the user switches to "links" panel in details panel using the webUI
Expand Down
20 changes: 16 additions & 4 deletions tests/acceptance/pageObjects/FilesPageElement/appSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ const util = require('util')

module.exports = {
commands: {
isThumbnailVisible: function () {
return this.waitForElementVisible('@sidebar').waitForElementVisible('@fileInfoIcon')
isThumbnailVisible: function (previewSize, item) {
if (previewSize === 'big') {
return this.waitForElementVisible('@sidebar').waitForElementVisible(
'@fileInfoIconBigPreview'
)
} else {
const panelName = item === 'people' ? 'sharing' : item
return this.waitForElementVisible('@sidebar').waitForElementVisible(
util.format(this.elements.fileInfoIconSmallPreview.selector, panelName)
)
}
},
closeSidebarIfOpen: async function (timeout = 300) {
if (!(await this.isSideBarOpen(false))) {
Expand Down Expand Up @@ -208,8 +217,11 @@ module.exports = {
selector: '//*[@id="files-sidebar"]',
locateStrategy: 'xpath'
},
fileInfoIcon: {
selector: '.details-icon-wrapper .details-icon'
fileInfoIconBigPreview: {
selector: '#oc-file-details-sidebar .details-icon'
},
fileInfoIconSmallPreview: {
selector: '#sidebar-panel-%s-item .file_info__icon'
},
fileInfoResourceNameAnyType: {
selector: `//div[contains(@id, "files-sidebar")]//span[contains(@class, "oc-resource-name") and (@data-test-resource-name=%s or @data-test-resource-path=%s)]`,
Expand Down
9 changes: 6 additions & 3 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,12 @@ Then(
}
)

Then('the thumbnail should be visible in the app-sidebar', function () {
return client.page.FilesPageElement.appSideBar().isThumbnailVisible()
})
Then(
'the {string} preview of thumbnail should be visible in the {string} panel',
function (previewSize, panelName) {
return client.page.FilesPageElement.appSideBar().isThumbnailVisible(previewSize, panelName)
}
)

When('the user deletes the file {string} from the deleted files list', function (element) {
return client.page.FilesPageElement.filesList().deleteImmediately(element)
Expand Down

0 comments on commit 3875d52

Please sign in to comment.