diff --git a/mod/chat/tests/behat/app_navigation.feature b/mod/chat/tests/behat/app_navigation.feature new file mode 100644 index 000000000..fb4cd37ad --- /dev/null +++ b/mod/chat/tests/behat/app_navigation.feature @@ -0,0 +1,44 @@ +@mod @mod_chat @app @javascript +Feature: Test chat navigation + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | + | student1 | Student | first | + | student2 | Student | second | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | chat | Test chat name | Test chat | C1 | chat | 0 | + # Create sessions + # TODO use generator instead + And I enter the course "Course 1" as "student1" in the app + And I press "Test chat name" in the app + And I press "Enter the chat" in the app + And I set the field "New message" to "Test message" in the app + And I press "Send" in the app + Then I should find "Test message" in the app + + Scenario: Tablet navigation + Given I enter the course "Course 1" as "student2" in the app + And I change viewport size to "1200x640" + + # Sessions + When I press "Test chat name" in the app + And I press "View past chat sessions" in the app + Then I should find "No sessions found" in the app + + # Sessions — split view + When I press "Show incomplete sessions" in the app + Then "Student first" should be selected in the app + And I should find "Test message" in the app + + When I press "Show incomplete sessions" in the app + Then I should not find "Student first" in the app + And I should not find "Test message" in the app diff --git a/tests/behat/settings_navigation.feature b/tests/behat/settings_navigation.feature new file mode 100644 index 000000000..2837c1171 --- /dev/null +++ b/tests/behat/settings_navigation.feature @@ -0,0 +1,82 @@ +@app @javascript +Feature: It navigates properly within settings. + + Background: + Given the following "users" exist: + | username | + | student1 | + + Scenario: Mobile navigation + Given I enter the app + And I log in as "student1" + + # Settings + When I press "More" in the app + And I press "App settings" in the app + Then I should find "General" in the app + And I should find "Space usage" in the app + And I should find "Synchronisation" in the app + And I should find "About" in the app + + # Settings details + When I press "General" in the app + Then I should find "Language" in the app + And I should find "Text size" in the app + + When I press the back button in the app + And I press "About" in the app + Then I should find "Moodle Mobile" in the app + And I should find "Privacy policy" in the app + + # Preferences + When I press the back button in the app + And I press the back button in the app + And I press the user menu button in the app + And I press "Preferences" in the app + Then I should find "Messages" in the app + And I should find "Notifications" in the app + And I should find "Space usage" in the app + + # Preferences details + When I press "Messages" in the app + Then I should find "Accept messages from" in the app + And I should find "Notification preferences" in the app + + When I press the back button in the app + And I press "Manage storage" in the app + Then I should find "File storage used" in the app + + Scenario: Tablet navigation + Given I enter the app + And I log in as "student1" + And I change viewport size to "1200x640" + + # Settings + When I press "More" in the app + And I press "App settings" in the app + Then I should find "General" in the app + And I should find "Space usage" in the app + And I should find "Synchronisation" in the app + And I should find "About" in the app + And "General" should be selected in the app + And I should find "Language" in the app + And I should find "Text size" in the app + + When I press "About" in the app + Then "About" should be selected in the app + And I should find "Moodle Mobile" in the app + And I should find "Privacy policy" in the app + + # Preferences + When I press the user menu button in the app + And I press "Preferences" in the app + Then I should find "Messages" in the app + And I should find "Notifications" in the app + And I should find "Space usage" in the app + And "Messages" should be selected in the app + And I should find "Accept messages from" in the app + And I should find "Notification preferences" in the app + + When I press "Manage storage" in the app + Then "Manage storage" should be selected in the app + And I should find "File storage used" in the app