[ Index ]

PHP Cross Reference of Unnamed Project

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 | student1@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        | student1 | C1 | student |
  17      And I log in as "admin"
  18      And I am on site homepage
  19      And I follow "Course 1"
  20      And I turn editing mode on
  21      And I add a "Forum" to section "1" and I fill the form with:
  22        | Forum name | Test forum name |
  23        | Description | Test forum description |
  24      And I add a new discussion to "Test forum name" forum with:
  25        | Subject | Discussion 1 |
  26        | Message | Discussion contents 1, first message |
  27      And I reply "Discussion 1" post from "Test forum name" forum with:
  28        | Subject | Reply 1 to discussion 1 |
  29        | Message | Discussion contents 1, second message |
  30      And I add a new discussion to "Test forum name" forum with:
  31        | Subject | Discussion 2 |
  32        | Message | Discussion contents 2, first message |
  33      And I reply "Discussion 2" post from "Test forum name" forum with:
  34        | Subject | Reply 1 to discussion 2 |
  35        | Message | Discussion contents 2, second message |
  36      And I log out
  37      And I log in as "student1"
  38      And I follow "Course 1"
  39  
  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 select "Display replies flat, with oldest first" from the "mode" singleselect
  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    Scenario: Display replies flat, with newest first
  55      Given I reply "Discussion 1" post from "Test forum name" forum with:
  56        | Subject | Reply 2 to discussion 1 |
  57        | Message | Discussion contents 1, third message |
  58      When I select "Display replies flat, with newest first" from the "mode" singleselect
  59      Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
  60      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"
  61      And I reply "Discussion 2" post from "Test forum name" forum with:
  62        | Subject | Reply 2 to discussion 2 |
  63        | Message | Discussion contents 2, third message |
  64      And the field "Display mode" matches value "Display replies flat, with newest first"
  65      And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
  66      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"
  67  
  68    Scenario: Display replies in threaded form
  69      Given I follow "Test forum name"
  70      And I follow "Discussion 1"
  71      When I select "Display replies in threaded form" from the "mode" singleselect
  72      Then I should see "Discussion contents 1, first message"
  73      And I should see "Reply 1 to discussion 1" in the "span.forumthread" "css_element"
  74      And I follow "Test forum name"
  75      And I follow "Discussion 2"
  76      And the field "Display mode" matches value "Display replies in threaded form"
  77      And I should see "Discussion contents 2, first message"
  78      And I should see "Reply 1 to discussion 2" in the "span.forumthread" "css_element"
  79  
  80    Scenario: Display replies in nested form
  81      Given I follow "Test forum name"
  82      And I follow "Discussion 1"
  83      When I select "Display replies in nested form" from the "mode" singleselect
  84      Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
  85      And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
  86      And I follow "Test forum name"
  87      And I follow "Discussion 2"
  88      And the field "Display mode" matches value "Display replies in nested form"
  89      And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
  90      And I should see "Discussion contents 2, second message" in the "div.indent div.forumpost" "css_element"


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