Skip to content

Commit a027d55

Browse files
authored
Merge pull request #12700 from nextcloud/backport/12632/stable15
[stable15] Add acceptance tests for sharing files and folders with another user
2 parents 7bdfc0c + c6ca6b0 commit a027d55

10 files changed

Lines changed: 991 additions & 480 deletions

.drone.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,20 @@ pipeline:
703703
when:
704704
matrix:
705705
TESTS-ACCEPTANCE: app-files
706+
acceptance-app-files-sharing:
707+
image: nextcloudci/acceptance-php7.1:acceptance-php7.1-2
708+
commands:
709+
- tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files-sharing --selenium-server selenium:4444 allow-git-repository-modifications features/app-files-sharing.feature
710+
when:
711+
matrix:
712+
TESTS-ACCEPTANCE: app-files-sharing
713+
acceptance-app-files-sharing-link:
714+
image: nextcloudci/acceptance-php7.1:acceptance-php7.1-2
715+
commands:
716+
- tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files-sharing-link --selenium-server selenium:4444 allow-git-repository-modifications features/app-files-sharing-link.feature
717+
when:
718+
matrix:
719+
TESTS-ACCEPTANCE: app-files-sharing-link
706720
acceptance-app-files-tags:
707721
image: nextcloudci/acceptance-php7.1:acceptance-php7.1-2
708722
commands:
@@ -957,6 +971,10 @@ matrix:
957971
TESTS-ACCEPTANCE: app-comments
958972
- TESTS: acceptance
959973
TESTS-ACCEPTANCE: app-files
974+
- TESTS: acceptance
975+
TESTS-ACCEPTANCE: app-files-sharing
976+
- TESTS: acceptance
977+
TESTS-ACCEPTANCE: app-files-sharing-link
960978
- TESTS: acceptance
961979
TESTS-ACCEPTANCE: app-files-tags
962980
- TESTS: acceptance

