sessionAccess.feature 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Feature: Session access
  2. In order to access a session
  3. The teacher must be registered as a session coach for this course
  4. @javascript
  5. Scenario: Create session 1
  6. Given I am a platform administrator
  7. And I am on "/main/session/session_add.php"
  8. When I fill in the following:
  9. | name | Session1 |
  10. And I fill in select2 input "#coach_username" with id "1" and value "admin"
  11. And I press "submit"
  12. Then I should see "Add courses to this session (Session1)"
  13. Then I select "TEMP_PRIVATE (TEMPPRIVATE)" from "NoSessionCoursesList[]"
  14. And I press "add_course"
  15. And I press "next"
  16. Then I should see "Update successful"
  17. Then I should see "Subscribe users to this session"
  18. Then I follow "Multiple registration"
  19. Then I select "Warnier Yannick (ywarnier)" from "nosessionUsersList[]"
  20. And I press "add_user"
  21. And I press "next"
  22. Then I should see "Session1"
  23. Then I should see "TEMPPRIVATE"
  24. Then I should see "ywarnier"
  25. @javascript
  26. Scenario: Create session 2
  27. Given I am a platform administrator
  28. And I am on "/main/session/session_add.php"
  29. When I fill in the following:
  30. | name | Session2 |
  31. And I fill in select2 input "#coach_username" with id "1" and value "admin"
  32. And I press "submit"
  33. Then I should see "Add courses to this session (Session2)"
  34. Then I select "TEMP_PRIVATE (TEMPPRIVATE)" from "NoSessionCoursesList[]"
  35. And I press "add_course"
  36. And I press "next"
  37. Then I should see "Update successful"
  38. Then I should see "Subscribe users to this session"
  39. Then I follow "Multiple registration"
  40. Then I select "Mosquera Guardamino Michela (mmosquera)" from "nosessionUsersList[]"
  41. And I press "add_user"
  42. And I press "next"
  43. Then I should see "Session2"
  44. Then I should see "TEMPPRIVATE"
  45. Then I should see "mmosquera"
  46. Scenario: ywarnier connects to Session1
  47. Given I am logged as "ywarnier"
  48. Then I am on course "TEMPPRIVATE" homepage in session "Session1"
  49. Then I should not see "You are not allowed"
  50. Scenario: ywarnier connect to Session 2
  51. Given I am logged as "ywarnier"
  52. Then I am on course "TEMPPRIVATE" homepage in session "Session2"
  53. Then I should see "You are not allowed"
  54. Scenario: ywarnier connect to session that doesn't exists
  55. Given I am logged as "ywarnier"
  56. And I am on course "TEMPPRIVATE" homepage in session "Session does not exists"
  57. Then I should see "You are not allowed"
  58. Scenario: mmosquera connect to Session 1
  59. Given I am logged as "mmosquera"
  60. Then I am on course "TEMPPRIVATE" homepage in session "Session1"
  61. Then I should see "You are not allowed"
  62. Scenario: mmosquera connect to Session 2
  63. Given I am logged as "mmosquera"
  64. Then I am on course "TEMPPRIVATE" homepage in session "Session2"
  65. Then I should not see "You are not allowed"
  66. Scenario: Delete session "Session2"
  67. Given I am a platform administrator
  68. And I am on "/main/session/session_list.php?keyword=Session2"
  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 a platform administrator
  75. And I am on "/main/session/session_list.php?keyword=Session1"
  76. And wait for the page to be loaded
  77. And I follow "Delete"
  78. And I confirm the popup
  79. Then I should see "Deleted"