diff --git a/.github/workflows/e2eTests.yml b/.github/workflows/e2eTests.yml
index f00dfc20844..7d39bad7be3 100644
--- a/.github/workflows/e2eTests.yml
+++ b/.github/workflows/e2eTests.yml
@@ -73,7 +73,7 @@ jobs:
maven-version: 3.9.5
- name: Run tests
continue-on-error: true
- run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=2" "-DexecutionAddress=local" "-DtargetOperatingSystem=MAC" "-DtargetBrowserName=SAFARI" "-DgenerateAllureReportArchive=true" "-Dtest=${GLOBAL_TESTING_SCOPE}"
+ run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=2" "-DexecutionAddress=local" "-DtargetOperatingSystem=MAC" "-DtargetBrowserName=safari" "-DgenerateAllureReportArchive=true" "-Dtest=${GLOBAL_TESTING_SCOPE}"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
@@ -378,7 +378,7 @@ jobs:
maven-version: 3.9.5
- name: Run tests
continue-on-error: true
- run: mvn -e test "-DdefaultElementIdentificationTimeout=60" "-DretryMaximumNumberOfAttempts=2" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=ANDROID" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.platformVersion=13.0" "-DbrowserStack.deviceName=Google Pixel 7" "-DbrowserStack.appName=ApiDemos-debug.apk" "-DbrowserStack.appRelativeFilePath=src/test/resources/testDataFiles/apps/ApiDemos-debug.apk" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*ndroidBasic.*]"
+ run: mvn -e test "-DdefaultElementIdentificationTimeout=60" "-DretryMaximumNumberOfAttempts=2" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=android" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.platformVersion=13.0" "-DbrowserStack.deviceName=Google Pixel 7" "-DbrowserStack.appName=ApiDemos-debug.apk" "-DbrowserStack.appRelativeFilePath=src/test/resources/testDataFiles/apps/ApiDemos-debug.apk" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*ndroidBasic.*]"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
@@ -415,7 +415,7 @@ jobs:
maven-version: 3.9.5
- name: Run tests
continue-on-error: true
- run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=IOS" "-Dmobile_automationName=XCuiTest" "-DbrowserStack.osVersion=16" "-DbrowserStack.deviceName=iPhone 14" "-Dmobile_browserName=SAFARI" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
+ run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=iOS" "-Dmobile_automationName=XCuiTest" "-DbrowserStack.osVersion=16" "-DbrowserStack.deviceName=iPhone 14" "-Dmobile_browserName=safari" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
@@ -452,7 +452,7 @@ jobs:
maven-version: 3.9.5
- name: Run tests
continue-on-error: true
- run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=ANDROID" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.osVersion=13.0" "-DbrowserStack.deviceName=Samsung Galaxy S23" "-Dmobile_browserName=CHROME" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
+ run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=android" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.osVersion=13.0" "-DbrowserStack.deviceName=Samsung Galaxy S23" "-Dmobile_browserName=chrome" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
@@ -489,7 +489,7 @@ jobs:
maven-version: 3.9.5
- name: Run tests
continue-on-error: true
- run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=ANDROID" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.osVersion=13.0" "-DbrowserStack.deviceName=Samsung Galaxy S23" "-Dmobile_browserName=samsung" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
+ run: mvn -e test "-DdefaultElementIdentificationTimeout=5" "-DretryMaximumNumberOfAttempts=1" "-DexecutionAddress=browserstack" "-DtargetOperatingSystem=android" "-Dmobile_automationName=UIAutomator2" "-DbrowserStack.osVersion=13.0" "-DbrowserStack.deviceName=Samsung Galaxy S23" "-Dmobile_browserName=samsung" "-DbrowserStack.appName=" "-DbrowserStack.appRelativeFilePath=" "-DbrowserStack.appUrl=" "-DgenerateAllureReportArchive=true" "-Dtest=%regex[.*MobileWebTest.*]"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
diff --git a/pom.xml b/pom.xml
index cc44a337053..3390288041f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -107,7 +107,7 @@
org.seleniumhq.selenium
selenium-java
- 4.22.0
+ 4.23.0
diff --git a/src/main/java/com/shaft/driver/internal/DriverFactory/SynchronizationManager.java b/src/main/java/com/shaft/driver/internal/DriverFactory/SynchronizationManager.java
index 382ea51727c..5a720abc074 100644
--- a/src/main/java/com/shaft/driver/internal/DriverFactory/SynchronizationManager.java
+++ b/src/main/java/com/shaft/driver/internal/DriverFactory/SynchronizationManager.java
@@ -4,7 +4,6 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Browser;
import org.openqa.selenium.support.ui.FluentWait;
-import org.openqa.selenium.support.ui.Wait;
import java.time.Duration;
import java.util.ArrayList;
@@ -18,11 +17,11 @@ public SynchronizationManager(WebDriver driver) {
this.driver = driver;
}
- public Wait> fluentWait() {
+ public FluentWait> fluentWait() {
return fluentWait(false);
}
- public Wait> fluentWait(boolean isValidToCheckForVisibility) {
+ public FluentWait> fluentWait(boolean isValidToCheckForVisibility) {
return new FluentWait<>(driver)
.withTimeout(Duration.ofSeconds((long) (SHAFT.Properties.timeouts.defaultElementIdentificationTimeout())))
.pollingEvery(Duration.ofMillis(ELEMENT_IDENTIFICATION_POLLING_DELAY))
diff --git a/src/main/java/com/shaft/gui/element/TouchActions.java b/src/main/java/com/shaft/gui/element/TouchActions.java
index 4a18e762971..6e61679e190 100644
--- a/src/main/java/com/shaft/gui/element/TouchActions.java
+++ b/src/main/java/com/shaft/gui/element/TouchActions.java
@@ -546,6 +546,8 @@ public TouchActions swipeElementIntoView(By scrollableElementLocator, By targetE
}
}
elementActionsHelper.passAction(driverFactoryHelper.getDriver(), targetElementLocator, Thread.currentThread().getStackTrace()[1].getMethodName(), null, null, null);
+ } catch (UnsupportedCommandException unsupportedCommandException) {
+ throw unsupportedCommandException;
} catch (Exception e) {
elementActionsHelper.failAction(driverFactoryHelper.getDriver(), targetElementLocator, e);
}
@@ -735,13 +737,13 @@ private boolean attemptW3cCompliantActionsScroll(SwipeDirection swipeDirection,
scrollParameters.putAll(ImmutableMap.of(
"direction", swipeDirection.toString()
));
- canScrollMore = (Boolean) ((JavascriptExecutor) androidDriver).executeScript("scrollGesture", scrollParameters);
+ canScrollMore = (Boolean) androidDriver.executeScript("mobile:scrollGesture", scrollParameters);
} else if (driverFactoryHelper.getDriver() instanceof IOSDriver iosDriver) {
scrollParameters.putAll(ImmutableMap.of(
"direction", swipeDirection.toString()
));
//http://appium.github.io/appium-xcuitest-driver/4.16/execute-methods/#mobile-scroll
- var ret = ((JavascriptExecutor) iosDriver).executeScript("scroll", scrollParameters);
+ var ret = iosDriver.executeScript("mobile:scroll", scrollParameters);
canScrollMore = ret == null || (Boolean) ret;
}
var logMessageAfter = "Attempted to scroll using these parameters: \"" + scrollParameters + "\"";
diff --git a/src/main/java/com/shaft/gui/element/internal/ElementActionsHelper.java b/src/main/java/com/shaft/gui/element/internal/ElementActionsHelper.java
index b1be8bd7424..7741b8e21c6 100644
--- a/src/main/java/com/shaft/gui/element/internal/ElementActionsHelper.java
+++ b/src/main/java/com/shaft/gui/element/internal/ElementActionsHelper.java
@@ -38,6 +38,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicInteger;
@SuppressWarnings({"UnusedReturnValue"})
public class ElementActionsHelper {
@@ -51,18 +52,18 @@ public ElementActionsHelper(boolean isSilent) {
}
public int waitForElementPresenceWithReducedTimeout(WebDriver driver, By elementLocator) {
- var defaultElementIdentificationTimeout = SHAFT.Properties.timeouts.defaultElementIdentificationTimeout();
- SHAFT.Properties.timeouts.set().defaultElementIdentificationTimeout(0.3); //this is used for faster mobile native scrolling. default for ios is 200 and for android is 250, this covers both
- List