Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe
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
    And the following "blocks" exist:
21
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
22
      | private_files | System       | 1         | my-index        | side-post     |
23
 
24
  @javascript
25
  Scenario: The content bank link should go to the course Content bank
26
    When I log in as "teacher1"
27
    And I add an h5pactivity activity to course "Course 1" section "1"
28
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"
29
    And I click on "content bank (opens in new window)" "link" in the "General" "fieldset"
30
    And I switch to a second window
31
    And I should see "Content bank" in the "page-content" "region"
32
    And I should see "filltheblanks.h5p" in the "page-content" "region"
33
    And I close all opened windows
34
 
35
  @javascript
36
  Scenario: Content bank is not displayed if the user don't have access to the content bank
37
    Given the following "permission overrides" exist:
38
      | capability                 | permission | role           | contextlevel | reference |
39
      | moodle/contentbank:access  | Prevent    | editingteacher | Course       | C1        |
40
    When I log in as "teacher1"
41
    And I add an h5pactivity activity to course "Course 1" section "1"
42
    Then I should not see "Use the content Bank (opens in new window) to manage your H5P files"
43
 
44
  @javascript
45
  Scenario: A different message should be displayed if the package file is a link to the content bank file
46
    Given I log in as "admin"
47
    And I add an h5pactivity activity to course "Course 1" section "1"
48
    And I set the following fields to these values:
49
      | Name                       | H5P package added with link to content bank |
50
      | Description                | Description                                 |
51
    And I click on "Add..." "button" in the "Package file" "form_row"
52
    And I select "Content bank" repository in file picker
53
    And I click on "filltheblanks.h5p" "file" in repository content area
54
    And I click on "Link to the file" "radio"
55
    And I click on "Select this file" "button"
56
    And I click on "Save and display" "button"
57
    And I switch to "h5p-player" class iframe
58
    And I switch to "h5p-iframe" class iframe
59
    And I should see "Of which countries are Berlin, Washington, Beijing, Canberra and Brasilia the capitals?"
60
    And I switch to the main frame
61
    When I navigate to "Settings" in current page administration
62
    Then I should not see "Use the content Bank (opens in new window) to manage your H5P files"
63
    And I should see "Access the H5P file in the content bank (opens in a new window)."
64
    And I follow "Access the H5P file in the content bank"
65
 
66
  @javascript
67
  Scenario: The content bank link should go to the course Content bank if the file is a copy to a content bank file
68
    Given I log in as "admin"
69
    And I add an h5pactivity activity to course "Course 1" section "1"
70
    And I set the following fields to these values:
71
      | Name                       | H5P package added with link to content bank |
72
      | Description                | Description                                 |
73
    And I click on "Add..." "button" in the "Package file" "form_row"
74
    And I select "Content bank" repository in file picker
75
    And I click on "filltheblanks.h5p" "file" in repository content area
76
    And I click on "Make a copy of the file" "radio"
77
    And I click on "Select this file" "button"
78
    And I click on "Save and display" "button"
79
    And I switch to "h5p-player" class iframe
80
    And I switch to "h5p-iframe" class iframe
81
    And I should see "Of which countries are Berlin,"
82
    And I switch to the main frame
83
    When I navigate to "Settings" in current page administration
84
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"
85
 
86
  @javascript
87
  Scenario: The content bank link should go to the course Content bank if the file is referenced but to another repository
88
    Given I log in as "admin"
89
    And I follow "Manage private files..."
90
    And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
91
    And I click on "Save changes" "button"
92
    And I add an h5pactivity activity to course "Course 1" section "1"
93
    And I set the following fields to these values:
94
      | Name                       | H5P package added with link to content bank |
95
      | Description                | Description                                 |
96
    And I click on "Add..." "button" in the "Package file" "form_row"
97
    And I select "Private files" repository in file picker
98
    And I click on "guess-the-answer.h5p" "file" in repository content area
99
    And I click on "Link to the file" "radio"
100
    And I click on "Select this file" "button"
101
    And I click on "Save and display" "button"
102
    And I switch to "h5p-player" class iframe
103
    And I switch to "h5p-iframe" class iframe
104
    And I should see "Which fruit is this?"
105
    And I switch to the main frame
106
    When I navigate to "Settings" in current page administration
107
    Then I should see "Use the content bank (opens in new window) to manage your H5P files"