Skip to content

Commit

Permalink
check only versions tab is displayed in public link page
Browse files Browse the repository at this point in the history
  • Loading branch information
haribhandari07 committed Nov 27, 2019
1 parent 1bcb6ef commit 07d4b41
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,21 @@ Feature: Share by public link
When the user uploads file "lorem.txt" keeping both new and existing files using the webUI
Then file "lorem.txt" should be listed on the webUI
And file "lorem (2).txt" should be listed on the webUI

@issue-2090
Scenario: access details dialog of public share and check the tabs displayed
Given user "user1" has logged in using the webUI
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 "user1"
And the user picks the row of file "lorem.txt" in the webUI
Then the following tabs should be visible in the details dialog
| name |
| versions |
| links |
| collaborators |
# Then the following tabs should not be visible in the details dialog
# | name |
# | links |
# | collaborators |

18 changes: 18 additions & 0 deletions tests/acceptance/pageObjects/filesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ module.exports = {
callback(result.value)
})
},
getVisibleTabs: async function () {
const visibleTabsCollection = this.elements.tabsInSideBar.selector
const tabs = []
let elements
await this.api.elements('xpath', visibleTabsCollection, function (result) {
elements = result.value
})
for (const { ELEMENT } of elements) {
await this.api.elementIdText(ELEMENT, function (result) {
tabs.push(result.value.toLowerCase())
})
}
return tabs
},
copyPermalinkFromFilesAppBar: function () {
return this
.waitForElementVisible('@permalinkCopyButton')
Expand Down Expand Up @@ -450,6 +464,10 @@ module.exports = {
restorePreviousVersion: {
selector: '(//div[contains(@id,"oc-file-versions")]//tbody/tr[@class="file-row"])[1]//button[1]',
locateStrategy: 'xpath'
},
tabsInSideBar: {
selector: '//div[@class="sidebar-container"]//li/a',
locateStrategy: 'xpath'
}
}
}
9 changes: 9 additions & 0 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,15 @@ Then('the {string} details panel should be visible', function (panel) {
})
})

Then('the following tabs should be visible in the details dialog', async function (table) {
const visibleTabs = await client.page.filesPage().getVisibleTabs()
const expectedVisibleTabs = table.rows()
const difference = visibleTabs.filter(tab => !expectedVisibleTabs.flat().includes(tab))
if (difference.length !== 0) {
throw new Error(`${difference} tabs was expected to be visible but not found.`)
}
})

Then('no {string} tab should be available in the details panel', function (tab) {
const tabSelector = client.page.filesPage().getXpathOfLinkToTabInSidePanel()
return client.page.filesPage()
Expand Down

0 comments on commit 07d4b41

Please sign in to comment.