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: Search content in the content bank
3
  In order to find easily content in the content bank
4
  As an admin
5
  I need to be able to search content in the content bank
6
 
7
  Background:
8
    Given I log in as "admin"
9
    And I navigate to "H5P > Manage H5P content types" in site administration
10
    And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
11
    And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
12
    And the following "contentbank content" exist:
13
      | contextlevel | reference | contenttype     | user     | contentname          | filepath                                |
14
      | System       |           | contenttype_h5p | admin    | santjordi.h5p        | /h5p/tests/fixtures/filltheblanks.h5p   |
15
      | System       |           | contenttype_h5p | admin    | santjordi_rose.h5p   | /h5p/tests/fixtures/filltheblanks.h5p   |
16
      | System       |           | contenttype_h5p | admin    | SantJordi_book       | /h5p/tests/fixtures/filltheblanks.h5p   |
17
      | System       |           | contenttype_h5p | admin    | Dragon_santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p   |
18
      | System       |           | contenttype_h5p | admin    | princess.h5p         | /h5p/tests/fixtures/filltheblanks.h5p   |
19
      | System       |           | contenttype_h5p | admin    | mathsbook.h5p        | /h5p/tests/fixtures/filltheblanks.h5p   |
20
      | System       |           | contenttype_h5p | admin    | historybook.h5p      | /h5p/tests/fixtures/filltheblanks.h5p   |
21
      | System       |           | contenttype_h5p | admin    | santvicenc.h5p       | /h5p/tests/fixtures/filltheblanks.h5p   |
22
 
23
  Scenario: Admins can search content in the content bank
24
    Given I am on site homepage
25
    And I turn editing mode on
26
    And the following config values are set as admin:
27
      | unaddableblocks | | theme_boost|
28
    And I add the "Navigation" block if not present
29
    And I expand "Site pages" node
30
    And I click on "Content bank" "link"
31
    And I should see "santjordi.h5p"
32
    And "Clear search input" "button" should not be visible
33
    And I should not see "items found"
34
    When I set the field "Search" to "book"
35
    # Waiting for the animation to show the button to finish.
36
    And I wait "1" seconds
37
    Then "Clear search input" "button" should be visible
38
    And I should see "3 items found"
39
    And I should see "SantJordi_book"
40
    And I should see "mathsbook.h5p"
41
    And I should see "historybook.h5p"
42
    And I set the field "Search" to "sant"
43
    And "Clear search input" "button" should be visible
44
    And I should see "5 items found"
45
    And I set the field "Search" to "santjordi"
46
    And I should see "4 items found"
47
    And I should see "santjordi.h5p"
48
    And I should see "santjordi_rose.h5p"
49
    And I should see "SantJordi_book"
50
    And I should see "Dragon_santjordi.h5p"
51
    And I click on "Clear search input" "button"
52
    # Waiting for the animation to hide the button to finish.
53
    And I wait "1" seconds
54
    And "Clear search input" "button" should not be visible
55
    And I should not see "items found"
56
    And I set the field "Search" to ".h5p"
57
    # Waiting for the animation to show the button to finish.
58
    And I wait "1" seconds
59
    And "Clear search input" "button" should be visible
60
    And I should see "7 items found"
61
    And I set the field "Search" to "friend"
62
    And I should see "0 items found"