2 Feature: Edited wiki pages may be previewed before saving
3 In order to avoid silly mistakes
5 I need to preview pages before saving changes
8 Given the following "users" exists:
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@asd.com |
11 | student1 | Student | 1 | student1@asd.com |
12 And the following "courses" exists:
13 | fullname | shortname | category |
15 And the following "course enrolments" exists:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
18 | student1 | C1 | student |
19 And I log in as "teacher1"
20 And I follow "Course 1"
21 And I turn editing mode on
22 And I add a "Wiki" to section "1" and I fill the form with:
23 | Wiki name | Test wiki name |
24 | Description | Test wiki description |
25 | First page name | First page |
26 | Wiki mode | Collaborative wiki |
28 And I log in as "student1"
29 And I follow "Course 1"
30 And I follow "Test wiki name"
31 When I press "Create page"
32 And I fill the moodle form with:
33 | HTML format | Student page contents to be previewed |
35 Then I should see "This is a preview. Changes have not been saved yet"
36 And I should see "Student page contents to be previewed"
38 And I should see "Student page contents to be previewed"
42 Scenario: Page contents preview before saving with Javascript enabled
43 Then the "HTML format" field should match "<p>Student page contents to be previewed</p>" value
46 Scenario: Page contents preview before saving with Javascript disabled
47 Then the "HTML format" field should match "Student page contents to be previewed" value