Rev 1 | AutorÃa | Ultima modificación | Ver Log |
@editor @editor_atto @attoFeature: Atto AutosaveTo reduce frustration, atto should save drafts of my work.Background:Given the following "courses" exist:| fullname | shortname | category | groupmode || Course 1 | C1 | 0 | 1 |And the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || teacher2 | Teacher | 2 | teacher2@example.com |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || teacher2 | C1 | editingteacher |And I log in as "admin"And I navigate to "Plugins > Text editors > Atto HTML editor > Atto toolbar settings" in site administrationAnd I set the field "Autosave frequency" to "3"And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds"And I click on "Save changes" "button"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the field "Course summary format" to "1"And I click on "Save and display" "button"And I log out@javascriptScenario: Restore a draftGiven I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the field "Course summary" to "This is my draft"# Wait for the autosaveAnd I wait "5" secondsAnd I log outWhen I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administration# Wait for the autorestoreAnd I wait "2" secondsThen I should see "This is my draft"@javascriptScenario: Do not restore a draft if files have been modifiedGiven the following "user private file" exists:| user | teacher2 || filepath | lib/editor/atto/tests/fixtures/moodle-logo.png |And I am on the "Course 1" course page logged in as teacher1And I navigate to "Settings" in current page administrationAnd I set the field "Course summary" to "This is my draft"# Wait for the autosaveAnd I wait "5" secondsAnd I log outAnd I am on the "Course 1" course page logged in as teacher2And I navigate to "Settings" in current page administrationAnd I set the field "Course summary" to "<p>Image test</p>"And I select the text in the "Course summary" Atto editorAnd I click on "Insert or edit image" "button"And I click on "Browse repositories..." "button"And I click on "Private files" "link" in the ".fp-repo-area" "css_element"And I click on "moodle-logo.png" "link"And I click on "Select this file" "button"And I set the field "Describe this image" to "It's the Moodle"# Wait for the page to "settle".And I wait until the page is readyAnd I click on "Save image" "button"And I click on "Save and display" "button"And I log outWhen I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationThen I should not see "This is my draft"@javascriptScenario: Do not restore a draft if text has been modifiedGiven I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the field "Course summary" to "This is my draft"# Wait for the autosaveAnd I wait "5" secondsAnd I log outAnd I log in as "teacher2"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I set the field "Course summary" to "Modified text"And I click on "Save and display" "button"And I log outWhen I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationThen I should not see "This is my draft"And I should see "Modified text"