From 692f03eb3f06c9bb368769c78a419f15ad4f1d6d Mon Sep 17 00:00:00 2001 From: Aliaksej Mialeshka Date: Tue, 27 Jan 2026 16:08:00 +0100 Subject: [PATCH 1/2] Update Selenium to v.4.40.0 +semver: breaking - Fix javadocs issues - Update other plugins and dependencies - Update license year - Fix some test assertions - Update settings and pipeline to use appium3 --- LICENSE | 2 +- azure-pipelines.yml | 6 +- pom.xml | 22 ++--- .../elements/interfaces/IElementFactory.java | 89 ++++++++++--------- .../screens/screenfactory/ScreenType.java | 6 +- src/main/resources/settings.json | 2 +- .../java/integration/DeviceSettingsTest.java | 10 +-- .../samples/android/web/WebTextBoxTest.java | 10 +-- .../resources/settings.androidwebsession.json | 4 +- src/test/resources/settings.json | 6 +- 10 files changed, 80 insertions(+), 77 deletions(-) diff --git a/LICENSE b/LICENSE index 828d2a6..0237da3 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Aquality Automation + Copyright 2026 Aquality Automation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index df0ab23..8fa2828 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,7 +94,7 @@ jobs: echo "Emulator started" echo "Installing Appium" - npm install -g appium@2 + npm install -g appium@3 ln -fs /usr/local/lib/node_modules/appium/build/lib/main.js /usr/local/bin/appium chmod +x /usr/local/bin/appium export PATH=$PATH:/usr/local/bin/appium @@ -102,7 +102,7 @@ jobs: echo "Appium installed" echo "Installing UIA2 driver" - appium driver install uiautomator2@4 + appium driver install uiautomator2@6 appium driver list echo "UIA2 driver installed" @@ -122,7 +122,7 @@ jobs: displayName: 'Start Appium server' inputs: script: | - appium --allow-insecure chromedriver_autodownload --base-path /wd/hub & + appium --allow-insecure uiautomator2:chromedriver_autodownload --base-path /wd/hub & echo "Appium server started" condition: eq(variables['isRemote'], 'true') diff --git a/pom.xml b/pom.xml index f676780..d56faf8 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 11 11 @@ -69,7 +69,7 @@ org.jacoco jacoco-maven-plugin - 0.8.12 + 0.8.14 pre-unit-test @@ -97,7 +97,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.7.1 + 3.8.0 @@ -115,7 +115,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.4.0 attach-sources @@ -128,7 +128,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.12.0 11 @@ -144,7 +144,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.7 + 3.2.8 sign-artifacts @@ -164,7 +164,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.8.0 + 0.10.0 true central @@ -184,7 +184,7 @@ com.github.aquality-automation aquality-selenium-core - 4.9.0 + 4.12.0 @@ -196,21 +196,21 @@ org.testng testng - 7.10.2 + 7.12.0 test org.apache.commons commons-lang3 - 3.18.0 + 3.20.0 test commons-io commons-io - 2.19.0 + 2.21.0 test diff --git a/src/main/java/aquality/appium/mobile/elements/interfaces/IElementFactory.java b/src/main/java/aquality/appium/mobile/elements/interfaces/IElementFactory.java index 9769464..da263ae 100644 --- a/src/main/java/aquality/appium/mobile/elements/interfaces/IElementFactory.java +++ b/src/main/java/aquality/appium/mobile/elements/interfaces/IElementFactory.java @@ -13,156 +13,156 @@ public interface IElementFactory extends aquality.selenium.core.elements.interfaces.IElementFactory { /** - * Creates element that implements IButton interface. + * Creates an element that implements IButton interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements IButton interface + * @return Instance of an element that implements IButton interface */ default IButton getButton(By locator, String name) { return getButton(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements IButton interface. + * Creates an element that implements IButton interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements IButton interface + * @return Instance of an element that implements IButton interface */ default IButton getButton(By locator, String name, ElementState state) { return get(ElementType.BUTTON, locator, name, state); } /** - * Creates element that implements ICheckBox interface. + * Creates an element that implements ICheckBox interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements ICheckBox interface + * @return Instance of an element that implements ICheckBox interface */ default ICheckBox getCheckBox(By locator, String name) { return getCheckBox(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements ICheckBox interface. + * Creates an element that implements ICheckBox interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements ICheckBox interface + * @return Instance of an element that implements ICheckBox interface */ default ICheckBox getCheckBox(By locator, String name, ElementState state) { return get(ElementType.CHECKBOX, locator, name, state); } /** - * Creates element that implements IComboBox interface. + * Creates an element that implements IComboBox interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements IComboBox interface + * @return Instance of an element that implements IComboBox interface */ default IComboBox getComboBox(By locator, String name) { return getComboBox(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements IComboBox interface. + * Creates an element that implements IComboBox interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements IComboBox interface + * @return Instance of an element that implements IComboBox interface */ default IComboBox getComboBox(By locator, String name, ElementState state) { return get(ElementType.COMBOBOX, locator, name, state); } /** - * Creates element that implements ILabel interface. + * Creates an element that implements ILabel interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements ILabel interface + * @return Instance of an element that implements ILabel interface */ default ILabel getLabel(By locator, String name) { return getLabel(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements ILabel interface. + * Creates an element that implements ILabel interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements ILabel interface + * @return Instance of an element that implements ILabel interface */ default ILabel getLabel(By locator, String name, ElementState state) { return get(ElementType.LABEL, locator, name, state); } /** - * Creates element that implements ILink interface. + * Creates an element that implements ILink interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements ILink interface + * @return Instance of an element that implements ILink interface */ default ILink getLink(By locator, String name) { return getLink(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements ILink interface. + * Creates an element that implements ILink interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements ILink interface + * @return Instance of an element that implements ILink interface */ default ILink getLink(By locator, String name, ElementState state) { return get(ElementType.LINK, locator, name, state); } /** - * Creates element that implements IRadioButton interface. + * Creates an element that implements IRadioButton interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements IRadioButton interface + * @return Instance of an element that implements IRadioButton interface */ default IRadioButton getRadioButton(By locator, String name) { return getRadioButton(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements IRadioButton interface. + * Creates an element that implements IRadioButton interface. * * @param locator Element locator * @param name Element name * @param state Element state - * @return Instance of element that implements IRadioButton interface + * @return Instance of an element that implements IRadioButton interface */ default IRadioButton getRadioButton(By locator, String name, ElementState state) { return get(ElementType.RADIOBUTTON, locator, name, state); } /** - * Creates element that implements ITextBox interface. + * Creates an element that implements ITextBox interface. * * @param locator Element locator * @param name Element name - * @return Instance of element that implements ITextBox interface + * @return Instance of an element that implements ITextBox interface */ default ITextBox getTextBox(By locator, String name) { return getTextBox(locator, name, ElementState.DISPLAYED); } /** - * Creates element that implements ITextBox interface. + * Creates an element that implements ITextBox interface. * * @param locator Element locator * @param name Element name @@ -174,27 +174,27 @@ default ITextBox getTextBox(By locator, String name, ElementState state) { } /** - * Create element according to passed parameters. + * Create an element according to passed parameters. * * @param type Type of the element to be obtained * @param locator Locator of the target element. * @param name Name of the target element. * @param state Visibility state of the target element. * @param Type of the target element. - * @return Instance of custom element. + * @return Instance of a custom element. */ default T get(ElementType type, By locator, String name, ElementState state) { return getCustomElement(type.getClazz(), locator, name, state); } /** - * Create element according to passed parameters. + * Create an element according to passed parameters. * * @param type Type of the element to be obtained * @param locator Locator of the target element. * @param name Name of the target element. * @param Type of the target element. - * @return Instance of custom element. + * @return Instance of a custom element. */ default T get(ElementType type, By locator, String name) { return get(type, locator, name, ElementState.DISPLAYED); @@ -209,7 +209,7 @@ default T get(ElementType type, By locator, String name) { * @param parentElement parent element for relative search of child element * @param state visibility state of target elements * @param Type of the target element. - * @return found child element + * @return found a child element */ default T findChildElement(IElement parentElement, By childLoc, String name, ElementType type, ElementState state) { @@ -217,9 +217,9 @@ default T findChildElement(IElement parentElement, By child } /** - * Finds child element in any state by its locator relative to parent element. + * Finds a child element in any state by its locator relative to parent element. * - * @param childLoc Locator of child element relative to its parent. + * @param childLoc Locator of a child element relative to its parent. * @param type Type of the element to be obtained * @param name Child element name. * @param parentElement Parent element for relative search of child element. @@ -232,12 +232,12 @@ default T findChildElement(IElement parentElement, By child } /** - * Finds child element by its locator relative to parent element. + * Finds a child element by its locator relative to a parent element. * - * @param childLoc Locator of child element relative to its parent. + * @param childLoc Locator of a child element relative to its parent. * @param type Type of the element to be obtained * @param parentElement Parent element for relative search of child element. - * @param state Visibility state of child element. + * @param state Visibility state of a child element. * @param Type of the target element. * @return Child element. */ @@ -247,9 +247,9 @@ default T findChildElement(IElement parentElement, By child } /** - * Finds child element existing in any state by its locator relative to parent element. + * Finds a child element existing in any state by its locator relative to parent element. * - * @param childLoc Locator of child element relative to its parent. + * @param childLoc Locator of a child element relative to its parent. * @param type Type of the element to be obtained * @param parentElement Parent element for relative search of child element. * @param Type of the target element. @@ -260,13 +260,14 @@ default T findChildElement(IElement parentElement, By child } /** - * Find list of elements + * Find a list of elements * * @param locator Elements selector * @param name elements' name. * @param type Type of elements to be obtained * @param state visibility state of target elements * @param count type of expected count of elements + * @param Type of the target element. * @return list of elements */ default List findElements(By locator, String name, ElementType type, ElementsCount count, @@ -290,7 +291,7 @@ default List findElements(By locator, ElementType type, } /** - * Find list of elements. + * Find a list of elements. * * @param locator Elements selector. * @param type Type of elements to be obtained @@ -302,7 +303,7 @@ default List findElements(By locator, ElementType type) } /** - * Find list of elements. + * Find a list of elements. * * @param locator Elements selector. * @param type Type of elements to be obtained @@ -316,7 +317,7 @@ default List findElements(By locator, String name, Eleme } /** - * Find list of elements. + * Find a list of elements. * * @param locator Elements selector. * @param name Child element name. @@ -329,7 +330,7 @@ default List findElements(By locator, String name, Eleme } /** - * Find list of elements. + * Find a list of elements. * * @param locator Elements selector. * @param type Type of elements to be obtained diff --git a/src/main/java/aquality/appium/mobile/screens/screenfactory/ScreenType.java b/src/main/java/aquality/appium/mobile/screens/screenfactory/ScreenType.java index cd4f1ec..8d1dcd3 100644 --- a/src/main/java/aquality/appium/mobile/screens/screenfactory/ScreenType.java +++ b/src/main/java/aquality/appium/mobile/screens/screenfactory/ScreenType.java @@ -8,14 +8,16 @@ import java.lang.annotation.Target; /** - * Attribute that identifies platform of screen. + * Attribute that identifies a platform of the screen. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface ScreenType { /** - * Name of platform that screen relates to. + * Name of a platform that screen relates to. + * + * @return platform name */ PlatformName platform(); } diff --git a/src/main/resources/settings.json b/src/main/resources/settings.json index 71111e0..6b486ea 100644 --- a/src/main/resources/settings.json +++ b/src/main/resources/settings.json @@ -23,7 +23,7 @@ }, "localServiceSettings": { "arguments": { - "--allow-insecure": "chromedriver_autodownload" + "--allow-insecure": "uiautomator2:chromedriver_autodownload" }, "capabilities": { } diff --git a/src/test/java/integration/DeviceSettingsTest.java b/src/test/java/integration/DeviceSettingsTest.java index 7b6f9ba..0d464e9 100644 --- a/src/test/java/integration/DeviceSettingsTest.java +++ b/src/test/java/integration/DeviceSettingsTest.java @@ -36,12 +36,12 @@ public void testShouldBePossibleToUseDifferentDevicesProfiles() { System.setProperty(DEVICES_PROFILE_PROPERTY_KEY, "test"); IDeviceSettings testDeviceSettings = new DeviceSettings("iPhone_11"); Capabilities testCapabilities = testDeviceSettings.getCapabilities(); - Assert.assertEquals("iPhone 11 test", testCapabilities.getCapability("deviceName")); + Assert.assertEquals(testCapabilities.getCapability("deviceName"), "iPhone 11 test"); System.clearProperty(DEVICES_PROFILE_PROPERTY_KEY); IDeviceSettings deviceSettings = new DeviceSettings("iPhone_11"); Capabilities capabilities = deviceSettings.getCapabilities(); - Assert.assertEquals("iPhone 11", capabilities.getCapability("deviceName")); + Assert.assertEquals(capabilities.getCapability("deviceName"), "iPhone 11"); } @Test @@ -49,7 +49,7 @@ public void testShouldBePossibleToGetDefaultDeviceSettingsForIosPlatform() { System.setProperty(PLATFORM_NAME_PROPERTY_KEY, "ios"); System.setProperty(DEVICE_KEY_PROPERTY_KEY, "iPhone_11"); Capabilities capabilities = AqualityServices.get(IApplicationProfile.class).getDriverSettings().getCapabilities(); - Assert.assertEquals("iPhone 11", capabilities.getCapability("deviceName")); + Assert.assertEquals(capabilities.getCapability("deviceName"), "iPhone 11"); } @Test @@ -57,7 +57,7 @@ public void testShouldBePossibleToGetDefaultDeviceSettingsForAndroidPlatform() { System.setProperty(PLATFORM_NAME_PROPERTY_KEY, "android"); System.setProperty(DEVICE_KEY_PROPERTY_KEY, "Nexus"); Capabilities capabilities = AqualityServices.get(IApplicationProfile.class).getDriverSettings().getCapabilities(); - Assert.assertEquals("Nexus", capabilities.getCapability("deviceName")); + Assert.assertEquals(capabilities.getCapability("deviceName"), "Nexus"); } @Test @@ -65,7 +65,7 @@ public void testShouldBePossibleToOverrideDefaultDevice() { System.setProperty(PLATFORM_NAME_PROPERTY_KEY, "android"); System.setProperty(DEVICE_KEY_PROPERTY_KEY, "Samsung_Galaxy"); Capabilities capabilities = AqualityServices.get(IApplicationProfile.class).getDriverSettings().getCapabilities(); - Assert.assertEquals("Samsung Galaxy", capabilities.getCapability("deviceName")); + Assert.assertEquals(capabilities.getCapability("deviceName"), "Samsung Galaxy"); } @AfterClass diff --git a/src/test/java/samples/android/web/WebTextBoxTest.java b/src/test/java/samples/android/web/WebTextBoxTest.java index c031f5b..948d08a 100644 --- a/src/test/java/samples/android/web/WebTextBoxTest.java +++ b/src/test/java/samples/android/web/WebTextBoxTest.java @@ -26,19 +26,19 @@ public void testTextBoxInteraction() { btnCloseBanner.click(); } txbSearch.type(VALUE_TO_SUBMIT); - Assert.assertEquals(VALUE_TO_SUBMIT, txbSearch.getValue(), "Submitted value should match to expected"); + Assert.assertEquals(txbSearch.getValue(), VALUE_TO_SUBMIT, "Submitted value should match to expected"); txbSearch.clear(); - Assert.assertEquals("", txbSearch.getValue(), "Value should be cleared"); + Assert.assertEquals(txbSearch.getValue(), "", "Value should be cleared"); txbSearch.click(); checkUnfocus(); txbSearch.focus(); Assert.assertTrue(isKeyboardShown(true), "Keyboard should be shown when focus successful"); txbSearch.typeSecret(VALUE_TO_SUBMIT); - Assert.assertEquals(VALUE_TO_SUBMIT, txbSearch.getValue(), "Submitted value should match to expected"); + Assert.assertEquals(txbSearch.getValue(), VALUE_TO_SUBMIT, "Submitted value should match to expected"); txbSearch.clearAndType(VALUE_TO_SUBMIT); - Assert.assertEquals(VALUE_TO_SUBMIT, txbSearch.getValue(), "Submitted value should match to expected"); + Assert.assertEquals(txbSearch.getValue(), VALUE_TO_SUBMIT, "Submitted value should match to expected"); txbSearch.clearAndTypeSecret(VALUE_TO_SUBMIT); - Assert.assertEquals(VALUE_TO_SUBMIT, txbSearch.getValue(), "Submitted value should match to expected"); + Assert.assertEquals(txbSearch.getValue(), VALUE_TO_SUBMIT, "Submitted value should match to expected"); txbSearch.sendKeys(Keys.ENTER); Assert.assertTrue(txbSearch.state().waitForNotDisplayed(), "text field should disappear after the submit"); } diff --git a/src/test/resources/settings.androidwebsession.json b/src/test/resources/settings.androidwebsession.json index 4435d99..d974d11 100644 --- a/src/test/resources/settings.androidwebsession.json +++ b/src/test/resources/settings.androidwebsession.json @@ -1,6 +1,6 @@ { "platformName": "android", - "isRemote": true, + "isRemote": false, "remoteConnectionUrl": "http://127.0.0.1:4723/wd/hub", "screensLocation": "integration", "driverSettings": { @@ -21,7 +21,7 @@ }, "localServiceSettings": { "arguments": { - "--allow-insecure": "chromedriver_autodownload" + "--allow-insecure": "uiautomator2:chromedriver_autodownload" }, "capabilities": { } diff --git a/src/test/resources/settings.json b/src/test/resources/settings.json index 3c4de1a..343c733 100644 --- a/src/test/resources/settings.json +++ b/src/test/resources/settings.json @@ -1,6 +1,6 @@ { "platformName": "android", - "isRemote": true, + "isRemote": false, "remoteConnectionUrl": "http://127.0.0.1:4723/wd/hub", "screensLocation": "integration", "driverSettings": { @@ -26,14 +26,14 @@ }, "localServiceSettings": { "arguments": { - "--allow-insecure": "chromedriver_autodownload" + "--allow-insecure": "uiautomator2:chromedriver_autodownload" }, "capabilities": { } }, "timeouts": { "timeoutImplicit": 0, - "timeoutCondition": 15, + "timeoutCondition": 10, "timeoutPollingInterval": 300, "timeoutCommand": 120 }, From cc375d416746031b9f7b5a679aa52f616564a40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alaksiej=20Miale=C5=A1ka?= Date: Tue, 27 Jan 2026 17:39:46 +0100 Subject: [PATCH 2/2] Use Maven@4 task --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8fa2828..2c9670b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -126,7 +126,7 @@ jobs: echo "Appium server started" condition: eq(variables['isRemote'], 'true') - - task: Maven@3 + - task: Maven@4 displayName: 'Run tests' inputs: mavenPomFile: 'pom.xml' @@ -134,7 +134,7 @@ jobs: publishJUnitResults: true testResultsFiles: '**/surefire-reports/TEST-*.xml' javaHomeOption: 'JDKVersion' - jdkVersionOption: '11' + jdkVersionOption: '1.11' mavenVersionOption: 'Default' mavenAuthenticateFeed: false effectivePomSkip: false