Skip to content
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

Acceptance test: check for the tabs displayed in details of public share page #2580

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -821,3 +821,20 @@ Feature: Share by public link
| element | name |
| folder | simple-folder |
| file | lorem.txt |

@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 |
17 changes: 17 additions & 0 deletions tests/acceptance/pageObjects/filesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@ module.exports = {
callback(result.value)
})
},
getVisibleTabs: async function () {
const tabs = []
let elements
await this.api.elements('@tabsInSideBar', 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 @@ -454,6 +467,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 @@ -618,6 +618,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 = _.difference(expectedVisibleTabs.flat(), visibleTabs)
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