-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment.feature
125 lines (120 loc) · 6.01 KB
/
assignment.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
113
114
115
116
117
118
119
120
121
122
123
124
@plugin @plagiarism @plagiarism_turnitinsim @plagiarism_turnitinsim_assignment @plagiarism_turnitinsim_smoke
Feature: Plagiarism plugin works with a Moodle Assignment
In order to allow students to send assignment submissions to Turnitin
As a user
I need to create an assignment with the plugin enabled and the assignment to launch successfully.
Background: Set up the users, course and assignment with plugin enabled
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And I create a unique moodle user with username "student1"
And I create a unique moodle user with username "student2"
And I create a unique moodle user with username "instructor1"
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| instructor1 | C1 | editingteacher |
# Enable and configure plugin.
When I log in as "admin"
And I navigate to "Advanced features" in site administration
And I set the field "Enable plagiarism plugins" to "1"
And I press "Save changes"
And I navigate to "Plugins > Plagiarism > Turnitin Integrity plugin" in site administration
And I configure Turnitin Integrity credentials
And I set the following fields to these values:
| Enable Turnitin Integrity for Assign | 1 |
And I press "Save changes"
# Check that features enabled are displayed.
Then I should see "Turnitin Integrity features"
And I should see "Repositories checked against"
# Create Assignment.
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| turnitinenabled | 1 |
| accessoptions[accessstudents] | 1 |
| Group mode | No group |
And I follow "Test assignment name"
Then I should see "Grading summary"
@javascript @_file_upload @_switch_window
Scenario: A student can accept the EULA and submit to Turnitin, an Originality Report is retrieved and the Cloud Viewer can be launched.
Given I log out
# Student submits.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And I click on "#turnitinsim_eula_accept" "css_element"
And I upload "plagiarism/turnitinsim/tests/fixtures/testfile.txt" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Submitted for grading"
And I should see "Queued"
And I log out
# Admin runs scheduled task to send submission to Turnitin.
And I log in as "admin"
And I run the scheduled task "plagiarism_turnitinsim\task\send_submissions"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student1 student1" row "File submissions" column of "generaltable" table should contain "Pending"
# Student can see post has been sent to Turnitin.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
Then I should see "Pending"
And I log out
# Admin runs scheduled task to request an originality report.
And I log in as "admin"
And I wait "10" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
# Admin runs scheduled task to request originality report score.
And I wait "20" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
And I wait "30" seconds
And I run the scheduled task "plagiarism_turnitinsim\task\get_reports"
# Instructor should be able to view Cloud Viewer and be presented with the EULA.
And I log out
And I log in as "instructor1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student1 student1" row "File submissions" column of "generaltable" table should contain "%"
And I click on ".turnitinsim_or_score" "css_element"
And I switch to viewer window
And I click on "Accept" "button"
Then I should see "testfile.txt"
And I should see "student1 student1"
# Open the Cloud Viewer as student1.
And I switch back to the main window
And I wait "20" seconds
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
Then I should see "%"
And I click on ".turnitinsim_or_score" "css_element"
And I switch to viewer window
@javascript @_file_upload
Scenario: A student can decline the EULA, their submission still processes in Moodle but is not sent to Turnitin
Given I log out
# Student submits.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And I click on "#turnitinsim_eula_decline" "css_element"
Then I should see "Your submissions will not be sent to Turnitin as you have not accepted the Turnitin End User Licence Agreement."
And I upload "plagiarism/turnitinsim/tests/fixtures/testfile.txt" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Submitted for grading"
And I should see "Awaiting EULA"
And I log out
# Admin runs scheduled task to send submissions to Turnitin.
And I log in as "admin"
And I run the scheduled task "plagiarism_turnitinsim\task\send_submissions"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I navigate to "View all submissions" in current page administration
Then "student2 student2" row "File submissions" column of "generaltable" table should contain "Awaiting EULA"