-
Notifications
You must be signed in to change notification settings - Fork 2
/
s3bucket_global.feature
112 lines (105 loc) · 4.71 KB
/
s3bucket_global.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
@repository @repository_s3bucket @_file_upload
Feature: S3 bucket global repositories should be seen by admins and teachers
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | email | firstname | lastname |
| student | s@example.com | Student | 1 |
| teacher | t@example.com | Teacher | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student | C1 | student |
| teacher | C1 | editingteacher |
And I enable repository "s3bucket"
And I log in as "admin"
And I navigate to "Plugins > Repositories > Amazon S3 bucket" in site administration
And I click on "Create a repository instance" "button"
And I set the field "Name" to "Global bucket"
And I set the field "Bucket name" to "globalbucket"
And I set the field "Access key" to "anoTherfake@1"
And I set the field "Secret key" to "anotherFake_$2"
And I click on "Save" "button"
And I log out
@javascript
Scenario: An admin can see the global s3 bucket repository
When I log in as "admin"
Then I should see "No files available" in the "Private files" "block"
And I follow "Manage private files..."
And I click on "Add..." "button" in the "Files" "form_row"
Then I should see "Global bucket"
And I follow "Global bucket"
Then I should see "2020_dir"
And I should see "2020_f.jpg"
And I follow "2020_f.jpg"
Then I should see "Make a copy of the file"
# And I click on "Make a copy of the file" "radio"
And I click on "Select this file" "button"
Then I should see "2020_f.jpg"
And I click on "Save changes" "button"
Then I should not see "No files available" in the "Private files" "block"
And I should see "2020_f.jpg" in the "Private files" "block"
@javascript
Scenario: An admin can search the global s3 bucket repository
When I log in as "admin"
And I follow "Manage private files..."
And I click on "Add..." "button" in the "Files" "form_row"
Then I should see "Global bucket"
And I follow "Global bucket"
Then I should see "2" elements in repository content area
And I click on "Display folder with file details" "link" in the ".file-picker" "css_element"
And I click on "Display folder as file tree" "link" in the ".file-picker" "css_element"
And I click on "Display folder with file icons" "link" in the ".file-picker" "css_element"
And "Search repository" "field" should be visible
And I set the field "Search repository" to "2020"
When I press enter
Then I should see "2" elements in repository content area
And I set the field "Search repository" to "2021"
When I press enter
Then I should see "0" elements in repository content area
Scenario: A teacher cannot see the global s3 bucket repository in private area
When I log in as "teacher"
And I follow "Manage private files..."
And I click on "Add..." "button" in the "Files" "form_row"
Then I should not see "Global bucket"
@javascript
Scenario: A teacher can see the global s3 bucket repository in a course module
When I log in as "teacher"
And I am on "Course 1" course homepage with editing mode on
When I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Folder name |
| Description | Folder description |
And I click on "Add..." "button" in the "Files" "form_row"
Then I should see "Global bucket"
And I follow "Global bucket"
Then I should see "2020_dir"
And I should see "2020_f.jpg"
And I follow "2020_f.jpg"
Then I should see "Make a copy of the file"
And I click on "Select this file" "button"
Then I should see "2020_f.jpg"
And I click on "Save and display" "button"
Then I should see "Folder description"
And I should see "2020_f.jpg"
@javascript
Scenario: A teacher can add a global s3 bucket link in a url module
When I log in as "teacher"
And I am on "Course 1" course homepage with editing mode on
When I add a "URL" to section "1" and I fill the form with:
| Name | Url name |
And I click on "Choose a link..." "button"
Then I should see "Global bucket"
And I follow "Global bucket"
Then I should see "2020_dir"
And I should see "2020_f.jpg"
And I follow "2020_f.jpg"
And I click on "Select this file" "button"
And I click on "Save and return to course" "button"
Then I should see "Url name"
Scenario: A student cannot see the global s3 bucket repository
When I log in as "student"
And I follow "Manage private files..."
And I click on "Add..." "button" in the "Files" "form_row"
Then I should not see "Global bucket"