Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_customcert
2
Feature: Being able to manage site templates
3
  In order to ensure managing site templates works as expected
4
  As an admin
5
  I need to manage and load site templates
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
    And I log in as "admin"
21
 
22
  Scenario: Adding a site template and loading it into a course certificate
23
    And I navigate to "Plugins" in site administration
24
    And I click on "Settings" "link" in the "Custom certificate" "table_row"
25
    And I follow "Manage templates"
26
    And I press "Create template"
27
    And I set the field "Name" to "Site template"
28
    And I press "Save changes"
29
    And I add the element "Border" to page "1" of the "Site template" certificate template
30
    And I set the following fields to these values:
31
      | Width  | 5 |
32
      | Colour | #045ECD |
33
    And I press "Save changes"
34
    And I add the element "Category name" to page "1" of the "Site template" certificate template
35
    And I set the following fields to these values:
36
      | Font                     | Helvetica |
37
      | Size                     | 20        |
38
      | Colour                   | #045ECD   |
39
      | Width                    | 20        |
40
      | Reference point location | Top left  |
41
    And I press "Save changes"
42
    And I am on "Course 1" course homepage
43
    And I follow "Custom certificate 1"
44
    And I navigate to "Edit certificate" in current page administration
45
    And I set the field "ltid" to "Site template"
46
    And I click on "#id_loadtemplatesubmit" "css_element" in the "#loadtemplateform" "css_element"
47
    And I should see "Are you sure you wish to load this template?"
48
    And I press "Cancel"
49
    And "elementstable" "table" should not exist
50
    And I set the field "ltid" to "Site template"
51
    And I click on "#id_loadtemplatesubmit" "css_element" in the "#loadtemplateform" "css_element"
52
    And I should see "Are you sure you wish to load this template?"
53
    And I press "Continue"
54
    And I should see "Border" in the "elementstable" "table"
55
    And I should see "Category name" in the "elementstable" "table"
56
    And I click on ".edit-icon" "css_element" in the "Border" "table_row"
57
    And the following fields match these values:
58
      | Width  | 5 |
59
      | Colour | #045ECD |
60
    And I press "Save changes"
61
    And I click on ".edit-icon" "css_element" in the "Category name" "table_row"
62
    And the following fields match these values:
63
      | Font                     | Helvetica |
64
      | Size                     | 20        |
65
      | Colour                   | #045ECD   |
66
      | Width                    | 20        |
67
      | Reference point location | Top left  |
68
 
69
  Scenario: Deleting a site template
70
    And I navigate to "Plugins" in site administration
71
    And I click on "Settings" "link" in the "Custom certificate" "table_row"
72
    And I follow "Manage templates"
73
    And I press "Create template"
74
    And I set the field "Name" to "Site template"
75
    And I press "Save changes"
76
    And I follow "Manage templates"
77
    And I click on ".delete-icon" "css_element" in the "Site template" "table_row"
78
    And I press "Cancel"
79
    And I should see "Site template"
80
    And I click on ".delete-icon" "css_element" in the "Site template" "table_row"
81
    And I press "Continue"
82
    And I should not see "Site template"
83
 
84
  Scenario: Duplicating a site template
85
    And I navigate to "Plugins" in site administration
86
    And I click on "Settings" "link" in the "Custom certificate" "table_row"
87
    And I follow "Manage templates"
88
    And I press "Create template"
89
    And I set the field "Name" to "Site template"
90
    And I press "Save changes"
91
    And I follow "Manage templates"
92
    And I click on ".duplicate-icon" "css_element" in the "Site template" "table_row"
93
    And I press "Cancel"
94
    And I should see "Site template"
95
    And I should not see "Site template (duplicate)"
96
    And I click on ".duplicate-icon" "css_element" in the "Site template" "table_row"
97
    And I press "Continue"
98
    And I should see "Site template"
99
    And I should see "Site template (duplicate)"