tests/acceptance/config/behat.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ default:
1616
- FeatureContext
1717
- FileListContext
1818
- FilesAppContext
19-
- FilesSharingAppContext
19+
- FilesAppSharingContext
2020
- LoginPageContext
2121
- NotificationContext
22+
- PublicShareContext
2223
- SettingsContext
2324
- SettingsMenuContext
2425
- ThemingAppContext
@@ -42,9 +43,10 @@ default:
4243
- FeatureContext
4344
- FileListContext
4445
- FilesAppContext
45-
- FilesSharingAppContext
46+
- FilesAppSharingContext
4647
- LoginPageContext
4748
- NotificationContext
49+
- PublicShareContext
4850
- SettingsContext
4951
- SettingsMenuContext
5052
- ThemingAppContext
@@ -63,6 +65,9 @@ default:
6365
Jane:
6466
selenium2:
6567
wd_host: %selenium.server%
68+
Jim:
69+
selenium2:
70+
wd_host: %selenium.server%
6671
Rubeus:
6772
# Rubeus uses a browser that has CSS grid support.
6873
selenium2:
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
Feature: app-files-sharing-link
2+
3+
Scenario: open the menu in a public shared link
4+
Given I act as John
5+
And I am logged in
6+
And I share the link for "welcome.txt"
7+
And I write down the shared link
8+
When I act as Jane
9+
And I visit the shared link I wrote down
10+
And I see that the current page is the shared link I wrote down
11+
And I open the Share menu
12+
Then I see that the Share menu is shown
13+
14+
Scenario: hide download in a public shared link
15+
Given I act as John
16+
And I am logged in
17+
And I share the link for "welcome.txt"
18+
And I set the download of the shared link as hidden
19+
And I write down the shared link
20+
When I act as Jane
21+
And I visit the shared link I wrote down
22+
And I see that the current page is the shared link I wrote down
23+
Then I see that the download button is not shown
24+
And I see that the Share menu button is not shown
25+
26+
Scenario: show download again in a public shared link
27+
Given I act as John
28+
And I am logged in
29+
And I share the link for "welcome.txt"
30+
And I set the download of the shared link as hidden
31+
And I set the download of the shared link as shown
32+
And I write down the shared link
33+
When I act as Jane
34+
And I visit the shared link I wrote down
35+
And I see that the current page is the shared link I wrote down
36+
Then I see that the download button is shown
37+
And I open the Share menu
38+
And I see that the Share menu is shown
39+
40+
Scenario: creation is not possible by default in a public shared folder
41+
Given I act as John
42+
And I am logged in
43+
And I create a new folder named "Shared folder"
44+
# To share the link the "Share" inline action has to be clicked but, as the
45+
# details view is opened automatically when the folder is created, clicking
46+
# on the inline action could fail if it is covered by the details view due
47+
# to its opening animation. Instead of ensuring that the animations of the
48+
# contents and the details view have both finished it is easier to close the
49+
# details view and wait until it is closed before continuing.
50+
And I close the details view
51+
And I see that the details view is closed
52+
And I share the link for "Shared folder"
53+
And I write down the shared link
54+
When I act as Jane
55+
And I visit the shared link I wrote down
56+
And I see that the current page is the shared link I wrote down
57+
And I see that the file list is eventually loaded
58+
Then I see that it is not possible to create new files
59+
60+
Scenario: create folder in a public editable shared folder
61+
Given I act as John
62+
And I am logged in
63+
And I create a new folder named "Editable shared folder"
64+
# To share the link the "Share" inline action has to be clicked but, as the
65+
# details view is opened automatically when the folder is created, clicking
66+
# on the inline action could fail if it is covered by the details view due
67+
# to its opening animation. Instead of ensuring that the animations of the
68+
# contents and the details view have both finished it is easier to close the
69+
# details view and wait until it is closed before continuing.
70+
And I close the details view
71+
And I see that the details view is closed
72+
And I share the link for "Editable shared folder"
73+
And I set the shared link as editable
74+
And I write down the shared link
75+
When I act as Jane
76+
And I visit the shared link I wrote down
77+
And I see that the current page is the shared link I wrote down
78+
And I create a new folder named "Subfolder"
79+
Then I see that the file list contains a file named "Subfolder"
80+
81+
Scenario: owner sees folder created in the public page of an editable shared folder
82+
Given I act as John
83+
And I am logged in
84+
And I create a new folder named "Editable shared folder"
85+
# To share the link the "Share" inline action has to be clicked but, as the
86+
# details view is opened automatically when the folder is created, clicking
87+
# on the inline action could fail if it is covered by the details view due
88+
# to its opening animation. Instead of ensuring that the animations of the
89+
# contents and the details view have both finished it is easier to close the
90+
# details view and wait until it is closed before continuing.
91+
And I close the details view
92+
And I see that the details view is closed
93+
And I share the link for "Editable shared folder"
94+
And I set the shared link as editable
95+
And I write down the shared link
96+
And I act as Jane
97+
And I visit the shared link I wrote down
98+
And I see that the current page is the shared link I wrote down
99+
And I create a new folder named "Subfolder"
100+
And I see that the file list contains a file named "Subfolder"
101+
When I act as John
102+
And I enter in the folder named "Editable shared folder"
103+
Then I see that the file list contains a file named "Subfolder"
104+
105+
Scenario: set a password to a shared link
106+
Given I am logged in
107+
And I share the link for "welcome.txt"
108+
When I protect the shared link with the password "abcdef"
109+
Then I see that the working icon for password protect is shown
110+
And I see that the working icon for password protect is eventually not shown
111+
And I see that the link share is password protected
112+
# As Talk is not enabled in the acceptance tests of the server the checkbox
113+
# is never shown.
114+
And I see that the checkbox to protect the password of the link share by Talk is not shown
115+
116+
Scenario: access a shared link protected by password with a valid password
117+
Given I act as John
118+
And I am logged in
119+
And I share the link for "welcome.txt" protected by the password "abcdef"
120+
And I write down the shared link
121+
When I act as Jane
122+
And I visit the shared link I wrote down
123+
And I see that the current page is the Authenticate page for the shared link I wrote down
124+
And I authenticate with password "abcdef"
125+
Then I see that the current page is the shared link I wrote down
126+
And I see that the shared file preview shows the text "Welcome to your Nextcloud account!"
127+
128+
Scenario: access a shared link protected by password with an invalid password
129+
Given I act as John
130+
And I am logged in
131+
And I share the link for "welcome.txt" protected by the password "abcdef"
132+
And I write down the shared link
133+
When I act as Jane
134+
And I visit the shared link I wrote down
135+
And I authenticate with password "fedcba"
136+
Then I see that the current page is the Authenticate page for the shared link I wrote down
137+
And I see that a wrong password for the shared file message is shown
138+
139+
Scenario: access a direct download shared link protected by password with a valid password
140+
Given I act as John
141+
And I am logged in
142+
And I share the link for "welcome.txt" protected by the password "abcdef"
143+
And I write down the shared link
144+
When I act as Jane
145+
And I visit the direct download shared link I wrote down
146+
And I see that the current page is the Authenticate page for the direct download shared link I wrote down
147+
And I authenticate with password "abcdef"
148+
# download starts no page redirection
149+
And I see that the current page is the Authenticate page for the direct download shared link I wrote down

0 commit comments

Comments
 (0)