weekly release 3.1dev
[moodle.git] / mod / assign / feedback / editpdf / tests / behat / annotate_pdf.feature
CommitLineData
ef3bffde 1@mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
9e103d6e
JM
2Feature: In an assignment, teacher can annotate PDF files during grading
3 In order to provide visual report on a graded PDF
4 As a teacher
5 I need to use the PDF editor
6
7 @javascript
8 Scenario: Submit a PDF file as a student and annotate the PDF as a teacher
9 Given ghostscript is installed
7019e15e 10 And the following "courses" exist:
9e103d6e
JM
11 | fullname | shortname | category | groupmode |
12 | Course 1 | C1 | 0 | 1 |
7019e15e 13 And the following "users" exist:
9e103d6e 14 | username | firstname | lastname | email |
0fe86bbd
RT
15 | teacher1 | Teacher | 1 | teacher1@example.com |
16 | student1 | Student | 1 | student1@example.com |
7019e15e 17 And the following "course enrolments" exist:
9e103d6e
JM
18 | user | course | role |
19 | teacher1 | C1 | editingteacher |
20 | student1 | C1 | student |
21 And I log in as "admin"
f84a0d49 22 And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins"
9e103d6e
JM
23 And I upload "pix/help.png" file to "" filemanager
24 And I upload "pix/docs.png" file to "" filemanager
25 When I press "Save changes"
26 Then I should see "Changes saved"
27 And I follow "Test ghostscript path"
28 And I should see "The ghostscript path appears to be OK"
29 And I log out
30 And I log in as "teacher1"
31 And I follow "Course 1"
32 And I turn editing mode on
33 And I add a "Assignment" to section "1" and I fill the form with:
34 | Assignment name | Test assignment name |
35 | Description | Submit your PDF file |
36 | assignsubmission_file_enabled | 1 |
37 | Maximum number of uploaded files | 2 |
38 And I log out
39 And I log in as "student1"
40 And I follow "Course 1"
41 And I follow "Test assignment name"
42 And I press "Add submission"
43 And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
44 And I upload "mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf" file to "File submissions" filemanager
45 And I press "Save changes"
46 And I should see "Submitted for grading"
47 And I should see "submission.pdf"
48 And I should see "Not graded"
49 And I log out
50 And I log in as "teacher1"
51 And I follow "Course 1"
52 And I follow "Test assignment name"
53 And I follow "View/grade all submissions"
54 And I click on "Grade" "link" in the "Submitted for grading" "table_row"
55 And I follow "Launch PDF editor..."
f84a0d49 56 And I change window size to "large"
9e103d6e
JM
57 And I click on ".navigate-next-button" "css_element"
58 And I click on ".stampbutton" "css_element"
59 And I click on ".linebutton" "css_element"
60 And I click on ".commentcolourbutton" "css_element"
61 And I click on "//img[@alt=\"Blue\"]" "xpath_element"
f84a0d49
RT
62 And I change window size to "medium"
63 And I wait until the page is ready
9e103d6e
JM
64 And I click on "Close" "button"
65 And I press "Save changes"
66 And I should see "The grade changes were saved"
506df250
DW
67
68 @javascript
69 Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher
70 Given ghostscript is installed
71 And the following "courses" exist:
72 | fullname | shortname | category | groupmode |
73 | Course 1 | C1 | 0 | 1 |
74 And the following "users" exist:
75 | username | firstname | lastname | email |
0fe86bbd
RT
76 | teacher1 | Teacher | 1 | teacher1@example.com |
77 | student1 | Student | 1 | student1@example.com |
78 | student2 | Student | 2 | student2@example.com |
79 | student3 | Student | 3 | student3@example.com |
80 | student4 | Student | 4 | student4@example.com |
506df250
DW
81 And the following "course enrolments" exist:
82 | user | course | role |
83 | teacher1 | C1 | editingteacher |
84 | student1 | C1 | student |
85 | student2 | C1 | student |
86 | student3 | C1 | student |
87 | student4 | C1 | student |
88 And the following "groups" exist:
89 | name | course | idnumber |
90 | G1 | C1 | G1 |
91 | G2 | C1 | G2 |
92 And the following "groupings" exist:
93 | name | course | idnumber |
94 | G1 | C1 | G1 |
95 And the following "group members" exist:
96 | user | group |
97 | student1 | G1 |
98 | student2 | G1 |
99 | student3 | G2 |
100 | student4 | G2 |
101 And the following "grouping groups" exist:
102 | grouping | group |
103 | G1 | G1 |
104 | G1 | G2 |
105 And I log in as "teacher1"
106 And I follow "Course 1"
107 And I turn editing mode on
108 And I add a "Assignment" to section "1" and I fill the form with:
109 | Assignment name | Test assignment name |
110 | Description | Submit your PDF file |
111 | assignsubmission_file_enabled | 1 |
112 | Maximum number of uploaded files | 2 |
113 | Students submit in groups | Yes |
114 | Grouping for student groups | G1 |
115 And I log out
116 When I log in as "student1"
117 And I follow "Course 1"
118 And I follow "Test assignment name"
119 And I press "Add submission"
120 And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager
121 And I press "Save changes"
122 Then I should see "Submitted for grading"
123 And I should see "submission.pdf"
124 And I should see "Not graded"
125 And I log out
126 And I log in as "teacher1"
127 And I follow "Course 1"
128 And I follow "Test assignment name"
129 And I follow "View/grade all submissions"
130 And I click on "Grade" "link" in the "Student 2" "table_row"
131 And I follow "Launch PDF editor..."
e9671116 132 And I change window size to "large"
47ff1cd9
FM
133 And I click on ".stampbutton" "css_element"
134 And I click on ".drawingcanvas" "css_element"
f84a0d49
RT
135 And I change window size to "medium"
136 And I wait until the page is ready
506df250
DW
137 And I click on "Close" "button"
138 And I press "Save changes"
139 And I should see "The grade changes were saved"
140 And I press "Continue"
0fe86bbd 141 And I should see "View annotated PDF..." in the "student1@example.com" "table_row"