Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
b6dec0be
Commit
b6dec0be
authored
4 years ago
by
Daniel Calviño Sánchez
Browse files
Options
Downloads
Patches
Plain Diff
Add acceptance tests for reshares by link when resharing is disabled
Signed-off-by:
Daniel Calviño Sánchez
<
danxuliu@gmail.com
>
parent
22d949d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/acceptance/features/app-files-sharing-link.feature
+80
-0
80 additions, 0 deletions
tests/acceptance/features/app-files-sharing-link.feature
tests/acceptance/features/bootstrap/FilesAppSharingContext.php
+31
-0
31 additions, 0 deletions
.../acceptance/features/bootstrap/FilesAppSharingContext.php
with
111 additions
and
0 deletions
tests/acceptance/features/app-files-sharing-link.feature
+
80
−
0
View file @
b6dec0be
...
...
@@ -166,3 +166,83 @@ Feature: app-files-sharing-link
And
I authenticate with password
"abcdef"
# download starts no page redirection
And
I see that the current page is the Authenticate page for the direct download shared link I wrote down
Scenario
:
sharee can not reshare by link if resharing is disabled in the settings after the share is created
Given
I act as John
And
I am logged in as the admin
And
I act as Jane
And
I am logged in
And
I act as John
And
I rename
"welcome.txt"
to
"farewell.txt"
And
I see that the file list contains a file named
"farewell.txt"
And
I share
"farewell.txt"
with
"user0"
And
I see that the file is shared with
"user0"
And
I visit the settings page
And
I open the
"Sharing"
section of the
"Administration"
group
And
I disable resharing
And
I see that resharing is disabled
When
I act as Jane
# The Files app is open again to reload the file list
And
I open the Files app
Then
I see that the file list contains a file named
"farewell.txt"
And
I open the details view for
"farewell.txt"
And
I see that the details view is open
And
I open the
"Sharing"
tab in the details view
And
I see that the
"Sharing"
tab in the details view is eventually loaded
And
I see that the file is shared with me by
"admin"
And
I see that resharing the file by link is not available
Scenario
:
sharee can unshare a reshare by link if resharing is disabled in the settings after the reshare is created
Given
I act as John
And
I am logged in as the admin
And
I act as Jane
And
I am logged in
And
I act as John
And
I rename
"welcome.txt"
to
"farewell.txt"
And
I see that the file list contains a file named
"farewell.txt"
And
I share
"farewell.txt"
with
"user0"
And
I see that the file is shared with
"user0"
And
I act as Jane
# The Files app is open again to reload the file list
And
I open the Files app
And
I share the link for
"farewell.txt"
And
I write down the shared link
And
I act as John
And
I visit the settings page
And
I open the
"Sharing"
section of the
"Administration"
group
And
I disable resharing
And
I see that resharing is disabled
When
I act as Jane
# The Files app is open again to reload the file list
And
I open the Files app
And
I open the details view for
"farewell.txt"
And
I see that the details view is open
And
I open the
"Sharing"
tab in the details view
And
I see that the
"Sharing"
tab in the details view is eventually loaded
And
I unshare the link share
Then
I see that resharing the file by link is not available
Scenario
:
reshare by link can be accessed if resharing is disabled in the settings after the reshare is created
Given
I act as John
And
I am logged in as the admin
And
I act as Jane
And
I am logged in
And
I act as John
And
I rename
"welcome.txt"
to
"farewell.txt"
And
I see that the file list contains a file named
"farewell.txt"
And
I share
"farewell.txt"
with
"user0"
And
I see that the file is shared with
"user0"
And
I act as Jane
# The Files app is open again to reload the file list
And
I open the Files app
And
I share the link for
"farewell.txt"
And
I write down the shared link
And
I act as John
And
I visit the settings page
And
I open the
"Sharing"
section of the
"Administration"
group
And
I disable resharing
And
I see that resharing is disabled
When
I act as Jim
And
I visit the shared link I wrote down
Then
I see that the current page is the shared link I wrote down
And
I see that the shared file preview shows the text
"Welcome to your Nextcloud account!"
This diff is collapsed.
Click to expand it.
tests/acceptance/features/bootstrap/FilesAppSharingContext.php
+
31
−
0
View file @
b6dec0be
...
...
@@ -326,6 +326,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
describedAs
(
"Password protect by Talk checkbox input in the details view in Files app"
);
}
/**
* @return Locator
*/
public
static
function
unshareLinkButton
(
$shareLinkMenuTriggerElement
)
{
return
Locator
::
forThe
()
->
xpath
(
"//li[contains(concat(' ', normalize-space(@class), ' '), ' action ')]//button[normalize-space() = 'Unshare']"
)
->
descendantOf
(
self
::
shareLinkMenu
(
$shareLinkMenuTriggerElement
))
->
describedAs
(
"Unshare link button in the details view in Files app"
);
}
/**
* @Given I share the link for :fileName
*/
...
...
@@ -490,6 +499,16 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
$this
->
actor
->
find
(
self
::
unshareButton
(
$shareWithName
,
$shareWithMenuTriggerElement
),
2
)
->
click
();
}
/**
* @When I unshare the link share
*/
public
function
iUnshareTheLink
()
{
$this
->
showShareLinkMenuIfNeeded
();
$shareLinkMenuTriggerElement
=
$this
->
actor
->
find
(
self
::
shareLinkMenuTrigger
(),
2
);
$this
->
actor
->
find
(
self
::
unshareLinkButton
(
$shareLinkMenuTriggerElement
),
2
)
->
click
();
}
/**
* @Then I see that the file is shared with me by :sharedByName
*/
...
...
@@ -528,6 +547,18 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
$this
->
actor
->
find
(
self
::
shareWithInput
(),
10
)
->
getWrappedElement
()
->
getAttribute
(
"placeholder"
),
"Resharing is not allowed"
);
}
/**
* @Then I see that resharing the file by link is not available
*/
public
function
iSeeThatResharingTheFileByLinkIsNotAvailable
()
{
if
(
!
WaitFor
::
elementToBeEventuallyNotShown
(
$this
->
actor
,
self
::
shareLinkAddNewButton
(),
$timeout
=
10
*
$this
->
actor
->
getFindTimeoutMultiplier
()))
{
PHPUnit_Framework_Assert
::
fail
(
"The add new share link button is still shown after
$timeout
seconds"
);
}
}
/**
* @Then I see that :sharedWithName can not be allowed to edit the share
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment