[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/wiki/tests/behat/ -> wiki_formats.feature (source)

   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 I log in as "teacher1"
  18      And I follow "Course 1"
  19      And I turn editing mode on
  20      And I add a "Wiki" to section "1" and I fill the form with:
  21        | Wiki name | Test wiki name |
  22        | Description | Test wiki description |
  23        | First page name | First page |
  24      And I follow "Test wiki name"
  25  
  26    @javascript
  27    Scenario: Creole format
  28      When I set the following fields to these values:
  29        | Creole format | 1 |
  30      And I press "Create page"
  31      Then "div.wikieditor-toolbar" "css_element" should exist
  32      # Click on bold, italic, interal link and H1
  33      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[1]" "xpath_element"
  34      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element"
  35      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element"
  36      And the field "newcontent" matches value "**Bold text**//Italic text//[[Internal link]]"
  37      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element"
  38      And I press "Save"
  39      And I should see "Bold textItalic textInternal link"
  40      And I should see "Level 1 Header"
  41      And I should see "Table of contents"
  42      And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element"
  43      And I follow "Internal link"
  44      And I should see "New page title"
  45  
  46    @javascript
  47    Scenario: NWiki format
  48      When I set the following fields to these values:
  49        | NWiki format | 1 |
  50      And I press "Create page"
  51      Then "div.wikieditor-toolbar" "css_element" should exist
  52      # Click on italic, interal link and H1
  53      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element"
  54      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element"
  55      And the field "newcontent" matches value "'''Italic text'''[[Internal link]]"
  56      And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element"
  57      And I press "Save"
  58      And I should see "Italic textInternal link"
  59      And I should see "Level 1 Header"
  60      And I should see "Table of contents"
  61      And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element"
  62      And I follow "Internal link"
  63      And I should see "New page title"
  64  
  65    @javascript
  66    Scenario: HTML format
  67      When I set the following fields to these values:
  68        | HTML format | 1 |
  69      And I press "Create page"
  70      Then "#fitem_id_newcontent_editor" "css_element" should exist
  71      And I set the following fields to these values:
  72        | HTML format | I'm a text |
  73      And I press "Save"
  74      And I should see "I'm a text"


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