Skip to content

Commit

Permalink
Rewrite tests to use details button in context menu for sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 24, 2021
1 parent 3a89996 commit 60d61fb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
16 changes: 8 additions & 8 deletions tests/acceptance/features/webUIFilesDetails/fileDetails.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: User can open the details panel for any file or folder
Scenario: View different areas of the app-sidebar for a file in files page
Given user "Alice" has created file "lorem.txt"
And the user has browsed to the files page
When the user picks the row of file "lorem.txt" on the webUI
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
Expand All @@ -27,7 +27,7 @@ Feature: User can open the details panel for any file or folder
Scenario: View different areas of the app-sidebar for a folder in files page
Given user "Alice" has created folder "simple-folder"
And the user has browsed to the files page
When the user picks the row of folder "simple-folder" 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 "details" details panel should be visible
Expand All @@ -44,7 +44,7 @@ Feature: User can open the details panel for any file or folder
And the user has browsed to the files page
And user "Alice" has favorited element "lorem.txt"
And the user has browsed to the favorites page
When the user picks the row of file "lorem.txt" on the webUI
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
Expand All @@ -59,7 +59,7 @@ Feature: User can open the details panel for any file or folder
And the user has browsed to the files page
And user "Alice" has favorited element "simple-folder"
And the user has browsed to the favorites page
When the user picks the row of folder "simple-folder" 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 "details" details panel should be visible
Expand Down Expand Up @@ -93,7 +93,7 @@ Feature: User can open the details panel for any file or folder
And user "Alice" has shared folder "simple-folder" with user "Brian"
When the user browses to the shared-with-others page
Then folder "simple-folder" should be listed on the webUI
When the user picks the row of folder "simple-folder" 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
When the user switches to "people" panel in details panel using the webUI
Expand All @@ -110,7 +110,7 @@ Feature: User can open the details panel for any file or folder
And user "Alice" has created a new public link for resource "simple-folder"
When the user browses to the shared-with-others page
Then folder "simple-folder" should be listed on the webUI
When the user picks the row of folder "simple-folder" 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
When the user switches to "people" panel in details panel using the webUI
Expand All @@ -128,7 +128,7 @@ Feature: User can open the details panel for any file or folder
And the user re-logs in as "Brian" using the webUI
When the user browses to the shared-with-me page
Then folder "simple-folder" should be listed on the webUI
When the user picks the row of folder "simple-folder" 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
When the user switches to "people" panel in details panel using the webUI
Expand Down Expand Up @@ -171,7 +171,7 @@ Feature: User can open the details panel for any file or folder
Scenario: the sidebar is invisible after closing
Given user "Alice" has created file "lorem.txt"
And the user has browsed to the files page
When the user picks the row of file "lorem.txt" on the webUI
When the user opens the sidebar for file "lorem.txt" on the webUI
Then the app-sidebar should be visible
When the user closes the app-sidebar using the webUI
Then the app-sidebar should be invisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feature: Public link share management
When the user creates a new public link for folder "simple-folder" using the webUI with
| role | Editor |
And the public uses the webUI to access the last public link created by user "Alice"
And the user picks the row of file "lorem.txt" on the webUI
And the user opens the sidebar for file "lorem.txt" on the webUI
Then the following panels should be visible in the details dialog on the webUI
| name |
| versions |
Expand Down
24 changes: 12 additions & 12 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ module.exports = {
* @returns {*}
*/
openSideBar: async function(resource) {
await this.clickRow(resource)
await this.clickDetailsInContextMenu(resource)
return this.api.page.FilesPageElement.appSideBar()
},
/**
Expand All @@ -221,14 +221,15 @@ module.exports = {
/**
* @param {string} item the file/folder to click
*/
clickRow: async function(item) {
clickDetailsInContextMenu: async function(item) {
await this.waitForFileVisible(item)
const selectorXPath =
this.getFileRowSelectorByFileName(item) + this.elements.detailsBtnInFileRow.selector
const selectorContextMenu =
this.getFileRowSelectorByFileName(item) + this.elements.contextBtnInFileRow.selector
await this.click({
selector: selectorXPath,
selector: selectorContextMenu,
locateStrategy: 'xpath'
}).waitForAjaxCallsToStartAndFinish()
})
await this.click('@detailsBtnInContextMenu')
return this
},

