Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_wiki
2
Feature: There is a choice of formats for editing a wiki page
3
  In order to allow users to use their favorite wiki format
4
  As a user
5
  I need to choose which wiki format do I want to use
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1 | 0 |
14
    And the following "course enrolments" exist:
15
      | user | course | role |
16
      | teacher1 | C1 | editingteacher |
17
    And the following "activity" exists:
18
      | activity       | wiki           |
19
      | course         | C1             |
20
      | name           | Test wiki name |
21
      | wikimode       | collaborative  |
22
      | firstpagetitle | First page     |
23
    And I am on the "Test wiki name" "wiki activity" page logged in as teacher1
24
 
25
  @javascript
26
  Scenario: Creole format
27
    When I set the following fields to these values:
28
      | Creole format | 1 |
29
    And I press "Create page"
30
    Then "div.wikieditor-toolbar" "css_element" should exist
31
    # Click on bold, italic, interal link and H1
32
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[1]" "xpath_element"
33
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element"
34
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element"
35
    And the field "newcontent" matches value "**Bold text**//Italic text//[[Internal link]]"
36
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element"
37
    And I press "Save"
38
    And I should see "Bold textItalic textInternal link"
39
    And I should see "Level 1 Header"
40
    And I should see "Table of contents"
41
    And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element"
42
    And I follow "Internal link"
43
    And I should see "New page title"
44
 
45
  @javascript
46
  Scenario: NWiki format
47
    When I set the following fields to these values:
48
      | NWiki format | 1 |
49
    And I press "Create page"
50
    Then "div.wikieditor-toolbar" "css_element" should exist
51
    # Click on italic, interal link and H1
52
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element"
53
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element"
54
    And the field "newcontent" matches value "'''Italic text'''[[Internal link]]"
55
    And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element"
56
    And I press "Save"
57
    And I should see "Italic textInternal link"
58
    And I should see "Level 1 Header"
59
    And I should see "Table of contents"
60
    And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element"
61
    And I follow "Internal link"
62
    And I should see "New page title"
63
 
64
  @javascript
65
  Scenario: HTML format
66
    When I set the following fields to these values:
67
      | HTML format | 1 |
68
    And I press "Create page"
69
    Then "#id_newcontent_editor" "css_element" should exist
70
    And I set the following fields to these values:
71
      | HTML format | I'm a text |
72
    And I press "Save"
73
    And I should see "I'm a text"