manage_blocks.feature 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @core @core_block
  2. Feature: Block appearances
  3. In order to configure blocks appearance
  4. As a teacher
  5. I need to add and modify block configuration for the page
  6. Background:
  7. Given the following "courses" exist:
  8. | fullname | shortname | category |
  9. | Course 1 | C1 | 0 |
  10. And the following "users" exist:
  11. | username | firstname | lastname | email |
  12. | teacher1 | teacher | 1 | teacher1@example.com |
  13. And the following "course enrolments" exist:
  14. | user | course | role |
  15. | teacher1 | C1 | editingteacher |
  16. And I log in as "admin"
  17. And I am on site homepage
  18. And I follow "Course 1"
  19. And I follow "Turn editing on"
  20. And I add a "Survey" to section "1" and I fill the form with:
  21. | Name | Test survey name |
  22. | Survey type | ATTLS (20 item version) |
  23. | Description | Test survey description |
  24. And I add a "Book" to section "1" and I fill the form with:
  25. | Name | Test book name |
  26. | Description | Test book description |
  27. And I follow "Test book name"
  28. And I set the following fields to these values:
  29. | Chapter title | Book title |
  30. | Content | Book content test test |
  31. And I press "Save changes"
  32. And I log out
  33. And I log in as "teacher1"
  34. And I follow "Course 1"
  35. And I follow "Turn editing on"
  36. And I add the "Comments" block
  37. And I configure the "Comments" block
  38. And I set the following fields to these values:
  39. | Display on page types | Any page |
  40. And I press "Save changes"
  41. Scenario: Block settings can be modified so that a block apprears on any page
  42. When I follow "Test survey name"
  43. Then I should see "Comments" in the "Comments" "block"
  44. And I follow "Course 1"
  45. And I configure the "Comments" block
  46. And I set the following fields to these values:
  47. | Display on page types | Any course page |
  48. And I press "Save changes"
  49. And I follow "Turn editing off"
  50. And I follow "Test survey name"
  51. And I should not see "Comments"
  52. Scenario: Block settings can be modified so that a block can be hidden or moved
  53. When I follow "Test book name"
  54. And I configure the "Comments" block
  55. And I set the following fields to these values:
  56. | Visible | No |
  57. And I press "Save changes"
  58. And I follow "Turn editing off"
  59. And I follow "Test book name"
  60. Then I should not see "Comments"
  61. And I expand "Course administration" node
  62. And I follow "Turn editing on"
  63. And I configure the "Comments" block
  64. And I set the following fields to these values:
  65. | Visible | Yes |
  66. | Region | Right |
  67. And I press "Save changes"
  68. And I should see "Comments" in the "//*[@id='region-post' or @id='block-region-side-post']" "xpath_element"