Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from jitsi:master #144

Merged
merged 12 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/grid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Get video resources
uses: robinraju/[email protected]
Expand All @@ -42,14 +46,15 @@ jobs:
# uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push chrome stable
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: ./doc/grid
push: true
build-args: |
Expand All @@ -58,10 +63,24 @@ jobs:
tags: |
jitsi/selenium-standalone-chrome:latest
jitsi/selenium-standalone-chrome:${{ needs.date.outputs.date }}
-
name: Build and push chromium stable
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: ./doc/grid
push: true
build-args: |
BROWSER=chromium
VERSION=latest
tags: |
jitsi/selenium-standalone-chromium:latest
jitsi/selenium-standalone-chromium:${{ needs.date.outputs.date }}
-
name: Build and push firefox stable
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: ./doc/grid
push: true
build-args: |
Expand All @@ -72,8 +91,9 @@ jobs:
jitsi/selenium-standalone-firefox:${{ needs.date.outputs.date }}
-
name: Build and push chrome beta
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: ./doc/grid
push: true
build-args: |
Expand All @@ -84,8 +104,9 @@ jobs:
jitsi/selenium-standalone-chrome:beta-${{ needs.date.outputs.date }}
-
name: Build and push firefox beta
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: ./doc/grid
push: true
build-args: |
Expand Down
5 changes: 4 additions & 1 deletion doc/grid/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ARG BROWSER=chrome
ARG VERSION=latest
FROM selenium/standalone-${BROWSER}:${VERSION}
FROM --platform=$TARGETPLATFORM selenium/standalone-${BROWSER}:${VERSION}
ARG TARGETPLATFORM
ARG BUILDPLATFORM


USER root

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.13.0</version>
<version>4.26.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>4.13.0</version>
<version>4.26.0</version>
</dependency>

<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.5.3</version>
<version>5.9.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,15 @@ public void testRemoveFromWhitelist()
// we try to unmute and test it that it was still muted
tryToAudioUnmuteAndCheck(participant2, participant1);

// under some windows size toolbar can be over the thumbnail and cause problem finding
// the mute button
participantsPane.close();

// stop video and check
participant1.getRemoteParticipantById(participant2.getEndpointId()).stopVideo();

participantsPane.open();

participant1.getParticipantsPane().assertIsParticipantVideoMuted(participant2, true);
participant2.getParticipantsPane().assertIsParticipantVideoMuted(participant2, true);

Expand Down
33 changes: 16 additions & 17 deletions src/test/java/org/jitsi/meet/test/IFrameAPICommandsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1357,48 +1357,47 @@ public void testCommandToggleParticipantsPane()
TestUtils.executeScript(driver1,
"window.jitsiAPI.isParticipantsPaneOpen()" +
".then(res => window.jitsiAPI.test.isParticipantsPaneOpen1 = res);");
boolean isParticipantsPaneOpen = TestUtils.executeScriptAndReturnBoolean(driver1,
"return window.jitsiAPI.test.isParticipantsPaneOpen1;");

// checks both the function and the UI
assertFalse(isParticipantsPaneOpen);
TestUtils.waitForCondition(driver1, 2, (ExpectedCondition<Boolean>) d ->
TestUtils.executeScriptAndReturnBoolean(driver1,
"return !window.jitsiAPI.test.isParticipantsPaneOpen1;"));

switchToMeetContent(this.iFrameUrl, driver1);
TestUtils.waitForCondition(driver1, 5, (ExpectedCondition<Boolean>) d ->
participantsPane.isOpen() == false);
!participantsPane.isOpen());

// then executes the command to open it
switchToIframeAPI(driver1);
TestUtils.executeScript(driver1,
"window.jitsiAPI.executeCommand('toggleParticipantsPane', true);");
TestUtils.waitMillis(500);

TestUtils.executeScript(driver1,
"window.jitsiAPI.isParticipantsPaneOpen()" +
".then(res => window.jitsiAPI.test.isParticipantsPaneOpen2 = res);");
isParticipantsPaneOpen = TestUtils.executeScriptAndReturnBoolean(driver1,
"return window.jitsiAPI.test.isParticipantsPaneOpen2;");

assertTrue(isParticipantsPaneOpen);
TestUtils.waitForCondition(driver1, 2, (ExpectedCondition<Boolean>) d ->
TestUtils.executeScriptAndReturnBoolean(driver1,
"return window.jitsiAPI.test.isParticipantsPaneOpen2;"));

switchToMeetContent(this.iFrameUrl, driver1);
TestUtils.waitForCondition(driver1, 5, (ExpectedCondition<Boolean>) d ->
participantsPane.isOpen() == true);
TestUtils.waitForCondition(driver1, 2, (ExpectedCondition<Boolean>) d ->
participantsPane.isOpen());

// executes the command to close it
switchToIframeAPI(driver1);
TestUtils.executeScript(driver1,
"window.jitsiAPI.executeCommand('toggleParticipantsPane', false);");
TestUtils.waitMillis(500);

TestUtils.executeScript(driver1,
"window.jitsiAPI.isParticipantsPaneOpen()" +
".then(res => window.jitsiAPI.test.isParticipantsPaneOpen2 = res);");
isParticipantsPaneOpen = TestUtils.executeScriptAndReturnBoolean(driver1,
"return window.jitsiAPI.test.isParticipantsPaneOpen2;");

assertFalse(isParticipantsPaneOpen);
TestUtils.waitForCondition(driver1, 2, (ExpectedCondition<Boolean>) d ->
TestUtils.executeScriptAndReturnBoolean(driver1,
"return !window.jitsiAPI.test.isParticipantsPaneOpen2;"));

