MDL-53980 lang: Fix the reworded strings in Behat tests
[moodle.git] / admin / tool / lp / tests / behat / framework_crud.feature
CommitLineData
0b7c334c
IT
1@tool @javascript @tool_lp @tool_lp_framework
2Feature: Manage competency frameworks
3 As a competency framework admin
4 In order to perform CRUD operations on competency framework
5 I need to create, update and delete competency framework
6
7 Background:
8 Given I log in as "admin"
9 And I am on site homepage
5416f580
IT
10 And I expand "Site administration" node
11 When I expand "Competencies" node
746da8ba 12 Then I should see "Competency frameworks"
0b7c334c
IT
13
14 Scenario: Create a new framework
746da8ba 15 Given I follow "Competency frameworks"
0b7c334c
IT
16 And I should see "List of competency frameworks"
17 And I click on "Add new competency framework" "button"
18 And I should see "General"
19 And I should see "Taxonomies"
20 And I set the field "Name" to "Science Year-1"
c1d44340 21 And I set the field "ID number" to "Comp-frm-1"
0b7c334c 22 And I press "Save changes"
c1d44340 23 And I should see "The scale needs to be configured by selecting default and proficient items."
0b7c334c
IT
24 And "Configure scales" "button" should be visible
25 And I press "Configure scales"
49792e9c
IT
26 And I click on "//input[@data-field='tool_lp_scale_default_1']" "xpath_element"
27 And I click on "//input[@data-field='tool_lp_scale_proficient_1']" "xpath_element"
0b7c334c
IT
28 And I click on "//input[@value='Close']" "xpath_element"
29 When I press "Save changes"
30 Then I should see "Competency framework created"
0b7c334c
IT
31 And I should see "Science Year-1"
32
33 Scenario: Read a framework
34 Given the following lp "frameworks" exist:
35 | shortname | idnumber |
36 | Science Year-2 | sc-y-2 |
746da8ba 37 And I follow "Competency frameworks"
0b7c334c
IT
38 And I should see "Science Year-2"
39 When I click on "Science Year-2" "link"
40 Then I should see "Science Year-2"
41
42 Scenario: Edit a framework
43 Given the following lp "frameworks" exist:
44 | shortname | idnumber |
45 | Science Year-3 | sc-y-3 |
746da8ba 46 And I follow "Competency frameworks"
0b7c334c 47 And I should see "Science Year-3"
c7f2b74e 48 And I click on "Edit" of edit menu in the "Science Year-3" row
0b7c334c
IT
49 And the field "Name" matches value "Science Year-3 "
50 And I set the field "Name" to "Science Year-3 Edited"
51 When I press "Save changes"
52 Then I should see "Competency framework updated"
0b7c334c
IT
53 And I should see "Science Year-3 Edited"
54 And I should see "sc-y-3"
55
56 Scenario: Delete a framework
57 Given the following lp "frameworks" exist:
58 | shortname | idnumber |
59 | Science Year-4 | sc-y-4 |
746da8ba 60 And I follow "Competency frameworks"
0b7c334c
IT
61 And I should see "Science Year-4"
62 And I should see "sc-y-4"
c7f2b74e 63 And I click on "Delete" of edit menu in the "Science Year-4" row
0b7c334c
IT
64 And "Confirm" "dialogue" should be visible
65 And "Delete" "button" should exist in the "Confirm" "dialogue"
66 And "Cancel" "button" should exist in the "Confirm" "dialogue"
67 And I click on "Cancel" "button"
c7f2b74e 68 And I click on "Delete" of edit menu in the "Science Year-4" row
0b7c334c
IT
69 And "Confirm" "dialogue" should be visible
70 When I click on "Delete" "button"
71 Then I should not see "Science Year-4"
65abd20d
SG
72 And I should not see "sc-y-4"
73
74Scenario: Edit a framework with competencies in user competency
75 Given the following lp "frameworks" exist:
4474c874 76 | shortname | idnumber |
65abd20d
SG
77 | Science Year-5 | sc-y-5 |
78 And the following lp "competencies" exist:
79 | shortname | framework |
80 | Comp1 | sc-y-5 |
81 | Comp2 | sc-y-5 |
82 And the following lp "plans" exist:
83 | name | user | description |
84 | Plan Science-5 | admin | Plan description |
85 And the following lp "plancompetencies" exist:
86 | plan | competency |
87 | Plan Science-5 | Comp1 |
88 | Plan Science-5 | Comp2 |
89 And the following lp "usercompetencies" exist:
4474c874 90 | user | competency |
65abd20d
SG
91 | admin | Comp1 |
92 | admin | Comp2 |
746da8ba 93 And I follow "Competency frameworks"
65abd20d
SG
94 And I should see "Science Year-5"
95 And I click on "Edit" of edit menu in the "Science Year-5" row
96 And the field "Name" matches value "Science Year-5 "
97 And I set the field "Name" to "Science Year-5 Edited"
98 And the "scaleid" "select" should be readonly
99 When I press "Save changes"
100 Then I should see "Competency framework updated"
101 And I should see "Science Year-5 Edited"
102 And I should see "sc-y-5"
103
104Scenario: Edit a framework with competencies in user competency plan
105 Given the following lp "frameworks" exist:
4474c874 106 | shortname | idnumber |
65abd20d
SG
107 | Science Year-6 | sc-y-6 |
108 And the following lp "competencies" exist:
109 | shortname | framework |
110 | Comp1 | sc-y-6 |
111 | Comp2 | sc-y-6 |
112 And the following lp "plans" exist:
113 | name | user | description |
114 | Plan Science-6 | admin | Plan description |
115 And the following lp "plancompetencies" exist:
116 | plan | competency |
117 | Plan Science-6 | Comp1 |
118 | Plan Science-6 | Comp2 |
119 And the following lp "usercompetencyplans" exist:
120 | user | competency | plan |
121 | admin | Comp1 | Plan Science-6 |
122 | admin | Comp2 | Plan Science-6 |
746da8ba 123 And I follow "Competency frameworks"
65abd20d
SG
124 And I should see "Science Year-6"
125 And I click on "Edit" of edit menu in the "Science Year-6" row
126 And the field "Name" matches value "Science Year-6 "
127 And I set the field "Name" to "Science Year-6 Edited"
128 And the "scaleid" "select" should be readonly
129 When I press "Save changes"
130 Then I should see "Competency framework updated"
131 And I should see "Science Year-6 Edited"
132 And I should see "sc-y-6"