Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
2
Feature: Navigate to different contexts in the content bank
3
  In order to navigate easily in the content bank
4
  I need to be able to view dropdown with all allowed contexts in the content bank
5
 
6
  Background:
7
    Given I log in as "admin"
8
    And the following "categories" exist:
9
      | name  | category | idnumber |
10
      | Cat 1 | 0        | CAT1     |
11
      | Cat 2 | 0        | CAT2     |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 0 | C0        |          |
15
      | Course 1 | C1        | CAT1     |
16
      | Course 2 | C2        | CAT2     |
17
    And I navigate to "H5P > Manage H5P content types" in site administration
18
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
19
    And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
20
    And the following "contentbank content" exist:
21
      | contextlevel | reference | contenttype     | user     | contentname          | filepath                                |
22
      | System       |           | contenttype_h5p | admin    | santjordi.h5p        | /h5p/tests/fixtures/filltheblanks.h5p   |
23
      | Category     | CAT1      | contenttype_h5p | admin    | santjordi_rose.h5p   | /h5p/tests/fixtures/filltheblanks.h5p   |
24
      | Category     | CAT2      | contenttype_h5p | admin    | SantJordi_book       | /h5p/tests/fixtures/filltheblanks.h5p   |
25
      | Course       | C0        | contenttype_h5p | admin    | Dragon.h5p | /h5p/tests/fixtures/filltheblanks.h5p   |
26
      | Course       | C1        | contenttype_h5p | admin    | princess.h5p         | /h5p/tests/fixtures/filltheblanks.h5p   |
27
      | Course       | C2        | contenttype_h5p | admin    | mathsbook.h5p        | /h5p/tests/fixtures/filltheblanks.h5p   |
28
 
29
  Scenario: Admins can view and navigate to all the contexts in the content bank
30
    Given I am on site homepage
31
    And I turn editing mode on
32
    And the following config values are set as admin:
33
      | unaddableblocks | | theme_boost|
34
    And I add the "Navigation" block if not present
35
    And I expand "Site pages" node
36
    When I click on "Content bank" "link"
37
    And the "Choose course or category" select box should contain "System"
38
    And the "Choose course or category" select box should contain "Cat 1"
39
    And the "Choose course or category" select box should contain "Cat 2"
40
    And the "Choose course or category" select box should contain "Course 0"
41
    And the "Choose course or category" select box should contain "Course 1"
42
    And the "Choose course or category" select box should contain "Course 2"
43
    And I should see "santjordi.h5p"
44
    And I should not see "santjordi_rose.h5p"
45
    And I should not see "Dragon.h5p"
46
    And I set the field "Choose course or category" to "Cat 1"
47
    Then I should not see "santjordi.h5p"
48
    And I should see "santjordi_rose.h5p"
49
    And I should not see "Dragon.h5p"
50
    And I set the field "Choose course or category" to "Course 0"
51
    And I should not see "santjordi.h5p"
52
    And I should not see "santjordi_rose.h5p"
53
    And I should see "Dragon.h5p"
54
 
55
  Scenario: Teachers can view and navigate to contexts in the content bank based on their permissions
56
    Given the following "users" exist:
57
      | username  | firstname | lastname |
58
      | teacher  | Joseba    | Cilarte  |
59
    And the following "course enrolments" exist:
60
      | user    | course | role           |
61
      | teacher | C0     | editingteacher |
62
      | teacher | C1     | editingteacher |
63
    And I log out
64
    And I am on the "C0" "Course" page logged in as "teacher"
65
    And I turn editing mode on
66
    And the following config values are set as admin:
67
      | unaddableblocks | | theme_boost|
68
    And I add the "Navigation" block if not present
69
    And I expand "Site pages" node
70
    When I click on "Content bank" "link"
71
    And the "Choose course or category" select box should contain "Course 0"
72
    And the "Choose course or category" select box should contain "Course 1"
73
    And the "Choose course or category" select box should not contain "System"
74
    And the "Choose course or category" select box should not contain "Cat 1"
75
    And the "Choose course or category" select box should not contain "Cat 2"
76
    And the "Choose course or category" select box should not contain "Course 2"
77
    And I should see "Dragon.h5p"
78
    And I should not see "princess.h5p"
79
    And I should not see "santjordi.h5p"
80
    And I should not see "santjordi_rose.h5p"
81
    And I set the field "Choose course or category" to "Course 1"
82
    Then I should not see "Dragon.h5p"
83
    And I should see "princess.h5p"
84
    And I should not see "santjordi.h5p"
85
    And I should not see "santjordi_rose.h5p"
86
    And the following "role assigns" exist:
87
      | user    | role          | contextlevel | reference |
88
      | teacher | manager       | Category     | CAT1      |
89
    And I am on the "C0" "Course" page logged in as "teacher"
90
    And I expand "Site pages" node
91
    When I click on "Content bank" "link"
92
    And the "Choose course or category" select box should contain "Course 0"
93
    And the "Choose course or category" select box should contain "Course 1"
94
    And the "Choose course or category" select box should contain "Cat 1"
95
    And the "Choose course or category" select box should not contain "System"
96
    And the "Choose course or category" select box should not contain "Cat 2"
97
    And the "Choose course or category" select box should not contain "Course 2"
98
    And I should see "Dragon.h5p"
99
    And I set the field "Choose course or category" to "Cat 1"
100
    And I should not see "Dragon.h5p"
101
    And I should see "santjordi_rose.h5p"