Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@editor @editor_atto @atto @_file_upload
2
Feature: Atto Autosave
3
  To reduce frustration, atto should save drafts of my work.
4
 
5
  Background:
6
    Given the following "courses" exist:
7
      | fullname | shortname | category | groupmode |
8
      | Course 1 | C1 | 0 | 1 |
9
    And the following "users" exist:
10
      | username | firstname | lastname | email |
11
      | teacher1 | Teacher | 1 | teacher1@example.com |
12
      | teacher2 | Teacher | 2 | teacher2@example.com |
13
    And the following "course enrolments" exist:
14
      | user | course | role |
15
      | teacher1 | C1 | editingteacher |
16
      | teacher2 | C1 | editingteacher |
17
    And the following "blocks" exist:
18
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
19
      | private_files | System       | 1         | my-index        | side-post     |
20
    And I log in as "admin"
21
    And I navigate to "Plugins > Text editors > Atto HTML editor > Atto toolbar settings" in site administration
22
    And I set the field "Autosave frequency" to "3"
23
    And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds"
24
    And I click on "Save changes" "button"
25
    And I am on "Course 1" course homepage
26
    And I navigate to "Settings" in current page administration
27
    And I set the field "Course summary format" to "1"
28
    And I click on "Save and display" "button"
29
    And I log out
30
 
31
  @javascript
32
  Scenario: Restore a draft
33
    Given I log in as "teacher1"
34
    And I am on "Course 1" course homepage
35
    And I navigate to "Settings" in current page administration
36
    And I set the field "Course summary" to "This is my draft"
37
    # Wait for the autosave
38
    And I wait "5" seconds
39
    And I log out
40
    When I log in as "teacher1"
41
    And I am on "Course 1" course homepage
42
    And I navigate to "Settings" in current page administration
43
    # Wait for the autorestore
44
    And I wait "2" seconds
45
    Then I should see "This is my draft"
46
 
47
  @javascript
48
  Scenario: Do not restore a draft if files have been modified
49
    Given I log in as "teacher1"
50
    And I am on "Course 1" course homepage
51
    And I navigate to "Settings" in current page administration
52
    And I set the field "Course summary" to "This is my draft"
53
    # Wait for the autosave
54
    And I wait "5" seconds
55
    And I log out
56
    And I log in as "teacher2"
57
    And I follow "Manage private files..."
58
    And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
59
    And I click on "Save changes" "button"
60
    And I am on "Course 1" course homepage
61
    And I navigate to "Settings" in current page administration
62
    And I set the field "Course summary" to "<p>Image test</p>"
63
    And I select the text in the "Course summary" Atto editor
64
    And I click on "Insert or edit image" "button"
65
    And I click on "Browse repositories..." "button"
66
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
67
    And I click on "moodle-logo.png" "link"
68
    And I click on "Select this file" "button"
69
    And I set the field "Describe this image" to "It's the Moodle"
70
    # Wait for the page to "settle".
71
    And I wait until the page is ready
72
    And I click on "Save image" "button"
73
    And I click on "Save and display" "button"
74
    And I log out
75
    When I log in as "teacher1"
76
    And I am on "Course 1" course homepage
77
    And I navigate to "Settings" in current page administration
78
    Then I should not see "This is my draft"
79
 
80
  @javascript
81
  Scenario: Do not restore a draft if text has been modified
82
    Given I log in as "teacher1"
83
    And I am on "Course 1" course homepage
84
    And I navigate to "Settings" in current page administration
85
    And I set the field "Course summary" to "This is my draft"
86
    # Wait for the autosave
87
    And I wait "5" seconds
88
    And I log out
89
    And I log in as "teacher2"
90
    And I am on "Course 1" course homepage
91
    And I navigate to "Settings" in current page administration
92
    And I set the field "Course summary" to "Modified text"
93
    And I click on "Save and display" "button"
94
    And I log out
95
    When I log in as "teacher1"
96
    And I am on "Course 1" course homepage
97
    And I navigate to "Settings" in current page administration
98
    Then I should not see "This is my draft"
99
    And I should see "Modified text"