From d3711e692f61e9453834ef7b1975128549737c1c Mon Sep 17 00:00:00 2001 From: rconner46 Date: Fri, 18 Jul 2025 09:53:27 -0500 Subject: [PATCH] Upgrade Selenium/Appium Versions and add a conversion script --- pom.xml | 4 +- scripts/appium-conversion.py | 230 +++++++++++++++++++++++++++++++ convert.py => scripts/convert.py | 0 3 files changed, 232 insertions(+), 2 deletions(-) create mode 100644 scripts/appium-conversion.py rename convert.py => scripts/convert.py (100%) diff --git a/pom.xml b/pom.xml index 0bb0b66..0847f98 100644 --- a/pom.xml +++ b/pom.xml @@ -49,9 +49,9 @@ UTF-8 7.11.0 7.23.0 - 9.2.2 + 9.5.0 - 4.19.0 + 4.34.0 2.24.3 2.19.0 3.17.0 diff --git a/scripts/appium-conversion.py b/scripts/appium-conversion.py new file mode 100644 index 0000000..998e6bc --- /dev/null +++ b/scripts/appium-conversion.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python3 +import sys +import os + +# Conversion script for migrating appium capabilities to use the appium prefix. This is required for the new version of appium +# that is imported by the Java SDK 6.1.0 and later. +def update_appium_capabilities(filepath): + with open(filepath, 'r') as infile: + contents = infile.read() + capabilities = [ + "adbExecTimeout", + "adbPort", + "absoluteWebLocations", + "additionalWebviewBundleIds", + "allowDelayAdb", + "allowProvisioningDeviceRegistration", + "allowTestPackages", + "androidInstallTimeout", + "app", + "appActivity", + "appInstallStrategy", + "appPackage", + "appPushTimeout", + "appWaitActivity", + "appWaitDuration", + "appWaitForLaunch", + "appWaitPackage", + "autoAcceptAlerts", + "autoFillPasswords", + "autoGrantPermissions", + "autoLaunch", + "autoWebview", + "autoWebviewName", + "autoWebviewTimeout", + "automationName", + "avd", + "avdArgs", + "avdEnv", + "avdLaunchTimeout", + "avdReadyTimeout", + "buildToolsVersion", + "bundleId", + "calendarAccessAuthorized", + "calendarFormat", + "chromeLoggingPrefs", + "chromeOptions", + "chromedriverArgs", + "chromedriverChromeMappingFile", + "chromedriverDisableBuildCheck", + "chromedriverExecutable", + "chromedriverExecutableDir", + "chromedriverPort", + "chromedriverPorts", + "chromedriverUseSystemExecutable", + "clearDeviceLogsOnStart", + "clearSystemFiles", + "commandTimeouts", + "connectHardwareKeyboard", + "customSSLCert", + "derivedDataPath", + "deviceName", + "disableAutomaticScreenshots", + "disableSuppressAccessibilityService", + "disableWindowAnimation", + "dontStopAppOnReset", + "enableAsyncExecuteFromHttps", + "enablePerformanceLogging", + "enableWebviewDetailsCollection", + "enforceAppInstall", + "enforceFreshSimulatorCreation", + "ensureWebviewsHavePages", + "extractChromeAndroidPackageFromContextName", + "forceAppLaunch", + "forceSimulatorSoftwareKeyboardPresence", + "fullContextList", + "fullReset", + "gpsEnabled", + "hideKeyboard", + "ignoreHiddenApiPolicyError", + "includeDeviceCapsToSessionInfo", + "includeSafariInWebviews", + "injectedImageProperties", + "intentAction", + "intentCategory", + "intentFlags", + "iosInstallPause", + "iosSimulatorLogsPredicate", + "isHeadless", + "keepKeyChains", + "keyAlias", + "keyPassword", + "keychainPassword", + "keychainPath", + "keychainsExcludePatterns", + "keystorePassword", + "keystorePath", + "language", + "launchWithIDB", + "locale", + "localeScript", + "localizableStringsDir", + "logcatFilterSpecs", + "logcatFormat", + "maxTypingFrequency", + "mjpegScreenshotUrl", + "mjpegServerPort", + "mockLocationApp", + "nativeWebScreenshot", + "nativeWebTap", + "nativeWebTapStrict", + "networkSpeed", + "newCommandTimeout", + "noReset", + "noSign", + "optionalIntentArguments", + "orientation", + "otherApps", + "permissions", + "platformVersion", + "prebuiltWDAPath", + "printPageSourceOnFindFailure", + "processArguments", + "recreateChromeDriverSessions", + "reduceMotion", + "reduceTransparency", + "remoteAdbHost", + "remoteAppsCacheLimit", + "resetLocationService", + "resetOnSessionStartOnly", + "resultBundlePath", + "resultBundleVersion", + "safariAllowPopups", + "safariGarbageCollect", + "safariGlobalPreferences", + "safariIgnoreFraudWarning", + "safariIgnoreWebHostnames", + "safariInitialUrl", + "safariLogAllCommunication", + "safariLogAllCommunicationHexDump", + "safariOpenLinksInBackground", + "safariSocketChunkSize", + "safariWebInspectorMaxFrameLength", + "scaleFactor", + "screenshotQuality", + "shouldTerminateApp", + "shouldUseSingletonTestManager", + "showChromedriverLog", + "showIOSLog", + "showXcodeLog", + "shutdownOtherSimulators", + "simpleIsVisibleCheck", + "simulatorDevicesSetPath", + "simulatorPasteboardAutomaticSync", + "simulatorStartupTimeout", + "simulatorTracePointer", + "simulatorWindowCenter", + "skipDeviceInitialization", + "skipLogCapture", + "skipLogcatCapture", + "skipServerInstallation", + "skipUnlock", + "suppressKillServer", + "systemPort", + "timeZone", + "udid", + "uiautomator2ServerInstallTimeout", + "uiautomator2ServerLaunchTimeout", + "uiautomator2ServerReadTimeout", + "uninstallOtherPackages", + "unlockKey", + "unlockStrategy", + "unlockSuccessTimeout", + "unlockType", + "updatedWDABundleId", + "useJSONSource", + "useKeystore", + "useNativeCachingStrategy", + "useNewWDA", + "usePrebuiltWDA", + "usePreinstalledWDA", + "useSimpleBuildTest", + "useXctestrunFile", + "userProfile", + "waitForIdleTimeout", + "waitForQuiescence", + "wdaBaseUrl", + "wdaConnectionTimeout", + "wdaEventloopIdleDelay", + "wdaLaunchTimeout", + "wdaLocalPort", + "wdaStartupRetries", + "wdaStartupRetryInterval", + "webDriverAgentUrl", + "webkitResponseTimeout", + "webviewConnectRetries", + "webviewConnectTimeout", + "webviewDevtoolsPort", + "xcodeConfigFile", + "xcodeOrgId", + "xcodeSigningId" + ] + + for capability in capabilities: + if f"\"{capability}\"" in contents: + print(f"Updating capability: {capability} in {filepath}") + # Replace the capability with its Appium v6.0.0 equivalent + contents =contents.replace(f"\"{capability}\"", f"\"appium:{capability}\"") + with open(filepath, 'w') as outfile: + outfile.write(contents) + + +# main execution starts here +args_processed = 0 +for filepath in sys.argv[1:]: + args_processed = args_processed + 1 + if os.path.isfile(filepath) and filepath[-5:] == '.json': + update_appium_capabilities(filepath) + elif os.path.isdir(filepath): + for root, dirs, files in os.walk(filepath): + for path in files: + if path[-5:] == '.json': + print("Processing file: " + os.path.join(root, path)) + update_appium_capabilities(os.path.join(root, path)) + else: + print(filepath + ' is not a valid json file or directory.') + +if (args_processed == 0): + print("Usage: %s ]+") + print("Converts files from ") + print(" : relative or absolute path to a directory with .json or pom.xml files to convert") diff --git a/convert.py b/scripts/convert.py similarity index 100% rename from convert.py rename to scripts/convert.py