Search in sources :

Example 1 with WebParticipant

use of org.jitsi.meet.test.web.WebParticipant in project jitsi-meet-torture by jitsi.

the class BreakoutRoomsTest method testCloseRoom.

@Test(dependsOnMethods = { "testAutoAssign" })
public void testCloseRoom() {
    participant3.getParticipantsPane().open();
    BreakoutRoomsList roomsList = participant1.getBreakoutRoomsList();
    // there should be two non-empty breakout rooms
    TestUtils.waitForCondition(participant1.getDriver(), 5, (ExpectedCondition<Boolean>) d -> {
        List<BreakoutRoomsList.BreakoutRoom> rooms = roomsList.getRooms();
        return rooms.size() == 2 && rooms.get(0).getParticipantsCount() == 1 && rooms.get(1).getParticipantsCount() == 1;
    });
    // close the first room
    BreakoutRoomsList.BreakoutRoom room = roomsList.getRooms().get(0);
    room.closeRoom();
    // there should be two rooms and first one should be empty
    TestUtils.waitForCondition(participant1.getDriver(), 5, (ExpectedCondition<Boolean>) d -> roomsList.getRoomsCount() == 2 && roomsList.getRooms().get(0).getParticipantsCount() == 0);
    // there should be two participants in the main room, either p2 or p3 got moved to the main room
    List<WebParticipant> participants = Arrays.asList(participant2, participant3);
    participants.forEach(p -> {
        TestUtils.waitForCondition(p.getDriver(), 5, (ExpectedCondition<Boolean>) d -> {
            BreakoutRoomsList.BreakoutRoom pRoom = p.getBreakoutRoomsList().getRooms().get(0);
            if (pRoom.getName().trim().equals(MAIN_ROOM_NAME)) {
                return pRoom.getParticipantsCount() == 2;
            }
            return pRoom.getParticipantsCount() == 0;
        }, 500);
    });
}
Also used : SkipException(org.testng.SkipException) java.util.logging(java.util.logging) java.util(java.util) WebTestBase(org.jitsi.meet.test.web.WebTestBase) By(org.openqa.selenium.By) ExpectedCondition(org.openqa.selenium.support.ui.ExpectedCondition) BreakoutRoomsList(org.jitsi.meet.test.pageobjects.web.BreakoutRoomsList) Test(org.testng.annotations.Test) TestUtils(org.jitsi.meet.test.util.TestUtils) WebParticipant(org.jitsi.meet.test.web.WebParticipant) TimeoutException(org.openqa.selenium.TimeoutException) Assert(org.testng.Assert) ParticipantsPane(org.jitsi.meet.test.pageobjects.web.ParticipantsPane) PARTICIPANT_ITEM(org.jitsi.meet.test.pageobjects.web.ParticipantsPane.PARTICIPANT_ITEM) JitsiMeetUrl(org.jitsi.meet.test.base.JitsiMeetUrl) WebParticipant(org.jitsi.meet.test.web.WebParticipant) BreakoutRoomsList(org.jitsi.meet.test.pageobjects.web.BreakoutRoomsList) BreakoutRoomsList(org.jitsi.meet.test.pageobjects.web.BreakoutRoomsList) Test(org.testng.annotations.Test)

Aggregations

java.util (java.util)1 java.util.logging (java.util.logging)1 JitsiMeetUrl (org.jitsi.meet.test.base.JitsiMeetUrl)1 BreakoutRoomsList (org.jitsi.meet.test.pageobjects.web.BreakoutRoomsList)1 ParticipantsPane (org.jitsi.meet.test.pageobjects.web.ParticipantsPane)1 PARTICIPANT_ITEM (org.jitsi.meet.test.pageobjects.web.ParticipantsPane.PARTICIPANT_ITEM)1 TestUtils (org.jitsi.meet.test.util.TestUtils)1 WebParticipant (org.jitsi.meet.test.web.WebParticipant)1 WebTestBase (org.jitsi.meet.test.web.WebTestBase)1 By (org.openqa.selenium.By)1 TimeoutException (org.openqa.selenium.TimeoutException)1 ExpectedCondition (org.openqa.selenium.support.ui.ExpectedCondition)1 Assert (org.testng.Assert)1 SkipException (org.testng.SkipException)1 Test (org.testng.annotations.Test)1