Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_resource @_file_upload
2
Feature: Details of uploaded file in the resource can be changed
3
  In order to change details of an uploaded file in a folder resource
4
  As a teacher
5
  I should be able to upload a file
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email          |
10
      | teacher1 | Teacher   | 1        | t1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1        | 0        |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
    And the following "activities" exist:
18
      | activity | course | name    |
19
      | folder   | C1     | Folder1 |
20
 
21
  @javascript
22
  Scenario: Uploaded file details can be changed
23
    Given I am on the "Folder1" "folder activity" page logged in as teacher1
24
    And I click on "Edit" "button"
25
    # Upload a file in folder resource
26
    And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
27
    And I press "Save changes"
28
    And I click on "Edit" "button"
29
    And I click on "empty.txt" "link"
30
    # Initially, file details are set to default values
31
    And the following fields match these values:
32
      | Name    | empty.txt             |
33
      | Author  | Teacher 1             |
34
      | licence | Licence not specified |
35
    # Update the file details for testing
36
    When I set the following fields to these values:
37
      | Name    | empty_file.txt      |
38
      | Author  | Teacher 1           |
39
      | licence | All rights reserved |
40
    And I press "Update"
41
    And I press "Save changes"
42
    # Confirm that file details have been updated correctly
43
    And I click on "Edit" "button"
44
    And I click on "empty_file.txt" "link"
45
    Then the following fields match these values:
46
      | Name    | empty_file.txt      |
47
      | Author  | Teacher 1           |
48
      | licence | All rights reserved |