Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@repository @repository_contentbank @javascript @core_h5p
2
Feature: Updating a file in the content bank after using in a course
3
  In order to use file alias
4
  As a user
5
  Updated files must update references when is an alias
6
 
7
  Background:
8
    Given the following "categories" exist:
9
      | name      | category | idnumber |
10
      | Category1 | 0        | CAT1     |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course1  | C1        | CAT1     |
14
    And the following "contentbank content" exist:
15
      | contextlevel | reference | contenttype     | user  | contentname | filepath                                  |
16
      | Course       | C1        | contenttype_h5p | admin | package.h5p | /h5p/tests/fixtures/guess-the-answer.h5p  |
17
 
18
  Scenario: Referenced files is the default option and updates alias as well
19
    When I log in as "admin"
20
    And I add an h5pactivity activity to course "Course1" section "1"
21
    And I set the following fields to these values:
22
      | Name                      | guessFile     |
23
    And I click on "Add..." "link" in the ".fp-toolbar" "css_element"
24
    And I select "Content bank" repository in file picker
25
    And I click on "package.h5p" "file" in repository content area
26
    And I click on "Select this file" "button"
27
    And I click on "Save and display" "button"
28
    And I switch to "h5p-player" class iframe
29
    And I switch to "h5p-iframe" class iframe
30
    Then I should see "Press here to reveal answer"
31
    And I switch to the main frame
32
    # Now edit the content in the content bank.
33
    When I am on "Course1" course homepage with editing mode on
34
    And the following config values are set as admin:
35
      | unaddableblocks | | theme_boost|
36
    And I add the "Navigation" block if not present
37
    And I expand "Site pages" node
38
    And I click on "Content bank" "link"
39
    And I click on "package.h5p" "link"
40
    And I click on "Edit" "link"
41
    And I wait until the page is ready
42
    And I switch to "h5p-editor-iframe" class iframe
43
    And I set the field "Title" to "Required title"
44
    And I set the field "Descriptive solution label" to "This is a new text"
45
    And I switch to the main frame
46
    And I click on "Save" "button"
47
    And I switch to "h5p-player" class iframe
48
    And I switch to "h5p-iframe" class iframe
49
    Then I should see "This is a new text"
50
    And I switch to the main frame
51
    # Check the course page is updated.
52
    When I am on "Course1" course homepage with editing mode on
53
    And I click on "guessFile" "link" in the "page-content" "region"
54
    And I switch to "h5p-player" class iframe
55
    And I switch to "h5p-iframe" class iframe
56
    Then I should see "This is a new text"
57
    And I switch to the main frame
58
 
59
  Scenario: Copied files should not be updated if the original is edited
60
    When I log in as "admin"
61
    And I add an h5pactivity activity to course "Course1" section "1"
62
    And I set the following fields to these values:
63
      | Name                      | guessFile     |
64
    And I click on "Add..." "link" in the ".fp-toolbar" "css_element"
65
    And I select "Content bank" repository in file picker
66
    And I click on "package.h5p" "file" in repository content area
67
    And I click on "Make a copy of the file" "radio"
68
    And I click on "Select this file" "button"
69
    And I click on "Save and display" "button"
70
    And I switch to "h5p-player" class iframe
71
    And I switch to "h5p-iframe" class iframe
72
    Then I should see "Press here to reveal answer"
73
    And I switch to the main frame
74
    # Now edit the content in the content bank.
75
    When I am on "Course1" course homepage with editing mode on
76
    And the following config values are set as admin:
77
      | unaddableblocks | | theme_boost|
78
    And I add the "Navigation" block if not present
79
    And I expand "Site pages" node
80
    And I click on "Content bank" "link"
81
    And I click on "package.h5p" "link"
82
    And I click on "Edit" "link"
83
    And I wait until the page is ready
84
    And I switch to "h5p-editor-iframe" class iframe
85
    And I set the field "Title" to "Required title"
86
    And I set the field "Descriptive solution label" to "This is a new text"
87
    And I switch to the main frame
88
    And I click on "Save" "button"
89
    And I switch to "h5p-player" class iframe
90
    And I switch to "h5p-iframe" class iframe
91
    Then I should see "This is a new text"
92
    And I switch to the main frame
93
    # Check the course page is not updated.
94
    When I am on "Course1" course homepage with editing mode on
95
    And I click on "guessFile" "link" in the "page-content" "region"
96
    And I switch to "h5p-player" class iframe
97
    And I switch to "h5p-iframe" class iframe
98
    Then I should see "Press here to reveal answer"
99
    And I switch to the main frame