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 @javascript
2
Feature: Users can see the H5P recent activity from the recent activity block
3
  In order to quickly see the updates from H5P activity in my course
4
  As a user
5
  I need to be able to see the recent activity in the recent activity block
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
      | student1 | Student   | 1        | student1@example.com |
12
      | student2 | Student   | 2        | student2@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1        | 0        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "permission overrides" exist:
22
      | capability                 | permission | role           | contextlevel | reference |
23
      | moodle/h5p:updatelibraries | Allow      | editingteacher | System       |           |
24
    And the following "activity" exists:
25
      | activity        | h5pactivity                                |
26
      | course          | C1                                         |
27
      | name            | Awesome H5P package                        |
28
      | packagefilepath | h5p/tests/fixtures/multiple-choice-2-6.h5p |
29
    And the following "blocks" exist:
30
      | blockname       | contextlevel | reference | pagetypepattern | defaultregion |
31
      | recent_activity | Course       | C1        | course-view-*   | side-pre      |
32
    And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
33
    # The H5P content needs some time to be displayed (so better to wait for 1 second to avoid random errors).
34
    And I switch to "h5p-player" class iframe
35
    And I switch to "h5p-iframe" class iframe
36
    And I click on "Wrong one" "text" in the ".h5p-question-content" "css_element"
37
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
38
    And I switch to the main frame
39
    And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student2
40
    # The H5P content needs some time to be displayed (so better to wait for 1 second to avoid random errors).
41
    And I switch to "h5p-player" class iframe
42
    And I switch to "h5p-iframe" class iframe
43
    And I click on "Correct one" "text" in the ".h5p-question-content" "css_element"
44
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
45
    And I switch to the main frame
46
 
47
  Scenario: Student see only his own activity
48
    Given I am on the "Course 1" course page logged in as student1
49
    And I should see "H5P submitted:" in the "Recent activity" "block"
50
    And I should see "Student 1" in the "Recent activity" "block"
51
    And I should not see "Grade:" in the "Recent activity" "block"
52
    And I should not see "Student 2" in the "Recent activity" "block"
53
    When I click on "Full report of recent activity" "link"
54
    Then I should see "H5P Awesome H5P package"
55
    And I should see "Student 1 - "
56
    And I should not see "Grade:"
57
    And I should not see "Student 2 - "
58
 
59
  Scenario: Teacher see each student activity
60
    Given I am on the "Course 1" course page logged in as teacher1
61
    And I should see "H5P submitted:" in the "Recent activity" "block"
62
    And I should see "Student 1" in the "Recent activity" "block"
63
    And I should not see "Grade:" in the "Recent activity" "block"
64
    And I should see "Student 2" in the "Recent activity" "block"
65
    When I click on "Full report of recent activity" "link"
66
    Then I should see "H5P Awesome H5P package"
67
    And I should see "Student 1 - "
68
    And I should see "Grade:"
69
    And I should see "Student 2 - "