[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/forum/tests/behat/ -> discussion_display.feature (source)

   1  @mod @mod_forum
   2  Feature: Students can choose from 4 discussion display options and their choice is remembered
   3    In order to read forum posts in a suitable view
   4    As a user
   5    I need to select which display method I want to use
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | student1 | Student | 1 | [email protected] |
  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        | student1 | C1 | student |
  17      And I log in as "admin"
  18      And I follow "Course 1"
  19      And I turn editing mode on
  20      And I add a "Forum" to section "1" and I fill the form with:
  21        | Forum name | Test forum name |
  22        | Description | Test forum description |
  23      And I add a new discussion to "Test forum name" forum with:
  24        | Subject | Discussion 1 |
  25        | Message | Discussion contents 1, first message |
  26      And I reply "Discussion 1" post from "Test forum name" forum with:
  27        | Subject | Reply 1 to discussion 1 |
  28        | Message | Discussion contents 1, second message |
  29      And I add a new discussion to "Test forum name" forum with:
  30        | Subject | Discussion 2 |
  31        | Message | Discussion contents 2, first message |
  32      And I reply "Discussion 2" post from "Test forum name" forum with:
  33        | Subject | Reply 1 to discussion 2 |
  34        | Message | Discussion contents 2, second message |
  35      And I log out
  36      And I log in as "student1"
  37      And I follow "Course 1"
  38  
  39    @javascript
  40    Scenario: Display replies flat, with oldest first
  41      Given I reply "Discussion 1" post from "Test forum name" forum with:
  42        | Subject | Reply 2 to discussion 1 |
  43        | Message | Discussion contents 1, third message |
  44      When I set the field "mode" to "Display replies flat, with oldest first"
  45      Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
  46      And I should see "Discussion contents 1, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
  47      And I reply "Discussion 2" post from "Test forum name" forum with:
  48        | Subject | Reply 2 to discussion 2 |
  49        | Message | Discussion contents 2, third message |
  50      And the field "Display mode" matches value "Display replies flat, with oldest first"
  51      And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
  52      And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
  53  
  54    @javascript
  55    Scenario: Display replies flat, with newest first
  56      Given I reply "Discussion 1" post from "Test forum name" forum with:
  57        | Subject | Reply 2 to discussion 1 |
  58        | Message | Discussion contents 1, third message |
  59      When I set the field "mode" to "Display replies flat, with newest first"
  60      Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
  61      And I should see "Discussion contents 1, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
  62      And I reply "Discussion 2" post from "Test forum name" forum with:
  63        | Subject | Reply 2 to discussion 2 |
  64        | Message | Discussion contents 2, third message |
  65      And the field "Display mode" matches value "Display replies flat, with newest first"
  66      And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
  67      And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
  68  
  69    @javascript
  70    Scenario: Display replies in threaded form
  71      Given I follow "Test forum name"
  72      And I follow "Discussion 1"
  73      When I set the field "mode" to "Display replies in threaded form"
  74      Then I should see "Discussion contents 1, first message"
  75      And I should see "Reply 1 to discussion 1" in the "span.forumthread" "css_element"
  76      And I follow "Test forum name"
  77      And I follow "Discussion 2"
  78      And the field "Display mode" matches value "Display replies in threaded form"
  79      And I should see "Discussion contents 2, first message"
  80      And I should see "Reply 1 to discussion 2" in the "span.forumthread" "css_element"
  81  
  82    @javascript
  83    Scenario: Display replies in nested form
  84      Given I follow "Test forum name"
  85      And I follow "Discussion 1"
  86      When I set the field "mode" to "Display replies in nested form"
  87      Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
  88      And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
  89      And I follow "Test forum name"
  90      And I follow "Discussion 2"
  91      And the field "Display mode" matches value "Display replies in nested form"
  92      And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
  93      And I should see "Discussion contents 2, second message" in the "div.indent div.forumpost" "css_element"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1