Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
2
Feature: Download H5P content from the content bank
3
  In order export H5P content from the content bank
4
  As an admin
5
  I need to be able to download any H5P content from the content bank
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username    | firstname | lastname | email              |
10
      | manager     | Max       | Manager  | man@example.com    |
11
    And the following "role assigns" exist:
12
      | user        | role      | contextlevel  | reference     |
13
      | manager     | manager   | System        |               |
14
    And the following "contentbank content" exist:
15
      | contextlevel | reference | contenttype     | user    | contentname              | filepath                               |
16
      | System       |           | contenttype_h5p | admin   | filltheblanksadmin.h5p   | /h5p/tests/fixtures/filltheblanks.h5p  |
17
      | System       |           | contenttype_h5p | manager | filltheblanksmanager.h5p | /h5p/tests/fixtures/filltheblanks.h5p  |
18
    And I log in as "admin"
19
    And I am on site homepage
20
    And I turn editing mode on
21
    And the following config values are set as admin:
22
      | unaddableblocks | | theme_boost|
23
    And I add the "Navigation" block if not present
24
    And I configure the "Navigation" block
25
    And I set the following fields to these values:
26
      | Page contexts | Display throughout the entire site |
27
    And I press "Save changes"
28
 
29
  Scenario: Admins can download content from the content bank
30
    Given I click on "Site pages" "list_item" in the "Navigation" "block"
31
    And I click on "Content bank" "link" in the "Navigation" "block"
32
    And I follow "filltheblanksmanager.h5p"
33
    And  I click on "More" "button"
34
    And I should see "Download"
35
    When I click on "Download" "link"
36
    Then I should see "filltheblanksmanager.h5p"
37
 
38
  Scenario: Users can download content created by different users
39
    Given the following "permission overrides" exist:
40
      | capability                            | permission | role    | contextlevel | reference |
41
      | moodle/contentbank:manageanycontent   | Prohibit   | manager | System       |           |
42
    And I log out
43
    And I log in as "manager"
44
    When I click on "Site pages" "list_item" in the "Navigation" "block"
45
    And I click on "Content bank" "link" in the "Navigation" "block"
46
    And I should see "filltheblanksadmin.h5p"
47
    And I follow "filltheblanksadmin.h5p"
48
    And  I click on "More" "button"
49
    Then I should see "Download"
50
    And I should not see "Rename"
51
 
52
  Scenario: Users without the required capability cannot download content
53
    Given the following "permission overrides" exist:
54
      | capability                            | permission | role    | contextlevel | reference |
55
      | moodle/contentbank:downloadcontent    | Prohibit   | manager | System       |           |
56
    And I log out
57
    And I log in as "manager"
58
    When I click on "Site pages" "list_item" in the "Navigation" "block"
59
    And I click on "Content bank" "link" in the "Navigation" "block"
60
    And I should see "filltheblanksmanager.h5p"
61
    And I follow "filltheblanksmanager.h5p"
62
    And  I click on "More" "button"
63
    Then I should not see "Download"