e2e tests updated to support new styled insecure tutorials

pull/20/head
pabloFuente 2017-07-19 17:54:18 +02:00
parent 58ec882eff
commit 028362fd8a
2 changed files with 11 additions and 15 deletions

View File

@ -9,14 +9,14 @@ Feature: Connecting To Session
And users fill "sessionId" input with session name <session>
When users click on "commit" button
Then users should see title <session> 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 <firefoxUsers> leave session
And <firefoxUsers> see "Join a video session" text in "h1" element
And <chromeUsers> div "subscriber" should have <chromeUsers> videos
And <chromeUsers> div "video-container" should have <chromeUsers> videos
And close all browsers
Examples:

View File

@ -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<String, BrowserUser> 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<String> 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();