Skip to content

Commit

Permalink
fix: Adds a workaround for not interactable menu on hover.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Jun 25, 2024
1 parent 3f8e7a4 commit f8dcab2
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private void clickAutoAssignButton()
*
* @param remoteId id the participant for which to open the menu
*/
private void openParticipantContextMenu(String remoteId)
private void openParticipantContextMenu(String remoteId, boolean retry)
{
WebElement listItem = TestUtils.waitForElementBy(participant.getDriver(),
By.xpath("//div[@id='participant-item-" + remoteId + "']"), 5);
Expand All @@ -426,8 +426,27 @@ private void openParticipantContextMenu(String remoteId)
hoverOnParticipantListItem.moveToElement(listItem);
hoverOnParticipantListItem.perform();

String cssSelector = MeetUIUtils.getAccessibilityCSSSelector(PARTICIPANT_MORE_LABEL);
listItem.findElement(By.cssSelector(cssSelector)).click();
try
{
String cssSelector = MeetUIUtils.getAccessibilityCSSSelector(PARTICIPANT_MORE_LABEL);
listItem.findElement(By.cssSelector(cssSelector)).click();
}
catch (ElementNotInteractableException e)
{
if (retry)
{
throw e;
}

// workaround of exception we sometimes see
// let's move the mous to local video and then back try the context menu
WebElement toolbar = participant.getDriver().findElement(By.id("localVideoContainer"));
Actions hoverOnToolbar = new Actions(participant.getDriver());
hoverOnToolbar.moveToElement(toolbar);
hoverOnToolbar.perform();

openParticipantContextMenu(remoteId, true);
}
}

/**
Expand All @@ -440,7 +459,7 @@ public void sendParticipantToBreakoutRoom(WebParticipant participantToSend, Stri
{
String remoteParticipantId = participantToSend.getEndpointId();

openParticipantContextMenu(remoteParticipantId);
openParticipantContextMenu(remoteParticipantId, false);

String cssSelector = MeetUIUtils.getAccessibilityCSSSelector(roomName);
WebElement sendButton = TestUtils.waitForElementBy(participant.getDriver(),
Expand Down

0 comments on commit f8dcab2

Please sign in to comment.