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: Overwrite file feature
3
  In order to update an existing file
4
  As a user
5
  I need to pick the file with the same name and select to overwrite
6
 
7
  @javascript @_bug_phantomjs
8
  Scenario: Upload a file in filemanager and overwrite it
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email |
11
      | teacher1 | Terry | Teacher | teacher1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1 | 0 |
15
    And the following "course enrolments" exist:
16
      | user | course | role |
17
      | teacher1 | C1 | editingteacher |
18
    And the following "blocks" exist:
19
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
20
      | private_files | System       | 1         | my-index        | side-post     |
21
    When I log in as "teacher1"
22
    And I follow "Manage private files"
23
    And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
24
    Then I should see "1" elements in "Files" filemanager
25
    And I upload and overwrite "lib/tests/fixtures/empty.txt" file to "Files" filemanager
26
    And I should see "1" elements in "Files" filemanager
27
    And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
28
      | Save as | empty_copy.txt |
29
    And I should see "2" elements in "Files" filemanager
30
    And I upload and overwrite "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
31
      | Save as | empty_copy.txt |
32
    And I should see "2" elements in "Files" filemanager
33
    And I press "Save changes"
34
    And I am on "Course 1" course homepage with editing mode on
35
    And I add a folder activity to course "Course 1" section "1"
36
    And I set the following fields to these values:
37
      | Name | Test folder |
38
      | Description | Test folder description |
39
    And I add "empty.txt" file from "Private files" to "Files" filemanager
40
    And I should see "1" elements in "Files" filemanager
41
    And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager
42
    And I should see "1" elements in "Files" filemanager
43
    And I add "empty.txt" file from "Private files" to "Files" filemanager as:
44
      | Save as | empty_copy.txt |
45
    And I should see "2" elements in "Files" filemanager
46
    And I add and overwrite "empty.txt" file from "Private files" to "Files" filemanager as:
47
      | Save as | empty_copy.txt |
48
    And I should see "2" elements in "Files" filemanager
49
    And I press "Save and display"
50
    And I should see "empty.txt"
51
    And I should see "empty_copy.txt"