Proyectos de Subversion Moodle

Rev

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

Rev Autor Línea Nro. Línea
1441 ariadna 1
@mod @mod_h5pactivity @core_h5p @_switch_iframe @core_completion
2
Feature: Completion of H5P activity by achieving a passing grade
3
  In order to complete an H5P activity
4
  As a student
5
  I need to be able to complete the h5p activity to receive a grade
1 efrain 6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Vinnie    | Student1 | student1@example.com |
11
      | student2 | Vinnie    | Student2 | student2@example.com |
12
      | student3 | Vinnie    | Student3 | student3@example.com |
13
      | teacher1 | Darrell   | Teacher1 | teacher1@example.com |
14
    And the following "courses" exist:
15
      | fullname | shortname | category | enablecompletion |
16
      | Course 1 | C1        | 0        | 1                |
17
    And the following "course enrolments" exist:
18
      | user     | course | role           |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
      | student3 | C1     | student        |
22
      | teacher1 | C1     | editingteacher |
23
    And the following "activity" exists:
24
      | activity            | h5pactivity                          |
25
      | course              | C1                                   |
26
      | name                | Music history                        |
27
      | completion          | 2                                    |
28
      | completionview      | 1                                    |
29
      | completionusegrade  | 1                                    |
30
      | completionpassgrade | 1                                    |
31
      | gradepass           | 25                                   |
32
      | packagefilepath     | h5p/tests/fixtures/filltheblanks.h5p |
33
 
1441 ariadna 34
  Scenario: Verify that the h5p completion conditions are displayed to teachers
35
    Given I change window size to "large"
36
    And I am on the "Music history" "h5pactivity activity" page logged in as teacher1
37
    Then "Music history" should have the "View" completion condition
1 efrain 38
    And "Music history" should have the "Receive a grade" completion condition
39
    And "Music history" should have the "Receive a passing grade" completion condition
1441 ariadna 40
 
41
  @javascript
42
  Scenario: Verify that students can complete an H5P activity by achieving a passing grade
43
    # Student 1 attempt the H5P and fills the blanks with the wrong answers... needs more geography lessons!
44
    Given I am on the "Music history" "h5pactivity activity" page logged in as student1
1 efrain 45
    And I switch to "h5p-player" class iframe
46
    And I switch to "h5p-iframe" class iframe
1441 ariadna 47
    And I should see "Of which countries are Berlin, Washington, Beijing, Canberra and Brasilia the capitals?"
48
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" to "Rio de Janeiro"
49
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 2 of 4\")]" to "New York"
50
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 3 of 4\")]" to "Hamburg"
51
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 4 of 4\")]" to "Sydney"
1 efrain 52
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
1441 ariadna 53
    And I switch to the main frame
1 efrain 54
    And I reload the page
1441 ariadna 55
    And the "View" completion condition of "Music history" is displayed as "done"
56
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
57
    And the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"
58
 
59
    # Student 2 attempts the H5P and fills the blanks with the correct answers.
1 efrain 60
    And I am on the "Music history" "h5pactivity activity" page logged in as student2
61
    And I switch to "h5p-player" class iframe
62
    And I switch to "h5p-iframe" class iframe
1441 ariadna 63
    And I should see "Of which countries are Berlin, Washington, Beijing, Canberra and Brasilia the capitals?"
1 efrain 64
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" to "Brasilia"
65
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 2 of 4\")]" to "Washington"
66
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 3 of 4\")]" to "Berlin"
67
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 4 of 4\")]" to "Canberra"
68
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
69
    And I switch to the main frame
70
    And I reload the page
1441 ariadna 71
    And the "View" completion condition of "Music history" is displayed as "done"
1 efrain 72
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
73
    And the "Receive a passing grade" completion condition of "Music history" is displayed as "done"
1441 ariadna 74
 
75
    # Teacher confirms which students have completed the H5P activity.
76
    When I am on the "Course 1" "course" page logged in as "teacher1"
77
    Then "Vinnie Student1" user has completed "Music history" activity
1 efrain 78
    And "Vinnie Student2" user has completed "Music history" activity
79
    And "Vinnie Student3" user has not completed "Music history" activity