Línea 1... |
Línea 1... |
1 |
@editor @editor_atto @atto @_file_upload
|
1 |
@editor @editor_atto @atto
|
2 |
Feature: Atto Autosave
|
2 |
Feature: Atto Autosave
|
3 |
To reduce frustration, atto should save drafts of my work.
|
3 |
To reduce frustration, atto should save drafts of my work.
|
Línea 4... |
Línea 4... |
4 |
|
4 |
|
5 |
Background:
|
5 |
Background:
|
Línea 12... |
Línea 12... |
12 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
12 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
13 |
And the following "course enrolments" exist:
|
13 |
And the following "course enrolments" exist:
|
14 |
| user | course | role |
|
14 |
| user | course | role |
|
15 |
| teacher1 | C1 | editingteacher |
|
15 |
| teacher1 | C1 | editingteacher |
|
16 |
| teacher2 | 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"
|
17 |
And I log in as "admin"
|
21 |
And I navigate to "Plugins > Text editors > Atto HTML editor > Atto toolbar settings" in site administration
|
18 |
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"
|
19 |
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"
|
20 |
And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds"
|
24 |
And I click on "Save changes" "button"
|
21 |
And I click on "Save changes" "button"
|
Línea 44... |
Línea 41... |
44 |
And I wait "2" seconds
|
41 |
And I wait "2" seconds
|
45 |
Then I should see "This is my draft"
|
42 |
Then I should see "This is my draft"
|
Línea 46... |
Línea 43... |
46 |
|
43 |
|
47 |
@javascript
|
44 |
@javascript
|
48 |
Scenario: Do not restore a draft if files have been modified
|
45 |
Scenario: Do not restore a draft if files have been modified
|
- |
|
46 |
Given the following "user private file" exists:
|
- |
|
47 |
| user | teacher2 |
|
49 |
Given I log in as "teacher1"
|
48 |
| filepath | lib/editor/atto/tests/fixtures/moodle-logo.png |
|
50 |
And I am on "Course 1" course homepage
|
49 |
And I am on the "Course 1" course page logged in as teacher1
|
51 |
And I navigate to "Settings" in current page administration
|
50 |
And I navigate to "Settings" in current page administration
|
52 |
And I set the field "Course summary" to "This is my draft"
|
51 |
And I set the field "Course summary" to "This is my draft"
|
53 |
# Wait for the autosave
|
52 |
# Wait for the autosave
|
54 |
And I wait "5" seconds
|
53 |
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"
|
54 |
And I log out
|
60 |
And I am on "Course 1" course homepage
|
55 |
And I am on the "Course 1" course page logged in as teacher2
|
61 |
And I navigate to "Settings" in current page administration
|
56 |
And I navigate to "Settings" in current page administration
|
62 |
And I set the field "Course summary" to "<p>Image test</p>"
|
57 |
And I set the field "Course summary" to "<p>Image test</p>"
|
63 |
And I select the text in the "Course summary" Atto editor
|
58 |
And I select the text in the "Course summary" Atto editor
|
64 |
And I click on "Insert or edit image" "button"
|
59 |
And I click on "Insert or edit image" "button"
|