Skip to content

Commit

Permalink
Not working yet...
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo committed Sep 23, 2019
1 parent 13bbf2c commit 948f0ae
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/files/src/components/FilesAppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<oc-breadcrumb id="files-breadcrumb" :items="breadcrumbs" v-if="showBreadcrumb" home></oc-breadcrumb>
<span class="uk-margin-small-left" v-if="showBreadcrumb && currentFolder.privateLink">
<oc-icon name="ready" v-show="linkCopied" />
<oc-icon name="link" v-clipboard="() => currentFolder.privateLink"
<oc-icon id="files-permalink-copy" name="link" v-clipboard="() => currentFolder.privateLink"
v-show="!linkCopied"
v-clipboard:success="clipboardSuccessHandler"
/>
Expand Down
14 changes: 14 additions & 0 deletions tests/acceptance/features/webUIFiles/copyCurrentPath.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: copy current path as a permanent link
As a user
I want to copy the permanent link to the current folder
So that I can paste paste it else where

Background:
Given user "user1" has been created with default attributes
And user "user1" has logged in using the webUI
And the user has browsed to the files page

@yetToImplement
Scenario: Copy permalink
When the user copies permalink to the current folder
Then the clipboard content should match current folder permalink
8 changes: 8 additions & 0 deletions tests/acceptance/pageObjects/filesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ module.exports = {
.isVisible(selector, (result) => {
callback(result.value)
})
},
copyPermalink: function () {
return this
.waitForElementVisible('@permalinkCopyButton')
.click('@permalinkCopyButton')
}
},
elements: {
Expand All @@ -174,6 +179,9 @@ module.exports = {
newFolderOkButton: {
selector: '#new-folder-ok'
},
permalinkCopyButton: {
selector: 'files-permalink-copy'
},
breadcrumb: {
selector: '#files-breadcrumb li:nth-of-type(2)'
},
Expand Down
13 changes: 13 additions & 0 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,16 @@ Given('the user has created the following files', function (entryList) {
})
return client
})

When('the user copies permalink to the current folder', function () {
client.page.copyPermalink()
})
Then('the clipboard content should match current folder permalink', function () {
const myInput = client.page.createElement('INPUT')
const inputType = client.page.createAttribute('type')
inputType.value = 'hidden'
myInput.setAttributeNode(inputType)
client.page.focus(myInput)
client.keys([client.Keys.CONTROL, 'v'])
console.log(myInput.value)
})

0 comments on commit 948f0ae

Please sign in to comment.