switchToMeetContent(this.iFrameUrl, driver1);
TestUtils.waitForCondition(driver1, 5, (ExpectedCondition<Boolean>) d ->
participantsPane.isOpen() == false);
!participantsPane.isOpen());
}

/**
Expand Down
98 changes: 92 additions & 6 deletions src/test/java/org/jitsi/meet/test/LobbyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.jitsi.meet.test;

import org.jitsi.meet.test.base.*;
import org.jitsi.meet.test.pageobjects.web.*;
import org.jitsi.meet.test.util.*;
import org.jitsi.meet.test.web.*;
Expand Down Expand Up @@ -126,6 +127,11 @@ public static void waitForLobbyEnabled(WebParticipant participant, boolean enabl
});
}

private String enterLobby(WebParticipant moderator, boolean enterDisplayName)
{
return this.enterLobby(moderator, enterDisplayName, false);
}

/**
* Expects that lobby is enabled for the room we will try to join.
* Lobby UI is shown, enter display name and join.
Expand All @@ -137,12 +143,28 @@ public static void waitForLobbyEnabled(WebParticipant participant, boolean enabl
* from local storage.
* @return the participant name knocking.
*/
private String enterLobby(WebParticipant moderator, boolean enterDisplayName)
private String enterLobby(WebParticipant moderator, boolean enterDisplayName, boolean usePrejoin)
{
joinThirdParticipant(null, new WebParticipantOptions().setSkipDisplayNameSet(true));
JitsiMeetUrl meetingUrl = getJitsiMeetUrl();

if (usePrejoin)
{
meetingUrl.removeFragmentParam("config.prejoinConfig");
meetingUrl.appendConfig("config.prejoinConfig.enabled=true");
}

joinThirdParticipant(meetingUrl, new WebParticipantOptions().setSkipDisplayNameSet(true));

WebParticipant participant3 = getParticipant3();
LobbyScreen lobbyScreen = participant3.getLobbyScreen();
ParentPreMeetingScreen lobbyScreen;
if (usePrejoin)
{
lobbyScreen = participant3.getPreJoinScreen();
}
else
{
lobbyScreen = participant3.getLobbyScreen();
}

// participant 3 should be now on pre-join screen
lobbyScreen.waitForLoading();
Expand All @@ -157,9 +179,13 @@ private String enterLobby(WebParticipant moderator, boolean enterDisplayName)

if (enterDisplayName)
{
// check join button is disabled
String classes = joinButton.getAttribute("class");
assertTrue(classes.contains("disabled"), "The join button should be disabled");

if (!usePrejoin)
{
// check join button is disabled
assertTrue(classes.contains("disabled"), "The join button should be disabled");
}

// TODO check that password is hidden as the room does not have password
// this check needs to be added once the functionality exists
Expand All @@ -181,7 +207,7 @@ private String enterLobby(WebParticipant moderator, boolean enterDisplayName)
(ExpectedCondition<Boolean>) d -> lobbyScreen.isLobbyRoomJoined());

// check no join button
assertFalse(lobbyScreen.hasJoinButton(), "Join button should be hidden after clicking it");
assertFalse(lobbyScreen.hasJoinButton(), "Join button should be hidden or disabled after clicking it");

// new screen, is password button shown
WebElement passwordButton = lobbyScreen.getPasswordButton();
Expand Down Expand Up @@ -514,4 +540,64 @@ public void testModeratorLeavesWhileLobbyEnabled()
5,
(ExpectedCondition<Boolean>) d -> lobbyScreen.isLobbyRoomJoined());
}

@Test(dependsOnMethods = {"testModeratorLeavesWhileLobbyEnabled"})
public void testRejectAndApproveInPreJoin()
{
hangUpAllParticipants();

ensureTwoParticipants();
enableLobby();

WebParticipant participant1 = getParticipant1();
String knockingParticipant = enterLobby(participant1, true, true); // set display name to false

// moderator rejects access
ParticipantsPane participantsPane = participant1.getParticipantsPane();
participantsPane.open();
participantsPane.rejectLobbyParticipant(knockingParticipant);
participantsPane.close();

WebParticipant participant3 = getParticipant3();
// check the denied one is out of lobby, sees the notification about it
// The third participant should see a warning that his access to the room was denied
TestUtils.waitForCondition(participant3.getDriver(), 5,
(ExpectedCondition<Boolean>) d -> participant3.getNotifications().hasLobbyAccessDenied());

// check Lobby room not left
TestUtils.waitForCondition(participant3.getDriver(), 5,
(ExpectedCondition<Boolean>) d -> !participant3.getLobbyScreen().isLobbyRoomJoined());

// try again entering the lobby with the third one and approve it
// check that everything is fine in the meeting
participant3.getNotifications().closeLocalLobbyAccessDenied();

// let's retry to enter the lobby and approve this time
ParentPreMeetingScreen lobbyScreen = participant3.getPreJoinScreen();

// click join button
lobbyScreen.join();

TestUtils.waitForCondition(
participant3.getDriver(),
5,
(ExpectedCondition<Boolean>) d -> lobbyScreen.isLobbyRoomJoined());

// check that moderator (participant 1) sees notification about participant in lobby
String name = participant1.getNotifications().getKnockingParticipantName();
assertEquals(name, participant3.getName(), "Wrong name for the knocking participant or participant is missing");


participantsPane.open();
participantsPane.admitLobbyParticipant(knockingParticipant);
participantsPane.close();

participant3.waitForParticipants(2);
participant3.waitForRemoteStreams(2);

assertEquals(
MeetUIUtils.getVisibleThumbnails(participant3.getDriver()).size(),
3, // one local and two remote
"number of visible thumbnails for participant3");
}
}
Loading
Loading