From b30f8ab4d1c3e4813da06ced5ba87e7a2004352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Castell=C3=B3n?= Date: Tue, 28 Jan 2020 12:01:42 +0100 Subject: [PATCH] MOBILE-3319 behat: Behat basic test for messages --- .../tests/behat/app_basic_usage.feature | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/mod/messages/tests/behat/app_basic_usage.feature b/mod/messages/tests/behat/app_basic_usage.feature index 6c3744ac4..f4948ce71 100755 --- a/mod/messages/tests/behat/app_basic_usage.feature +++ b/mod/messages/tests/behat/app_basic_usage.feature @@ -423,4 +423,120 @@ Feature: Test basic usage of messages in app And I should see "Starred (2)" And I press "Starred (2)" in the app Then I should see "Teacher teacher" - And I should see "Student1 student1" \ No newline at end of file + And I should see "Student1 student1" + + @app @3.8.0 @mobile @OK + Scenario: User blocking feature (mobile) + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student1 student1" in the app + Then I should see "Block user" + And I press "Block user" in the app + And I should see "Are you sure you want to block Student1 student1?" + And I press "Cancel" in the app + And I should see "Block user" + And I press "Block user" in the app + And I press "Block user" near "Cancel" in the app + Then I should not see "Block user" + And I should see "Unblock user" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + Then I should see "You are unable to message this user" + When I enter the app + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student1 student1" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Cancel" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Unblock user" near "Cancel" in the app + Then I should see "Block user" + And I should not see "Unblock user" + When I enter the app + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" 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 see "test message" + And I should not see "You are unable to message this user" + + @app @3.8.0 @tablet @OK + Scenario: User blocking feature (tablet) + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + Then I should see "Block user" + And I press "Block user" in the app + And I should see "Are you sure you want to block Student1 student1?" + And I press "Cancel" in the app + And I should see "Block user" + And I press "Block user" in the app + And I press "Block user" near "Cancel" in the app + Then I should not see "Block user" + And I should see "Unblock user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" in the app + Then I should see "You are unable to message this user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student2" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Cancel" in the app + Then I should see "Unblock user" + And I should not see "Block user" + And I press "Unblock user" in the app + And I press "Unblock user" near "Cancel" in the app + Then I should see "Block user" + And I should not see "Unblock user" + When I enter the app + And I change viewport size to "1280x1080" + And I log in as "student1" + Then the header should be "Acceptance test site" in the app + And I should see "Course 1" + And I press "Course 1" near "Recently accessed courses" in the app + And I press "Participants" in the app + And I press "Student2 student2" in the app + And I press "Message" 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 see "test message" + And I should not see "You are unable to message this user" \ No newline at end of file