Expand Down Expand Up @@ -265,10 +266,6 @@ module.exports = {
})
return selectionStatus
},
waitForTableLoaded: async function() {
await this.waitForElementVisible('@filesTable')
return this
},
waitForLoadingFinished: async function(awaitVisible = true, abortOnFailure = true) {
if (awaitVisible) {
await this.waitForElementVisible({ selector: '@anyAfterLoading', abortOnFailure })
Expand Down Expand Up @@ -698,10 +695,13 @@ module.exports = {
'//span[contains(@class, "oc-resource-name") and (@data-test-resource-name=%s or @data-test-resource-path=%s) and @data-test-resource-type=%s]/parent::*',
locateStrategy: 'xpath'
},
detailsBtnInFileRow: {
selector: '//button[contains(@class, "oc-table-files-btn-show-details")]',
contextBtnInFileRow: {
selector: '//button[contains(@class, "oc-table-files-btn-action-dropdown")]',
locateStrategy: 'xpath'
},
detailsBtnInContextMenu: {
selector: 'button.oc-files-actions-show-details-trigger'
},
/**
* This element is concatenated as child of @see fileRowByResourcePath
*/
Expand Down
18 changes: 9 additions & 9 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ When('the user browses to display the {string} details of file {string}', async
filename
) {
const api = client.page.FilesPageElement
await api.filesList().clickRow(filename)
await client.initAjaxCounters()
await api.filesList().openSideBar(filename)
await api.appSideBar().activatePanel(accordionItem)
await client.waitForOutstandingAjaxCalls()

Expand Down Expand Up @@ -367,7 +367,7 @@ When('the user marks file/folder {string} as favorite using the webUI sidebar',
path
) {
const api = client.page.FilesPageElement
await api.filesList().clickRow(path)
await api.filesList().openSideBar(path)
api.appSideBar().markFavoriteSidebar()
return client
})
Expand All @@ -376,7 +376,7 @@ When('the user unmarks the favorited file/folder {string} using the webUI sideba
path
) {
const api = client.page.FilesPageElement
await api.filesList().clickRow(path)
await api.filesList().openSideBar(path)
api.appSideBar().unmarkFavoriteSidebar()
return client
})
Expand Down Expand Up @@ -485,8 +485,8 @@ Then('the versions list for resource {string} should contain {int} entry/entries
expectedNumber
) {
const api = client.page.FilesPageElement
await api.filesList().clickRow(resourceName)
await client.initAjaxCounters()
await api.filesList().openSideBar(resourceName)
await api.appSideBar().activatePanel('versions')
await client.waitForOutstandingAjaxCalls()
const count = await api.versionsDialog().getVersionsCount()
Expand Down Expand Up @@ -599,8 +599,8 @@ When('the user batch restores the marked files using the webUI', function() {
return client.page.FilesPageElement.filesList().restoreSelected()
})

When('the user picks the row of file/folder {string} on the webUI', function(item) {
return client.page.FilesPageElement.filesList().clickRow(item)
When('the user opens the sidebar for file/folder {string} on the webUI', function(item) {
return client.page.FilesPageElement.filesList().openSideBar(item)
})

When('the user switches to {string} panel in details panel using the webUI', function(item) {
Expand Down Expand Up @@ -822,7 +822,7 @@ Then('as user {string} file/folder {string} should not be marked as favorite', a

Then('file/folder {string} should be marked as favorite on the webUI', async function(path) {
const selector = client.page.FilesPageElement.appSideBar().elements.fileInfoFavoriteShining
await client.page.FilesPageElement.filesList().clickRow(path)
await client.page.FilesPageElement.filesList().openSideBar(path)

client.expect.element(selector).to.be.present
client.page.FilesPageElement.appSideBar().closeSidebar()
Expand All @@ -832,7 +832,7 @@ Then('file/folder {string} should be marked as favorite on the webUI', async fun

Then('file/folder {string} should not be marked as favorite on the webUI', async function(path) {
const selector = client.page.FilesPageElement.appSideBar().elements.fileInfoFavoriteDimm
await client.page.FilesPageElement.filesList().clickRow(path)
await client.page.FilesPageElement.filesList().openSideBar(path)

client.expect.element(selector).to.be.present
client.page.FilesPageElement.appSideBar().closeSidebar()
Expand Down Expand Up @@ -1396,7 +1396,7 @@ Then(
Given('the app-sidebar for file/folder {string} has been visible on the webUI', async function(
resource
) {
await client.page.FilesPageElement.filesList().clickRow(resource)
await client.page.FilesPageElement.filesList().openSideBar(resource)

const visible = await client.page.personalPage().isSidebarVisible()
assert.strictEqual(visible, true, 'app-sidebar should be visible, but is not')
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ Then('user {string} should be listed as {string} in the collaborators list on th
Then(
'the share {string} shared with user {string} should have no expiration information displayed on the webUI',
async function(item, user) {
await client.page.FilesPageElement.filesList().clickRow(item)
await client.page.FilesPageElement.filesList().openSideBar(item)
await client.page.FilesPageElement.appSideBar().activatePanel('people')
const elementID = await client.page.FilesPageElement.SharingDialog.collaboratorsDialog().getCollaboratorExpirationInfo(
user
Expand All @@ -969,7 +969,7 @@ Then(
Then(
'the expiration information displayed on the webUI of share {string} shared with user {string} should be {string} or {string}',
async function(item, user, information1, information2) {
await client.page.FilesPageElement.filesList().clickRow(item)
await client.page.FilesPageElement.filesList().openSideBar(item)
await client.page.FilesPageElement.appSideBar().activatePanel('people')
const actualInfo = await client.page.FilesPageElement.SharingDialog.collaboratorsDialog().getCollaboratorExpirationInfo(
user
Expand Down

0 comments on commit 60d61fb

Please sign in to comment.