Skip to content

Commit

Permalink
Rename method and fix docs. (jitsi#637)
Browse files Browse the repository at this point in the history
* Rename method and fix docs.

* Change the order of the unmute checks

* Add a 1 sec wait between unmutes.

---------

Co-authored-by: Jaya Allamsetty <jaya.allamsetty@8x8.com>
  • Loading branch information
bgrozev and jallamsetty1 authored Mar 15, 2024
1 parent 43c5a5b commit 03568d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
19 changes: 9 additions & 10 deletions src/test/java/org/jitsi/meet/test/StartMutedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

import org.testng.annotations.*;

import static org.testng.Assert.*;

/**
* Start muted tests
* @author Hristo Terezov
Expand Down Expand Up @@ -213,7 +211,7 @@ public void startWithVideoMutedCanUnmute()

MeetUIUtils.unmuteVideoAndCheck(participant2, participant1);

participant1.getLargeVideo().isVideoPlaying();
participant1.getLargeVideo().assertVideoPlaying();
}

/**
Expand Down Expand Up @@ -305,21 +303,22 @@ public void startWithAudioVideoMutedCanUnmute()

// Unmute p1's both audio and video and check on p2.
participant1.getToolbar().clickAudioUnmuteButton();
MeetUIUtils.unmuteVideoAndCheck(participant1, participant2);

participant2.getLargeVideo().isVideoPlaying();

MeetUIUtils.waitForAudioMuted(
participant2.getDriver(),
participant1.getDriver(),
"participant1",
false);

MeetUIUtils.unmuteVideoAndCheck(participant1, participant2);
participant2.getLargeVideo().assertVideoPlaying();

TestUtils.waitMillis(1000);

// Unmute p2's audio and video and check on p1.
MeetUIUtils.unmuteVideoAndCheck(participant2, participant1);
participant2.getToolbar().clickAudioUnmuteButton();
participant1.getLargeVideo().assertVideoPlaying();

participant1.getLargeVideo().isVideoPlaying();
participant2.getToolbar().clickAudioUnmuteButton();
MeetUIUtils.waitForAudioMuted(
participant1.getDriver(),
participant2.getDriver(),
Expand Down Expand Up @@ -359,6 +358,6 @@ public void testp2pJvbSwitchAndSwitchBack()

// Check if p2's video is playing on p1.
participant1.getParticipantsPane().assertIsParticipantVideoMuted(participant2, false);
participant1.getLargeVideo().isVideoPlaying();
participant1.getLargeVideo().assertVideoPlaying();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,9 @@ public LargeVideo(WebParticipant participant)
}

/**
* Returns whether or not the video element on {@code LargeVideo} is
* currently playing.
*
* @return {@code boolean} True if the video element is progressing through
* video, false if no play progress is detected.
* Throws an exception if the video element is not playing (blocks for at least 500 ms).
*/
public void isVideoPlaying()
public void assertVideoPlaying()
{
TestUtils.waitForCondition(
participant.getDriver(),
Expand All @@ -60,7 +56,6 @@ public void isVideoPlaying()
TestUtils.waitMillis(500);

double newTime = this.getVideoPlaytime();
System.out.println(startTime + " " + newTime);
return newTime > startTime;
});
}
Expand Down

0 comments on commit 03568d8

Please sign in to comment.