MDL-67413 competencies: do nothing upon activity completion
[moodle.git] / admin / tool / lp / tests / behat / course_competencies.feature
CommitLineData
89da9b49
DW
1@report @javascript @tool_lp
2Feature: See the competencies for an activity on the course competencies page.
3 As a student
4 In order to see only the competencies for an activity in the course competencies page.
5
6 Background:
7 Given the following lp "frameworks" exist:
8 | shortname | idnumber |
9 | Test-Framework | ID-FW1 |
10 And the following lp "competencies" exist:
11 | shortname | framework |
12 | Test-Comp1 | ID-FW1 |
13 | Test-Comp2 | ID-FW1 |
14 Given the following "courses" exist:
930dba73 15 | shortname | fullname | enablecompletion |
16 | C1 | Course 1 | 1 |
89da9b49
DW
17 And the following "users" exist:
18 | username | firstname | lastname | email |
19 | student1 | Student | 1 | student1@example.com |
20 And the following "course enrolments" exist:
21 | user | course | role |
22 | student1 | C1 | student |
23 And the following "activities" exist:
930dba73 24 | activity | name | intro | course | idnumber | completion | completionview |
25 | page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
26 | page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
89da9b49
DW
27 And I log in as "admin"
28 And I am on site homepage
29 And I follow "Course 1"
30 And I follow "Competencies"
31 And I press "Add competencies to course"
32 And "Competency picker" "dialogue" should be visible
33 And I select "Test-Comp1" of the competency tree
34 And I click on "Add" "button" in the "Competency picker" "dialogue"
35 And I press "Add competencies to course"
36 And "Competency picker" "dialogue" should be visible
37 And I select "Test-Comp2" of the competency tree
38 And I click on "Add" "button" in the "Competency picker" "dialogue"
39 And I am on "Course 1" course homepage
40 And I follow "PageName1"
41 And I navigate to "Edit settings" in current page administration
42 And I follow "Expand all"
43 And I set the field "Course competencies" to "Test-Comp1"
44 And I press "Save and return to course"
45 And I log out
46
47 @javascript
48 Scenario: Go to the competency course competencies page.
49 When I log in as "student1"
50 And I am on site homepage
51 And I follow "Course 1"
52 And I follow "Competencies"
53 Then I should see "Test-Comp1"
54 And I should see "Test-Comp2"
55 And I set the field "Filter competencies by resource or activity" to "PageName1"
56 And I press key "13" in the field "Filter competencies by resource or activity"
57 And I should see "Test-Comp1"
58 And I should not see "Test-Comp2"
59 And I set the field "Filter competencies by resource or activity" to "PageName2"
60 And I press key "13" in the field "Filter competencies by resource or activity"
61 And I should not see "Test-Comp1"
62 And I should not see "Test-Comp2"
63 And I should see "No competencies have been linked to this activity or resource."
930dba73 64
65 @javascript
66 Scenario: None course competencies page.
67 When I log in as "student1"
68 And I am on site homepage
69 And I follow "Course 1"
70 And I follow "PageName1"
71 Then I should see "Test page content"
72 And I am on site homepage
73 And I follow "Course 1"
74 And I follow "PageName1"
75 Then I should see "Test page content"