session.feature 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Feature: Session tool
  2. In order to use the session tool
  3. The admin should be able to create a session
  4. Background:
  5. Given I am a platform administrator
  6. Scenario: Create a session category
  7. Given I am on "/main/session/session_category_add.php"
  8. When I fill in the following:
  9. | name | category_1 |
  10. And I press "Add category"
  11. Then I should see "The category has been added"
  12. @javascript
  13. Scenario: Create a session
  14. Given I am on "/main/session/session_add.php"
  15. When I fill in the following:
  16. | name | Session1 |
  17. And I fill in select2 input "#coach_username" with id "1" and value "admin"
  18. And I press "submit"
  19. Then I should see "Add courses to this session (Session1)"
  20. Then I select "TEMP (TEMP)" from "NoSessionCoursesList[]"
  21. And I press "add_course"
  22. And I press "next"
  23. Then I should see "Update successful"
  24. @javascript
  25. Scenario: Create a session with description
  26. Given I am on "/main/session/session_add.php"
  27. When I fill in the following:
  28. | name | Temp Session |
  29. And I fill in select2 input "#coach_username" with id "1" and value "admin"
  30. And I press "advanced_params"
  31. And I fill in ckeditor field "description" with "Description for Temp Session"
  32. And I press "submit"
  33. Then I should see "Add courses to this session (Temp Session)"
  34. Then I select "TEMP (TEMP)" from "NoSessionCoursesList[]"
  35. And I press "add_course"
  36. And I press "next"
  37. Then I should see "Update successful"
  38. Scenario: Check session description is not present
  39. Given I am on "/user_portal.php?nosession=true"
  40. Then I should see "Temp Session"
  41. And I should not see "Description for Temp Session"
  42. Scenario: Edit session description setting
  43. Given I am on "/main/session/session_list.php?keyword=Temp+session"
  44. And wait for the page to be loaded
  45. And I follow "Edit"
  46. When I press "advanced_params"
  47. And I check "Show description"
  48. And I press "submit"
  49. Then I should see "Update successful"
  50. Scenario: Check session description with platform setting off
  51. Given I am a platform administrator
  52. And I am on "/main/admin/settings.php?search_field=show_session_description&category=search_setting"
  53. And I check the "show_session_description" radio button with "false" value
  54. And I press "Save settings"
  55. Then I am on "/user_portal.php?nosession=true"
  56. Then I should see "Temp Session"
  57. And I should not see "Description for Temp Session"
  58. Scenario: Check session description with platform setting on
  59. Given I am a platform administrator
  60. And I am on "/main/admin/settings.php?search_field=show_session_description&category=search_setting"
  61. And I check the "show_session_description" radio button with "true" value
  62. And I press "Save settings"
  63. Then I should see "Update successful"
  64. Then I am on "/user_portal.php?nosession=true"
  65. Then I should see "Temp Session"
  66. And I should see "Description for Temp Session"
  67. Scenario: Delete session
  68. Given I am on "/main/session/session_list.php?keyword=Temp+session"
  69. And wait for the page to be loaded
  70. And I follow "Delete"
  71. And I confirm the popup
  72. Then I should see "Deleted"
  73. Scenario: Delete session "Session1"
  74. Given I am on "/main/session/session_list.php?keyword=Session1"
  75. And wait for the page to be loaded
  76. And I follow "Delete"
  77. And I confirm the popup
  78. Then I should see "Deleted"
  79. Scenario: Delete session category
  80. Given I am on "/main/session/session_category_list.php"
  81. And I follow "Delete"
  82. And I confirm the popup
  83. Then I should see "The selected categories have been deleted"