From 028362fd8a618e6f0210f33eb53f008a78613265 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 19 Jul 2017 17:54:18 +0200 Subject: [PATCH] e2e tests updated to support new styled insecure tutorials --- openvidu-test-e2e/src/main/features/test.feature | 12 ++++++------ .../stepdefinition/StepsConnectingToSession.java | 14 +++++--------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/openvidu-test-e2e/src/main/features/test.feature b/openvidu-test-e2e/src/main/features/test.feature index 304d4d91..1c2ece0f 100644 --- a/openvidu-test-e2e/src/main/features/test.feature +++ b/openvidu-test-e2e/src/main/features/test.feature @@ -9,14 +9,14 @@ Feature: Connecting To Session And users fill "sessionId" input with session name When users click on "commit" button Then users should see title in element with id "session-header" - And "1" video element/s should be shown in element with id "publisher" - And "1" video element/s in "publisher" should be playing media - And users should see other users nicknames in paragraph element - And all video elements should be shown in element with id "subscriber" - And all video elements in "subscriber" should be playing media + And "1" video element/s should be shown in element with id "main-video" + And "1" video element/s in "main-video" should be playing media + And users should see other users nicknames + And all video elements should be shown in element with id "video-container" + And all video elements in "video-container" should be playing media And leave session And see "Join a video session" text in "h1" element - And div "subscriber" should have videos + And div "video-container" should have videos And close all browsers Examples: diff --git a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/stepdefinition/StepsConnectingToSession.java b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/stepdefinition/StepsConnectingToSession.java index 2a46e88f..ef2f8a97 100644 --- a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/stepdefinition/StepsConnectingToSession.java +++ b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/stepdefinition/StepsConnectingToSession.java @@ -110,7 +110,7 @@ public class StepsConnectingToSession { public void all_video_elements_should_be_shown_in_element_with_id_something(String strArg1) throws Throwable { for (BrowserUser user : this.browserUsers.values()) { new Thread(() -> { - user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.cssSelector("#" + strArg1 + " video"), this.browserUsers.size() - 1)); + user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.cssSelector("#" + strArg1 + " video"), this.browserUsers.size())); }).run(); } } @@ -126,19 +126,17 @@ public class StepsConnectingToSession { numOfVideosPlaying++; } } - Assert.assertEquals(numOfVideosPlaying, this.browserUsers.size() - 1); + Assert.assertEquals(numOfVideosPlaying, this.browserUsers.size()); }).run(); } } - @Then("^users should see other users nicknames in paragraph element$") + @Then("^users should see other users nicknames$") public void users_should_see_other_users_nicknames_in_paragraph_element() throws Throwable { for (BrowserUser user : this.browserUsers.values()) { new Thread(() -> { for (Entry entry : this.browserUsers.entrySet()) { - if (entry.getValue().getUserName() != user.getUserName()) { - user.getWaiter().until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector("div#subscriber p#data-" + entry.getKey()), entry.getKey())); - } + user.getWaiter().until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector("#data-" + entry.getKey() + " p"), entry.getKey())); } }).run(); } @@ -172,9 +170,7 @@ public class StepsConnectingToSession { List users = this.fromArrayStringifyToList(usersInRoom); if (users.contains(user.getUserName())) { for (String u : users) { - if (!u.equals(user.getUserName())) { - user.getWaiter().until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#" + strArg1 + " video#" + "native-video-" + u + "_webcam"))); - } + user.getWaiter().until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#" + strArg1 + " video#" + "native-video-" + u + "_webcam"))); } } }).run();