1441 |
ariadna |
1 |
@mod @mod_workshop
|
|
|
2 |
Feature: Student can upload a set number of attachments in submission
|
|
|
3 |
In order to create a submission with a set number of attachments
|
|
|
4 |
As a teacher
|
|
|
5 |
I should be able to set the number of attachments
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname |
|
|
|
14 |
| Course 1 | C1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | nattachments |
|
|
|
21 |
| workshop | Workshop 1 | C1 | 2 |
|
|
|
22 |
And I am on the "Workshop 1" "workshop activity" page logged in as teacher1
|
|
|
23 |
And I edit assessment form in workshop "Workshop 1" as:
|
|
|
24 |
| id_description__idx_0_editor | Aspect1 |
|
|
|
25 |
| id_description__idx_1_editor | Aspect2 |
|
|
|
26 |
| id_description__idx_2_editor | Aspect3 |
|
|
|
27 |
And I change phase in workshop "Workshop 1" to "Submission phase"
|
|
|
28 |
|
|
|
29 |
@javascript @_file_upload
|
|
|
30 |
Scenario: Student can create submission with set number of attachments
|
|
|
31 |
Given I am on the "Workshop 1" "workshop activity" page logged in as student1
|
|
|
32 |
When I press "Add submission"
|
|
|
33 |
# Add... button is visible initially because there are no attachments yet.
|
|
|
34 |
Then "Add..." "button" should be visible
|
|
|
35 |
# Add 2 attachments - the set number of attachments.
|
|
|
36 |
And I upload "mod/workshop/tests/fixtures/moodlelogo.png" file to "Attachment" filemanager
|
|
|
37 |
And I upload "lib/tests/fixtures/gd-logo.png" file to "Attachment" filemanager
|
|
|
38 |
# Confirm that Add... button is not visible after set number of attachments is met.
|
|
|
39 |
And "Add..." "button" should not be visible
|
|
|
40 |
# Delete one attachment.
|
|
|
41 |
And I click on "gd-logo.png" "link"
|
|
|
42 |
And I click on "Delete" "button" in the "Edit gd-logo.png" "dialogue"
|
|
|
43 |
And I click on "Yes" "button" in the "Confirm" "dialogue"
|
|
|
44 |
# Confirm that Add... button is visible again after 1 attachment is deleted.
|
|
|
45 |
And "Add..." "button" should be visible
|