Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
11 efrain 1
@mod @mod_h5pactivity @core_h5p @_switch_iframe
1 efrain 2
Feature: Content bank link in the activity settings form
3
  In order to have direct access to the Content bank
4
  As a teacher
5
  I need to see a Content bank link in the activity settings
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1 | 0 |
14
    And the following "course enrolments" exist:
15
      | user | course | role |
16
      | teacher1 | C1 | editingteacher |
17
    And the following "contentbank content" exist:
18
      | contextlevel | reference | contenttype     | user     | contentname         | filepath                                  |
19
      | Course       | C1        | contenttype_h5p | admin    | filltheblanks.h5p   | /h5p/tests/fixtures/filltheblanks.h5p     |
20
 
21
  @javascript
22
  Scenario: The content bank link should go to the course Content bank
23
    When I log in as "teacher1"
24
    And I add an h5pactivity activity to course "Course 1" section "1"
25
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"
26
    And I click on "content bank (opens in new window)" "link" in the "General" "fieldset"
27
    And I switch to a second window
28
    And I should see "Content bank" in the "page-content" "region"
29
    And I should see "filltheblanks.h5p" in the "page-content" "region"
30
    And I close all opened windows
31
 
32
  @javascript
33
  Scenario: Content bank is not displayed if the user don't have access to the content bank
34
    Given the following "permission overrides" exist:
35
      | capability                 | permission | role           | contextlevel | reference |
36
      | moodle/contentbank:access  | Prevent    | editingteacher | Course       | C1        |
37
    When I log in as "teacher1"
38
    And I add an h5pactivity activity to course "Course 1" section "1"
39
    Then I should not see "Use the content Bank (opens in new window) to manage your H5P files"
40
 
41
  @javascript
42
  Scenario: A different message should be displayed if the package file is a link to the content bank file
43
    Given I log in as "admin"
44
    And I add an h5pactivity activity to course "Course 1" section "1"
45
    And I set the following fields to these values:
46
      | Name                       | H5P package added with link to content bank |
47
      | Description                | Description                                 |
48
    And I click on "Add..." "button" in the "Package file" "form_row"
49
    And I select "Content bank" repository in file picker
50
    And I click on "filltheblanks.h5p" "file" in repository content area
51
    And I click on "Link to the file" "radio"
52
    And I click on "Select this file" "button"
53
    And I click on "Save and display" "button"
54
    And I switch to "h5p-player" class iframe
55
    And I switch to "h5p-iframe" class iframe
56
    And I should see "Of which countries are Berlin, Washington, Beijing, Canberra and Brasilia the capitals?"
57
    And I switch to the main frame
58
    When I navigate to "Settings" in current page administration
59
    Then I should not see "Use the content Bank (opens in new window) to manage your H5P files"
60
    And I should see "Access the H5P file in the content bank (opens in a new window)."
61
    And I follow "Access the H5P file in the content bank"
62
 
63
  @javascript
64
  Scenario: The content bank link should go to the course Content bank if the file is a copy to a content bank file
65
    Given I log in as "admin"
66
    And I add an h5pactivity activity to course "Course 1" section "1"
67
    And I set the following fields to these values:
68
      | Name                       | H5P package added with link to content bank |
69
      | Description                | Description                                 |
70
    And I click on "Add..." "button" in the "Package file" "form_row"
71
    And I select "Content bank" repository in file picker
72
    And I click on "filltheblanks.h5p" "file" in repository content area
73
    And I click on "Make a copy of the file" "radio"
74
    And I click on "Select this file" "button"
75
    And I click on "Save and display" "button"
76
    And I switch to "h5p-player" class iframe
77
    And I switch to "h5p-iframe" class iframe
78
    And I should see "Of which countries are Berlin,"
79
    And I switch to the main frame
80
    When I navigate to "Settings" in current page administration
81
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"
82
 
83
  @javascript
84
  Scenario: The content bank link should go to the course Content bank if the file is referenced but to another repository
11 efrain 85
    Given the following "user private file" exists:
86
      | user     | admin                                   |
87
      | filepath | h5p/tests/fixtures/guess-the-answer.h5p |
88
    When I log in as "admin"
1 efrain 89
    And I add an h5pactivity activity to course "Course 1" section "1"
90
    And I set the following fields to these values:
91
      | Name                       | H5P package added with link to content bank |
92
      | Description                | Description                                 |
93
    And I click on "Add..." "button" in the "Package file" "form_row"
94
    And I select "Private files" repository in file picker
95
    And I click on "guess-the-answer.h5p" "file" in repository content area
96
    And I click on "Link to the file" "radio"
97
    And I click on "Select this file" "button"
98
    And I click on "Save and display" "button"
99
    And I switch to "h5p-player" class iframe
100
    And I switch to "h5p-iframe" class iframe
101
    And I should see "Which fruit is this?"
102
    And I switch to the main frame
11 efrain 103
    And I navigate to "Settings" in current page administration
1 efrain 104
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"