[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/editor/atto/tests/behat/ -> autosave.feature (source)

   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 I log in as "admin"
  18      And I navigate to "Atto toolbar settings" node in "Site administration > Plugins > Text editors > Atto HTML editor"
  19      And I set the field "Autosave frequency" to "3"
  20      And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds"
  21      And I click on "Save changes" "button"
  22      And I am on site homepage
  23      And I follow "Course 1"
  24      And I navigate to "Edit settings" node in "Course administration"
  25      And I set the field with xpath "//select[@name='summary_editor[format]']" to "1"
  26      And I click on "Save and display" "button"
  27      And I log out
  28  
  29    @javascript
  30    Scenario: Restore a draft
  31      Given I log in as "teacher1"
  32      And I follow "Course 1"
  33      And I navigate to "Edit settings" node in "Course administration"
  34      And I set the field "Course summary" to "This is my draft"
  35      # Wait for the autosave
  36      And I wait "5" seconds
  37      And I log out
  38      When I log in as "teacher1"
  39      And I follow "Course 1"
  40      And I navigate to "Edit settings" node in "Course administration"
  41      # Wait for the autorestore
  42      And I wait "2" seconds
  43      Then I should see "This is my draft"
  44  
  45    @javascript
  46    Scenario: Do not restore a draft if files have been modified
  47      Given I log in as "teacher1"
  48      And I follow "Course 1"
  49      And I navigate to "Edit settings" node in "Course administration"
  50      And I set the field "Course summary" to "This is my draft"
  51      # Wait for the autosave
  52      And I wait "5" seconds
  53      And I log out
  54      And I log in as "teacher2"
  55      And I follow "Manage private files..."
  56      And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
  57      And I click on "Save changes" "button"
  58      And I click on "Dashboard" "link" in the "Navigation" "block"
  59      And I follow "Course 1"
  60      And I navigate to "Edit settings" node in "Course administration"
  61      And I set the field "Course summary" to "<p>Image test</p>"
  62      And I select the text in the "Course summary" Atto editor
  63      And I click on "Image" "button"
  64      And I click on "Browse repositories..." "button"
  65      And I click on "Private files" "link"
  66      And I click on "moodle-logo.png" "link"
  67      And I click on "Select this file" "button"
  68      And I set the field "Describe this image" to "It's the Moodle"
  69      # Wait for the page to "settle".
  70      And I wait until the page is ready
  71      And I click on "Save image" "button"
  72      And I click on "Save and display" "button"
  73      And I log out
  74      When I log in as "teacher1"
  75      And I follow "Course 1"
  76      And I navigate to "Edit settings" node in "Course administration"
  77      Then I should not see "This is my draft"
  78  
  79    @javascript
  80    Scenario: Do not restore a draft if text has been modified
  81      Given I log in as "teacher1"
  82      And I follow "Course 1"
  83      And I navigate to "Edit settings" node in "Course administration"
  84      And I set the field "Course summary" to "This is my draft"
  85      # Wait for the autosave
  86      And I wait "5" seconds
  87      And I log out
  88      And I log in as "teacher2"
  89      And I follow "Course 1"
  90      And I navigate to "Edit settings" node in "Course administration"
  91      And I set the field "Course summary" to "Modified text"
  92      And I click on "Save and display" "button"
  93      And I log out
  94      When I log in as "teacher1"
  95      And I follow "Course 1"
  96      And I navigate to "Edit settings" node in "Course administration"
  97      Then I should not see "This is my draft"
  98      And I should see "Modified text"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1