1 |
efrain |
1 |
@mod @mod_assign @_file_upload
|
|
|
2 |
Feature: In an assignment, students can upload files for assessment
|
|
|
3 |
In order to complete my assignments providing files
|
|
|
4 |
As a student
|
|
|
5 |
I need to upload files from my file system to be assessed
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Submit a file and update the submission with another file
|
|
|
9 |
Given the following "courses" exist:
|
|
|
10 |
| fullname | shortname | category | groupmode |
|
|
|
11 |
| Course 1 | C1 | 0 | 1 |
|
|
|
12 |
And the following "users" exist:
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
| student1 | Student | 1 | student1@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
And the following "activity" exists:
|
|
|
21 |
| activity | assign |
|
|
|
22 |
| course | C1 |
|
|
|
23 |
| name | Test assignment name |
|
|
|
24 |
| intro | Submit your online text |
|
|
|
25 |
| submissiondrafts | 0 |
|
|
|
26 |
| assignsubmission_onlinetext_enabled | 0 |
|
|
|
27 |
| assignsubmission_file_enabled | 1 |
|
|
|
28 |
| assignsubmission_file_maxfiles | 2 |
|
|
|
29 |
| assignsubmission_file_maxsizebytes | 1000000 |
|
|
|
30 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
31 |
When I press "Add submission"
|
|
|
32 |
And I upload "lib/tests/fixtures/empty.txt" file to "File submissions" filemanager
|
|
|
33 |
And I press "Save changes"
|
|
|
34 |
Then I should see "Submitted for grading"
|
|
|
35 |
And I should see "Not graded"
|
|
|
36 |
And "empty.txt" "link" should exist
|
|
|
37 |
And I press "Edit submission"
|
|
|
38 |
And I upload "lib/tests/fixtures/upload_users.csv" file to "File submissions" filemanager
|
|
|
39 |
And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should not be visible
|
|
|
40 |
And I press "Save changes"
|
|
|
41 |
And I should see "Submitted for grading"
|
|
|
42 |
And "empty.txt" "link" should exist
|
|
|
43 |
And "upload_users.csv" "link" should exist
|
|
|
44 |
And I press "Edit submission"
|
|
|
45 |
And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should not be visible
|
|
|
46 |
And I delete "empty.txt" from "File submissions" filemanager
|
|
|
47 |
And I press "Save changes"
|
|
|
48 |
And "empty.txt" "link" should not exist
|
|
|
49 |
And "upload_users.csv" "link" should exist
|