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

[stable13] Add acceptance tests for permissions on public shared folders #8758

merged 6 commits into from Mar 9, 2018


None yet
3 participants

danxuliu commented Mar 9, 2018

Backport of #8594

danxuliu added some commits Feb 18, 2018

Extract file list locators and steps to its own class
Besides the extraction some minor adjustments (sorting locators for file
action menu entries to reflect the order of the menu entries in the UI,
moving parametrized locators like "createMenuItemFor" above the locators
that use them and placing "descendantOf" calls always in a new line)
were made too.

Signed-off-by: Daniel Calviño Sánchez <>
Store the name of the actor in the Actor object
This is needed to be able to easily use the actor as a key in an array.

Signed-off-by: Daniel Calviño Sánchez <>
Generalize file list locators so a specific ancestor can be used
The file list is used in other places besides the Files app (for
example, the File sharing app); in those cases the locators for the file
list elements are the same, but not for the ancestor of the file list.
To make possible to reuse the file list locators in those cases too now
they receive the ancestor to use.

Note that the locators for the file actions menu were not using an
ancestor locator because it is expected that there is only one file
actions menu at a time in the whole page; that may change in the future,
but for the time being it is a valid assumption and thus the ancestor
was not added to those locators in this commit.

Although the locators were generalized the steps themselves still use
the "FilesAppContext::currentSectionMainView" locator as ancestor; the
steps will be generalized in a following commit.

Signed-off-by: Daniel Calviño Sánchez <>
Generalize file list steps so a specific ancestor can be used
The "FileListContext" provides steps to interact with and check the
behaviour of a file list. However, the "FileListContext" does not know
the right file list ancestor that has to be used by the file list steps,
so until now the file list steps were explicitly wired to the Files app
and they could be used only in that case.

Instead of duplicating the steps with a slightly different name (for
example, "I create a new folder named :folderName in the public shared
folder" instead of "I create a new folder named :folderName") the steps
were generalized; now contexts that "know" that certain file list
ancestor has to be used by the FileListContext steps performed by
certain actor from that point on (until changed again) set it
explicitly. For example, when the current page is the Files app then the
ancestor of the file list is the main view of the current section of the
Files app, but when the current page is a shared link then the ancestor
is set to null (because there will be just one file list, and thus its
ancestor is not relevant to differentiate between instances)

A helper trait, "FileListAncestorSetter", was introduced to reduce the
boilerplate needed to set the file list ancestor from other contexts.

Signed-off-by: Daniel Calviño Sánchez <>
Extract common "wait for" functions to a helper class
Signed-off-by: Daniel Calviño Sánchez <>
Add acceptance tests for creation of subfolders in public shared folders
Signed-off-by: Daniel Calviño Sánchez <>

@danxuliu danxuliu added this to the Nextcloud 13.0.1 milestone Mar 9, 2018

@danxuliu danxuliu requested review from rullzer, MorrisJobke and skjnldsv Mar 9, 2018


rullzer approved these changes Mar 9, 2018

@MorrisJobke MorrisJobke merged commit f17cabd into stable13 Mar 9, 2018

1 of 2 checks passed

continuous-integration/drone/pr this build is pending
continuous-integration/drone/push the build was successful

@MorrisJobke MorrisJobke deleted the stable13-8594-add-acceptance-tests-for-permissions-on-public-shared-folders branch Mar 9, 2018


This comment has been minimized.

codecov bot commented Mar 9, 2018

Codecov Report

Merging #8758 into stable13 will increase coverage by <.01%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##             stable13   #8758      +/-   ##
+ Coverage        51.3%   51.3%   +<.01%     
  Complexity      25022   25022              
  Files            1609    1609              
  Lines           95294   95294              
  Branches         1376    1376              
+ Hits            48889   48893       +4     
+ Misses          46405   46401       -4
Impacted Files Coverage Δ Complexity Δ
lib/private/Server.php 80.66% <0%> (+0.11%) 134% <0%> (ø) ⬇️
core/js/js.js 66.4% <0%> (+0.11%) 0% <0%> (ø) ⬇️
lib/private/Files/Cache/Propagator.php 96.2% <0%> (+1.26%) 16% <0%> (ø) ⬇️
apps/files_trashbin/lib/Expiration.php 91.93% <0%> (+1.61%) 29% <0%> (ø) ⬇️

@MorrisJobke MorrisJobke referenced this pull request Mar 9, 2018


13.0.1 RC1 #8748

10 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment