Proyectos de Subversion Moodle

Rev

| 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: Add H5P activity
3
  In order to let students access a H5P package
4
  As a teacher
5
  I need to add H5P activity to a course
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 "permission overrides" exist:
18
      | capability                 | permission | role           | contextlevel | reference |
19
      | moodle/h5p:updatelibraries | Allow      | editingteacher | System       |           |
20
    And I log in as "teacher1"
21
    And I am on "Course 1" course homepage with editing mode on
22
 
23
  @javascript
24
  Scenario: Add an h5pactivity to a course
25
    Given the following "activity" exists:
26
      | activity        | h5pactivity                   |
27
      | course          | C1                            |
28
      | name            | Awesome H5P package           |
29
      | intro           | H5P activity Description      |
30
      | packagefilepath | h5p/tests/fixtures/ipsums.h5p |
31
    When I am on the "Awesome H5P package" "h5pactivity activity" page
32
    Then I should see "H5P activity Description"
33
    And I switch to "h5p-player" class iframe
34
    And I switch to "h5p-iframe" class iframe
35
    And I should see "Lorum ipsum"
36
    And I should not see "Reuse"
37
    And I should not see "Rights of use"
38
    And I should not see "Embed"
39
 
40
  @javascript
41
  Scenario: Add an h5pactivity with download display option
42
    Given the following "activity" exists:
43
      | activity        | h5pactivity                   |
44
      | course          | C1                            |
45
      | name            | Awesome H5P package           |
46
      | displayoptions  | 12                            |
47
      | packagefilepath | h5p/tests/fixtures/ipsums.h5p |
48
    When I am on the "Awesome H5P package" "h5pactivity activity" page
49
    Then I switch to "h5p-player" class iframe
50
    And I switch to "h5p-iframe" class iframe
51
    And "Reuse" "text" should exist in the ".h5p-actions" "css_element"
52
    And I should not see "Rights of use"
53
    And I should not see "Embed"
54
 
55
  @javascript
56
  Scenario: Add an h5pactivity with embed display option
57
    Given the following "activity" exists:
58
      | activity        | h5pactivity                   |
59
      | course          | C1                            |
60
      | name            | Awesome H5P package           |
61
      | displayoptions  | 10                            |
62
      | packagefilepath | h5p/tests/fixtures/ipsums.h5p |
63
    When I am on the "Awesome H5P package" "h5pactivity activity" page
64
    Then I switch to "h5p-player" class iframe
65
    And I switch to "h5p-iframe" class iframe
66
    And "Reuse" "text" should not exist in the ".h5p-actions" "css_element"
67
    And I should not see "Rights of use"
68
    And I should see "Embed"
69
 
70
  @javascript
71
  Scenario: Add an h5pactivity with copyright display option using a content with copyright
72
    Given the following "activity" exists:
73
      | activity        | h5pactivity                             |
74
      | course          | C1                                      |
75
      | name            | Awesome H5P package                     |
76
      | displayoptions  | 6                                       |
77
      | packagefilepath | h5p/tests/fixtures/guess-the-answer.h5p |
78
    And I change window size to "large"
79
    When I am on the "Awesome H5P package" "h5pactivity activity" page
80
    Then I switch to "h5p-player" class iframe
81
    And I switch to "h5p-iframe" class iframe
82
    And "Reuse" "text" should not exist in the ".h5p-actions" "css_element"
83
    And I should see "Rights of use"
84
    And I should not see "Embed"
85
    And I click on "Rights of use" "button" in the ".h5p-actions" "css_element"
86
    And I should see "Fruits"
87
    And I should see "Attribution (CC BY) 4.0 International (CC BY 4.0)"
88
    And I should see "H5P Author"
89
    And I should see "https://h5p.org (Originator)"
90
    And I should see "2000-2023"
91
    And I should see "This is licence extras information added for testing purposes."
92
    And I should see "Add metadata information, Another user, 01-11-23"
93
 
94
  @javascript
95
  Scenario: Add an h5pactivity with copyright display option using a content without copyright
96
    Given the following "activity" exists:
97
      | activity        | h5pactivity                   |
98
      | course          | C1                            |
99
      | name            | Awesome H5P package           |
100
      | displayoptions  | 6                             |
101
      | packagefilepath | h5p/tests/fixtures/ipsums.h5p |
102
    When I am on the "Awesome H5P package" "h5pactivity activity" page
103
    Then I switch to "h5p-player" class iframe
104
    And I switch to "h5p-iframe" class iframe
105
    And "Reuse" "text" should not exist in the ".h5p-actions" "css_element"
106
    And I should not see "Rights of use"
107
    And I should not see "Embed"
108
 
109
  @javascript
110
  Scenario: Add an h5pactivity with all display options enabled
111
    Given the following "activity" exists:
112
      | activity        | h5pactivity                             |
113
      | course          | C1                                      |
114
      | name            | Awesome H5P package                     |
115
      | displayoptions  | 0                                       |
116
      | packagefilepath | h5p/tests/fixtures/guess-the-answer.h5p |
117
    When I am on the "Awesome H5P package" "h5pactivity activity" page
118
    Then I switch to "h5p-player" class iframe
119
    And I switch to "h5p-iframe" class iframe
120
    And "Reuse" "text" should exist in the ".h5p-actions" "css_element"
121
    And I should see "Rights of use"
122
    And I should see "Embed"