Skip to content

Commit

Permalink
Add raising hand integration test code
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaboleken committed Jan 8, 2025
1 parent fa471f1 commit 910ab32
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion react/.env.development.webinar
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ REACT_APP_FOOTER_MESSAGE_BUTTON_VISIBILITY=true
REACT_APP_FOOTER_PARTICIPANT_LIST_BUTTON_VISIBILITY=true
REACT_APP_FOOTER_END_CALL_BUTTON_VISIBILITY=true
REACT_APP_FOOTER_CLOCK_VISIBILITY=true
REACT_APP_FOOTER_PUBLISHER_REQUEST_BUTTON_VISIBILITY=false
REACT_APP_FOOTER_PUBLISHER_REQUEST_BUTTON_VISIBILITY=true

# Option menu buttons configurations
REACT_APP_OPTION_MENU_GENERAL_SETTINGS_BUTTON_VISIBILITY=false
Expand Down
58 changes: 58 additions & 0 deletions test/test_webinar.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ def join_room_as_player(self, participant, room, skip_speed_test=False):

return handle

def accept_raising_hand_request(self, participant):
accept_button = self.chrome.get_element_with_retry(By.ID,"approve-become-speaker-"+participant)
self.chrome.click_element(accept_button)

def reject_raising_hand_request(self, participant):
reject_button = self.chrome.get_element_with_retry(By.ID,"reject-become-speaker-"+participant)
self.chrome.click_element(reject_button)

def add_presenter_to_listener_room(self, presenter):
add_button = self.chrome.get_element(By.ID,"add-presenter-"+presenter)
self.chrome.click_element(add_button)
Expand Down Expand Up @@ -752,6 +760,56 @@ def _test_admin_video_card_controls(self):
wait.until(lambda x: self.chrome.get_element_in_element(presenterA_video_card, By.XPATH, ".//button[@type='button' and @aria-label='turn-off-camera']") is not None)


self.chrome.close_all()

def test_raising_hand(self):
# create a room and join as admin and 2 players
room = "room"+str(random.randint(100, 999))
handle_admin = self.join_room_as_admin("admin", room)
handle_player_A = self.join_room_as_player("playerA", room)
handle_player_B = self.join_room_as_player("playerB", room)

wait = self.chrome.get_wait()

# switch to playerA and raise hand
self.chrome.switch_to_tab(handle_player_A)

raise_hand_button = self.chrome.get_element_with_retry(By.ID, "request-to-publisher-button")
self.chrome.click_element(raise_hand_button)

# switch to admin and check if playerA is in the request list
self.chrome.switch_to_tab(handle_admin)

self.open_close_publisher_request_list_drawer()

time.sleep(15)

self.accept_raising_hand_request("playerA")

# switch to playerA and join the room
self.chrome.switch_to_tab(handle_player_A)

join_button = self.chrome.get_element_with_retry(By.ID,"room_join_button")
self.chrome.click_element(join_button)

time.sleep(5)

meeting_gallery = self.chrome.get_element_with_retry(By.ID,"meeting-gallery")

assert(meeting_gallery.is_displayed())

wait.until(lambda x: len(self.get_participants()) == 2)

# switch to admin and join the room
self.chrome.switch_to_tab(handle_admin)

wait.until(lambda x: len(self.get_participants()) == 2)

# switch to playerB and join the room
self.chrome.switch_to_tab(handle_player_B)

wait.until(lambda x: len(self.get_participants()) == 0)

self.chrome.close_all()

if __name__ == '__main__':
Expand Down

0 comments on commit 910ab32

Please sign in to comment.