Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_filepicker @_file_upload
2
Feature: Select file feature
3
  In order to add a file to a filearea
4
  As a user
5
  I need to be able to select the file using the file picker
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1 | 0 |
11
    And the following "blocks" exist:
12
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
13
      | private_files | System       | 1         | my-index        | side-post     |
14
    And the following "activities" exist:
15
      | activity | course | name        |
16
      | folder   | C1     | Test folder |
17
    And I am on the "Test folder" "folder activity" page logged in as admin
18
    And I press "Edit"
19
    And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
20
    And I press "Save changes"
21
 
22
  @javascript
23
  Scenario: Select a file from the "Recent files" repository using "icons" view
24
    Given I follow "Dashboard"
25
    And I follow "Manage private files"
26
    And I click on "Add..." "button" in the "Files" "form_row"
27
    And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
28
    And I click on "Display folder with file icons" "link" in the ".file-picker" "css_element"
29
    And I click on "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')][normalize-space(.)='empty.txt']" "xpath_element"
30
    And I should see "Select empty.txt"
31
    When I click on "Select this file" "button"
32
    Then I should see "1" elements in "Files" filemanager
33
    And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
34
 
35
  @javascript
36
  Scenario: Select a file from the "Recent files" repository using "list" view
37
    Given I follow "Dashboard"
38
    And I follow "Manage private files"
39
    And I click on "Add..." "button" in the "Files" "form_row"
40
    And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
41
    And I click on "Display folder with file details" "link" in the ".file-picker" "css_element"
42
    And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' file-picker ')]/descendant::span[normalize-space(.)='empty.txt']/ancestor::a" "xpath_element"
43
    And I should see "Select empty.txt"
44
    When I click on "Select this file" "button"
45
    Then I should see "1" elements in "Files" filemanager
46
    And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"
47
 
48
  @javascript
49
  Scenario: Select a file from the "Recent files" repository using "tree" view
50
    Given I follow "Dashboard"
51
    And I follow "Manage private files"
52
    And I click on "Add..." "button" in the "Files" "form_row"
53
    And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
54
    And I click on "Display folder as file tree" "link" in the ".file-picker" "css_element"
55
    And I click on "//div[contains(concat(' ', normalize-space(@class), ' '), ' file-picker ')]/descendant::span[normalize-space(.)='empty.txt']/ancestor::a" "xpath_element"
56
    And I should see "Select empty.txt"
57
    When I click on "Select this file" "button"
58
    Then I should see "1" elements in "Files" filemanager
59
    And I should see "empty.txt" in the ".fp-content .fp-file" "css_element"