Skip to content

Commit

Permalink
Merge branch 'betterStatsCollector' into fixP2P
Browse files Browse the repository at this point in the history
  • Loading branch information
lastpeony committed Aug 6, 2024
2 parents b744809 + 387715b commit 48f13bc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:

- name: Run ffmpeg
#send test stream to the server to play test
run: ffmpeg -re -stream_loop 10 -i ./webrtc-android-sample-app/src/androidTest/resources/test.flv -codec copy -f flv rtmp://test.antmedia.io/LiveApp/stream556677i4d 2>&1 < /dev/null &
run: ffmpeg -re -stream_loop 20 -i ./webrtc-android-sample-app/src/androidTest/resources/test.flv -codec copy -f flv rtmp://test.antmedia.io/LiveApp/stream556677i4d 2>&1 < /dev/null &

- uses: browser-actions/setup-chrome@v1
id: setup-chrome
Expand Down
5 changes: 1 addition & 4 deletions multitrack-conference-server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
Expand All @@ -12,8 +12,6 @@
from selenium.webdriver.chrome.service import Service




class Browser:
def init(self, is_headless):
chrome_path = os.getenv('CHROME_PATH')
Expand All @@ -38,7 +36,6 @@ def init(self, is_headless):
service = Service(executable_path=chromedriver_path)
#service = Service(executable_path='C:/Users/yunus/Desktop/antmedia/chromedriver-win64/chromedriver.exe')


self.driver = webdriver.Chrome(service=service, options=browser_options)

def open_in_new_tab(self, url, tab_id):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,15 @@ public void testJoinWithExternalParticipant() throws InterruptedException {

onView(withId(R.id.show_stats_button)).perform(click());

Thread.sleep(5000);
Thread.sleep(10000);

onView(withId(R.id.stats_popup_container)).perform(swipeUp());

onView(withId(R.id.multitrack_stats_popup_play_stats_video_track_recyclerview)).inRoot(isDialog()).check(matches(isDisplayed()));


Thread.sleep(5000);

onView(withId(R.id.multitrack_stats_popup_play_stats_video_track_recyclerview))
.check((view, noViewFoundException) -> {
if (noViewFoundException != null) {
Expand Down Expand Up @@ -338,8 +343,12 @@ public void testConferenceReconnect() throws IOException, InterruptedException {

Thread.sleep(5000);

onView(withId(R.id. stats_popup_container)).perform(swipeUp());

Thread.sleep(5000);
onView(withId(R.id.multitrack_stats_popup_play_stats_video_track_recyclerview)).inRoot(isDialog()).check(matches(isDisplayed()));


onView(withId(R.id.multitrack_stats_popup_play_stats_video_track_recyclerview))
.check((view, noViewFoundException) -> {
if (noViewFoundException != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ public void testPlayReconnection() throws InterruptedException, IOException {
Intent intent = new Intent(ApplicationProvider.getApplicationContext(), PlayActivity.class);
ActivityScenario<PlayActivity> scenario = ActivityScenario.launch(intent);

scenario.onActivity(new ActivityScenario.ActivityAction<PlayActivity>() {
@Override
public void perform(PlayActivity activity) {
mIdlingResource = activity.getIdlingResource();
IdlingRegistry.getInstance().register(mIdlingResource);
activity.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}
scenario.onActivity(activity -> {
mIdlingResource = activity.getIdlingResource();
IdlingRegistry.getInstance().register(mIdlingResource);
activity.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
});

//stream556677i4d is the stream id in github actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public void testStatsCollector() throws InterruptedException {
R.id.stats_popup_packets_sent_audio_textview,
R.id.stats_popup_bytes_sent_audio_textview,
R.id.stats_popup_packets_sent_per_second_audio_textview,
R.id.stats_popup_local_audio_bitrate_textview
};

int[] videoTrackStatsTextViewIds = {
Expand All @@ -108,13 +107,13 @@ public void testStatsCollector() throws InterruptedException {
R.id.stats_popup_frames_encoded_video_textview,
R.id.stats_popup_bytes_sent_video_textview,
R.id.stats_popup_packets_sent_per_second_video_textview,
R.id.stats_popup_local_video_bitrate_textview
};

for (int id : audioTrackStatsTextViewIds) {
onView(withId(id)).check((view, noViewFoundException) -> {
String text = ((TextView) view).getText().toString();
float value = Float.parseFloat(text);

assertTrue(value > 0f);
});
}
Expand Down

0 comments on commit 48f13bc

Please sign in to comment.