sessionManagement.feature 3.7 KB

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