1 |
efrain |
1 |
@mod @mod_customcert
|
|
|
2 |
Feature: Being able to set a site setting to determine whether or not to display the position X and Y fields
|
|
|
3 |
In order to ensure the show position X and Y fields setting works as expected
|
|
|
4 |
As an admin
|
|
|
5 |
I need to ensure teachers can see the position X and Y fields depending on the site setting
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | name | intro | course | idnumber |
|
|
|
19 |
| customcert | Custom certificate 1 | Custom certificate 1 intro | C1 | customcert1 |
|
|
|
20 |
|
|
|
21 |
Scenario: Adding an element with the show position X and Y setting disabled
|
|
|
22 |
And I log in as "teacher1"
|
|
|
23 |
And I am on "Course 1" course homepage
|
|
|
24 |
And I follow "Custom certificate 1"
|
|
|
25 |
And I navigate to "Edit certificate" in current page administration
|
|
|
26 |
And I add the element "Code" to page "1" of the "Custom certificate 1" certificate template
|
|
|
27 |
And I should not see "Position X"
|
|
|
28 |
And I should not see "Position Y"
|
|
|
29 |
|
|
|
30 |
Scenario: Adding an element with the show position X and Y setting enabled
|
|
|
31 |
And I log in as "admin"
|
|
|
32 |
And I navigate to "Plugins" in site administration
|
|
|
33 |
And I click on "Settings" "link" in the "Custom certificate" "table_row"
|
|
|
34 |
And I set the field "Show position X and Y" to "1"
|
|
|
35 |
And I press "Save changes"
|
|
|
36 |
And I log out
|
|
|
37 |
And I log in as "teacher1"
|
|
|
38 |
And I am on "Course 1" course homepage
|
|
|
39 |
And I follow "Custom certificate 1"
|
|
|
40 |
And I navigate to "Edit certificate" in current page administration
|
|
|
41 |
And I add the element "Code" to page "1" of the "Custom certificate 1" certificate template
|
|
|
42 |
And I should see "Position X"
|
|
|
43 |
And I should see "Position Y"
|
|
|
44 |
And I set the following fields to these values:
|
|
|
45 |
| Position X | 5 |
|
|
|
46 |
| Position Y | 10 |
|
|
|
47 |
And I press "Save changes"
|
|
|
48 |
And I click on ".edit-icon" "css_element" in the "Code" "table_row"
|
|
|
49 |
And the following fields match these values:
|
|
|
50 |
| Position X | 5 |
|
|
|
51 |
| Position Y | 10 |
|