[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/choice/tests/behat/ -> block_editing.feature (source)

   1  @mod @mod_choice
   2  Feature: Add choice activity
   3    In order to customise choice page
   4    As a teacher or admin
   5    I need to add remove block from the choice page
   6  
   7    # This tests that the hacky block editing is not borked by legacy forms in choice activity.
   8    Scenario: Add a choice activity as admin and check blog menu block should contain link.
   9      Given the following "courses" exist:
  10        | fullname | shortname | category |
  11        | Course 1 | C1 | 0 |
  12      And I log in as "admin"
  13      And I am on site homepage
  14      And I follow "Course 1"
  15      And I turn editing mode on
  16      And I add a "Choice" to section "1" and I fill the form with:
  17        | Choice name | Choice name 1 |
  18        | Description | Choice Description 1 |
  19        | option[0] | Option 1 |
  20        | option[1] | Option 2 |
  21      And I follow "Choice name 1"
  22      And I add the "Blog menu" block
  23      And I should see "View all entries about this Choice"
  24      When I configure the "Blog menu" block
  25      And I press "Save changes"
  26      Then I should see "View all entries about this Choice"
  27      And I open the "Blog menu" blocks action menu
  28      And I click on "Delete" "link" in the "Blog menu" "block"
  29      And I press "Yes"
  30      And I should not see "View all entries about this Choice"
  31      And I should see "Choice Description 1"
  32  
  33    Scenario: Add a choice activity as teacher and check blog menu block contain choice link.
  34      Given the following "users" exist:
  35        | username | firstname | lastname | email |
  36        | teacher1 | Teacher | 1 | teacher1@example.com |
  37        | student1 | Student | 1 | student1@example.com |
  38      And the following "courses" exist:
  39        | fullname | shortname | category |
  40        | Course 1 | C1 | 0 |
  41      And the following "course enrolments" exist:
  42        | user | course | role |
  43        | teacher1 | C1 | editingteacher |
  44        | student1 | C1 | student |
  45      And I log in as "teacher1"
  46      And I follow "Course 1"
  47      And I turn editing mode on
  48      And I add a "Choice" to section "1" and I fill the form with:
  49        | Choice name | Choice name 1 |
  50        | Description | Choice Description 1 |
  51        | option[0] | Option 1 |
  52        | option[1] | Option 2 |
  53      And I follow "Choice name 1"
  54      And I add the "Blog menu" block
  55      And I should see "View all entries about this Choice"
  56      When I configure the "Blog menu" block
  57      And I press "Save changes"
  58      Then I should see "View all entries about this Choice"
  59      And I open the "Blog menu" blocks action menu
  60      And I click on "Delete" "link" in the "Blog menu" "block"
  61      And I press "Yes"
  62      And I should not see "View all entries about this Choice"
  63      And I should see "Choice Description 1"
  64  
  65    Scenario: Add a choice activity as teacher (with dual role) and check blog menu block contain choice link.
  66      Given the following "users" exist:
  67        | username | firstname | lastname | email |
  68        | teacher1 | Teacher | 1 | teacher1@example.com |
  69      And the following "courses" exist:
  70        | fullname | shortname | category |
  71        | Course 1 | C1 | 0 |
  72      And the following "course enrolments" exist:
  73        | user | course | role |
  74        | teacher1 | C1 | editingteacher |
  75        | teacher1 | C1 | student |
  76      And I log in as "teacher1"
  77      And I follow "Course 1"
  78      And I turn editing mode on
  79      And I add a "Choice" to section "1" and I fill the form with:
  80        | Choice name | Choice name 1 |
  81        | Description | Choice Description 1 |
  82        | option[0] | Option 1 |
  83        | option[1] | Option 2 |
  84      And I follow "Choice name 1"
  85      And I add the "Blog menu" block
  86      And I should see "View all entries about this Choice"
  87      When I configure the "Blog menu" block
  88      And I press "Save changes"
  89      Then I should see "View all entries about this Choice"
  90      And I open the "Blog menu" blocks action menu
  91      And I click on "Delete" "link" in the "Blog menu" "block"
  92      And I press "Yes"
  93      And I should not see "View all entries about this Choice"
  94      And I should see "Choice Description 1"


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