From 90938fb916c95ff7600c0d1a89fc711e4fa0e40e Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 5 Oct 2023 08:44:52 -0500 Subject: [PATCH] feat: Migrates selenium and appium to latest. --- pom.xml | 15 +- .../jitsi/meet/test/ActiveSpeakerTest.java | 3 +- .../org/jitsi/meet/test/ChatPanelTest.java | 2 - .../org/jitsi/meet/test/DataChannelTest.java | 6 +- .../org/jitsi/meet/test/EtherpadTest.java | 8 +- .../org/jitsi/meet/test/IFrameAPIBase.java | 3 +- .../java/org/jitsi/meet/test/PSNRTest.java | 1 - .../java/org/jitsi/meet/test/PreJoinTest.java | 4 +- .../org/jitsi/meet/test/StartMutedTest.java | 1 - .../org/jitsi/meet/test/base/Participant.java | 3 +- .../meet/test/mobile/MobileParticipant.java | 26 +-- .../mobile/base/MobileParticipantFactory.java | 6 +- .../meet/test/mobile/base/MobileTestBase.java | 1 - .../meet/test/pageobjects/base/TestHint.java | 19 +- .../test/pageobjects/mobile/ToolbarView.java | 9 +- .../pageobjects/mobile/WelcomePageView.java | 14 +- .../mobile/base/AbstractMobilePage.java | 2 +- .../mobile/permissions/PermissionsAlert.java | 10 +- .../pageobjects/web/BreakoutRoomsList.java | 1 - .../meet/test/pageobjects/web/ChatPanel.java | 3 +- .../meet/test/pageobjects/web/Dialogs.java | 5 - .../test/pageobjects/web/InviteDialog.java | 4 +- .../test/pageobjects/web/LobbyScreen.java | 6 +- .../pageobjects/web/ParticipantsPane.java | 1 - .../test/pageobjects/web/PreJoinScreen.java | 4 +- .../test/pageobjects/web/SecurityDialog.java | 9 +- .../test/pageobjects/web/SettingsDialog.java | 3 +- .../org/jitsi/meet/test/util/CmdExecutor.java | 1 - .../org/jitsi/meet/test/util/MeetUIUtils.java | 4 +- .../org/jitsi/meet/test/util/MeetUtils.java | 3 +- .../org/jitsi/meet/test/util/TestUtils.java | 27 +-- .../jitsi/meet/test/web/TabbedWebDriver.java | 179 ++---------------- .../jitsi/meet/test/web/WebParticipant.java | 5 +- .../meet/test/web/WebParticipantFactory.java | 9 +- .../meet/test/web/WebParticipantOptions.java | 1 - 35 files changed, 134 insertions(+), 264 deletions(-) diff --git a/pom.xml b/pom.xml index 84aae4981..59bf34283 100644 --- a/pom.xml +++ b/pom.xml @@ -32,20 +32,20 @@ org.seleniumhq.selenium selenium-java - 3.141.59 + 4.13.0 org.seleniumhq.selenium selenium-chrome-driver - 3.141.59 + 4.13.0 io.github.bonigarcia webdrivermanager - 5.5.0 + 5.5.3 @@ -57,7 +57,8 @@ io.appium java-client - 6.1.0 + + 8.5.1 org.json @@ -75,6 +76,12 @@ 1.1.1 + + org.apache.httpcomponents + httpclient + 4.5.14 + + org.uncommons reportng diff --git a/src/test/java/org/jitsi/meet/test/ActiveSpeakerTest.java b/src/test/java/org/jitsi/meet/test/ActiveSpeakerTest.java index 93d44d326..f86c18f10 100644 --- a/src/test/java/org/jitsi/meet/test/ActiveSpeakerTest.java +++ b/src/test/java/org/jitsi/meet/test/ActiveSpeakerTest.java @@ -23,6 +23,7 @@ import org.testng.*; import org.testng.annotations.*; +import java.time.*; import java.util.*; import static org.testng.Assert.*; @@ -162,7 +163,7 @@ private void testActiveSpeaker( // perspective try { - new WebDriverWait(driver2, 10).until( + new WebDriverWait(driver2, Duration.ofSeconds(10)).until( (ExpectedCondition) d -> speakerEndpoint.equals( MeetUIUtils.getLargeVideoResource(d))); } diff --git a/src/test/java/org/jitsi/meet/test/ChatPanelTest.java b/src/test/java/org/jitsi/meet/test/ChatPanelTest.java index 74998680a..fbd7985c5 100644 --- a/src/test/java/org/jitsi/meet/test/ChatPanelTest.java +++ b/src/test/java/org/jitsi/meet/test/ChatPanelTest.java @@ -19,8 +19,6 @@ import org.jitsi.meet.test.web.*; import org.testng.annotations.*; -import static org.testng.Assert.*; - /** * Checks that the chat panel can be opened and closed with a shortcut and * with the toolbar button. diff --git a/src/test/java/org/jitsi/meet/test/DataChannelTest.java b/src/test/java/org/jitsi/meet/test/DataChannelTest.java index 0e30f8116..86efc6d6d 100644 --- a/src/test/java/org/jitsi/meet/test/DataChannelTest.java +++ b/src/test/java/org/jitsi/meet/test/DataChannelTest.java @@ -23,6 +23,8 @@ import org.testng.annotations.*; +import java.time.*; + import static org.testng.Assert.*; /** @@ -156,7 +158,7 @@ public void testDataChannelOfParticipant2() */ private void waitForDataChannelToOpen(WebDriver webDriver) { - new WebDriverWait(webDriver, 15).until( + new WebDriverWait(webDriver, Duration.ofSeconds(15)).until( (ExpectedCondition) this::isDataChannelOpen); } @@ -171,7 +173,7 @@ private void waitForDataChannelToOpen(WebDriver webDriver) */ private void waitToReceiveServerHello(WebDriver webDriver) { - new WebDriverWait(webDriver, 15).until( + new WebDriverWait(webDriver, Duration.ofSeconds(15)).until( (ExpectedCondition) this::isServerHelloReceived); } diff --git a/src/test/java/org/jitsi/meet/test/EtherpadTest.java b/src/test/java/org/jitsi/meet/test/EtherpadTest.java index f72b6a84e..ac4d00042 100644 --- a/src/test/java/org/jitsi/meet/test/EtherpadTest.java +++ b/src/test/java/org/jitsi/meet/test/EtherpadTest.java @@ -23,6 +23,8 @@ import org.testng.*; import org.testng.annotations.*; +import java.time.*; + import static org.testng.Assert.*; /** @@ -96,17 +98,17 @@ public void writeTextAndCheck() // give time for the internal frame to load and attach to the page. TestUtils.waitMillis(2000); - WebDriverWait wait = new WebDriverWait(driver1, 30); + WebDriverWait wait = new WebDriverWait(driver1, Duration.ofSeconds(30)); wait.until( ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.id("etherpadIFrame"))); - wait = new WebDriverWait(driver1, 30); + wait = new WebDriverWait(driver1, Duration.ofSeconds(30)); wait.until( ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.name("ace_outer"))); - wait = new WebDriverWait(driver1, 30); + wait = new WebDriverWait(driver1, Duration.ofSeconds(30)); wait.until( ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.name("ace_inner"))); diff --git a/src/test/java/org/jitsi/meet/test/IFrameAPIBase.java b/src/test/java/org/jitsi/meet/test/IFrameAPIBase.java index 33e7b55a1..03961b15b 100644 --- a/src/test/java/org/jitsi/meet/test/IFrameAPIBase.java +++ b/src/test/java/org/jitsi/meet/test/IFrameAPIBase.java @@ -25,6 +25,7 @@ import org.testng.*; import java.net.*; +import java.time.*; import java.util.logging.*; /** @@ -177,7 +178,7 @@ protected static void switchToMeetContent(JitsiMeetUrl iFrameUrl, WebDriver driv if (iFrameUrl.getIframeToNavigateTo() != null) { // let's wait for switch to that iframe, so we can continue with regular tests - WebDriverWait wait = new WebDriverWait(driver, 60); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(60)); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.id(iFrameUrl.getIframeToNavigateTo()))); } diff --git a/src/test/java/org/jitsi/meet/test/PSNRTest.java b/src/test/java/org/jitsi/meet/test/PSNRTest.java index 004d13a87..61d399b9d 100644 --- a/src/test/java/org/jitsi/meet/test/PSNRTest.java +++ b/src/test/java/org/jitsi/meet/test/PSNRTest.java @@ -15,7 +15,6 @@ */ package org.jitsi.meet.test; -import org.jitsi.meet.test.base.*; import org.jitsi.meet.test.capture.*; import org.jitsi.meet.test.tasks.*; import org.jitsi.meet.test.util.*; diff --git a/src/test/java/org/jitsi/meet/test/PreJoinTest.java b/src/test/java/org/jitsi/meet/test/PreJoinTest.java index 505e53f99..b8063ffa5 100644 --- a/src/test/java/org/jitsi/meet/test/PreJoinTest.java +++ b/src/test/java/org/jitsi/meet/test/PreJoinTest.java @@ -23,6 +23,8 @@ import org.openqa.selenium.support.ui.*; import org.testng.annotations.*; +import java.time.*; + import static org.testng.Assert.*; public class PreJoinTest @@ -86,7 +88,7 @@ public void testJoinWithoutAudio() preJoinScreen.waitForLoading(); preJoinScreen.getJoinOptions().click(); - WebDriverWait wait = new WebDriverWait(getParticipant1().getDriver(), 5); + WebDriverWait wait = new WebDriverWait(getParticipant1().getDriver(), Duration.ofSeconds(5)); WebElement joinWithoutAudioBtn = wait.until( ExpectedConditions.elementToBeClickable( preJoinScreen.getJoinWithoutAudioButton())); diff --git a/src/test/java/org/jitsi/meet/test/StartMutedTest.java b/src/test/java/org/jitsi/meet/test/StartMutedTest.java index 17c8d5845..f7bb0f208 100644 --- a/src/test/java/org/jitsi/meet/test/StartMutedTest.java +++ b/src/test/java/org/jitsi/meet/test/StartMutedTest.java @@ -20,7 +20,6 @@ import org.jitsi.meet.test.util.*; import org.jitsi.meet.test.web.*; -import org.openqa.selenium.*; import org.testng.annotations.*; /** diff --git a/src/test/java/org/jitsi/meet/test/base/Participant.java b/src/test/java/org/jitsi/meet/test/base/Participant.java index 55422d678..e94da2d0f 100644 --- a/src/test/java/org/jitsi/meet/test/base/Participant.java +++ b/src/test/java/org/jitsi/meet/test/base/Participant.java @@ -24,6 +24,7 @@ import org.openqa.selenium.support.ui.*; import java.io.*; +import java.time.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; @@ -493,7 +494,7 @@ public void saveHtmlSource(File outputDir, String fileName) if (getMeetUrl().getIframeToNavigateTo() != null) { // let's wait for switch to that iframe, so we can save the correct page - WebDriverWait wait = new WebDriverWait(driver, 60); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(60)); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.id(getMeetUrl().getIframeToNavigateTo()))); } diff --git a/src/test/java/org/jitsi/meet/test/mobile/MobileParticipant.java b/src/test/java/org/jitsi/meet/test/mobile/MobileParticipant.java index 3751c7ccd..147885e35 100644 --- a/src/test/java/org/jitsi/meet/test/mobile/MobileParticipant.java +++ b/src/test/java/org/jitsi/meet/test/mobile/MobileParticipant.java @@ -36,7 +36,7 @@ * * @author Pawel Domas */ -public class MobileParticipant extends Participant> +public class MobileParticipant extends Participant { /** * The default config part of the {@link JitsiMeetUrl} for every mobile @@ -73,7 +73,7 @@ public class MobileParticipant extends Participant> /** * The Appium driver instance. */ - private final AppiumDriver driver; + private final AppiumDriver driver; /** * Initializes {@link MobileParticipant}. @@ -87,7 +87,7 @@ public class MobileParticipant extends Participant> * @param appBinaryFile - A full path to the app binary file which can be * used to install the app on the device. */ - public MobileParticipant(AppiumDriver driver, + public MobileParticipant(AppiumDriver driver, String name, ParticipantType type, String appBundleId, @@ -145,9 +145,9 @@ private boolean dismissAlertIfAny() } } - private AndroidDriver getAndroidDriver() + private AndroidDriver getAndroidDriver() { - return type.isAndroid() ? (AndroidDriver) driver : null; + return type.isAndroid() ? (AndroidDriver) driver : null; } /** @@ -259,7 +259,7 @@ private void maybeAcceptOverlayPermissions() toggleSwitch.click(); - getAndroidDriver().pressKeyCode(AndroidKeyCode.BACK); + getAndroidDriver().pressKey(new KeyEvent(AndroidKey.BACK)); logger.info("Overlay permissions granted !"); } @@ -279,7 +279,7 @@ public void doJoinConference(JitsiMeetUrl conferenceUrl) WelcomePageView welcomePageView = new WelcomePageView(this); - MobileElement roomNameInput = welcomePageView.getRoomNameInput(); + WebElement roomNameInput = welcomePageView.getRoomNameInput(); roomNameInput.sendKeys(conferenceUrl.toString()); @@ -367,7 +367,7 @@ public void close() /** * {@inheritDoc} */ - public AppiumDriver getDriver() + public AppiumDriver getDriver() { return driver; } @@ -381,9 +381,9 @@ public void reinstallAppIfInstalled() if (removeAppIfInstalled()) { Logger.getGlobal().log(Level.INFO, "Installing app..."); - driver.installApp(appBinaryFile); + ((InteractsWithApps)driver).installApp(appBinaryFile); Logger.getGlobal().log(Level.INFO, "Launching app..."); - driver.launchApp(); + ((InteractsWithApps)driver).activateApp(appBundleId); } } @@ -397,10 +397,10 @@ public void reinstallAppIfInstalled() public boolean removeAppIfInstalled() { // FIXME driver.isAppInstalled does not work on iOS - if (type.isIOS() || driver.isAppInstalled(appBundleId)) + if (type.isIOS() || ((InteractsWithApps)driver).isAppInstalled(appBundleId)) { Logger.getGlobal().log(Level.INFO, "Removing app..."); - driver.removeApp(appBundleId); + ((InteractsWithApps)driver).removeApp(appBundleId); return true; } @@ -507,7 +507,7 @@ public Filmstrip getFilmstrip() } @Override - public List>> + public List> getRemoteParticipants() { throw new RuntimeException("Not implemented"); diff --git a/src/test/java/org/jitsi/meet/test/mobile/base/MobileParticipantFactory.java b/src/test/java/org/jitsi/meet/test/mobile/base/MobileParticipantFactory.java index e65a5f591..f9649202e 100644 --- a/src/test/java/org/jitsi/meet/test/mobile/base/MobileParticipantFactory.java +++ b/src/test/java/org/jitsi/meet/test/mobile/base/MobileParticipantFactory.java @@ -77,10 +77,10 @@ protected MobileParticipant doCreateParticipant(ParticipantOptions options) URL appiumUrl = targetOptions.getAppiumServerUrl(); DesiredCapabilities capabilities = targetOptions.createCapabilities(); - AppiumDriver driver + AppiumDriver driver = type.isAndroid() - ? new AndroidDriver<>(appiumUrl, capabilities) - : new IOSDriver<>(appiumUrl, capabilities); + ? new AndroidDriver(appiumUrl, capabilities) + : new IOSDriver(appiumUrl, capabilities); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); diff --git a/src/test/java/org/jitsi/meet/test/mobile/base/MobileTestBase.java b/src/test/java/org/jitsi/meet/test/mobile/base/MobileTestBase.java index 5d0e0ddaf..4d2097e08 100644 --- a/src/test/java/org/jitsi/meet/test/mobile/base/MobileTestBase.java +++ b/src/test/java/org/jitsi/meet/test/mobile/base/MobileTestBase.java @@ -18,7 +18,6 @@ import org.jitsi.meet.test.base.*; import org.jitsi.meet.test.mobile.*; -import java.util.*; /** * Base class of mobile test cases. diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/base/TestHint.java b/src/test/java/org/jitsi/meet/test/pageobjects/base/TestHint.java index 045d531e4..d0677b711 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/base/TestHint.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/base/TestHint.java @@ -37,7 +37,7 @@ public class TestHint /** * The mobile participant's driver. */ - private final AppiumDriver driver; + private final AppiumDriver driver; /** * The test hint's id (key). @@ -51,7 +51,7 @@ public class TestHint * @param id - The test hint's id (key) which identifies a hint in the app's * scope. */ - public TestHint(AppiumDriver driver, String id) + public TestHint(AppiumDriver driver, String id) { this.driver = driver; this.id = id; @@ -67,18 +67,18 @@ public void click() } /** - * Finds the underlying {@link MobileElement} for this {@link TestHint} + * Finds the underlying {@link WebElement} for this {@link TestHint} * instance. * - * @return {@link MobileElement} - * @throws NoSuchElementException if {@link MobileElement} could not be + * @return {@link WebElement} + * @throws NoSuchElementException if {@link WebElement} could not be * found on the current screen. */ - private MobileElement getElement() + private WebElement getElement() { return useAccessibilityForId() - ? driver.findElementByAccessibilityId(id) - : driver.findElementById(id); + ? driver.findElement(AppiumBy.accessibilityId(id)) + : driver.findElement(By.ById.name(id)); } /** @@ -107,7 +107,8 @@ public String getValue() */ private boolean useAccessibilityForId() { - Platform driversPlatform = driver.getCapabilities().getPlatform(); + Platform driversPlatform + = Platform.fromString((String)driver.getCapabilities().getCapability("platformName")); // FIXME This looks like a bug, but I don't want to deal with this right // now. diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/ToolbarView.java b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/ToolbarView.java index 41677d554..3c59f9fdc 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/ToolbarView.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/ToolbarView.java @@ -19,6 +19,7 @@ import io.appium.java_client.pagefactory.*; import org.jitsi.meet.test.pageobjects.mobile.base.*; +import org.openqa.selenium.*; /** * Page object for the mobile toolbar area. @@ -35,8 +36,8 @@ public class ToolbarView extends AbstractMobilePage * A locator for the hangup button. */ @AndroidFindBy(accessibility = HANGUP_BTN_ACCESS_ID) - @iOSFindBy(accessibility = HANGUP_BTN_ACCESS_ID) - private MobileElement hangup; + @iOSXCUITFindBy(accessibility = HANGUP_BTN_ACCESS_ID) + private WebElement hangup; /** * Creates new ToolbarView. @@ -59,7 +60,7 @@ public ToolbarView(ConferenceView conferenceView) public boolean isOpen() { return !participant.getDriver() - .findElementsByAccessibilityId(HANGUP_BTN_ACCESS_ID) + .findElements(AppiumBy.accessibilityId(HANGUP_BTN_ACCESS_ID)) .isEmpty(); } @@ -68,7 +69,7 @@ public boolean isOpen() * * @return MobileElement proxy object. */ - public MobileElement getHangupButton() + public WebElement getHangupButton() { return hangup; } diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/WelcomePageView.java b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/WelcomePageView.java index 6bfa9ae48..d4281dc79 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/WelcomePageView.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/WelcomePageView.java @@ -15,11 +15,11 @@ */ package org.jitsi.meet.test.pageobjects.mobile; -import io.appium.java_client.*; import io.appium.java_client.pagefactory.*; import org.jitsi.meet.test.mobile.*; import org.jitsi.meet.test.pageobjects.mobile.base.*; +import org.openqa.selenium.*; /** * Page object for the mobile welcome page. @@ -30,15 +30,15 @@ public class WelcomePageView extends AbstractMobilePage * Conference room name input locator. */ @AndroidFindBy(accessibility = "Enter room name") - @iOSFindBy(accessibility = "Enter room name") - private MobileElement roomNameInput; + @iOSXCUITFindBy(accessibility = "Enter room name") + private WebElement roomNameInput; /** * Join conference room button. */ @AndroidFindBy(accessibility = "Tap to join") - @iOSFindBy(accessibility = "Tap to join") - private MobileElement joinRoomButton; + @iOSXCUITFindBy(accessibility = "Tap to join") + private WebElement joinRoomButton; /** * Creates new WelcomePageView. @@ -55,7 +55,7 @@ public WelcomePageView(MobileParticipant participant) * * @return MobileElement proxy object. */ - public MobileElement getRoomNameInput() + public WebElement getRoomNameInput() { return roomNameInput; } @@ -65,7 +65,7 @@ public MobileElement getRoomNameInput() * * @return MobileElement proxy object. */ - public MobileElement getJoinRoomButton() + public WebElement getJoinRoomButton() { return joinRoomButton; } diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/base/AbstractMobilePage.java b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/base/AbstractMobilePage.java index 16a35fb33..90e28cf66 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/base/AbstractMobilePage.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/base/AbstractMobilePage.java @@ -47,7 +47,7 @@ public AbstractMobilePage(MobileParticipant participant) /** * Initializes any member fields annotated with @AndroidFindBy or - * @iOSFindBy. + * @iOSXCUITFindBy. */ private void initFields() { diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/permissions/PermissionsAlert.java b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/permissions/PermissionsAlert.java index 3bae9673d..794768fca 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/mobile/permissions/PermissionsAlert.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/mobile/permissions/PermissionsAlert.java @@ -15,11 +15,11 @@ */ package org.jitsi.meet.test.pageobjects.mobile.permissions; -import io.appium.java_client.*; import io.appium.java_client.pagefactory.*; import org.jitsi.meet.test.mobile.*; import org.jitsi.meet.test.pageobjects.mobile.base.*; +import org.openqa.selenium.*; /** * This is the camera/mic permissions alert. @@ -33,10 +33,10 @@ public class PermissionsAlert extends AbstractMobilePage @AndroidFindBy( id = "com.android.packageinstaller:id/permission_allow_button" ) - @iOSFindBy( + @iOSXCUITFindBy( id = "OK" ) - private MobileElement allowButton; + private WebElement allowButton; /** * Creates new {@link PermissionsAlert}. @@ -51,9 +51,9 @@ public PermissionsAlert(MobileParticipant participant) * Obtains the OK/Allow button used to grant permission to use * camera/microphone. * - * @return a {@link MobileElement} proxy object. + * @return a {@link WebElement} proxy object. */ - public MobileElement getAllowButton() + public WebElement getAllowButton() { return allowButton; } diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/BreakoutRoomsList.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/BreakoutRoomsList.java index 5669598a9..be83dd411 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/BreakoutRoomsList.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/BreakoutRoomsList.java @@ -18,7 +18,6 @@ import org.jitsi.meet.test.util.*; import org.jitsi.meet.test.web.*; import org.openqa.selenium.*; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.interactions.*; import java.util.*; diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/ChatPanel.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/ChatPanel.java index 5baffec00..fe1cbd5d2 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/ChatPanel.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/ChatPanel.java @@ -21,6 +21,7 @@ import org.openqa.selenium.support.ui.*; import static org.junit.Assert.*; +import java.time.*; import java.util.*; /** @@ -63,7 +64,7 @@ public WebElement getChat() { try { - return new WebDriverWait(this.participant.getDriver(), 3) + return new WebDriverWait(this.participant.getDriver(), Duration.ofSeconds(3)) .until(driver -> driver.findElement(By.id("sideToolbarContainer"))); } catch(Exception e) diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/Dialogs.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/Dialogs.java index 977069872..2ee54d4f8 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/Dialogs.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/Dialogs.java @@ -17,11 +17,6 @@ import org.jitsi.meet.test.util.*; import org.jitsi.meet.test.web.*; -import org.openqa.selenium.*; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.interactions.*; - -import java.util.*; /** * Manages dialogs diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/InviteDialog.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/InviteDialog.java index 1d014746f..809fe89b5 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/InviteDialog.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/InviteDialog.java @@ -15,13 +15,13 @@ */ package org.jitsi.meet.test.pageobjects.web; +import java.time.*; import java.util.*; import java.util.logging.*; import org.jitsi.meet.test.util.*; import org.jitsi.meet.test.web.*; import org.openqa.selenium.*; -import org.openqa.selenium.interactions.*; import org.openqa.selenium.support.ui.*; /** @@ -212,7 +212,7 @@ private String getValueAfterColon(String className) // sometimes we see FF taking long (more than 5 seconds) to show the dialog // let's wait a little bit longer, give it 5 more seconds to see it - String fullText = (new WebDriverWait(driver, 5)).until((ExpectedCondition) d -> + String fullText = (new WebDriverWait(driver, Duration.ofSeconds(5))).until((ExpectedCondition) d -> { String text = driver.findElement(By.className(className)).getText(); diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/LobbyScreen.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/LobbyScreen.java index 874ba887f..b3f20ad06 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/LobbyScreen.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/LobbyScreen.java @@ -21,6 +21,8 @@ import org.openqa.selenium.interactions.*; import org.openqa.selenium.support.ui.*; +import java.time.*; + /** * The Lobby screen representation. */ @@ -105,7 +107,7 @@ public void enterPassword(String password) new Actions(this.participant.getDriver()).moveToElement(passwordButton).click().perform(); - new WebDriverWait(this.participant.getDriver(), 3).until( + new WebDriverWait(this.participant.getDriver(), Duration.ofSeconds(3)).until( (ExpectedCondition) d -> d.findElements(ByTestId.testId("lobby.password")).size() > 0); @@ -158,7 +160,7 @@ public void join() public void waitForLoading() { // we wait for LOBBY_SCREEN_ID to successfully appear - new WebDriverWait(this.participant.getDriver(), 5).until( + new WebDriverWait(this.participant.getDriver(), Duration.ofSeconds(5)).until( (ExpectedCondition) d -> d.findElements(By.className(LOBBY_SCREEN_ID)).size() > 0); } diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/ParticipantsPane.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/ParticipantsPane.java index d409e2b1e..8034cc131 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/ParticipantsPane.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/ParticipantsPane.java @@ -6,7 +6,6 @@ import org.openqa.selenium.interactions.Actions; import java.util.*; -import java.util.logging.*; import static org.testng.Assert.fail; diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/PreJoinScreen.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/PreJoinScreen.java index 8788ad6e6..f8630b90b 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/PreJoinScreen.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/PreJoinScreen.java @@ -20,6 +20,8 @@ import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; +import java.time.*; + /** * The pre join screen representation. */ @@ -65,7 +67,7 @@ public PreJoinScreen(WebParticipant participant) */ public void waitForLoading() { - new WebDriverWait(this.participant.getDriver(), 3).until( + new WebDriverWait(this.participant.getDriver(), Duration.ofSeconds(3)).until( (ExpectedCondition) d -> d.findElements(ByTestId.testId(PREJOIN_SCREEN_TEST_ID)).size() > 0); } diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/SecurityDialog.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/SecurityDialog.java index cf2f50482..dcb85ebb7 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/SecurityDialog.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/SecurityDialog.java @@ -15,6 +15,7 @@ */ package org.jitsi.meet.test.pageobjects.web; +import java.time.*; import java.util.*; import org.jitsi.meet.test.util.*; @@ -73,7 +74,7 @@ public void addPassword(String password) WebElement addPasswordLink = driver.findElement(By.className(ADD_PASSWORD_LINK)); - new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(addPasswordLink)); + new WebDriverWait(driver, Duration.ofSeconds(5)).until(ExpectedConditions.elementToBeClickable(addPasswordLink)); new Actions(driver).click(addPasswordLink).perform(); @@ -134,7 +135,7 @@ public void close() clickCloseButton(); // waits till it is closed - new WebDriverWait(participant.getDriver(), 6).until( + new WebDriverWait(participant.getDriver(), Duration.ofSeconds(6)).until( (ExpectedCondition) d -> !isOpen()); } @@ -214,7 +215,7 @@ public void open() this.clickToolbarButton(); // waits till its open - new WebDriverWait(participant.getDriver(), 3).until( + new WebDriverWait(participant.getDriver(), Duration.ofSeconds(3)).until( (ExpectedCondition) d -> isOpen()); // give time the dialog to settle before operating on it, we see failures where click button handlers are @@ -237,7 +238,7 @@ public void removePassword() WebDriver driver = participant.getDriver(); - new WebDriverWait(driver, 5).until( + new WebDriverWait(driver, Duration.ofSeconds(5)).until( ExpectedConditions.elementToBeClickable(By.className(REMOVE_PASSWORD))); WebElement removePasswordElement diff --git a/src/test/java/org/jitsi/meet/test/pageobjects/web/SettingsDialog.java b/src/test/java/org/jitsi/meet/test/pageobjects/web/SettingsDialog.java index 3acc32a31..270ea9c9e 100644 --- a/src/test/java/org/jitsi/meet/test/pageobjects/web/SettingsDialog.java +++ b/src/test/java/org/jitsi/meet/test/pageobjects/web/SettingsDialog.java @@ -5,6 +5,7 @@ import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; +import java.time.*; import java.util.*; public class SettingsDialog @@ -226,7 +227,7 @@ private void openTab(String xPathSelectorForTab) WebDriver driver = participant.getDriver(); TestUtils.waitForElementBy(driver, By.xpath(xPathSelectorForTab), 5); - WebDriverWait wait = new WebDriverWait(driver, 10); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); WebElement element = wait.until(ExpectedConditions.elementToBeClickable( By.xpath(xPathSelectorForTab))); diff --git a/src/test/java/org/jitsi/meet/test/util/CmdExecutor.java b/src/test/java/org/jitsi/meet/test/util/CmdExecutor.java index d1b6ac2df..b11e61700 100644 --- a/src/test/java/org/jitsi/meet/test/util/CmdExecutor.java +++ b/src/test/java/org/jitsi/meet/test/util/CmdExecutor.java @@ -17,7 +17,6 @@ import java.util.*; import java.util.concurrent.*; -import java.util.concurrent.TimeoutException; /** * Utility class for running command through the {@link ProcessBuilder}. diff --git a/src/test/java/org/jitsi/meet/test/util/MeetUIUtils.java b/src/test/java/org/jitsi/meet/test/util/MeetUIUtils.java index b37ab6522..a104e2c46 100644 --- a/src/test/java/org/jitsi/meet/test/util/MeetUIUtils.java +++ b/src/test/java/org/jitsi/meet/test/util/MeetUIUtils.java @@ -15,13 +15,13 @@ */ package org.jitsi.meet.test.util; -import org.jitsi.meet.test.pageobjects.web.ParticipantsPane; import org.jitsi.meet.test.web.*; import org.openqa.selenium.*; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.interactions.*; import org.openqa.selenium.support.ui.*; +import java.time.*; import java.util.*; import static org.testng.Assert.*; @@ -955,7 +955,7 @@ public static void waitForLargeVideoSwitch( WebDriver driver, final String expectedVideoSrc) { - new WebDriverWait(driver, 3) + new WebDriverWait(driver, Duration.ofSeconds(3)) .withMessage( "Failed to switch the large video at: " + MeetUtils.getResourceJid(driver) diff --git a/src/test/java/org/jitsi/meet/test/util/MeetUtils.java b/src/test/java/org/jitsi/meet/test/util/MeetUtils.java index 52998db7d..264e04e6a 100644 --- a/src/test/java/org/jitsi/meet/test/util/MeetUtils.java +++ b/src/test/java/org/jitsi/meet/test/util/MeetUtils.java @@ -20,6 +20,7 @@ import org.openqa.selenium.chrome.*; import org.openqa.selenium.support.ui.*; +import java.time.*; import java.util.*; import static org.testng.Assert.fail; @@ -264,7 +265,7 @@ public static void waitForPageToLoad(WebDriver driver) "catch (e) { console.warn(e); } " + "return state;"; - Wait wait = new WebDriverWait(driver, 10); + Wait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); try { wait.until(driverInstance -> { diff --git a/src/test/java/org/jitsi/meet/test/util/TestUtils.java b/src/test/java/org/jitsi/meet/test/util/TestUtils.java index f8196169a..7ed387776 100644 --- a/src/test/java/org/jitsi/meet/test/util/TestUtils.java +++ b/src/test/java/org/jitsi/meet/test/util/TestUtils.java @@ -20,6 +20,7 @@ import java.io.*; import java.nio.file.*; +import java.time.*; import java.util.*; import static org.testng.Assert.fail; @@ -74,7 +75,7 @@ else if (osName.startsWith("Mac")) public static void click(WebDriver driver, final By by) { waitForElementBy(driver, by, 10); - WebDriverWait wait = new WebDriverWait(driver, 10); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); WebElement element = wait.until( ExpectedConditions.elementToBeClickable(by)); @@ -132,7 +133,7 @@ public static void waitForBoolean( final String scriptToExecute, long timeout) { - (new WebDriverWait(driver, timeout)) + (new WebDriverWait(driver, Duration.ofSeconds(timeout))) .until((ExpectedCondition) d -> { Object res = ((JavascriptExecutor) driver) .executeScript(scriptToExecute); @@ -154,7 +155,7 @@ public static void waitForStrings( final String expectedResult, long timeout) { - (new WebDriverWait(driver, timeout)) + (new WebDriverWait(driver, Duration.ofSeconds(timeout))) .until((ExpectedCondition) d -> { Object res = ((JavascriptExecutor) driver) @@ -193,7 +194,7 @@ public static WebElement waitForElementByXPath( String errorMessage) { FluentWait waitImpl - = new WebDriverWait(driver, timeout); + = new WebDriverWait(driver, Duration.ofSeconds(timeout)); if (errorMessage != null) { @@ -220,7 +221,7 @@ public static WebElement waitForElementBy( long timeout) { final WebElement[] foundElement = new WebElement[1]; - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> { List elements = d.findElements(by); @@ -251,7 +252,7 @@ public static String waitForElementTextBy( final String[] foundElement = new String[2]; try { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> { List elements = d.findElements(by); @@ -294,7 +295,7 @@ public static void waitForElementNotPresentBy( final By by, long timeout) { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> d.findElements(by) .isEmpty()); } @@ -382,7 +383,7 @@ public static void waitForElementAttributeValueByXPath( final Object attributeValue, long timeout) { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> { WebElement el = d.findElement(By.xpath(xpath)); @@ -407,7 +408,7 @@ public static void waitForElementContainsClassByXPath( long timeout ) { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> { WebElement el = d.findElement(By.xpath(xpath)); String classNames = el.getAttribute("class"); @@ -429,7 +430,7 @@ public static void waitForElementNotContainsClassByXPath( final String className, long timeout) { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .until((ExpectedCondition) d -> { WebElement el = d.findElement(By.xpath(xpath)); String classNames = el.getAttribute("class"); @@ -496,7 +497,7 @@ public static void waitForElementDisplayToBe( long timeout, final boolean isDisplayed) { - new WebDriverWait(driver, timeout) + new WebDriverWait(driver, Duration.ofSeconds(timeout)) .withMessage( "Is " + (isDisplayed ? "" : "not") + "displayed: " + by.toString()) @@ -535,7 +536,7 @@ public static void waitForCondition(WebDriver driver, int timeoutSeconds, ExpectedCondition condition) { - WebDriverWait wait = new WebDriverWait(driver, timeoutSeconds); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(timeoutSeconds)); if (message != null) { @@ -574,7 +575,7 @@ public static void waitForCondition(WebDriver driver, ExpectedCondition condition, long pollWaitTime) { - (new WebDriverWait(driver, timeoutSeconds, pollWaitTime)) + (new WebDriverWait(driver, Duration.ofSeconds(timeoutSeconds), Duration.ofSeconds(pollWaitTime))) .until(condition); } diff --git a/src/test/java/org/jitsi/meet/test/web/TabbedWebDriver.java b/src/test/java/org/jitsi/meet/test/web/TabbedWebDriver.java index ec7f5203b..b2a7bd631 100644 --- a/src/test/java/org/jitsi/meet/test/web/TabbedWebDriver.java +++ b/src/test/java/org/jitsi/meet/test/web/TabbedWebDriver.java @@ -17,20 +17,19 @@ import org.apache.commons.lang3.*; import org.openqa.selenium.*; +import org.openqa.selenium.federatedcredentialmanagement.*; import org.openqa.selenium.interactions.*; -import org.openqa.selenium.internal.*; import org.openqa.selenium.logging.*; +import org.openqa.selenium.print.*; import org.openqa.selenium.remote.*; +import org.openqa.selenium.virtualauthenticator.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; /** A wrapper around RemoteWebDriver that allows multiple tabs to be running at once in the same browser instance. */ -public class TabbedWebDriver implements WebDriver, JavascriptExecutor, - FindsById, FindsByClassName, FindsByLinkText, FindsByName, - FindsByCssSelector, FindsByTagName, FindsByXPath, - HasInputDevices, HasCapabilities, Interactive, TakesScreenshot +public class TabbedWebDriver implements WebDriver, JavascriptExecutor, HasCapabilities, HasFederatedCredentialManagement, HasVirtualAuthenticator, Interactive, PrintsPage, TakesScreenshot { private static final Map bases = Collections.synchronizedMap(new IdentityHashMap<>()); @@ -240,20 +239,6 @@ public Options manage() } } - @Override - public Keyboard getKeyboard() - { - // TODO: if we need it, need to add locking inside the returned object. - throw new NotImplementedException("Not implemented"); - } - - @Override - public Mouse getMouse() - { - // TODO: if we need it, need to add locking inside the returned object. - throw new NotImplementedException("Not implemented"); - } - @Override public void perform(Collection actions) { @@ -275,163 +260,40 @@ public void resetInputState() } @Override - public WebElement findElementByClassName(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByClassName(using); - } - } - - @Override - public List findElementsByClassName(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByClassName(using); - } - } - - @Override - public WebElement findElementByCssSelector(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByCssSelector(using); - } - } - - @Override - public List findElementsByCssSelector(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByCssSelector(using); - } - } - - @Override - public WebElement findElementById(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementById(using); - } - } - - @Override - public List findElementsById(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsById(using); - } - } - - @Override - public WebElement findElementByLinkText(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByLinkText(using); - } - } - - @Override - public List findElementsByLinkText(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByLinkText(using); - } - } - - @Override - public WebElement findElementByPartialLinkText(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByPartialLinkText(using); - } - } - - @Override - public List findElementsByPartialLinkText(String using) - { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByPartialLinkText(using); - } - } - - @Override - public WebElement findElementByName(String using) + public Pdf print(PrintOptions printOptions) + throws WebDriverException { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByName(using); - } + throw new NotImplementedException("Not implemented"); } @Override - public List findElementsByName(String using) + public void setDelayEnabled(boolean enabled) { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByName(using); - } + throw new NotImplementedException("Not implemented"); } @Override - public WebElement findElementByTagName(String using) + public void resetCooldown() { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByTagName(using); - } + throw new NotImplementedException("Not implemented"); } @Override - public List findElementsByTagName(String using) + public FederatedCredentialManagementDialog getFederatedCredentialManagementDialog() { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByTagName(using); - } + throw new NotImplementedException("Not implemented"); } @Override - public WebElement findElementByXPath(String using) + public VirtualAuthenticator addVirtualAuthenticator(VirtualAuthenticatorOptions options) { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementByXPath(using); - } + throw new NotImplementedException("Not implemented"); } @Override - public List findElementsByXPath(String using) + public void removeVirtualAuthenticator(VirtualAuthenticator authenticator) { - synchronized (baseDriver) - { - baseDriver.switchTo().window(tabId); - return baseDriver.findElementsByXPath(using); - } + throw new NotImplementedException("Not implemented"); } protected class TabbedWebDriverOptions @@ -514,13 +376,6 @@ public Timeouts timeouts() } } - @Override - public ImeHandler ime() - { - // TODO: if we need it, need to add locking inside the returned object. - throw new NotImplementedException("Not implemented"); - } - @Override public Window window() { diff --git a/src/test/java/org/jitsi/meet/test/web/WebParticipant.java b/src/test/java/org/jitsi/meet/test/web/WebParticipant.java index 882e785e0..bd6348cac 100644 --- a/src/test/java/org/jitsi/meet/test/web/WebParticipant.java +++ b/src/test/java/org/jitsi/meet/test/web/WebParticipant.java @@ -26,6 +26,7 @@ import org.openqa.selenium.remote.*; import org.openqa.selenium.support.ui.*; +import java.time.*; import java.util.*; import java.util.concurrent.*; import java.util.logging.*; @@ -140,7 +141,7 @@ public String getBridgeIp() { // With the default stats interval (10s) this can take up to 20 seconds. // We wait for 30 to give ourselves some margin. - return new WebDriverWait(driver, 30).until(d -> { + return new WebDriverWait(driver, Duration.ofSeconds(30)).until(d -> { RtpStatistics rtpStats = new WebRtpStatistics((JavascriptExecutor) d); @@ -209,7 +210,7 @@ public void doJoinConference(JitsiMeetUrl conferenceUrl) { // let's wait for loading and switch to that iframe so we can continue // with regular tests - WebDriverWait wait = new WebDriverWait(driver, 60); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(60)); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt( By.id(conferenceUrl.getIframeToNavigateTo()))); } diff --git a/src/test/java/org/jitsi/meet/test/web/WebParticipantFactory.java b/src/test/java/org/jitsi/meet/test/web/WebParticipantFactory.java index 4827a7588..0535fa2bb 100644 --- a/src/test/java/org/jitsi/meet/test/web/WebParticipantFactory.java +++ b/src/test/java/org/jitsi/meet/test/web/WebParticipantFactory.java @@ -196,7 +196,7 @@ private RemoteWebDriver startWebDriver( { if (version != null && version.length() > 0) { - ffOptions.setCapability(CapabilityType.VERSION, version); + ffOptions.setBrowserVersion(version); } return new RemoteWebDriver(options.getRemoteDriverAddress(), ffOptions); @@ -242,7 +242,7 @@ else if (participantType == ParticipantType.edge) logPrefs.enable(LogType.BROWSER, Level.ALL); final ChromeOptions ops = new ChromeOptions(); - ops.setCapability(CapabilityType.APPLICATION_NAME, options.getApplicationName()); +// ops.setCapability(CapabilityType.APPLICATION_NAME, options.getApplicationName()); // Force chrome to use English instead of system language. Map prefs = new HashMap(); @@ -267,7 +267,7 @@ else if (participantType == ParticipantType.edge) ops.addArguments("auto-select-desktop-capture-source=Your Entire screen"); - ops.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); +// ops.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); ops.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, options.allowsInsecureCerts()); if (options.isChromeSandboxDisabled()) @@ -340,7 +340,8 @@ else if (participantType == ParticipantType.edge) { if (version != null && version.length() > 0) { - ops.setCapability(CapabilityType.VERSION, version); +// ops.setCapability(CapabilityType.VERSION, version); + ops.setBrowserVersion(version); } return new RemoteWebDriver( diff --git a/src/test/java/org/jitsi/meet/test/web/WebParticipantOptions.java b/src/test/java/org/jitsi/meet/test/web/WebParticipantOptions.java index 3e8e3d06a..7f7327ce1 100644 --- a/src/test/java/org/jitsi/meet/test/web/WebParticipantOptions.java +++ b/src/test/java/org/jitsi/meet/test/web/WebParticipantOptions.java @@ -16,7 +16,6 @@ package org.jitsi.meet.test.web; import org.jitsi.meet.test.base.*; -import org.openqa.selenium.*; import java.net.*; import java.util.*;