From 82c4cbb9847f2948fc14ee95132b1bea75dc71fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 17 May 2018 17:23:12 +0200 Subject: [PATCH 1/8] Fix locator when asserting that the chat view is shown in the main view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To check that the chat view is shown in the main view the ancestor locator of the chat view must be the main view; if the chat ancestor set in other steps is used it just checks that the chat view is shown somewhere, but it does not guarantee that it is shown in the main view. Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/features/bootstrap/ChatContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/bootstrap/ChatContext.php b/tests/acceptance/features/bootstrap/ChatContext.php index c269cba18d6..0c54d668384 100644 --- a/tests/acceptance/features/bootstrap/ChatContext.php +++ b/tests/acceptance/features/bootstrap/ChatContext.php @@ -215,7 +215,7 @@ public function iSendANewChatMessageWith($message) { * @Then I see that the chat is shown in the main view */ public function iSeeThatTheChatIsShownInTheMainView() { - PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::chatView($this->chatAncestor), 10)->isVisible()); + PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::chatView(TalkAppContext::mainView()), 10)->isVisible()); } /** From 89d613ef045b761d52fb5d404ec47089828d2b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 21 May 2018 14:26:32 +0200 Subject: [PATCH 2/8] Add Firefox profiles with granted permissions and fake devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to test calls a camera and a microphone need to be faked by the acceptance tests. Fortunately, Firefox provides fake video and audio streams that can be set through settings in the Firefox profile (either video and audio or only audio, but not only video). Note, however, that those fake streams can not be controlled; the audio stream is always playing, so it can not be used to extensively test a conversation between different participants. It is good enough for basic tests, though. Before using the camera or the microphone Firefox asks the user to grant access to them, even if the fake ones are going to be used. This is done through a dialog outside the Selenium domain, so it can not be accepted or declined directly from the acceptance tests. However, it is possible to disable that dialog through a setting in the Firefox profile too. When the dialog is disabled the permissions are automatically granted whenever they are needed without any interaction. By default Selenium uses a clean Firefox profile when a new session is started, but it also allows the customization of the profile through a zipped "user.js" file. The contents of that file have to be provided in the "firefox_profile" capability when the Firefox session is created. In the Mink extension for Behat several Mink sessions can be defined in the "behat.yml" file. Each Mink session uses a different browser session in Selenium, and each of those browser sessions is initialized with the capabilities provided in the "behat.yml" file. From the point of view of the acceptance tests each Mink session is an actor, so different actors can use different browsers with different capabilities. Due to all this several new actors were introduced meant to be used in tests that require granted media permissions with no camera nor microphone, granted media permissions with microphone but no camera, and granted media permissions with microphone and camera. Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/config/behat.yml | 36 ++++++++++++++++++ ...permissions-with-microphone-and-camera.zip | Bin 0 -> 222 bytes ...nted-media-permissions-with-microphone.zip | Bin 0 -> 233 bytes .../granted-media-permissions.zip | Bin 0 -> 204 bytes 4 files changed, 36 insertions(+) create mode 100644 tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone-and-camera.zip create mode 100644 tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone.zip create mode 100644 tests/acceptance/config/firefox-profiles/granted-media-permissions.zip diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 64bac4cdd75..b56492699df 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -35,3 +35,39 @@ default: Jane: selenium2: wd_host: %selenium.server% + Kermit with microphone and camera: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions-with-microphone-and-camera.zip + Karen with microphone: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions-with-microphone.zip + James: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions.zip + April with microphone and camera: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions-with-microphone-and-camera.zip + Jarvis with microphone: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions-with-microphone.zip + Lucius: + selenium2: + wd_host: %selenium.server% + capabilities: + firefox: + profile: %paths.base%/firefox-profiles/granted-media-permissions.zip diff --git a/tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone-and-camera.zip b/tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone-and-camera.zip new file mode 100644 index 0000000000000000000000000000000000000000..8699172d795b7f149165ee4e9190e27d98f7c3db GIT binary patch literal 222 zcmWIWW@Zs#W?b!9>1nI&RfNi}vIiL+y^uhmM~ z6tku;K4Sjw17m@^LU}TVBXpqg;)_rrC5uFb3 RW@Uq@VPuE|GV(zj1^`wKKE(h4 literal 0 HcmV?d00001 diff --git a/tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone.zip b/tests/acceptance/config/firefox-profiles/granted-media-permissions-with-microphone.zip new file mode 100644 index 0000000000000000000000000000000000000000..2d6ad79fd357d8d280c55115d2add5de2557bdb2 GIT binary patch literal 233 zcmWIWW@Zs#W?av^=M!6LODF>a!yF)H2jbG=)FQpC;@-1oIU5Xk*e>i2?oekv z$;78Tv2JR@e~(+|^yT(+G26r$zlam5o2N9#K=oZw(OEB6siQtcO6tel8)jeIn00s) zul%`HO^YW!=icui-tOa(|IqS=b6$WqBa=NdF1uBLwu68|!;(f24Rr|@g93=hz{nuM l&|u`8WccPXV}tzjckkW;X(&Iyo0ScshLIr>$fyEw7yxDLMY{k1 literal 0 HcmV?d00001 diff --git a/tests/acceptance/config/firefox-profiles/granted-media-permissions.zip b/tests/acceptance/config/firefox-profiles/granted-media-permissions.zip new file mode 100644 index 0000000000000000000000000000000000000000..c8bb6cc942be2479ddf3b4e13a57cd37a58f4008 GIT binary patch literal 204 zcmWIWW@h1HW&i^9_KiL(7Chmz0J1@t9f(VdQ;YPnia}I-K~ZX&hEi^7N@k*7USe5h zdSXd_kzPS+QEp~&ab|v=UP@+hVp2|Oijs~(Nl|I4rZrc9HzSihGcMy*fEIv&Lc@|q q5Dm4Ai$MXzV_;;EU}(si8}|O~Wkz&5z?+o~qK1(n63B=JaTov}xHX{w literal 0 HcmV?d00001 From e568cd788b50c47db9f8c1da30940d89ba28830d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 19 Jun 2018 21:45:54 +0200 Subject: [PATCH 3/8] Add acceptance tests for starting a call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/config/behat.yml | 1 + .../features/bootstrap/CallContext.php | 169 ++++++++++++++++++ .../features/bootstrap/ChatContext.php | 7 + .../bootstrap/ConversationInfoContext.php | 37 ++++ tests/acceptance/features/call.feature | 55 ++++++ 5 files changed, 269 insertions(+) create mode 100644 tests/acceptance/features/bootstrap/CallContext.php create mode 100644 tests/acceptance/features/call.feature diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index b56492699df..66b13ae9114 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -17,6 +17,7 @@ default: - LoginPageContext # Talk app contexts + - CallContext - ChatContext - ConversationInfoContext - ConversationListContext diff --git a/tests/acceptance/features/bootstrap/CallContext.php b/tests/acceptance/features/bootstrap/CallContext.php new file mode 100644 index 00000000000..4adbdd3eda1 --- /dev/null +++ b/tests/acceptance/features/bootstrap/CallContext.php @@ -0,0 +1,169 @@ +. + * + */ + +use Behat\Behat\Context\Context; + +class CallContext implements Context, ActorAwareInterface { + + use ActorAware; + + /** + * @return Locator + */ + public static function localContainer() { + return Locator::forThe()->css("#localVideoContainer")-> + descendantOf(TalkAppContext::mainView())-> + describedAs("Local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localVideo() { + return Locator::forThe()->css("video")-> + descendantOf(self::localContainer())-> + describedAs("Video in the local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localAvatar() { + return Locator::forThe()->css(".avatar-container")-> + descendantOf(self::localContainer())-> + describedAs("Avatar in the local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localAudioEnabledIndicator() { + return Locator::forThe()->css(".icon-audio:not(.audio-disabled):not(.no-audio-available)")-> + descendantOf(self::localContainer())-> + describedAs("Audio enabled indicator in the local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localAudioNotAvailableIndicator() { + return Locator::forThe()->css(".no-audio-available")-> + descendantOf(self::localContainer())-> + describedAs("Audio not available indicator in the local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localVideoEnabledIndicator() { + return Locator::forThe()->css(".icon-video:not(.video-disabled):not(.no-video-available)")-> + descendantOf(self::localContainer())-> + describedAs("Video enabled indicator in the local container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function localVideoNotAvailableIndicator() { + return Locator::forThe()->css(".no-video-available")-> + descendantOf(self::localContainer())-> + describedAs("Video not available indicator in the local container of the call in the main view"); + } + + /** + * @Then I see that the local audio is enabled + */ + public function iSeeThatTheLocalAudioIsEnabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localAudioEnabledIndicator(), 10)); + } + + /** + * @Then I see that the local audio is not available + */ + public function iSeeThatTheLocalAudioIsNotAvailable() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localAudioNotAvailableIndicator(), 10)); + } + + /** + * @Then I see that the local video is enabled + */ + public function iSeeThatTheLocalVideoIsEnabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localVideoEnabledIndicator(), 10)); + } + + /** + * @Then I see that the local video is not available + */ + public function iSeeThatTheLocalVideoIsNotAvailable() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localVideoNotAvailableIndicator(), 10)); + } + + /** + * @Then I see that the local video is shown + */ + public function iSeeThatTheLocalVideoIsShown() { + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::localVideo(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The local video was not shown yet after $timeout seconds"); + } + } + + /** + * @Then I see that the local video is not shown + */ + public function iSeeThatTheLocalVideoIsNotShown() { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::localVideo(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The local video is still shown after $timeout seconds"); + } + } + + /** + * @Then I see that the local avatar is shown + */ + public function iSeeThatTheLocalAvatarIsShown() { + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::localAvatar(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The local avatar was not shown yet after $timeout seconds"); + } + } + + /** + * @Then I see that the local avatar is not shown + */ + public function iSeeThatTheLocalAvatarIsNotShown() { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::localAvatar(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The local avatar is still shown after $timeout seconds"); + } + } + +} diff --git a/tests/acceptance/features/bootstrap/ChatContext.php b/tests/acceptance/features/bootstrap/ChatContext.php index 0c54d668384..adabfe207cd 100644 --- a/tests/acceptance/features/bootstrap/ChatContext.php +++ b/tests/acceptance/features/bootstrap/ChatContext.php @@ -218,6 +218,13 @@ public function iSeeThatTheChatIsShownInTheMainView() { PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::chatView(TalkAppContext::mainView()), 10)->isVisible()); } + /** + * @Then I see that the chat is shown in the sidebar + */ + public function iSeeThatTheChatIsShownInTheSidebar() { + PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::chatView(TalkAppContext::sidebar()), 10)->isVisible()); + } + /** * @Then I see that the message :number was sent by :author with the text :message */ diff --git a/tests/acceptance/features/bootstrap/ConversationInfoContext.php b/tests/acceptance/features/bootstrap/ConversationInfoContext.php index fe8b07ef9dd..60c2ec3d520 100644 --- a/tests/acceptance/features/bootstrap/ConversationInfoContext.php +++ b/tests/acceptance/features/bootstrap/ConversationInfoContext.php @@ -26,6 +26,7 @@ class ConversationInfoContext implements Context, ActorAwareInterface { use ActorAware; + use ChatAncestorSetter; /** * @return Locator @@ -72,6 +73,24 @@ public static function conversationNameTextInput() { describedAs("Conversation name text input in conversation info"); } + /** + * @return Locator + */ + public static function joinCallButton() { + return Locator::forThe()->css(".join-call")-> + descendantOf(self::conversationInfoContainer())-> + describedAs("Join call button in conversation info"); + } + + /** + * @return Locator + */ + public static function leaveCallButton() { + return Locator::forThe()->css(".leave-call")-> + descendantOf(self::conversationInfoContainer())-> + describedAs("Leave call button in conversation info"); + } + /** * @Given I rename the conversation to :newConversationName */ @@ -81,4 +100,22 @@ public function iRenameTheConversationTo($newConversationName) { $this->actor->find(self::conversationNameTextInput(), 2)->setValue($newConversationName . "\r"); } + /** + * @Given I join the call + */ + public function iJoinTheCall() { + $this->actor->find(self::joinCallButton(), 10)->click(); + + $this->setChatAncestorForActor(TalkAppContext::sidebar(), $this->actor); + } + + /** + * @Given I leave the call + */ + public function iLeaveTheCall() { + $this->actor->find(self::leaveCallButton(), 10)->click(); + + $this->setChatAncestorForActor(TalkAppContext::mainView(), $this->actor); + } + } diff --git a/tests/acceptance/features/call.feature b/tests/acceptance/features/call.feature new file mode 100644 index 00000000000..5dc05714f70 --- /dev/null +++ b/tests/acceptance/features/call.feature @@ -0,0 +1,55 @@ +Feature: call + + Scenario: start a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I see that the local audio is enabled + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + + Scenario: start a call without camera + Given I act as "Karen with microphone" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I see that the local audio is enabled + And I see that the local avatar is shown + And I see that the local video is not available + And I see that the local video is not shown + + Scenario: start a call without camera nor microphone + Given I act as "James" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I see that the local avatar is shown + And I see that the local audio is not available + And I see that the local video is not available + And I see that the local video is not shown + + Scenario: leave a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + When I leave the call + Then I see that the chat is shown in the main view From 56a23018f859608f5d8ee0c147eff55189f39b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 19 Jun 2018 21:45:54 +0200 Subject: [PATCH 4/8] Add acceptance tests for one-to-one calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/CallContext.php | 152 ++++++++++++++++++ tests/acceptance/features/call.feature | 88 ++++++++++ 2 files changed, 240 insertions(+) diff --git a/tests/acceptance/features/bootstrap/CallContext.php b/tests/acceptance/features/bootstrap/CallContext.php index 4adbdd3eda1..1c358b1a8be 100644 --- a/tests/acceptance/features/bootstrap/CallContext.php +++ b/tests/acceptance/features/bootstrap/CallContext.php @@ -90,6 +90,73 @@ public static function localVideoNotAvailableIndicator() { describedAs("Video not available indicator in the local container of the call in the main view"); } + /** + * @return Locator + */ + public static function promotedContainer() { + return Locator::forThe()->css(".videoContainer.promoted")-> + descendantOf(TalkAppContext::mainView())-> + describedAs("Promoted container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedDummyContainer() { + // A dummy container is used to show the user name and the media + // permissions at the same place shown in the unpromoted container for + // the user (as the promoted container is centered and the unpromoted + // container can be anywhere in the bottom area). + return Locator::forThe()->css(".videoContainer-dummy")-> + descendantOf(TalkAppContext::mainView())-> + describedAs("Promoted dummy container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedVideo() { + return Locator::forThe()->css("video")-> + descendantOf(self::promotedContainer())-> + describedAs("Video in the promoted container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedAvatar() { + return Locator::forThe()->css(".avatar-container")-> + descendantOf(self::promotedContainer())-> + describedAs("Avatar in the promoted container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedUserName() { + return Locator::forThe()->css(".nameIndicator")-> + descendantOf(self::promotedDummyContainer())-> + describedAs("Name indicator in the promoted dummy container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedAudioEnabledIndicator() { + return Locator::forThe()->css(".audio-on")-> + descendantOf(self::promotedDummyContainer())-> + describedAs("Audio enabled indicator in the promoted dummy container of the call in the main view"); + } + + /** + * @return Locator + */ + public static function promotedVideoEnabledIndicator() { + return Locator::forThe()->css(".icon-video")-> + descendantOf(self::promotedDummyContainer())-> + describedAs("Video enabled indicator in the promoted dummy container of the call in the main view"); + } + /** * @Then I see that the local audio is enabled */ @@ -166,4 +233,89 @@ public function iSeeThatTheLocalAvatarIsNotShown() { } } + /** + * @Then I see that the promoted video is shown + */ + public function iSeeThatThePromotedVideoIsShown() { + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::promotedVideo(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The promoted video was not shown yet after $timeout seconds"); + } + } + + /** + * @Then I see that the promoted video is not shown + */ + public function iSeeThatThePromotedVideoIsNotShown() { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::promotedVideo(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The promoted video is still shown after $timeout seconds"); + } + } + + /** + * @Then I see that the promoted avatar is shown + */ + public function iSeeThatThePromotedAvatarIsShown() { + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::promotedAvatar(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The promoted avatar was not shown yet after $timeout seconds"); + } + } + + /** + * @Then I see that the promoted avatar is not shown + */ + public function iSeeThatThePromotedAvatarIsNotShown() { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::promotedAvatar(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The promoted avatar is still shown after $timeout seconds"); + } + } + + /** + * @Then I see that the promoted user is :userName + */ + public function iSeeThatThePromotedUserIs($userName) { + $promotedUserNameMatchedCallback = function() use($userName) { + try { + $foundUserName = $this->actor->find(self::promotedUserName())->getText(); + } catch (NoSuchElementException $exception) { + return false; + } + + if ($foundUserName == $userName) { + return true; + } + + return false; + }; + + if (!Utils::waitFor($promotedUserNameMatchedCallback, $timeout = 10 * $this->actor->getFindTimeoutMultiplier(), $timeoutStep = 1)) { + PHPUnit_Framework_Assert::fail("The promoted user name was not $userName yet after $timeout seconds"); + } + } + + /** + * @Then I see that the promoted audio is enabled + */ + public function iSeeThatThePromotedAudioIsEnabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedAudioEnabledIndicator(), 10)); + } + + /** + * @Then I see that the promoted video is enabled + */ + public function iSeeThatThePromotedVideoIsEnabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedVideoEnabledIndicator(), 10)); + } + } diff --git a/tests/acceptance/features/call.feature b/tests/acceptance/features/call.feature index 5dc05714f70..c695e5534eb 100644 --- a/tests/acceptance/features/call.feature +++ b/tests/acceptance/features/call.feature @@ -53,3 +53,91 @@ Feature: call And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view When I leave the call Then I see that the chat is shown in the main view + + Scenario: join a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the local audio is enabled + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "admin" + + Scenario: join a call without camera + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "Karen with microphone" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the local audio is enabled + And I see that the local avatar is shown + And I see that the local video is not available + And I see that the local video is not shown + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted avatar is shown + And I see that the promoted video is not shown + And I see that the promoted user is "admin" + + Scenario: leave a call with another participant + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I act as "Kermit with microphone and camera" + And I see that the promoted video is shown + When I leave the call + Then I see that the chat is shown in the main view + And I act as "April with microphone and camera" + And I see that the chat is shown in the sidebar + And I see that the "Waiting for user0 to join the call …" empty content message is shown in the main view From 9ff886a8238ce717acdfc8f96b6f470379984323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 21 Jun 2018 10:55:18 +0200 Subject: [PATCH 5/8] Add acceptance test for joining call without microphone nor camera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/CallContext.php | 67 +++++++++++++++++++ tests/acceptance/features/call.feature | 29 ++++++++ 2 files changed, 96 insertions(+) diff --git a/tests/acceptance/features/bootstrap/CallContext.php b/tests/acceptance/features/bootstrap/CallContext.php index 1c358b1a8be..82df7da65d9 100644 --- a/tests/acceptance/features/bootstrap/CallContext.php +++ b/tests/acceptance/features/bootstrap/CallContext.php @@ -90,6 +90,42 @@ public static function localVideoNotAvailableIndicator() { describedAs("Video not available indicator in the local container of the call in the main view"); } + /** + * @return Locator + */ + public static function containerFor($user) { + return Locator::forThe()->xpath("//div[contains(concat(' ', normalize-space(@class), ' '), ' videoContainer ') and not(contains(concat(' ', normalize-space(@class), ' '), ' promoted '))]//div[contains(concat(' ', normalize-space(@class), ' '), ' nameIndicator ') and normalize-space() = '$user']/..")-> + descendantOf(TalkAppContext::mainView())-> + describedAs("Container for $user of the call in the main view"); + } + + /** + * @return Locator + */ + public static function videoFor($user) { + return Locator::forThe()->css("video")-> + descendantOf(self::containerFor($user))-> + describedAs("Video in the container for $user of the call in the main view"); + } + + /** + * @return Locator + */ + public static function avatarFor($user) { + return Locator::forThe()->css(".avatar-container")-> + descendantOf(self::containerFor($user))-> + describedAs("Avatar in the container for $user of the call in the main view"); + } + + /** + * @return Locator + */ + public static function audioNotAvailableIndicatorFor($user) { + return Locator::forThe()->css(".audio-off")-> + descendantOf(self::containerFor($user))-> + describedAs("Audio not available indicator in the container for $user of the call in the main view"); + } + /** * @return Locator */ @@ -233,6 +269,37 @@ public function iSeeThatTheLocalAvatarIsNotShown() { } } + /** + * @Then I see that the video for :user is not shown + */ + public function iSeeThatTheVideoForIsNotShown($user) { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::videoFor($user), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The video for $user is still shown after $timeout seconds"); + } + } + + /** + * @Then I see that the avatar for :user is shown + */ + public function iSeeThatTheAvatarForIsShown($user) { + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::avatarFor($user), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The avatar for $user was not shown yet after $timeout seconds"); + } + } + + /** + * @Then I see that the audio for :user is not available + */ + public function iSeeThatTheAudioForIsNotAvailable($user) { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::audioNotAvailableIndicatorFor($user), 10)); + } + /** * @Then I see that the promoted video is shown */ diff --git a/tests/acceptance/features/call.feature b/tests/acceptance/features/call.feature index c695e5534eb..8c90a5ced7e 100644 --- a/tests/acceptance/features/call.feature +++ b/tests/acceptance/features/call.feature @@ -117,6 +117,35 @@ Feature: call And I see that the promoted video is not shown And I see that the promoted user is "admin" + Scenario: join a call without camera nor microphone + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "James" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + When I join the call + Then I see that the chat is shown in the sidebar + And I see that the local avatar is shown + And I see that the local audio is not available + And I see that the local video is not available + And I see that the local video is not shown + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" + And I act as "Kermit with microphone and camera" + And I see that the audio for "admin" is not available + And I see that the avatar for "admin" is shown + And I see that the video for "admin" is not shown + Scenario: leave a call with another participant Given I act as "Kermit with microphone and camera" And I am logged in From 916a72e04a7e97aafc42dbf2dd4503c90d163beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 21 Jun 2018 11:41:09 +0200 Subject: [PATCH 6/8] Add acceptance tests for enabling and disabling audio and video MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/CallContext.php | 106 +++++++ tests/acceptance/features/call.feature | 269 ++++++++++++++++++ 2 files changed, 375 insertions(+) diff --git a/tests/acceptance/features/bootstrap/CallContext.php b/tests/acceptance/features/bootstrap/CallContext.php index 82df7da65d9..8a021423a55 100644 --- a/tests/acceptance/features/bootstrap/CallContext.php +++ b/tests/acceptance/features/bootstrap/CallContext.php @@ -63,6 +63,15 @@ public static function localAudioEnabledIndicator() { describedAs("Audio enabled indicator in the local container of the call in the main view"); } + /** + * @return Locator + */ + public static function localAudioDisabledIndicator() { + return Locator::forThe()->css(".audio-disabled:not(.no-audio-available)")-> + descendantOf(self::localContainer())-> + describedAs("Audio disabled indicator in the local container of the call in the main view"); + } + /** * @return Locator */ @@ -81,6 +90,15 @@ public static function localVideoEnabledIndicator() { describedAs("Video enabled indicator in the local container of the call in the main view"); } + /** + * @return Locator + */ + public static function localVideoDisabledIndicator() { + return Locator::forThe()->css(".icon-video-off:not(.no-video-available)")-> + descendantOf(self::localContainer())-> + describedAs("Video disabled indicator in the local container of the call in the main view"); + } + /** * @return Locator */ @@ -184,6 +202,15 @@ public static function promotedAudioEnabledIndicator() { describedAs("Audio enabled indicator in the promoted dummy container of the call in the main view"); } + /** + * @return Locator + */ + public static function promotedAudioNotAvailableIndicator() { + return Locator::forThe()->css(".audio-off")-> + descendantOf(self::promotedDummyContainer())-> + describedAs("Audio not available indicator in the promoted dummy container of the call in the main view"); + } + /** * @return Locator */ @@ -193,6 +220,57 @@ public static function promotedVideoEnabledIndicator() { describedAs("Video enabled indicator in the promoted dummy container of the call in the main view"); } + /** + * @return Locator + */ + public static function promotedVideoDisabledIndicator() { + return Locator::forThe()->css(".icon-video-off")-> + descendantOf(self::promotedDummyContainer())-> + describedAs("Video disabled indicator in the promoted dummy container of the call in the main view"); + } + + /** + * @When I enable the local audio + */ + public function iEnableTheLocalAudio() { + $this->actor->find(self::localAudioDisabledIndicator(), 10)->click(); + } + + /** + * @When I disable the local audio + */ + public function iDisableTheLocalAudio() { + $this->actor->find(self::localAudioEnabledIndicator(), 10)->click(); + } + + /** + * @When I enable the local video + */ + public function iEnableTheLocalVideo() { + $this->actor->find(self::localVideoDisabledIndicator(), 10)->click(); + } + + /** + * @When I disable the local video + */ + public function iDisableTheLocalVideo() { + $this->actor->find(self::localVideoEnabledIndicator(), 10)->click(); + } + + /** + * @When I enable the promoted video + */ + public function iEnableThePromotedVideo() { + $this->actor->find(self::promotedVideoDisabledIndicator(), 10)->click(); + } + + /** + * @When I disable the promoted video + */ + public function iDisableThePromotedVideo() { + $this->actor->find(self::promotedVideoEnabledIndicator(), 10)->click(); + } + /** * @Then I see that the local audio is enabled */ @@ -200,6 +278,13 @@ public function iSeeThatTheLocalAudioIsEnabled() { PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localAudioEnabledIndicator(), 10)); } + /** + * @Then I see that the local audio is disabled + */ + public function iSeeThatTheLocalAudioIsDisabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localAudioDisabledIndicator(), 10)); + } + /** * @Then I see that the local audio is not available */ @@ -214,6 +299,13 @@ public function iSeeThatTheLocalVideoIsEnabled() { PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localVideoEnabledIndicator(), 10)); } + /** + * @Then I see that the local video is disabled + */ + public function iSeeThatTheLocalVideoIsDisabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::localVideoDisabledIndicator(), 10)); + } + /** * @Then I see that the local video is not available */ @@ -378,6 +470,13 @@ public function iSeeThatThePromotedAudioIsEnabled() { PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedAudioEnabledIndicator(), 10)); } + /** + * @Then I see that the promoted audio is not available + */ + public function iSeeThatThePromotedAudioIsNotAvailable() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedAudioNotAvailableIndicator(), 10)); + } + /** * @Then I see that the promoted video is enabled */ @@ -385,4 +484,11 @@ public function iSeeThatThePromotedVideoIsEnabled() { PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedVideoEnabledIndicator(), 10)); } + /** + * @Then I see that the promoted video is disabled + */ + public function iSeeThatThePromotedVideoIsDisabled() { + PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::promotedVideoDisabledIndicator(), 10)); + } + } diff --git a/tests/acceptance/features/call.feature b/tests/acceptance/features/call.feature index 8c90a5ced7e..2bc4c331d75 100644 --- a/tests/acceptance/features/call.feature +++ b/tests/acceptance/features/call.feature @@ -170,3 +170,272 @@ Feature: call And I act as "April with microphone and camera" And I see that the chat is shown in the sidebar And I see that the "Waiting for user0 to join the call …" empty content message is shown in the main view + + Scenario: disable local video during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + When I disable the local video + Then I see that the local video is disabled + And I see that the local video is not shown + And I see that the local avatar is shown + And I see that the local audio is enabled + And I see that the promoted video is shown + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted avatar is shown + And I see that the promoted video is not shown + And I see that the promoted user is "admin" + + Scenario: disable local audio during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local audio is enabled + When I disable the local audio + Then I see that the local audio is disabled + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is not available + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "admin" + + Scenario: enable again local video during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I disable the local video + And I see that the local video is disabled + And I act as "Kermit with microphone and camera" + And I see that the promoted video is not shown + When I act as "April with microphone and camera" + And I enable the local video + Then I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I see that the local audio is enabled + And I see that the promoted video is shown + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "admin" + + Scenario: enable again local audio during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local audio is enabled + And I disable the local audio + And I see that the local audio is disabled + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is not available + When I act as "April with microphone and camera" + And I enable the local audio + Then I see that the local audio is enabled + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "admin" + + Scenario: join again a call after disabling local video + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I disable the local video + And I see that the local video is disabled + When I leave the call + And I see that the chat is shown in the main view + And I join the call + Then I see that the chat is shown in the sidebar + And I see that the local audio is enabled + And I see that the local avatar is shown + And I see that the local video is disabled + And I see that the local video is not shown + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is enabled + And I see that the promoted avatar is shown + And I see that the promoted video is not shown + And I see that the promoted user is "admin" + + Scenario: join again a call after disabling local audio + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is shown + And I see that the local audio is enabled + And I disable the local audio + And I see that the local audio is disabled + When I leave the call + And I see that the chat is shown in the main view + And I join the call + Then I see that the chat is shown in the sidebar + And I see that the local audio is disabled + And I see that the local video is enabled + And I see that the local video is shown + And I see that the local avatar is not shown + And I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" + And I act as "Kermit with microphone and camera" + And I see that the promoted audio is not available + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "admin" + + Scenario: disable remote video during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + When I disable the promoted video + Then I see that the promoted audio is enabled + And I see that the promoted avatar is shown + And I see that the promoted video is disabled + And I see that the promoted video is not shown + And I see that the promoted user is "user0" + + Scenario: enable again remote video during a call + Given I act as "Kermit with microphone and camera" + And I am logged in + And I have opened the Talk app + And I create a one-to-one conversation with "admin" + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I see that the "Waiting for admin to join the call …" empty content message is shown in the main view + And I act as "April with microphone and camera" + And I am logged in as the admin + And I have opened the Talk app + And I open the "user0" conversation + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I disable the promoted video + And I see that the promoted avatar is shown + And I see that the promoted video is disabled + And I see that the promoted video is not shown + When I enable the promoted video + Then I see that the promoted audio is enabled + And I see that the promoted video is enabled + And I see that the promoted video is shown + And I see that the promoted avatar is not shown + And I see that the promoted user is "user0" From 948fd485b6c2fd4eec4cd939fd25b973b3485597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 21 Jun 2018 11:42:03 +0200 Subject: [PATCH 7/8] Add acceptance tests for chat during a call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/features/call.feature | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/tests/acceptance/features/call.feature b/tests/acceptance/features/call.feature index 2bc4c331d75..a0ebc7e4e5e 100644 --- a/tests/acceptance/features/call.feature +++ b/tests/acceptance/features/call.feature @@ -439,3 +439,89 @@ Feature: call And I see that the promoted video is shown And I see that the promoted avatar is not shown And I see that the promoted user is "user0" + + Scenario: send messages during a call + Given I act as "Karen with microphone" + And I am logged in as the admin + And I have opened the Talk app + And I create a one-to-one conversation with "user0" + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I act as "Jarvis with microphone" + And I am logged in + And I have opened the Talk app + And I open the "admin" conversation + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + When I act as "Karen with microphone" + And I send a new chat message with the text "Hello" + And I act as "Jarvis with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I send a new chat message with the text "Hi!" + Then I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" + And I act as "Karen with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" + + Scenario: start and join a call after sending messages + Given I act as "Karen with microphone" + And I am logged in as the admin + And I have opened the Talk app + And I create a one-to-one conversation with "user0" + And I see that the "user0" conversation is active + And I see that the chat is shown in the main view + And I act as "Jarvis with microphone" + And I am logged in + And I have opened the Talk app + And I open the "admin" conversation + And I see that the "admin" conversation is active + And I see that the chat is shown in the main view + And I act as "Karen with microphone" + And I send a new chat message with the text "Hello" + And I act as "Jarvis with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I send a new chat message with the text "Hi!" + When I join the call + And I see that the chat is shown in the sidebar + And I act as "Karen with microphone" + And I join the call + And I see that the chat is shown in the sidebar + Then I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" + And I act as "Jarvis with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" + + Scenario: leave a call after sending messages + Given I act as "Karen with microphone" + And I am logged in as the admin + And I have opened the Talk app + And I create a one-to-one conversation with "user0" + And I see that the "user0" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I act as "Jarvis with microphone" + And I am logged in + And I have opened the Talk app + And I open the "admin" conversation + And I see that the "admin" conversation is active + And I join the call + And I see that the chat is shown in the sidebar + And I act as "Karen with microphone" + And I send a new chat message with the text "Hello" + And I act as "Jarvis with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I send a new chat message with the text "Hi!" + When I leave the call + And I see that the chat is shown in the main view + And I act as "Karen with microphone" + And I leave the call + And I see that the chat is shown in the main view + Then I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" + And I act as "Jarvis with microphone" + And I see that the message 1 was sent by "admin" with the text "Hello" + And I see that the message 2 was sent by "user0" with the text "Hi!" From fbd5dc8cf9933d413892439fea09f463a88c2858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 21 Jun 2018 11:42:52 +0200 Subject: [PATCH 8/8] Add acceptance tests for calls to Drone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index a6c65c5705b..15392c0d94e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -262,6 +262,8 @@ matrix: DATABASEHOST: postgres-10 # Acceptance tests + - TESTS: acceptance + TESTS_ACCEPTANCE: call - TESTS: acceptance TESTS_ACCEPTANCE: chat - TESTS: acceptance