- *
+ *
* @see DbUnitExModule#insertDataSet(IDataSet)
- *
+ *
* @param dataSet
* a DBUnit dataset object
* @return {@link #self()}
@@ -146,16 +146,16 @@ public SELF data(
/**
* Runs specified SQL-DML batch.
- *
+ *
* @param sql
* the SQL statement to execute
* @param params
* an array of query replacement parameters, where each row in
* this array is one set of batch replacement values
- *
+ *
* @see QueryRunner#batch(String, Object[][])
* @return {@link #self()}
- *
+ *
* @throws IllegalArgumentException
* if the array of replacement parameters is empty
*/
@@ -177,7 +177,7 @@ public SELF data(
/**
* Does nothing -- just initializes the JGiven infrastructure.
- *
+ *
* @return {@link #self()}
*/
public SELF nothing() {
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/steps/GenericVerifications.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/steps/GenericVerifications.java
index 98bc075c11..fe148fa334 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/steps/GenericVerifications.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/steps/GenericVerifications.java
@@ -37,7 +37,6 @@
import org.unitils.database.*;
import com.google.common.collect.*;
-import com.jayway.jsonassert.*;
import com.tngtech.jgiven.annotation.*;
import dev.aherscu.qa.jgiven.commons.formatters.*;
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/DatabaseTest.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/DatabaseTest.java
index 36bf5cdb2f..f3b53c4253 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/DatabaseTest.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/DatabaseTest.java
@@ -23,7 +23,7 @@
/**
* Database testing annotation.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/MissingCoverage.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/MissingCoverage.java
index 534d3b9d29..9477a86805 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/MissingCoverage.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/MissingCoverage.java
@@ -21,7 +21,7 @@
/**
* Missing coverage.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/SelfTest.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/SelfTest.java
index bddd23b40a..811b352041 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/SelfTest.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/tags/SelfTest.java
@@ -21,7 +21,7 @@
/**
* Self test tagging annotation.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AbstractConfigurableDataSourceFactory.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AbstractConfigurableDataSourceFactory.java
index 8e3ed42cf0..cb3c258bcd 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AbstractConfigurableDataSourceFactory.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AbstractConfigurableDataSourceFactory.java
@@ -25,7 +25,7 @@
/**
* Data source factory that its configuration can be overridden via system
* properties.
- *
+ *
* @author aherscu
*
*/
@@ -57,8 +57,8 @@ public final void init(final Properties configuration,
config = new CustomDatabaseConfiguration(
new DatabaseConfigurationsFactory(
new Configuration(configuration))
- .create()
- .getDatabaseConfiguration(databaseName));
+ .create()
+ .getDatabaseConfiguration(databaseName));
}
/**
@@ -73,8 +73,8 @@ public final void init(final Properties configuration) {
config = new CustomDatabaseConfiguration(
new DatabaseConfigurationsFactory(
new Configuration(configuration))
- .create()
- .getDatabaseConfiguration());
+ .create()
+ .getDatabaseConfiguration());
}
/**
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshot.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshot.java
index 925ccd10a7..6db6e62575 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshot.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshot.java
@@ -19,7 +19,7 @@
/**
* Screenshot directive annotation.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshotAspect.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshotAspect.java
index 885b60a216..c5e077cf25 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshotAspect.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/AttachesScreenshotAspect.java
@@ -53,7 +53,7 @@ public class AttachesScreenshotAspect {
/**
* Attaches a screenshot even if the advised method failed.
- *
+ *
* @param thisJoinPoint
* advised join point
* @return forwarded from advised method
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/BeanUtilsConverter.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/BeanUtilsConverter.java
index 0dfad5a64d..46113bbc70 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/BeanUtilsConverter.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/BeanUtilsConverter.java
@@ -21,7 +21,7 @@
/**
* Provides the means to specify a {@link Converter} for the annotated type.
- *
+ *
*
* EXPERIMENTAL
*
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/CallableWithDescription.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/CallableWithDescription.java
index 99b3ad4996..2a146bd667 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/CallableWithDescription.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/CallableWithDescription.java
@@ -22,10 +22,10 @@
/**
* Wraps a {@link Callable} with a description.
- *
+ *
* @param
* the type of output
- *
+ *
* @author Adrian Herscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DbUnitExModule.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DbUnitExModule.java
index ffc536f727..8364c26ea6 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DbUnitExModule.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DbUnitExModule.java
@@ -26,7 +26,7 @@
/**
* Provides data insertion method using the default dataset factory.
- *
+ *
*
* In order to use this class during runtime, the {@code unitils.properties}
* file of the project shall contain
@@ -69,7 +69,7 @@ public DbUnitExModule() {
/**
* Creates a multi-schema data-set from given DbUnit dataset file.
- *
+ *
* @param dataSetFile
* The test data set, not null
* @return the data-set
@@ -81,7 +81,7 @@ public MultiSchemaDataSet createDataSet(final File dataSetFile) {
/**
* Loads the given dataset into the default schema of the database, using
* the default load strategy.
- *
+ *
* @param dataSet
* dataset that is inserted in the database
*/
@@ -92,7 +92,7 @@ public void insertDataSet(final IDataSet dataSet) {
/**
* Loads the given dataset into the default schema of the database, using a
* specified load strategy.
- *
+ *
* @param dataSet
* dataset that is inserted in the database
* @param dataSetLoadStrategy
@@ -115,7 +115,7 @@ public void insertDataSet(
/**
* Loads the given dataset into the default schema of the database, using
* the default load strategy.
- *
+ *
* @param multiSchemaDataSet
* multi-schema dataset that is inserted in the database
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DesiredCapabilitiesEx.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DesiredCapabilitiesEx.java
index b17c5dc6e6..86a74e5eb2 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DesiredCapabilitiesEx.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/DesiredCapabilitiesEx.java
@@ -67,7 +67,7 @@ public DesiredCapabilitiesEx with(
/**
* Chains a {@code true} capability.
- *
+ *
* @param key
* the capability to chain
* @return chained capabilities, on new set of capabilities
@@ -113,7 +113,7 @@ public DesiredCapabilitiesEx withAdded(
return with(key,
requireNonNull(getCapability(key),
"capability does not exist")
- .toString()
+ .toString()
+ value);
}
}
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/FunctionWithDescription.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/FunctionWithDescription.java
index 1e5374ed0d..18bb32f9bd 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/FunctionWithDescription.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/FunctionWithDescription.java
@@ -22,13 +22,13 @@
/**
* Wraps a {@link Function} with a description.
- *
+ *
* @param
* the type of input
*
* @param
* the type of output
- *
+ *
* @author Adrian Herscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/HikariPoolingDataSourceFactory.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/HikariPoolingDataSourceFactory.java
index 625575f264..c978544330 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/HikariPoolingDataSourceFactory.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/HikariPoolingDataSourceFactory.java
@@ -31,13 +31,13 @@
* pooling used by
* Unitils'
* {@link DatabaseModule}.
- *
+ *
*
* This implementation uses
* HikariCP as its
* connection pooling library.
*
- *
+ *
*
* Adapted from {@link PropertiesDataSourceFactory}.
*
@@ -72,7 +72,7 @@ public final DataSource createDataSource() {
/**
* Override to customize the connection timeout.
- *
+ *
* @return the configured connection timeout; by default 30,000 ms
* @see HikariConfig#setConnectionTimeout(long)
*/
@@ -83,7 +83,7 @@ protected long connectionTimeout() {
/**
* Override to customize the idle timeout.
- *
+ *
* @return the configured idle timeout; by default 600,000 ms (10 minutes)
* @see HikariConfig#setIdleTimeout(long)
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/LoggingAspect.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/LoggingAspect.java
index fdf86f8921..dea970ff43 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/LoggingAspect.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/LoggingAspect.java
@@ -59,8 +59,8 @@ public Object aroundStepMethod(
stream(isNull(thisJoinPoint.getArgs())
? new Object[] {}
: thisJoinPoint.getArgs())
- .map(arg -> Objects.toString(arg, "null"))
- .collect(joining(COMMA, "[", "]")));
+ .map(arg -> Objects.toString(arg, "null"))
+ .collect(joining(COMMA, "[", "]")));
val retval = thisJoinPoint.proceed(thisJoinPoint.getArgs());
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MayAttachScreenshots.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MayAttachScreenshots.java
index 6fcbd122ed..9ddd249789 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MayAttachScreenshots.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MayAttachScreenshots.java
@@ -20,12 +20,12 @@
/**
* Use to mark a JGiven stage that may attach screenshots.
- *
+ *
* @param
* type of JGiven stage
*
* @see AttachesScreenshot
- *
+ *
* @author Adrian Herscu
*
*/
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MetricReporterSuiteListener.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MetricReporterSuiteListener.java
index b08685fc5e..5474c34c0c 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MetricReporterSuiteListener.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/MetricReporterSuiteListener.java
@@ -43,12 +43,12 @@
* CSV files are written to directory as specified via {@code target-directory}
* parameter. If this parameter is not specified, then {@code target} is
* assumed.
- *
+ *
*
* If {@code metric-report-interval-ms} parameter is specified, then plots the
* accumulated metrics to console every so milliseconds.
*
- *
+ *
*
* To be used via {@code testng.xml}; see
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.~java
similarity index 99%
rename from qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.java
rename to qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.~java
index f3d45f9e0c..fc713b9a25 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/RemoteWebDriverHttpClientAspect.~java
@@ -50,7 +50,7 @@ public class RemoteWebDriverHttpClientAspect implements ISuiteListener {
*
* @param thisJoinPoint
* the execution
- *
+ *
* @return the {@link HttpResponse}
* @throws Throwable
* any of below
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/Root.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/Root.java
index ea26033eb5..fc0f3449b2 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/Root.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/Root.java
@@ -22,11 +22,11 @@
/**
* Annotation bound to {@link Locale#ROOT} locale.
- *
+ *
* @see
* Storing translations in source code
- *
+ *
* @author aherscu
*/
@Target(ElementType.METHOD)
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestEx.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestEx.java
index 13c9bb7d23..8cc1619c52 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestEx.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestEx.java
@@ -29,7 +29,7 @@
* This is a complete replacement of
* {@link com.tngtech.jgiven.testng.ScenarioTest} in order to use
* {@link ScenarioTestListenerEx}.
- *
+ *
* @param
* type of given stage
* @param
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestListenerEx.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestListenerEx.java
index 8814289e09..8eadfe8c5a 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestListenerEx.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/ScenarioTestListenerEx.java
@@ -18,9 +18,11 @@
import static dev.aherscu.qa.jgiven.commons.utils.WebDriverEx.*;
import static dev.aherscu.qa.testing.utils.StringUtilsExtensions.*;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.*;
+import static io.appium.java_client.remote.options.SupportsPlatformVersionOption.*;
import static java.util.Objects.*;
import static lombok.AccessLevel.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.util.*;
import java.util.stream.*;
@@ -71,14 +73,14 @@ private static Stream> reportModelsFor(
final ITestContext context) {
return ((Map) context
.getAttribute(REPORT_MODELS_ATTRIBUTE))
- .entrySet()
+ .entrySet()
+ .stream()
+ .filter(reportModelEntry -> ((TestRunner) context)
+ .getTestClasses()
.stream()
- .filter(reportModelEntry -> ((TestRunner) context)
- .getTestClasses()
- .stream()
- .map(IClass::getName)
- .anyMatch(testClassName -> testClassName.equals(
- reportModelEntry.getKey())));
+ .map(IClass::getName)
+ .anyMatch(testClassName -> testClassName.equals(
+ reportModelEntry.getKey())));
}
private static void reportRetries(
@@ -95,7 +97,7 @@ private static void reportRetries(
TestRetryAnalyzer.retryCounters
.get(qualifiedMethodName)
.toString())
- .setPrependType(true);
+ .setPrependType(true);
reportModel.addTag(retriesTag);
scenario.addTag(retriesTag);
@@ -108,22 +110,22 @@ private static void reportSession(
final WebDriverSessionInfo session,
final ScenarioModel scenario) {
scenario.addTag(new Tag(DEVICE_NAME_TAG, DEVICE_NAME_TAG,
- session.capabilities.getCapability(DEVICE_NAME)));
+ session.capabilities.getCapability(DEVICE_NAME_OPTION)));
scenario.addTag(new Tag(PLATFORM_NAME_TAG, PLATFORM_NAME_TAG,
session.capabilities.getCapability(PLATFORM_NAME)));
scenario.addTag(new Tag(PLATFORM_VERSION_TAG, PLATFORM_VERSION_TAG,
- session.capabilities.getCapability(PLATFORM_VERSION)));
+ session.capabilities.getCapability(PLATFORM_VERSION_OPTION)));
}
private static void reportSession(
final WebDriverSessionInfo session,
final ReportModel reportModel) {
reportModel.addTag(new Tag(DEVICE_NAME_TAG, DEVICE_NAME_TAG,
- session.capabilities.getCapability(DEVICE_NAME)));
+ session.capabilities.getCapability(DEVICE_NAME_OPTION)));
reportModel.addTag(new Tag(PLATFORM_NAME_TAG, PLATFORM_NAME_TAG,
session.capabilities.getCapability(PLATFORM_NAME)));
reportModel.addTag(new Tag(PLATFORM_VERSION_TAG, PLATFORM_VERSION_TAG,
- session.capabilities.getCapability(PLATFORM_VERSION)));
+ session.capabilities.getCapability(PLATFORM_VERSION_OPTION)));
}
@Override
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StageEx.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StageEx.java
index 13e9235733..15196f40e0 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StageEx.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StageEx.java
@@ -143,7 +143,7 @@ protected final void attachScreenshot(
/**
* Attaches specified text. Useful for attaching JSON, XML, or just plain
* text. Override to customize, e.g. to shorten or format the text.
- *
+ *
* @param text
* the text to attach
* @return the attached text
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StepModelPatchAspect.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StepModelPatchAspect.java
index bc99d29502..7b7e966258 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StepModelPatchAspect.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/StepModelPatchAspect.java
@@ -44,7 +44,7 @@ public class StepModelPatchAspect {
/**
* Monitors attempts to set step method's duration. If the duration is
* already set, then overrides to do nothing.
- *
+ *
* @param thisJoinPoint
* this join-point
* @param stepModel
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/TestRetryAnalyzer.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/TestRetryAnalyzer.java
index ca5c531c89..3393fdb9bd 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/TestRetryAnalyzer.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/TestRetryAnalyzer.java
@@ -38,7 +38,7 @@
*
* Had an issue with JGiven: https://github.com/TNG/JGiven/issues/312
*
- *
+ *
*
* Can be added as a listener, in this case the retry mechanism will get applied
* to all test methods covered by.
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/UnitilsScenarioTest.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/UnitilsScenarioTest.java
index 24532a88b3..3d647c5d5b 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/UnitilsScenarioTest.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/UnitilsScenarioTest.java
@@ -116,8 +116,8 @@ public void configure() {
try {
val typesAnnotatedWithBeanUtilsConverter = new Reflections(
"dev.aherscu.qa.jgiven.commons.scenarios") //$NON-NLS-1$
- .getTypesAnnotatedWith(
- BeanUtilsConverter.class);
+ .getTypesAnnotatedWith(
+ BeanUtilsConverter.class);
for (val clazz : typesAnnotatedWithBeanUtilsConverter) {
val annotation = clazz
.getAnnotation(BeanUtilsConverter.class);
diff --git a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/WebDriverEx.java b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/WebDriverEx.java
index 21909b7171..2bafcf940d 100644
--- a/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/WebDriverEx.java
+++ b/qa-jgiven-commons/src/main/java/dev/aherscu/qa/jgiven/commons/utils/WebDriverEx.java
@@ -28,7 +28,6 @@
import org.openqa.selenium.chrome.*;
import org.openqa.selenium.edge.*;
import org.openqa.selenium.firefox.*;
-import org.openqa.selenium.opera.*;
import org.openqa.selenium.remote.*;
import org.openqa.selenium.safari.*;
@@ -36,7 +35,6 @@
import com.google.gson.*;
import dev.aherscu.qa.jgiven.commons.*;
-import io.appium.java_client.*;
import io.appium.java_client.android.*;
import io.appium.java_client.ios.*;
import io.appium.java_client.windows.*;
@@ -58,6 +56,132 @@
@Slf4j
@ToString
public class WebDriverEx {
+ /**
+ * Represents a DOM
+ * Event.
+ */
+ @AllArgsConstructor
+ public static class Event {
+ /**
+ * Represents an event type.
+ *
+ * @author Adrian Herscu
+ */
+ public interface Type {
+ // marker interface
+ }
+
+ /**
+ * The type of this Pointer Event.
+ */
+ public final Type type;
+ /**
+ * Event
+ * Initialization Dictionary
+ */
+ public final Map eventInitDict;
+
+ /**
+ * @return JavaScript literal representation of this Event
+ */
+ @Override
+ public String toString() {
+ return MessageFormat.format("new {0}(\"{1}\",{2})",
+ getClass().getSimpleName(),
+ type,
+ new Gson().toJson(eventInitDict, Map.class));
+ }
+ }
+
+ /**
+ * Represents a DOM
+ * MouseEvent.
+ *
+ *
- */
- public static class UIEvent extends Event {
- /**
- * @param type
- * type of event
- * @param eventInitDict
- * initialization data
- */
- public UIEvent(
- final Type type,
- final Map eventInitDict) {
- super(type, eventInitDict);
- }
- }
}
diff --git a/qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/GenericTest.java b/qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/GenericTest.~java
similarity index 100%
rename from qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/GenericTest.java
rename to qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/GenericTest.~java
diff --git a/qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/JGivenTestNgParallelDataProviderTests.java b/qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/JGivenTestNgParallelDataProviderTests.java
new file mode 100644
index 0000000000..e6038615a8
--- /dev/null
+++ b/qa-jgiven-commons/src/test/java/dev/aherscu/qa/jgiven/commons/scenarios/JGivenTestNgParallelDataProviderTests.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2023 Adrian Herscu
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dev.aherscu.qa.jgiven.commons.scenarios;
+
+import static dev.aherscu.qa.jgiven.commons.utils.UnitilsScenarioTest.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.*;
+
+import java.util.*;
+import java.util.stream.*;
+
+import org.hamcrest.*;
+import org.testng.annotations.*;
+
+import com.tngtech.jgiven.*;
+import com.tngtech.jgiven.annotation.*;
+import com.tngtech.jgiven.testng.*;
+
+import dev.aherscu.qa.jgiven.commons.utils.*;
+
+/**
+ * Seems that parallel data providers are not supported.
+ *
* private final Supplier> queueHandlerSupplier =
* QueueHandler.Singleton. builder()
@@ -98,12 +98,12 @@ public class QueueHandler implements AutoCloseable {
* It is guaranteed that calling {@code queueHandler()} from any
* thread, will supply the same QueueHandler instance.
*
- *
+ *
*
* The connection is internally managed and closed via a runtime shutdown
* hook.
*
- *
+ *
* @param
* type of message-key; it should have a proper hash function in
* order to get O(1) access time, otherwise it may degrade to
diff --git a/qa-jgiven-rabbitmq/src/test/resources/logback-test.xml b/qa-jgiven-rabbitmq/src/test/resources/logback-test.xml
index cee6329f21..a1748d7dd7 100644
--- a/qa-jgiven-rabbitmq/src/test/resources/logback-test.xml
+++ b/qa-jgiven-rabbitmq/src/test/resources/logback-test.xml
@@ -56,7 +56,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-jgiven-reporter-maven-plugin/.classpath b/qa-jgiven-reporter-maven-plugin/.classpath
index 67e7e3ffcd..f04414371e 100644
--- a/qa-jgiven-reporter-maven-plugin/.classpath
+++ b/qa-jgiven-reporter-maven-plugin/.classpath
@@ -6,12 +6,14 @@
+
+
-
+
diff --git a/qa-jgiven-reporter-maven-plugin/pom.xml b/qa-jgiven-reporter-maven-plugin/pom.xml
index 6d1226915c..c3e8665f98 100644
--- a/qa-jgiven-reporter-maven-plugin/pom.xml
+++ b/qa-jgiven-reporter-maven-plugin/pom.xml
@@ -22,7 +22,7 @@
dev.aherscu.qaqa-automation
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTqa-jgiven-reporter-maven-plugin
@@ -34,6 +34,11 @@
JSON Report files.
+
+
+ true
+
+
org.projectlombok
@@ -79,7 +84,7 @@
dev.aherscu.qaqa-jgiven-reporter
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOT
@@ -95,7 +100,7 @@
junit
- 3.8.1
+ 3.8.2test
@@ -171,23 +176,5 @@
true
-
-
- platform-jdk11
-
- [11,)
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- --add-opens java.base/java.io=ALL-UNNAMED
-
-
-
-
-
{@code } -- required, the password; can be empty
*
- *
+ *
*
* @param client
* the SSH client
diff --git a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/model/SshScenarioType.java b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/model/SshScenarioType.java
index 640f8755e3..6ac3011526 100644
--- a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/model/SshScenarioType.java
+++ b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/model/SshScenarioType.java
@@ -19,7 +19,7 @@
/**
* SSH configuration type of scenario.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshActions.java b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshActions.java
index d5bf392664..eb464444ec 100644
--- a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshActions.java
+++ b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshActions.java
@@ -39,10 +39,10 @@
/**
* Generic SSH configuration actions. Act on previously set configuration. Each
* action closes the connection.
- *
+ *
* @param
* the type of the subclass
- *
+ *
* @author aherscu
*/
@ThreadSafe
@@ -112,7 +112,7 @@ private static int portOfOrDefault(final URI url) {
/**
* Deletes the entire directory of downloaded files.
- *
+ *
* @return {@link #self()}
*/
@NestedSteps
@@ -122,7 +122,7 @@ public SELF deleting_downloaded_files() {
/**
* Downloads a file from target SSH machine to local machine.
- *
+ *
* @param url
* the machine from which to download
* @param file
@@ -147,7 +147,7 @@ public SELF downloading(final URI url, final File file) {
* Executes a batch command on target SSH machine, using the timeout set by
* {@link SshFixtures#execution_timeout(int)} and the target output stream
* set by {@link SshFixtures#execution_output_to(OutputStream)}.
- *
+ *
* @param url
* the machine on which to execute
* @param command
@@ -163,7 +163,7 @@ public SELF executing(final URI url, final String command) {
/**
* Executes a batch command on target SSH machine.
- *
+ *
* @param url
* the machine on which to execute
* @param command
diff --git a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshFixtures.java b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshFixtures.java
index b909408256..69790183ce 100644
--- a/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshFixtures.java
+++ b/qa-jgiven-ssh/src/main/java/dev/aherscu/qa/jgiven/ssh/steps/SshFixtures.java
@@ -86,10 +86,10 @@ public class SshFixtures>
/**
* Sets up a specific SSH configuration; otherwise the {@link DefaultConfig}
* will be used.
- *
+ *
* @param config
* the configuration to use
- *
+ *
* @return {@link #self()}
*/
public SELF an_SSH_client_configuration(final Config config) {
@@ -100,7 +100,7 @@ public SELF an_SSH_client_configuration(final Config config) {
/**
* Sets the connection timeout on the given SSH client; otherwise
* {@link ConnectionDefaults#DEFAULT_CONNECTION_TIMEOUT}.
- *
+ *
* @param millis
* the read timeout interval, in milliseconds.
*
@@ -115,7 +115,7 @@ public SELF connection_timeout(
/**
* Sets the execution output on the given SSH client; otherwise
* {@link System#err}.
- *
+ *
* @param target
* the target output stream
*
@@ -129,7 +129,7 @@ public SELF execution_output_to(final OutputStream target) {
/**
* Sets the execution timeout on the given SSH client; otherwise
* {@link ConnectionDefaults#DEFAULT_EXECUTION_TIMEOUT}.
- *
+ *
* @param millis
* the read timeout interval, in milliseconds.
*
@@ -144,7 +144,7 @@ public SELF execution_timeout(
/**
* Sets the read timeout on the given SSH client; otherwise
* {@link ConnectionDefaults#DEFAULT_READ_TIMEOUT}.
- *
+ *
* @param millis
* the read timeout interval, in milliseconds.
*
diff --git a/qa-jgiven-ssh/src/test/resources/logback-test.xml b/qa-jgiven-ssh/src/test/resources/logback-test.xml
index 81c001e66d..904534a6db 100644
--- a/qa-jgiven-ssh/src/test/resources/logback-test.xml
+++ b/qa-jgiven-ssh/src/test/resources/logback-test.xml
@@ -56,7 +56,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-jgiven-webdriver/.classpath b/qa-jgiven-webdriver/.classpath
index 464f70b3be..19cd20ff75 100644
--- a/qa-jgiven-webdriver/.classpath
+++ b/qa-jgiven-webdriver/.classpath
@@ -6,13 +6,15 @@
+
+
-
+
diff --git a/qa-jgiven-webdriver/pom.xml b/qa-jgiven-webdriver/pom.xml
index 5d6bfa1e01..45d56be691 100644
--- a/qa-jgiven-webdriver/pom.xml
+++ b/qa-jgiven-webdriver/pom.xml
@@ -15,12 +15,14 @@
~ limitations under the License.
-->
-
+4.0.0dev.aherscu.qaqa-automation
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTqa-jgiven-webdriver
@@ -30,15 +32,11 @@
and support for taking screenshots.
-
- true
-
-
dev.aherscu.qaqa-jgiven-commons
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTorg.projectlombok
@@ -47,13 +45,17 @@
org.seleniumhq.seleniumhtmlunit-driver
- 2.39.0
+ 4.13.0testcommons-loggingcommons-logging
+
+ org.eclipse.jetty.websocket
+ websocket-client
+
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerClassWebSessionTest.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerClassWebSessionTest.java
index b9f07708a0..0775046586 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerClassWebSessionTest.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerClassWebSessionTest.java
@@ -70,7 +70,7 @@ protected void afterClassQuitWebDriver() {
log.debug("after class quitting web driver");
requireNonNull(webDriver.get(),
"web driver not initialized nothing to quit")
- .safelyQuit();
+ .safelyQuit();
}
/**
@@ -105,7 +105,7 @@ protected void beforeClassOpenWebDriver() {
/**
* Continues on same device session without recovery.
- *
+ *
* @see #continuing_section(Runnable)
*/
protected void continuing_section() {
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerMethodWebSessionTest.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerMethodWebSessionTest.java
index a0f01b4e47..d9d5250cbf 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerMethodWebSessionTest.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/ApplicationPerMethodWebSessionTest.java
@@ -32,7 +32,7 @@
* {@link WebDriverConfiguration}. This enables each test method to run in its
* own thread.
*
- *
+ *
*
* Eventually, multiple support classes may be derived from this one and
* override above behaviors as needed.
@@ -71,7 +71,7 @@ protected void afterMethodQuitWebDriver() {
log.debug("after method quitting web driver");
requireNonNull(webDriver.get(),
"web driver not initialized nothing to quit")
- .safelyQuit();
+ .safelyQuit();
}
/**
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/WebDriverConfiguration.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/WebDriverConfiguration.java
index fcedfb95d3..528a8cf0d2 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/WebDriverConfiguration.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/WebDriverConfiguration.java
@@ -48,14 +48,29 @@
@Slf4j
public class WebDriverConfiguration extends BaseConfiguration {
- private static final AtomicReference theDeviceType =
- new AtomicReference<>();
+ enum DeviceType {
+ _WINDOWS, _IOS, _ANDROID, _WEB;
+
+ static DeviceType from(final String deviceType) {
+ return isBlank(deviceType)
+ ? _WEB
+ : fromString(DeviceType.class,
+ deviceType.toUpperCase(ROOT));
+ }
+
+ @Override
+ public String toString() {
+ return EnumUtils.toString(this).toLowerCase(ROOT);
+ }
+ }
// NOTE must be static otherwise all tests will run with same capabilities.
// This also means that if two instances are created with different
// devices, hence different sets of capabilities, this mechanism will break.
private static final AtomicInteger nextRequiredCapabilitiesIndex =
new AtomicInteger(0);
+ private static final AtomicReference theDeviceType =
+ new AtomicReference<>();
private final Supplier> requiredCapabilities =
memoize(() -> unmodifiableList(loadRequiredCapabilities()
.peek(capabilities -> log.trace("loaded {}", capabilities))
@@ -145,14 +160,6 @@ public DesiredCapabilitiesEx capabilities() {
.orElse(capabilities(deviceType()));
}
- /**
- * @return the `device.type` as specified in source configuration, or
- * {@link Platform#ANY} if none specified
- */
- public DeviceType deviceType() {
- return DeviceType.from(getString("device.type", EMPTY));
- }
-
/**
* @param prefix
* prefix
@@ -163,14 +170,10 @@ public DeviceType deviceType() {
@SuppressWarnings("serial")
@SneakyThrows
public DesiredCapabilitiesEx capabilitiesFor(final String prefix) {
+ log.trace("building capabilities for {}", prefix);
return new DesiredCapabilitiesEx() {
{
- // NOTE: on Chrome 75+ need to turn off W3C mode
- // https://support.saucelabs.com/hc/en-us/articles/360057263354
- setCapability(ChromeOptions.CAPABILITY, ImmutableMap.builder()
- .put("w3c", false)
- .build());
- setCapability("name", generateFromCurrentThreadAndTime());
+ setCapability("sauce:name", generateFromCurrentThreadAndTime());
entrySet()
.stream()
.map(entry -> new AbstractMap.SimpleImmutableEntry<>(
@@ -178,6 +181,9 @@ public DesiredCapabilitiesEx capabilitiesFor(final String prefix) {
entry.getValue().toString()))
.filter(entry -> entry.getKey()
.startsWith(prefix + DOT))
+ .peek(capabilitiesEntry -> log.trace(
+ "adding capabilities entry {}",
+ capabilitiesEntry))
.forEach(capabilitiesEntry -> setCapability(
substringAfter(capabilitiesEntry.getKey(),
prefix + DOT),
@@ -186,6 +192,21 @@ public DesiredCapabilitiesEx capabilitiesFor(final String prefix) {
};
}
+ /**
+ * @return the `device.type` as specified in source configuration, or
+ * {@link Platform#ANY} if none specified
+ */
+ public DeviceType deviceType() {
+ return DeviceType.from(getString("device.type", EMPTY));
+ }
+
+ /**
+ * @return the `provider` as specified source configuration
+ */
+ public String provider() {
+ return getString("provider");
+ }
+
/**
* @param deviceType
* device type to filter by
@@ -197,9 +218,9 @@ public List requiredCapabilities(
.stream()
.filter(capabilities -> DeviceType
.from(requireNonNull(capabilities
- .getCapability("type"),
+ .getCapability("-x:type"),
"internal error, no type capability")
- .toString())
+ .toString())
.equals(deviceType))
.peek(capabilities -> log.trace("found required capabilities {}",
capabilities))
@@ -207,10 +228,24 @@ public List requiredCapabilities(
}
/**
- * @return the `provider` as specified source configuration
+ * @return device capabilities per configuration
*/
- public String provider() {
- return getString("provider");
+ public List requiredCapabilities() {
+ return requiredCapabilities(deviceType());
+ }
+
+ private Stream loadRequiredCapabilities() {
+ return groupsOf("required.capability")
+ .map(requiredCapabilitiesGroup -> new DesiredCapabilitiesEx(
+ capabilitiesFor(provider()
+ + requiredCapabilitiesGroup.get("type")))
+ .with(requiredCapabilitiesGroup
+ .entrySet()
+ .stream()
+ .peek(e -> log.trace("adding capabilities entry {}", e))
+ .map(e -> Maps.immutableEntry(
+ "type".equals(e.getKey()) ? "-x:type" : e.getKey(),
+ e.getValue()))));
}
/**
@@ -238,42 +273,6 @@ private Optional nextRequiredCapabilities(
// during the initialization of the test class, there is no way
// to assign them a test (thread) name because these are not
// running yet -- hence we do it here
- .with("name", generateFromCurrentThreadAndTime()));
- }
-
- /**
- * @return device capabilities per configuration
- */
- public List requiredCapabilities() {
- return requiredCapabilities(deviceType());
- }
-
- private Stream loadRequiredCapabilities() {
- return groupsOf("required.capability")
- .map(requiredCapabilitiesGroup -> new DesiredCapabilitiesEx(
- capabilitiesFor(
- provider() + requiredCapabilitiesGroup.get("type")))
- .with(requiredCapabilitiesGroup
- .entrySet()
- .stream()
- .map(e -> Maps.immutableEntry(
- e.getKey(),
- e.getValue()))));
- }
-
- enum DeviceType {
- _WINDOWS, _IOS, _ANDROID, _WEB;
-
- static DeviceType from(final String deviceType) {
- return isBlank(deviceType)
- ? _WEB
- : fromString(DeviceType.class,
- deviceType.toUpperCase(ROOT));
- }
-
- @Override
- public String toString() {
- return EnumUtils.toString(this).toLowerCase(ROOT);
- }
+ .with("sauce:name", generateFromCurrentThreadAndTime()));
}
}
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/CapabilitiesFormatter.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/CapabilitiesFormatter.java
index b393dd40fa..48d971af17 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/CapabilitiesFormatter.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/CapabilitiesFormatter.java
@@ -30,7 +30,7 @@
/**
* Annotation formatter for {@link Capabilities} objects.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WebDriverFormatter.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WebDriverFormatter.java
index c4b7f89ac3..8778c6472e 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WebDriverFormatter.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WebDriverFormatter.java
@@ -15,9 +15,11 @@
*/
package dev.aherscu.qa.jgiven.webdriver.formatters;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.*;
+import static io.appium.java_client.remote.options.SupportsPlatformVersionOption.*;
import static java.util.Objects.*;
import static org.apache.commons.lang3.StringUtils.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.lang.annotation.*;
import java.text.*;
@@ -32,7 +34,7 @@
/**
* Annotation formatter for WebDriver.
- *
+ *
* @author aherscu
*
*/
@@ -40,20 +42,6 @@
public class WebDriverFormatter implements
AnnotationArgumentFormatter {
- @Override
- public String format(final Object argumentToFormat,
- final WebDriverFormatter.Annotation annotation) {
- if (isNull(argumentToFormat))
- return EMPTY;
-
- val capabilities =
- ((WebDriverEx) argumentToFormat).originalCapabilities;
- return MessageFormat.format("{0} {1} {2}",
- capabilities.getCapability(DEVICE_NAME),
- capabilities.getCapability(PLATFORM_NAME),
- capabilities.getCapability(PLATFORM_VERSION));
- }
-
/**
* Formatter annotation for WebDriver.
*
@@ -66,4 +54,18 @@ public String format(final Object argumentToFormat,
public @interface Annotation {
// no parameter to declare
}
+
+ @Override
+ public String format(final Object argumentToFormat,
+ final WebDriverFormatter.Annotation annotation) {
+ if (isNull(argumentToFormat))
+ return EMPTY;
+
+ val capabilities =
+ ((WebDriverEx) argumentToFormat).originalCapabilities;
+ return MessageFormat.format("{0} {1} {2}",
+ capabilities.getCapability(DEVICE_NAME_OPTION),
+ capabilities.getCapability(PLATFORM_NAME),
+ capabilities.getCapability(PLATFORM_VERSION_OPTION));
+ }
}
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WinAppDriverFormatter.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WinAppDriverFormatter.java
index a32839ae8b..497bda9d38 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WinAppDriverFormatter.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/formatters/WinAppDriverFormatter.java
@@ -16,9 +16,11 @@
package dev.aherscu.qa.jgiven.webdriver.formatters;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
+import static io.appium.java_client.remote.options.SupportsAppOption.*;
+import static io.appium.java_client.remote.options.SupportsPlatformVersionOption.*;
import static java.util.Objects.*;
import static org.apache.commons.lang3.StringUtils.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.lang.annotation.*;
import java.text.*;
@@ -39,19 +41,6 @@
public class WinAppDriverFormatter
implements
AnnotationArgumentFormatter {
- @Override
- public String format(final Object argumentToFormat,
- final WinAppDriverFormatter.Annotation annotation) {
- if (isNull(argumentToFormat))
- return EMPTY;
- final org.openqa.selenium.Capabilities capabilities =
- ((WebDriverEx) argumentToFormat).originalCapabilities;
- return MessageFormat.format("{0} {1} {2}",
- capabilities.getCapability(PLATFORM_NAME),
- capabilities.getCapability(PLATFORM_VERSION),
- capabilities.getCapability("app"));
- }
-
/**
* Formatter annotation for WebDriver.
*
@@ -63,4 +52,17 @@ public String format(final Object argumentToFormat,
public @interface Annotation {
// no parameter to declare
}
+
+ @Override
+ public String format(final Object argumentToFormat,
+ final WinAppDriverFormatter.Annotation annotation) {
+ if (isNull(argumentToFormat))
+ return EMPTY;
+ final org.openqa.selenium.Capabilities capabilities =
+ ((WebDriverEx) argumentToFormat).originalCapabilities;
+ return MessageFormat.format("{0} {1} {2}",
+ capabilities.getCapability(PLATFORM_NAME),
+ capabilities.getCapability(PLATFORM_VERSION_OPTION),
+ capabilities.getCapability(APP_OPTION));
+ }
}
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/model/WebDriverScenarioType.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/model/WebDriverScenarioType.java
index 4c8853d96a..2e7ae383c2 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/model/WebDriverScenarioType.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/model/WebDriverScenarioType.java
@@ -19,7 +19,7 @@
/**
* Web Driver type of scenario.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverActions.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverActions.java
index 1f13d86125..b7ed81ef8a 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverActions.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverActions.java
@@ -27,6 +27,7 @@
import javax.annotation.concurrent.*;
import org.openqa.selenium.*;
+import org.openqa.selenium.NoSuchContextException;
import org.openqa.selenium.NoSuchElementException;
import com.tngtech.jgiven.annotation.*;
@@ -34,6 +35,8 @@
import dev.aherscu.qa.jgiven.commons.steps.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
import dev.aherscu.qa.jgiven.webdriver.model.*;
+import io.appium.java_client.*;
+import io.appium.java_client.remote.*;
import io.appium.java_client.windows.*;
import lombok.*;
import lombok.extern.slf4j.*;
@@ -244,7 +247,7 @@ public SELF opening(final String url) {
* @return #self()
*/
public SELF rotating_device_to(final ScreenOrientation orientation) {
- thisWebDriver().asMobile().rotate(orientation);
+ ((SupportsRotation) thisWebDriver()).rotate(orientation);
return self();
}
@@ -257,7 +260,7 @@ public SELF rotating_device_to(final ScreenOrientation orientation) {
*/
public SELF sending_application_to_background_for(final Duration duration) {
log.debug("sending application to background for {}", duration);
- thisWebDriver().asMobile().runAppInBackground(duration);
+ ((InteractsWithApps) thisWebDriver()).runAppInBackground(duration);
log.debug("returned from background");
return self();
}
@@ -288,7 +291,7 @@ public SELF submitting_the_form_containing(final By locator) {
public SELF terminating_application(final String appId) {
log.debug("application {} was running and stopped successfully: {}",
appId,
- thisWebDriver().asMobile().terminateApp(appId));
+ ((InteractsWithApps) thisWebDriver()).terminateApp(appId));
return self();
}
@@ -364,7 +367,7 @@ public SELF terminating_application(final String appId) {
@Hidden
protected SELF activating_application(final String appId) {
log.debug("activating application {}", appId);
- thisWebDriver().asMobile().activateApp(appId);
+ ((InteractsWithApps) thisWebDriver()).activateApp(appId);
return self();
}
@@ -474,7 +477,7 @@ protected WebElement scrollIntoView(final WebElement element) {
*/
@Hidden
protected SELF switching_to_context(final Predicate byRule) {
- return context(byRule, thisWebDriver().asMobile());
+ return context(byRule, (ContextAware) thisWebDriver());
}
/**
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverFixtures.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverFixtures.java
index e437861a91..738b5bfc8f 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverFixtures.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverFixtures.java
@@ -89,18 +89,6 @@ public SELF a_web_driver(
return self();
}
- /**
- * Restarts the mobile application in clean state.
- *
- * @return #self()
- */
- public SELF application_is_restarted_in_clean_state() {
- val mobileDriver = thisWebDriver().asMobile();
- log.debug("restarting {}", mobileDriver);
- mobileDriver.resetApp();
- return self();
- }
-
/**
* Opens Web application at specified host if not already open.
*
@@ -138,7 +126,7 @@ && hostOf(currentUrl)
*/
@Hidden
protected SELF context(final Predicate byRule) {
- return context(byRule, thisWebDriver().asMobile());
+ return context(byRule, (ContextAware) thisWebDriver());
}
/**
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverVerifications.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverVerifications.java
index a4c3e5d47b..b5b604ca0f 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverVerifications.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/steps/WebDriverVerifications.java
@@ -31,6 +31,7 @@
import dev.aherscu.qa.jgiven.commons.steps.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
import dev.aherscu.qa.jgiven.webdriver.model.*;
+import io.appium.java_client.*;
import io.appium.java_client.appmanagement.*;
import lombok.*;
import lombok.extern.slf4j.*;
@@ -120,7 +121,7 @@ public SELF elements(
public SELF the_application(final Matcher matcher,
final String appId) {
return eventually_assert_that(
- () -> thisWebDriver().asMobile().queryAppState(appId),
+ () -> ((InteractsWithApps) thisWebDriver()).queryAppState(appId),
matcher);
}
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/UITest.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/UITest.java
index c44380cb64..bb9a3b77d3 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/UITest.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/UITest.java
@@ -21,7 +21,7 @@
/**
* User interface testing annotation.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/WebDriverTest.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/WebDriverTest.java
index a2108d9430..eaf02f778e 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/WebDriverTest.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/tags/WebDriverTest.java
@@ -21,7 +21,7 @@
/**
* Self test tagging annotation.
- *
+ *
* @author aherscu
*
*/
diff --git a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/utils/AbstractSauceLabsReporter.java b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/utils/AbstractSauceLabsReporter.java
index da687eb152..4791c943e5 100644
--- a/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/utils/AbstractSauceLabsReporter.java
+++ b/qa-jgiven-webdriver/src/main/java/dev/aherscu/qa/jgiven/webdriver/utils/AbstractSauceLabsReporter.java
@@ -57,7 +57,7 @@ public void onTestSuccess(final ITestResult testResult) {
sessionInfo -> {
log.trace("succeeded on session {} -> {}",
sessionInfo.sessionId.toString(),
- sessionInfo.capabilities.getCapability("name"));
+ sessionInfo.capabilities.getCapability("sauce:name"));
sauceLabs()
.jobPassed(sessionInfo.sessionId.toString());
});
@@ -76,7 +76,7 @@ public void onTestFailure(final ITestResult testResult) {
sessionInfo -> {
log.trace("failed on session {} -> {}",
sessionInfo.sessionId.toString(),
- sessionInfo.capabilities.getCapability("name"));
+ sessionInfo.capabilities.getCapability("sauce:name"));
sauceLabs()
.jobFailed(sessionInfo.sessionId.toString());
});
diff --git a/qa-jgiven-webdriver/src/test/java/dev/aherscu/qa/jgiven/webdriver/scenarios/GenericWebDriverTest.java b/qa-jgiven-webdriver/src/test/java/dev/aherscu/qa/jgiven/webdriver/scenarios/GenericWebDriverTest.java
index 28b476dd08..15680211de 100644
--- a/qa-jgiven-webdriver/src/test/java/dev/aherscu/qa/jgiven/webdriver/scenarios/GenericWebDriverTest.java
+++ b/qa-jgiven-webdriver/src/test/java/dev/aherscu/qa/jgiven/webdriver/scenarios/GenericWebDriverTest.java
@@ -44,7 +44,8 @@
value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE",
justification = "JGiven framework limitation")
@Slf4j
-public final class GenericWebDriverTest extends AbstractWireMockTest, WebDriverActions>, WebDriverVerifications>> {
+public final class GenericWebDriverTest extends
+ AbstractWireMockTest, WebDriverActions>, WebDriverVerifications>> {
private WebDriverEx driver;
@@ -53,9 +54,9 @@ public final class GenericWebDriverTest extends AbstractWireMockTest
+
+
diff --git a/qa-jgiven-webdriver/src/test/resources/logback-test.xml b/qa-jgiven-webdriver/src/test/resources/logback-test.xml
index 81c001e66d..904534a6db 100644
--- a/qa-jgiven-webdriver/src/test/resources/logback-test.xml
+++ b/qa-jgiven-webdriver/src/test/resources/logback-test.xml
@@ -56,7 +56,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-jgiven-commons/src/test/resources/required-capabilities.properties b/qa-jgiven-webdriver/src/test/resources/required-capabilities.properties
similarity index 100%
rename from qa-jgiven-commons/src/test/resources/required-capabilities.properties
rename to qa-jgiven-webdriver/src/test/resources/required-capabilities.properties
diff --git a/qa-jgiven-commons/src/test/resources/webdriver.properties b/qa-jgiven-webdriver/src/test/resources/webdriver.properties
similarity index 100%
rename from qa-jgiven-commons/src/test/resources/webdriver.properties
rename to qa-jgiven-webdriver/src/test/resources/webdriver.properties
diff --git a/qa-jgiven-webdriver/testng.xml b/qa-jgiven-webdriver/testng.xml
index 53c8ff177a..771181c815 100644
--- a/qa-jgiven-webdriver/testng.xml
+++ b/qa-jgiven-webdriver/testng.xml
@@ -20,6 +20,7 @@
+
diff --git a/qa-orcanos-publisher-maven-plugin/.classpath b/qa-orcanos-publisher-maven-plugin/.classpath
index 61fa2efd7f..982620de54 100644
--- a/qa-orcanos-publisher-maven-plugin/.classpath
+++ b/qa-orcanos-publisher-maven-plugin/.classpath
@@ -6,6 +6,8 @@
+
+
@@ -28,7 +30,7 @@
-
+
@@ -46,8 +48,8 @@
-
+
diff --git a/qa-orcanos-publisher-maven-plugin/pom.xml b/qa-orcanos-publisher-maven-plugin/pom.xml
index c3a09b9500..428649e60c 100644
--- a/qa-orcanos-publisher-maven-plugin/pom.xml
+++ b/qa-orcanos-publisher-maven-plugin/pom.xml
@@ -22,7 +22,7 @@
dev.aherscu.qaqa-automation
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTqa-orcanos-publisher-maven-plugin
@@ -81,19 +81,19 @@
dev.aherscu.qaqa-testing-utils
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTdev.aherscu.qaqa-jgiven-reporter
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTcom.j2htmlj2html
- 1.4.0
+ 1.6.0
@@ -132,6 +132,19 @@
${jersey.version}
+
+ com.sun.activation
+ javax.activation
+
+
+ javax.xml.bind
+ jaxb-api
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+
+
org.apache.maven.plugin-testingmaven-plugin-testing-harness
@@ -145,14 +158,7 @@
junit
- 3.8.1
- test
-
-
-
- com.github.tomakehurst
- wiremock-jre8
- 2.26.3
+ 3.8.2test
@@ -176,6 +182,7 @@
org.codehaus.mojojaxb2-maven-plugin
+
2.5.0
@@ -272,40 +279,6 @@
-
-
- platform-jdk11
-
- [11,)
-
-
- 2.3.1
-
-
-
-
-
- com.sun.activation
- javax.activation
- 1.2.0
- runtime
-
-
- javax.xml.bind
- jaxb-api
- ${jaxb.version}
- runtime
-
-
- org.glassfish.jaxb
- jaxb-runtime
- ${jaxb.version}
- runtime
-
-
-
-
-
diff --git a/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojo.java b/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojo.java
index 67610bd7a7..06d5abc7a2 100644
--- a/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojo.java
+++ b/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojo.java
@@ -19,12 +19,12 @@
import static dev.aherscu.qa.jgiven.reporter.QaJGivenPerMethodReporter.*;
import static dev.aherscu.qa.testing.utils.FileUtilsExtensions.*;
import static dev.aherscu.qa.testing.utils.UriUtils.*;
+import static jakarta.ws.rs.client.Entity.*;
+import static jakarta.ws.rs.core.MediaType.*;
import static java.text.MessageFormat.*;
import static java.util.Objects.*;
import static java.util.UUID.*;
import static java.util.regex.Pattern.*;
-import static javax.ws.rs.client.Entity.*;
-import static javax.ws.rs.core.MediaType.*;
import static org.apache.commons.io.IOUtils.*;
import static org.glassfish.jersey.client.ClientProperties.*;
@@ -33,9 +33,6 @@
import java.util.*;
import java.util.regex.*;
-import javax.ws.rs.*;
-import javax.ws.rs.client.*;
-
import org.apache.commons.io.filefilter.*;
import org.apache.maven.plugin.*;
import org.apache.maven.plugins.annotations.*;
@@ -49,6 +46,8 @@
import dev.aherscu.qa.orcanos.publisher.maven.plugin.model.*;
import dev.aherscu.qa.testing.utils.*;
import dev.aherscu.qa.testing.utils.rest.*;
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.client.*;
import lombok.*;
/**
@@ -193,7 +192,7 @@ private GenericResponse recordExecutionResults(
+ "on execution set {2} with status {3}",
requireNonNull(results.getRun(),
"couldn't get execution run result, check orcanos credentials")
- .getName(),
+ .getName(),
reportHandle.testId(),
reportHandle.executionSetId(),
reportHandle.status()));
@@ -240,7 +239,7 @@ private void report(
retrieveExecutionSetRunResults(orcanosEndpointTarget,
reportHandle),
uploadReport(orcanosEndpointTarget, reportToUpload))
- .toString());
+ .toString());
} catch (final Throwable t) {
getLog().error(reportHandle.toString(), t);
}
diff --git a/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/ReportHandle.java b/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/ReportHandle.java
index 4867bffb3b..c9f1c02339 100644
--- a/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/ReportHandle.java
+++ b/qa-orcanos-publisher-maven-plugin/src/main/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/ReportHandle.java
@@ -57,9 +57,9 @@ final class ReportHandle {
/**
* Returns the device name from {@code DeviceName} attribute.
- *
+ *
* @return the device name
- *
+ *
*/
public String deviceName() {
return attributes.get(DEVICE_NAME);
@@ -67,9 +67,9 @@ public String deviceName() {
/**
* Returns the execution set identifier from {@code Reference} attribute.
- *
+ *
* @return the id
- *
+ *
*/
public String executionSetId() {
return substringAfter(reference(), UNDERSCORE);
@@ -78,9 +78,9 @@ public String executionSetId() {
/**
* Returns supported {@code Reference} has an execution set id and a test
* case id.
- *
+ *
* @return true if has a execution set id
- *
+ *
*/
public boolean hasSupportedReference() {
return reference().matches("\\d+_\\d+");
@@ -88,9 +88,9 @@ public boolean hasSupportedReference() {
/**
* Returns supported status can be {@code SUCCESS or FAIL}.
- *
+ *
* @return true if supported
- *
+ *
*/
public boolean hasSupportedStatus() {
return !Status.UNSUPPORTED.equals(status());
@@ -98,9 +98,9 @@ public boolean hasSupportedStatus() {
/**
* Returns the platform name from {@code PlatformName} attribute.
- *
+ *
* @return platform name
- *
+ *
*/
public String platformName() {
return attributes.get(PLATFORM_NAME);
@@ -108,9 +108,9 @@ public String platformName() {
/**
* Returns the platform version from {@code PlatformVersion} attribute.
- *
+ *
* @return platform version
- *
+ *
*/
public String platformVersion() {
return attributes.get(PLATFORM_VERSION);
@@ -138,9 +138,9 @@ public String reference() {
/**
* Returns the report source file to upload.
- *
+ *
* @return the source file
- *
+ *
*/
public File sourceFile() {
return sourceFile;
@@ -148,9 +148,9 @@ public File sourceFile() {
/**
* Returns the execution status.
- *
+ *
* @return the status
- *
+ *
*/
public Status status() {
return Status.from(status);
@@ -158,7 +158,7 @@ public Status status() {
/**
* Returns the test case identifier from {@code Reference} attribute.
- *
+ *
* @return the test id
*/
public String testId() {
diff --git a/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojoTest.java b/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojoTest.java
index 8550665095..c0b3379703 100644
--- a/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojoTest.java
+++ b/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/OrcanosPublisherMojoTest.java
@@ -26,7 +26,7 @@
import java.io.*;
import java.net.*;
-import javax.ws.rs.client.*;
+import jakarta.ws.rs.client.*;
import org.apache.maven.plugin.testing.*;
diff --git a/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/SelfTest.java b/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/SelfTest.java
index a27676d1e0..71395c8da5 100644
--- a/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/SelfTest.java
+++ b/qa-orcanos-publisher-maven-plugin/src/test/java/dev/aherscu/qa/orcanos/publisher/maven/plugin/SelfTest.java
@@ -18,13 +18,13 @@
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static dev.aherscu.qa.testing.utils.WireMockServerUtils.*;
-import static javax.ws.rs.client.Entity.*;
-import static javax.ws.rs.core.HttpHeaders.*;
-import static javax.ws.rs.core.MediaType.*;
+import static jakarta.ws.rs.client.Entity.*;
+import static jakarta.ws.rs.core.HttpHeaders.*;
+import static jakarta.ws.rs.core.MediaType.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
-import javax.ws.rs.client.*;
+import jakarta.ws.rs.client.*;
import org.testng.annotations.*;
diff --git a/qa-orcanos-publisher-maven-plugin/src/test/resources/logback-test.xml b/qa-orcanos-publisher-maven-plugin/src/test/resources/logback-test.xml
index 1013be551f..c5bb1c0144 100644
--- a/qa-orcanos-publisher-maven-plugin/src/test/resources/logback-test.xml
+++ b/qa-orcanos-publisher-maven-plugin/src/test/resources/logback-test.xml
@@ -55,7 +55,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-s3-publisher-maven-plugin/.classpath b/qa-s3-publisher-maven-plugin/.classpath
index 71f1d573f5..08eb734ef4 100644
--- a/qa-s3-publisher-maven-plugin/.classpath
+++ b/qa-s3-publisher-maven-plugin/.classpath
@@ -6,7 +6,7 @@
-
+
diff --git a/qa-s3-publisher-maven-plugin/pom.xml b/qa-s3-publisher-maven-plugin/pom.xml
index c585136b60..b3d1c423ef 100644
--- a/qa-s3-publisher-maven-plugin/pom.xml
+++ b/qa-s3-publisher-maven-plugin/pom.xml
@@ -20,7 +20,7 @@
dev.aherscu.qaqa-automation
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTqa-s3-publisher-maven-plugin
@@ -38,8 +38,8 @@
- com.google.code.findbugs
- annotations
+ com.github.spotbugs
+ spotbugs-annotations
@@ -71,10 +71,15 @@
provided
+
+ com.sun.activation
+ javax.activation
+
+
com.amazonawsaws-java-sdk
- 1.12.406
+ 1.12.565
@@ -90,7 +95,7 @@
junit
- 3.8.1
+ 3.8.2test
@@ -144,7 +149,7 @@
org.apache.maven.surefiresurefire-junit3
- 3.0.0-M3
+ ${surefire.version}
@@ -160,21 +165,4 @@
-
-
-
- platform-jdk11
-
- [11,)
-
-
-
- com.sun.activation
- javax.activation
- 1.2.0
-
-
-
-
-
diff --git a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/S3StaticUploaderMojo.java b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/S3StaticUploaderMojo.java
index 4e539b8ee3..53ad1358be 100644
--- a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/S3StaticUploaderMojo.java
+++ b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/S3StaticUploaderMojo.java
@@ -111,7 +111,7 @@ public class S3StaticUploaderMojo extends AbstractMojo {
* for those remote objects which remain unchanged but contain metadata with
* expired timestamps. This is useful if you want to enlarge cache lifetime
* for unchanged objects when you deploy new versions of the site.
- *
+ *
* @parameter default-value= false
*/
private boolean refreshExpiredObjects;
diff --git a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Bind.java b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Bind.java
index 911c1e5ac3..a5f3aa9e85 100644
--- a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Bind.java
+++ b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Bind.java
@@ -34,7 +34,7 @@ public class Bind {
/**
* The id of the metadata which will be applied to all the files matching
* the pattern parameter.
- *
+ *
* @parameter
* @required
*/
diff --git a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Include.java b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Include.java
index 72f735c597..81b0f369ca 100644
--- a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Include.java
+++ b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/config/Include.java
@@ -34,7 +34,7 @@ public class Include {
/**
* List of binds specifying constraints in order to override metadata for a
* subset of files.
- *
+ *
* @parameter
*/
List constraints;
diff --git a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/util/S3Uploader.java b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/util/S3Uploader.java
index e7243674d2..11223af936 100644
--- a/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/util/S3Uploader.java
+++ b/qa-s3-publisher-maven-plugin/src/main/java/dev/aherscu/qa/s3/publisher/maven/plugin/util/S3Uploader.java
@@ -111,7 +111,7 @@ private CopyObjectRequest buildCopyObjectRequest(
final ObjectMetadata objectMetadata) {
return new CopyObjectRequest(bucketName, remoteFileName, bucketName,
remoteFileName)
- .withNewObjectMetadata(objectMetadata);
+ .withNewObjectMetadata(objectMetadata);
}
private File encodeManagedFile(final ManagedFile managedFile)
diff --git a/qa-testing-archetype/pom.xml b/qa-testing-archetype/pom.xml
index d5329c0e28..c2a3d87cdf 100644
--- a/qa-testing-archetype/pom.xml
+++ b/qa-testing-archetype/pom.xml
@@ -24,7 +24,7 @@
dev.aherscu.qaqa-testing-parent
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOT../qa-testing-parent
@@ -40,6 +40,7 @@
true
+
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/.github/workflows/maven.yml b/qa-testing-archetype/src/main/resources/archetype-resources/.github/workflows/maven.yml
index 3e69ca8cca..043d6e9977 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/.github/workflows/maven.yml
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/.github/workflows/maven.yml
@@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Set up JDK 8
- uses: actions/setup-java@v2
+ - name: Set up JDK 11
+ uses: actions/setup-java@v3
with:
- java-version: '8'
+ java-version: '11'
distribution: 'temurin'
cache: maven
- name: Packaging with Maven
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/TestConfiguration.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/TestConfiguration.java
index 9f93e547ed..3496a87cc1 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/TestConfiguration.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/TestConfiguration.java
@@ -22,15 +22,12 @@
import org.apache.commons.configuration.*;
import dev.aherscu.qa.jgiven.webdriver.*;
-import lombok.extern.slf4j.*;
/**
* Represents the configuration parameters for tests.
*
* @author aherscu
*/
-@SuppressWarnings("boxing")
-@Slf4j
@ThreadSafe
public final class TestConfiguration extends WebDriverConfiguration {
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorActions.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorActions.java
index 58caaa9052..6d4b285972 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorActions.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorActions.java
@@ -16,13 +16,13 @@
package ${package}.steps.tutorial;
-import static io.appium.java_client.MobileBy.*;
+import static io.appium.java_client.AppiumBy.*;
import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class CalculatorActions>
extends WebDriverActions {
public SELF typing(final String expression) {
- return typing_$_into(expression, AccessibilityId("CalculatorResults"));
+ return typing_$_into(expression, accessibilityId("CalculatorResults"));
}
}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorFixtures.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorFixtures.java
index e88af71534..381620d9cc 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorFixtures.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorFixtures.java
@@ -16,8 +16,8 @@
package ${package}.steps.tutorial;
-import dev.aherscu.qa.jgiven.webdriver.steps.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
+import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class CalculatorFixtures>
extends WebDriverFixtures {
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorVerifications.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorVerifications.java
index d2928848c6..7acd04af26 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorVerifications.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/CalculatorVerifications.java
@@ -16,12 +16,12 @@
package ${package}.steps.tutorial;
-import static io.appium.java_client.MobileBy.*;
+import static io.appium.java_client.AppiumBy.*;
-import dev.aherscu.qa.jgiven.webdriver.steps.*;
import org.hamcrest.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
+import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class CalculatorVerifications>
extends WebDriverVerifications {
@@ -29,7 +29,7 @@ public class CalculatorVerifications>
@AttachesScreenshot
public SELF the_result(final Matcher matcher) {
return eventually_assert_that(
- () -> element(AccessibilityId("CalculatorResults")).getText(),
+ () -> element(accessibilityId("CalculatorResults")).getText(),
matcher);
}
}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleActions.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleActions.java
index dd566700f8..399e1d291f 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleActions.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleActions.java
@@ -16,10 +16,10 @@
package ${package}.steps.tutorial;
-import dev.aherscu.qa.jgiven.webdriver.steps.*;
import org.openqa.selenium.*;
import dev.aherscu.qa.jgiven.commons.model.*;
+import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class GoogleActions>
extends WebDriverActions {
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleFixtures.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleFixtures.java
index 9da63c5e58..476c275e6b 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleFixtures.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleFixtures.java
@@ -16,8 +16,8 @@
package ${package}.steps.tutorial;
-import dev.aherscu.qa.jgiven.webdriver.steps.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
+import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class GoogleFixtures>
extends WebDriverFixtures {
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleVerifications.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleVerifications.java
index ba869226ed..277882bf41 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleVerifications.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/main/java/steps/tutorial/GoogleVerifications.java
@@ -18,16 +18,14 @@
import java.util.stream.*;
-import dev.aherscu.qa.jgiven.webdriver.steps.*;
import org.hamcrest.*;
import org.openqa.selenium.*;
import dev.aherscu.qa.jgiven.commons.model.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
+import dev.aherscu.qa.jgiven.webdriver.steps.*;
import ${package}.model.tutorial.*;
-import lombok.extern.slf4j.*;
-@Slf4j
public class GoogleVerifications>
extends WebDriverVerifications {
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/SelfTests.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/SelfTests.java
index 77ef707774..6f5eb689b3 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/SelfTests.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/SelfTests.java
@@ -17,9 +17,9 @@
package ${package}.scenarios;
import static dev.aherscu.qa.jgiven.commons.utils.UnitilsScenarioTest.*;
+import static dev.aherscu.qa.testing.utils.StreamMatchers.allMatch;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
-import static uk.co.probablyfine.matchers.StreamMatchers.*;
import java.util.stream.*;
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingRemoteWebApplication.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingRemoteWebApplication.java
new file mode 100644
index 0000000000..9675a849e4
--- /dev/null
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingRemoteWebApplication.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2023 Adrian Herscu
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ${package}.scenarios.tutorial3;
+
+import static dev.aherscu.qa.testing.utils.StreamMatchers.*;
+import static java.util.Objects.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
+
+import java.net.*;
+
+import org.openqa.selenium.*;
+import org.openqa.selenium.remote.*;
+import org.testng.annotations.*;
+
+import dev.aherscu.qa.jgiven.commons.utils.*;
+import edu.umd.cs.findbugs.annotations.*;
+import lombok.*;
+import lombok.extern.slf4j.*;
+
+@Slf4j
+public class TestingRemoteWebApplication {
+ public final static String SAUCELABS_PASSWORD;
+ public final static String SAUCELABS_URL;
+ public final static String SAUCELABS_USER;
+
+ static {
+ SAUCELABS_PASSWORD =
+ requireNonNull(System.getenv("SAUCELABS_PASSWORD"),
+ "missing SauceLabs password");
+ SAUCELABS_USER =
+ requireNonNull(System.getenv("SAUCELABS_USER"),
+ "missing SauceLabs username");
+ SAUCELABS_URL = String
+ .format("https://%s:%s@ondemand.saucelabs.com:443/wd/hub",
+ SAUCELABS_USER, SAUCELABS_PASSWORD);
+ }
+
+ private WebDriver webDriver;
+
+ @Test
+ public void shouldFind() {
+ // NOTE the search keyword must be unique such that it is not
+ // translated to other languages or written differently
+ val SEARCH_KEYWORD = "testng";
+ webDriver.findElement(By.name("q"))
+ .sendKeys(SEARCH_KEYWORD + Keys.ENTER);
+ assertThat(
+ webDriver.findElements(By.xpath("//a/h3"))
+ .stream()
+ .map(webElement -> webElement.getAttribute("textContent"))
+ .peek(resultTitle -> log.debug("found {}", resultTitle)),
+ allMatch(either(containsStringIgnoringCase("testng"))
+ .or(containsStringIgnoringCase("Try again"))
+ .or(containsStringIgnoringCase("More results"))));
+ }
+
+ @Test
+ public void shouldOpenWeb() {
+ assertThat(webDriver.getTitle(), containsString("Google"));
+ }
+
+ @SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "called by testng framework")
+ @AfterClass(alwaysRun = true) // important, otherwise we may leak resources
+ private void afterClassCloseWebDriver() {
+ webDriver.quit();
+ }
+
+ @SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "called by testng framework")
+ @BeforeClass
+ @SneakyThrows
+ private void beforeClassOpenWebDriver() {
+ log.trace("connecting saucelabs with {}:{}",
+ SAUCELABS_USER, SAUCELABS_PASSWORD);
+ webDriver = new RemoteWebDriver(new URL(SAUCELABS_URL),
+ new DesiredCapabilitiesEx()
+ .with(BROWSER_NAME, "firefox")
+ .with("sauce:name", "selenium 4 test")
+ // NOTE since Selenium 4, non-standard capabilities must be prefixed;
+ // see https://www.w3.org/TR/webdriver1/#capabilities
+ // and https://docs.saucelabs.com/dev/test-configuration-options/
+ // and
+ // https://docs.saucelabs.com/dev/test-configuration-options/#desktop-and-mobile-capabilities-sauce-specific--optional
+ // and
+ // https://docs.saucelabs.com/mobile-apps/automated-testing/appium/appium-2-migration/
+ // For example,
+ // .with("my:capability", "kuku")
+ );
+
+ webDriver.manage().window().maximize();
+ webDriver.manage().timeouts().implicitlyWait(10, SECONDS);
+ webDriver.get("https://google.com?hl=en");
+ }
+}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebApplication.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebApplication.java
index bb90fad5cb..e015d03d2a 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebApplication.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebApplication.java
@@ -17,19 +17,23 @@
package ${package}.scenarios.tutorial3;
import static dev.aherscu.qa.jgiven.commons.utils.UnitilsScenarioTest.*;
+import static ${package}.scenarios.tutorial3.TestingRemoteWebApplication.*;
+import static dev.aherscu.qa.testing.utils.StreamMatchers.*;
import static java.util.concurrent.TimeUnit.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
-import static uk.co.probablyfine.matchers.StreamMatchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
+import java.net.*;
import java.util.function.*;
import org.jooq.lambda.*;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.*;
-import org.openqa.selenium.firefox.*;
+import org.openqa.selenium.remote.*;
import org.testng.annotations.*;
+import dev.aherscu.qa.jgiven.commons.utils.*;
import edu.umd.cs.findbugs.annotations.*;
import io.github.bonigarcia.wdm.*;
import lombok.*;
@@ -40,41 +44,37 @@ public class TestingWebApplication {
private final WebDriver webDriver;
@Factory(dataProvider = INTERNAL_DATA_PROVIDER)
- public TestingWebApplication(Supplier webDriver) {
+ public TestingWebApplication(final Supplier webDriver) {
this.webDriver = webDriver.get();
log.trace("testing with {}", webDriver);
}
- @DataProvider
+ // NOTE: parallel with @Factory requires parallel=instances
+ // see https://github.com/testng-team/testng/issues/1951
+ @DataProvider(parallel = true)
private static Object[][] data() {
// NOTE we use suppliers in order to lazily create drivers;
// thus, only when the test is constructed by TestNG
return new Object[][] {
- { Unchecked.supplier(() -> {
- log.trace("setting up firefox driver");
- WebDriverManager.firefoxdriver().setup();
- return new FirefoxDriver();
- }) },
+ // ISSUE Firefox cannot be installed on certain systems
+ // { Unchecked.supplier(() -> {
+ // log.trace("setting up firefox driver");
+ // WebDriverManager.firefoxdriver().setup();
+ // return new FirefoxDriver();
+ // }) },
{ Unchecked.supplier(() -> {
log.trace("setting up chrome driver");
WebDriverManager.chromedriver().setup();
return new ChromeDriver();
}) },
- // TODO setup Selenium on GitHub runner or wait for SauceLabs
- // { Unchecked.supplier(() -> new RemoteWebDriver(
- // new URL("http://localhost:4444"),
- // new DesiredCapabilitiesEx() {
- // {
- // setCapability(BROWSER_NAME, "firefox");
- // }
- // })) }
+ { Unchecked.supplier(() -> {
+ log.trace("setting up remote driver");
+ return new RemoteWebDriver(
+ new URL(SAUCELABS_URL),
+ new DesiredCapabilitiesEx()
+ .with(BROWSER_NAME, "firefox"));
+ }) }
};
-
- }
-
- @Test
- public void shouldOpenWeb() {
- assertThat(webDriver.getTitle(), containsString("Google"));
}
@Test
@@ -82,6 +82,7 @@ public void shouldFind() {
// NOTE the search keyword must be unique such that it is not
// translated to other languages or written differently
val SEARCH_KEYWORD = "testng";
+ log.debug("searching for {} on Google", SEARCH_KEYWORD);
webDriver.findElement(By.name("q"))
.sendKeys(SEARCH_KEYWORD + Keys.ENTER);
assertThat(
@@ -89,9 +90,15 @@ public void shouldFind() {
.stream()
.map(webElement -> webElement.getAttribute("textContent"))
.peek(resultTitle -> log.debug("found {}", resultTitle)),
- allMatch(either(containsStringIgnoringCase("testng"))
- .or(containsStringIgnoringCase("Try again"))
- .or(containsStringIgnoringCase("More results"))));
+ allMatch(either(containsStringIgnoringCase("testng"))
+ .or(containsStringIgnoringCase("Try again"))
+ .or(containsStringIgnoringCase("More results"))));
+ }
+
+ @Test
+ public void shouldOpenWeb() {
+ log.debug("window title must contain Google");
+ assertThat(webDriver.getTitle(), containsString("Google"));
}
@SuppressFBWarnings(
@@ -111,6 +118,6 @@ private void beforeClassOpenWebDriver() {
log.trace("before connecting selenium");
webDriver.manage().window().maximize();
webDriver.manage().timeouts().implicitlyWait(10, SECONDS);
- webDriver.get("https://google.com");
+ webDriver.get("https://google.com?hl=en"); // ensure English
}
}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebWithJGiven.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebWithJGiven.java
index 676665b1ad..21199c4912 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebWithJGiven.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial3/TestingWebWithJGiven.java
@@ -27,16 +27,15 @@
import org.hamcrest.*;
import org.testng.annotations.*;
-import dev.aherscu.qa.jgiven.webdriver.*;
-import dev.aherscu.qa.jgiven.webdriver.model.*;
import dev.aherscu.qa.jgiven.commons.model.*;
+import dev.aherscu.qa.jgiven.commons.tags.*;
+import dev.aherscu.qa.jgiven.webdriver.*;
import ${package}.*;
import ${package}.steps.tutorial.*;
import lombok.*;
public class TestingWebWithJGiven
- extends
- ApplicationPerMethodWebSessionTest, GoogleActions>, GoogleVerifications>> {
+ extends ApplicationPerMethodWebSessionTest, GoogleActions>, GoogleVerifications>> {
protected TestingWebWithJGiven() {
super(TestConfiguration.class);
@@ -45,15 +44,14 @@ protected TestingWebWithJGiven() {
@DataProvider
private Object[][] data() {
return new Object[][] {
- { new Text(wrap(randomAlphanumeric(40), DOUBLE_QUOTE)),
+ { new QuotedText(randomAlphanumeric(40)),
counts(equalTo(0L)) },
- { new Text("testng"),
- allMatch(either(containsStringIgnoringCase("testng"))
- .or(containsStringIgnoringCase("Try again"))
- .or(containsStringIgnoringCase("More results"))) }
+ { new QuotedText("testng"),
+ anyMatch(containsStringIgnoringCase("testng")) }
};
}
+ @Reference("68")
@Test(dataProvider = INTERNAL_DATA_PROVIDER)
public void shouldFind(
final Text textToSearch,
@@ -77,4 +75,10 @@ public void beforeMethodOpenWebDriver() {
super.beforeMethodOpenWebDriver();
webDriver.get().asRemote().manage().window().maximize();
}
+
+ private static class QuotedText extends Text {
+ public QuotedText(final String value) {
+ super(wrap(value, DOUBLE_QUOTE));
+ }
+ }
}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidApplication.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidApplication.java
index a5186a4e4e..5e30d55ae8 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidApplication.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidApplication.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 Adrian Herscu
+ * Copyright 2023 Adrian Herscu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,13 @@
package ${package}.scenarios.tutorial4;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
import static io.appium.java_client.remote.MobilePlatform.*;
+import static io.appium.java_client.remote.options.SupportsAppOption.*;
+import static io.appium.java_client.remote.options.SupportsAutoWebViewOption.*;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.io.*;
import java.net.*;
@@ -39,15 +42,15 @@ public class TestingAndroidApplication {
private WebDriver webDriver;
@SneakyThrows
- static AndroidDriver localApp() {
- return new AndroidDriver<>(
+ static AndroidDriver localApp() {
+ return new AndroidDriver(
new URL("http://127.0.0.1:4723/wd/hub"),
new DesiredCapabilities() {
{
setCapability(PLATFORM_NAME, ANDROID);
- setCapability(DEVICE_NAME, "DONTCARE"); // local
- setCapability(AUTO_WEBVIEW, true);
- setCapability(APP,
+ setCapability(DEVICE_NAME_OPTION, "DONTCARE"); // local
+ setCapability(AUTO_WEB_VIEW_OPTION, true);
+ setCapability(APP_OPTION,
new File(System.getProperty("user.dir"), "app.apk")
.toString());
}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidOnSauceLabs.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
index 6fa17d6c1f..2ceaccbc92 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 Adrian Herscu
+ * Copyright 2023 Adrian Herscu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,15 @@
package ${package}.scenarios.tutorial4;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
import static io.appium.java_client.remote.MobilePlatform.*;
+import static io.appium.java_client.remote.options.SupportsAppOption.APP_OPTION;
+import static io.appium.java_client.remote.options.SupportsAutoWebViewOption.AUTO_WEB_VIEW_OPTION;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.DEVICE_NAME_OPTION;
+import static io.appium.java_client.remote.options.SupportsPlatformVersionOption.PLATFORM_VERSION_OPTION;
import static java.util.concurrent.TimeUnit.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.net.*;
import java.time.*;
@@ -41,19 +45,22 @@ public class TestingAndroidOnSauceLabs {
private WebDriver webDriver;
+ @java.lang.SuppressWarnings("serial")
@SneakyThrows
- static AndroidDriver saucelabsApp(
+ static AndroidDriver saucelabsApp(
final String name) {
- return new AndroidDriver<>(new URL(
+ return new AndroidDriver(new URL(
+ // FIXME should get these credentials from system enviroment
+ // SAUCELABS_USERNAME and SAUCELABS_PASSWORD
"https://TBD:TBD@ondemand.saucelabs.com:443/wd/hub"),
new DesiredCapabilities() {
{
setCapability(PLATFORM_NAME, ANDROID);
- setCapability(PLATFORM_VERSION, "8");
- setCapability(DEVICE_NAME,
+ setCapability(PLATFORM_VERSION_OPTION, "8");
+ setCapability(DEVICE_NAME_OPTION,
"Samsung Galaxy S9 Plus WQHD GoogleAPI Emulator");
- setCapability(AUTO_WEBVIEW, true);
- setCapability(APP, "sauce-storage:app.apk");
+ setCapability(AUTO_WEB_VIEW_OPTION, true);
+ setCapability(APP_OPTION, "sauce-storage:app.apk");
setCapability("name", name);
setCapability("build", "local-"
+ DateTimeFormatter.ofPattern("yyyyMMddHHmmss")
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidWithJGiven.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidWithJGiven.java
index 665fdaa0de..1d71745b3b 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidWithJGiven.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial4/TestingAndroidWithJGiven.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 Adrian Herscu
+ * Copyright 2023 Adrian Herscu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
+import java.lang.SuppressWarnings;
+
import org.openqa.selenium.*;
import org.testng.annotations.*;
@@ -123,7 +125,7 @@ static class Fixtures extends Stage {
private final ThreadLocal webDriver = new ThreadLocal<>();
Fixtures application_installed(
- @Hidden final WebDriver webDriver) {
+ @SuppressWarnings("hiding") @Hidden final WebDriver webDriver) {
log.debug("application installed {}", webDriver);
this.webDriver.set(webDriver);
return self();
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsApplication.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsApplication.java
index 4c81d55213..dcb2f9d6ca 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsApplication.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsApplication.java
@@ -21,6 +21,7 @@
import java.net.*;
+import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import org.testng.annotations.*;
@@ -30,7 +31,7 @@
public class TestingWindowsApplication {
- private WindowsDriver> driver;
+ private WindowsDriver driver;
@Test
public void shouldOpenCalculator() {
@@ -39,10 +40,9 @@ public void shouldOpenCalculator() {
@Test
public void shouldCalculate() {
- driver.findElementByAccessibilityId("CalculatorResults")
+ driver.findElement(By.id("CalculatorResults"))
.sendKeys("8+7=");
- assertThat(driver
- .findElementByAccessibilityId("CalculatorResults")
+ assertThat(driver.findElement(By.id("CalculatorResults"))
.getText(),
stringContainsInOrder("Display is", "15"));
}
@@ -66,7 +66,7 @@ private void beforeClassOpenWebDriver() {
val capabilities = new DesiredCapabilities();
capabilities.setCapability("app",
"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
- driver = new WindowsDriver<>(new URL("http://127.0.0.1:4723"),
+ driver = new WindowsDriver(new URL("http://127.0.0.1:4723"),
capabilities);
// NOTE: should uncomment in order to deal with latencies
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsWithJGiven.java b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsWithJGiven.java
index f35708718b..50e462f0e3 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsWithJGiven.java
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/java/scenarios/tutorial5/TestingWindowsWithJGiven.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 Adrian Herscu
+ * Copyright 2023 Adrian Herscu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,22 +30,12 @@
@Slf4j
public class TestingWindowsWithJGiven
- extends
- ApplicationPerClassWebSessionTest, CalculatorActions>, CalculatorVerifications>> {
+ extends ApplicationPerClassWebSessionTest, CalculatorActions>, CalculatorVerifications>> {
protected TestingWindowsWithJGiven() {
super(TestConfiguration.class);
}
- @BeforeClass
- @SneakyThrows
- @Override
- protected void beforeClassOpenWebDriver() {
- log.debug("before class opening WinAppDriver");
- webDriver.set(WebDriverEx.from(configuration()
- .capabilitiesFor("provider.local.windows")));
- }
-
@DataProvider
static Object[][] data() {
return new Object[][] {
@@ -56,6 +46,15 @@ static Object[][] data() {
};
}
+ @BeforeClass
+ @SneakyThrows
+ @Override
+ protected void beforeClassOpenWebDriver() {
+ log.debug("before class opening WinAppDriver");
+ webDriver.set(WebDriverEx.from(configuration()
+ .capabilitiesFor("provider.local.windows")));
+ }
+
@Test
public void shouldOpenCalculator() {
given()
@@ -65,7 +64,7 @@ public void shouldOpenCalculator() {
.the_title(is(equalTo("Calculator")));
}
- @Test(dataProvider = INTERNAL_DATA_PROVIDER)
+ @Test(dataProvider = "data")
public void shouldCalculate(final Calculation calculation) {
given()
.a_calculator(webDriver.get());
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/logback-common.xml b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/logback-common.xml
index 95e85bcb68..ab2cebdd70 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/logback-common.xml
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/logback-common.xml
@@ -57,7 +57,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/required-capabilities.properties b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/required-capabilities.properties
index 8711a07ab4..24ff8f5ade 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/required-capabilities.properties
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/required-capabilities.properties
@@ -14,7 +14,7 @@
# limitations under the License.
#
required.capability0.type =web
-required.capability0.class=org.openqa.selenium.chrome.ChromeDriver
+required.capability0.-x\:class=org.openqa.selenium.chrome.ChromeDriver
# ISSUE initialization failed due to io.github.bonigarcia.wdm.config.WebDriverManagerException:
# Error HTTP 403 executing https://api.github.com/repos/mozilla/geckodriver/releases
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/webdriver.properties b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/webdriver.properties
index 6992c01056..627da080ac 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/webdriver.properties
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/src/test/resources/webdriver.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-commons.appPackage =TBD
+commons.appPackage =TBD
#
# NOTES:
# Appium capabilities are detailed at
@@ -26,20 +26,20 @@ commons.appPackage =TBD
# Common local properties
# Assumes Appium is installed
# https://github.com/appium/appium-desktop/releases
-commons.local.url =http://127.0.0.1:4723/wd/hub
+commons.local.url =http://127.0.0.1:4723/wd/hub
#
#
# Common SauceLabs properties
-commons.saucelabs.url =https://${env:SAUCELABS_USER}:${env:SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
-commons.saucelabs.maxDuration =6000
-commons.saucelabs.idleTimeout =1000
-commons.saucelabs.application.filename =${application.filename}-${release}
+commons.saucelabs.url =https://${env:SAUCELABS_USER}:${env:SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
+commons.saucelabs.sauce\:maxDuration =6000
+commons.saucelabs.sauce\:idleTimeout =1000
+commons.saucelabs.application.filename =${application.filename}-${release}
#
# Common Selenium properties
-commons.selenium.url =http://localhost:4444/wd/hub
-commons.selenium.maxDuration =6000
-commons.selenium.idleTimeout =1000
-commons.selenium.application.filename =${application.filename}-${release}
+commons.selenium.url =http://localhost:4444/wd/hub
+commons.selenium.sauce\:maxDuration =6000
+commons.selenium.sauce\:idleTimeout =1000
+commons.selenium.application.filename =${application.filename}-${release}
#
#
# Local Windows (desktop) properties
@@ -47,137 +47,135 @@ commons.selenium.application.filename =${application.filename}-${release
# https://github.com/Microsoft/WinAppDriver/releases
# v1.2.1 works with Appium Desktop 1.22.0
#
-provider.local.windows.url =http://127.0.0.1:4723
-provider.local.windows.class =io.appium.java_client.windows.WindowsDriver
-provider.local.windows.platformName =Windows
-provider.local.windows.platformVersion =10
-provider.local.windows.deviceName =WindowsPC
-provider.local.windows.app =${application.filename}
+provider.local.windows.-x\:url =http://127.0.0.1:4723
+provider.local.windows.-x\:class =io.appium.java_client.windows.WindowsDriver
+provider.local.windows.platformName =Windows
+provider.local.windows.appium\:platformVersion =10
+provider.local.windows.appium\:deviceName =WindowsPC
+provider.local.windows.appium\:app =${application.filename}
#
#
# Local Web browser properties
#
-provider.local.web.class =org.openqa.selenium.chrome.ChromeDriver
+provider.local.web.-x\:class =org.openqa.selenium.chrome.ChromeDriver
#
#
# Local Android properties
#
-provider.local.android.url =${commons.local.url}
-provider.local.android.class =io.appium.java_client.android.AndroidDriver
-provider.local.android.nativeWebScreenshot =true
-provider.local.android.automationName =UIAutomator2
-provider.local.android.deviceName =DONTCARE
-provider.local.android.platform =android
-provider.local.android.app =${user.dir}/${application.filename}.apk
-provider.local.android.newCommandTimeout =500
+provider.local.android.-x\:url =${commons.local.url}
+provider.local.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.local.android.appium\:nativeWebScreenshot =true
+provider.local.android.appium\:automationName =UIAutomator2
+provider.local.android.appium\:deviceName =DONTCARE
+provider.local.android.platformName =android
+provider.local.android.appium\:app =${user.dir}/${application.filename}.apk
+provider.local.android.appium\:newCommandTimeout =500
# NOTE: no popups occur on Android
#provider.local.android.autoGrantPermissions =true
#
#
# Local iOS properties
#
-provider.local.ios.url =${commons.local.url}
-provider.local.ios.class =io.appium.java_client.ios.IOSDriver
-provider.local.ios.automationName =XCuiTest
-provider.local.ios.deviceName =iPhone 12 Pro
-provider.local.ios.platform =ios
-provider.local.ios.platformVersion =14.4
-provider.local.ios.udid =TBD
-provider.local.ios.app =${user.dir}/${application.filename}.zip
+provider.local.ios.-x\:url =${commons.local.url}
+provider.local.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.local.ios.appium\:automationName =XCuiTest
+provider.local.ios.appium\:deviceName =iPhone 12 Pro
+provider.local.ios.platformName =ios
+provider.local.ios.appium\:platformVersion =14.4
+provider.local.ios.appium\:udid =TBD
+provider.local.ios.appium\:app =${user.dir}/${application.filename}.zip
# NOTE: has no effect; tested both on local simulator and on SauceLabs
#provider.local.ios.autoAcceptAlerts =true
#
#
# SauceLabs Web browser properties
#
-provider.saucelabs.web.class =org.openqa.selenium.remote.RemoteWebDriver
-provider.saucelabs.web.url =${commons.saucelabs.url}
-provider.saucelabs.web.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.web.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.web.target =${web.url}
-provider.saucelabs.web.browserName =Chrome
-provider.saucelabs.web.platform =
-provider.saucelabs.web.version =
-provider.saucelabs.web.build =${build.label}
-provider.saucelabs.web.tags =${build.tags}
+provider.saucelabs.web.-x\:class =org.openqa.selenium.remote.RemoteWebDriver
+provider.saucelabs.web.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.web.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.web.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.web.-x\:target =${web.url}
+provider.saucelabs.web.browserName =Chrome
+provider.saucelabs.web.sauce\:build =${build.label}
+provider.saucelabs.web.sauce\:tags =${build.tags}
#
#
# SauceLabs Android properties
#
-provider.saucelabs.android.class =io.appium.java_client.android.AndroidDriver
-provider.saucelabs.android.url =${commons.saucelabs.url}
-provider.saucelabs.android.nativeWebScreenshot=true
-provider.saucelabs.android.appium.version =1.18.1
-provider.saucelabs.android.automationName =UIAutomator2
-provider.saucelabs.android.deviceName =Google Pixel 3a XL GoogleAPI Emulator
-provider.saucelabs.android.platformVersion =10.0
-provider.saucelabs.android.platformName =Android
-provider.saucelabs.android.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.android.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.android.app =sauce-storage:${commons.saucelabs.application.filename}.apk
-provider.saucelabs.android.appPackage =${commons.appPackage}
-provider.saucelabs.android.build =${build.label}
-provider.saucelabs.android.tags =${build.tags}
+provider.saucelabs.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.saucelabs.android.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.android.appium\:nativeWebScreenshot=true
+provider.saucelabs.android.appium\:appium.version =1.18.1
+provider.saucelabs.android.appium\:automationName =UIAutomator2
+provider.saucelabs.android.appium\:deviceName =Google Pixel 3a XL GoogleAPI Emulator
+provider.saucelabs.android.appium\:platformVersion =10.0
+provider.saucelabs.android.platformName =Android
+provider.saucelabs.android.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.android.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.android.appium\:app =sauce-storage:${commons.saucelabs.application.filename}.apk
+provider.saucelabs.android.appium\:appPackage =${commons.appPackage}
+provider.saucelabs.android.sauce\:build =${build.label}
+provider.saucelabs.android.sauce\:tags =${build.tags}
#
#
# SauceLabs iOS properties
#
-provider.saucelabs.ios.class =io.appium.java_client.ios.IOSDriver
-provider.saucelabs.ios.url =${commons.saucelabs.url}
-provider.saucelabs.ios.nativeWebScreenshot =true
-provider.saucelabs.ios.appium.version =1.21.0
-provider.saucelabs.ios.automationName =XCuiTest
-provider.saucelabs.ios.deviceName =iPhone 12 Pro Max Simulator
-provider.saucelabs.ios.platformVersion =14.4
-provider.saucelabs.ios.platformName =iOS
-provider.saucelabs.ios.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.ios.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.ios.app =sauce-storage:${commons.saucelabs.application.filename}.zip
-provider.saucelabs.ios.appPackage =${commons.appPackage}
-provider.saucelabs.ios.build =${build.label}
-provider.saucelabs.ios.tags =${build.tags}
+provider.saucelabs.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.saucelabs.ios.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.ios.appium\:nativeWebScreenshot =true
+provider.saucelabs.ios.appium\:appium.version =1.21.0
+provider.saucelabs.ios.appium\:automationName =XCuiTest
+provider.saucelabs.ios.appium\:deviceName =iPhone 12 Pro Max Simulator
+provider.saucelabs.ios.appium\:platformVersion =14.4
+provider.saucelabs.ios.platformName =iOS
+provider.saucelabs.ios.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.ios.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.ios.appium\:app =sauce-storage:${commons.saucelabs.application.filename}.zip
+provider.saucelabs.ios.appium\:appPackage =${commons.appPackage}
+provider.saucelabs.ios.sauce\:build =${build.label}
+provider.saucelabs.ios.sauce\:tags =${build.tags}
#
# Self-hosted local Selenium Web browser properties
#
-provider.selenium.web.class =org.openqa.selenium.remote.RemoteWebDriver
-provider.selenium.web.url =${commons.selenium.url}
-provider.selenium.web.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.web.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.web.browserName =chrome
-provider.selenium.web.platform =linux
+provider.selenium.web.-x\:class =org.openqa.selenium.remote.RemoteWebDriver
+provider.selenium.web.-x\:url =${commons.selenium.url}
+provider.selenium.web.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.web.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.web.browserName =chrome
+provider.selenium.web.platformName =linux
#
#
# Self-hosted local Android properties
#
-provider.selenium.android.class =io.appium.java_client.android.AndroidDriver
-provider.selenium.android.url =${commons.selenium.url}
-provider.selenium.android.nativeWebScreenshot =true
-provider.selenium.android.appium.version =1.18.1
-provider.selenium.android.automationName =UIAutomator2
-provider.selenium.android.deviceName =Google Pixel 3a XL GoogleAPI Emulator
-provider.selenium.android.platformVersion =10.0
-provider.selenium.android.platformName =Android
-provider.selenium.android.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.android.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.android.app =sauce-storage:${commons.selenium.application.filename}.apk
-provider.selenium.android.appPackage =${commons.appPackage}
-provider.selenium.android.build =${build.label}
-provider.selenium.android.tags =${build.tags}
+provider.selenium.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.selenium.android.-x\:url =${commons.selenium.url}
+provider.selenium.android.appium\:nativeWebScreenshot =true
+provider.selenium.android.appium\:appium.version =1.18.1
+provider.selenium.android.appium\:automationName =UIAutomator2
+provider.selenium.android.appium\:deviceName =Google Pixel 3a XL GoogleAPI Emulator
+provider.selenium.android.appium\:platformVersion =10.0
+provider.selenium.android.platformName =Android
+provider.selenium.android.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.android.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.android.appium\:app =sauce-storage:${commons.selenium.application.filename}.apk
+provider.selenium.android.appium\:appPackage =${commons.appPackage}
+provider.selenium.android.sauce\:build =${build.label}
+provider.selenium.android.sauce\:tags =${build.tags}
#
#
# Self-hosted local iOS properties
#
-provider.selenium.ios.class =io.appium.java_client.ios.IOSDriver
-provider.selenium.ios.url =${commons.selenium.url}
-provider.selenium.ios.nativeWebScreenshot =true
-provider.selenium.ios.appium.version =1.21.0
-provider.selenium.ios.automationName =XCuiTest
-provider.selenium.ios.deviceName =iPhone 12 Pro Max Simulator
-provider.selenium.ios.platformVersion =14.4
-provider.selenium.ios.platformName =iOS
-provider.selenium.ios.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.ios.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.ios.app =sauce-storage:${commons.selenium.application.filename}.zip
-provider.selenium.ios.appPackage =${commons.appPackage}
-provider.selenium.ios.build =${build.label}
-provider.selenium.ios.tags =${build.tags}
+provider.selenium.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.selenium.ios.-x\:url =${commons.selenium.url}
+provider.selenium.ios.appium\:nativeWebScreenshot =true
+provider.selenium.ios.appium\:appium.version =1.21.0
+provider.selenium.ios.appium\:automationName =XCuiTest
+provider.selenium.ios.appium\:deviceName =iPhone 12 Pro Max Simulator
+provider.selenium.ios.appium\:platformVersion =14.4
+provider.selenium.ios.platformName =iOS
+provider.selenium.ios.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.ios.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.ios.appium\:app =sauce-storage:${commons.selenium.application.filename}.zip
+provider.selenium.ios.appium\:appPackage =${commons.appPackage}
+provider.selenium.ios.sauce\:build =${build.label}
+provider.selenium.ios.sauce\:tags =${build.tags}
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/standalone-tutorials.bat b/qa-testing-archetype/src/main/resources/archetype-resources/standalone-tutorials.bat
index 56eda4b3e8..26665c5a17 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/standalone-tutorials.bat
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/standalone-tutorials.bat
@@ -7,7 +7,7 @@ if [%TEST_JAR%]==[] (
echo INFO: run "mvn package -Pgenerate-standalone" to generate the test jar
exit /b 1
)
-java ^
+%JAVA_HOME%\bin\java ^
-Dlog.root.level=info ^
-Dlogback.configurationFile=logback-test.xml ^
-Dpoll.timeout=15 ^
diff --git a/qa-testing-archetype/src/main/resources/archetype-resources/standalone-windows.bat b/qa-testing-archetype/src/main/resources/archetype-resources/standalone-windows.bat
index df5f5ba6d9..329413b751 100644
--- a/qa-testing-archetype/src/main/resources/archetype-resources/standalone-windows.bat
+++ b/qa-testing-archetype/src/main/resources/archetype-resources/standalone-windows.bat
@@ -7,7 +7,7 @@ if [%TEST_JAR%]==[] (
echo INFO: run "mvn package -Pgenerate-standalone" to generate the test jar
exit /b 1
)
-java ^
+%JAVA_HOME%\bin\java ^
-Dlog.root.level=info ^
-Dlogback.configurationFile=logback-test.xml ^
-Dpoll.timeout=15 ^
diff --git a/qa-testing-example/.classpath b/qa-testing-example/.classpath
index 3f5f77a274..f960821cb4 100644
--- a/qa-testing-example/.classpath
+++ b/qa-testing-example/.classpath
@@ -20,7 +20,7 @@
-
+
diff --git a/qa-testing-example/pom.xml b/qa-testing-example/pom.xml
index 9a0318c929..67212d8757 100644
--- a/qa-testing-example/pom.xml
+++ b/qa-testing-example/pom.xml
@@ -21,7 +21,7 @@
dev.aherscu.qaqa-testing-parent
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOT../qa-testing-parent
@@ -43,29 +43,29 @@
dev.aherscu.qaqa-jgiven-webdriver
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTorg.mock-servermockserver-netty
- 5.14.0
+ 5.15.0dev.aherscu.qaqa-jgiven-rest
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTtestdev.aherscu.qaqa-jgiven-rabbitmq
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTtestdev.aherscu.qaqa-jgiven-elasticsearch
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTtest
diff --git a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/AbstractMockServerTest.java b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/AbstractMockServerTest.java
index 3cdc11a850..9e45806b81 100644
--- a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/AbstractMockServerTest.java
+++ b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/AbstractMockServerTest.java
@@ -18,8 +18,6 @@
import java.io.*;
import java.net.*;
-import javax.ws.rs.core.*;
-
import org.mockserver.client.*;
import org.mockserver.integration.*;
import org.testng.annotations.*;
@@ -28,6 +26,7 @@
import dev.aherscu.qa.jgiven.commons.steps.*;
import dev.aherscu.qa.jgiven.commons.utils.*;
import dev.aherscu.qa.testing.utils.config.*;
+import jakarta.ws.rs.core.*;
import lombok.*;
import lombok.extern.slf4j.*;
diff --git a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorActions.java b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorActions.java
index a3aad896c5..5e35735145 100644
--- a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorActions.java
+++ b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorActions.java
@@ -16,13 +16,13 @@
package dev.aherscu.qa.testing.example.steps.tutorial;
-import static io.appium.java_client.MobileBy.*;
+import static io.appium.java_client.AppiumBy.*;
import dev.aherscu.qa.jgiven.webdriver.steps.*;
public class CalculatorActions>
extends WebDriverActions {
public SELF typing(final String expression) {
- return typing_$_into(expression, AccessibilityId("CalculatorResults"));
+ return typing_$_into(expression, accessibilityId("CalculatorResults"));
}
}
diff --git a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorVerifications.java b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorVerifications.java
index e6ad3c7b78..97d9663ab9 100644
--- a/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorVerifications.java
+++ b/qa-testing-example/src/main/java/dev/aherscu/qa/testing/example/steps/tutorial/CalculatorVerifications.java
@@ -16,7 +16,7 @@
package dev.aherscu.qa.testing.example.steps.tutorial;
-import static io.appium.java_client.MobileBy.*;
+import static io.appium.java_client.AppiumBy.*;
import org.hamcrest.*;
@@ -29,7 +29,7 @@ public class CalculatorVerifications>
@AttachesScreenshot
public SELF the_result(final Matcher matcher) {
return eventually_assert_that(
- () -> element(AccessibilityId("CalculatorResults")).getText(),
+ () -> element(accessibilityId("CalculatorResults")).getText(),
matcher);
}
}
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/SelfTests.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/SelfTests.java
index 4e043111a7..40fb13547c 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/SelfTests.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/SelfTests.java
@@ -17,9 +17,9 @@
package dev.aherscu.qa.testing.example.scenarios;
import static dev.aherscu.qa.jgiven.commons.utils.UnitilsScenarioTest.*;
+import static dev.aherscu.qa.testing.utils.StreamMatchers.allMatch;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
-import static uk.co.probablyfine.matchers.StreamMatchers.*;
import java.util.stream.*;
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingRemoteWebApplication.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingRemoteWebApplication.java
new file mode 100644
index 0000000000..f6efef1720
--- /dev/null
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingRemoteWebApplication.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2023 Adrian Herscu
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dev.aherscu.qa.testing.example.scenarios.tutorial3;
+
+import static dev.aherscu.qa.testing.utils.StreamMatchers.*;
+import static java.util.Objects.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.hamcrest.MatcherAssert.*;
+import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
+
+import java.net.*;
+
+import org.openqa.selenium.*;
+import org.openqa.selenium.remote.*;
+import org.testng.annotations.*;
+
+import dev.aherscu.qa.jgiven.commons.utils.*;
+import edu.umd.cs.findbugs.annotations.*;
+import lombok.*;
+import lombok.extern.slf4j.*;
+
+@Slf4j
+public class TestingRemoteWebApplication {
+ public final static String SAUCELABS_PASSWORD;
+ public final static String SAUCELABS_URL;
+ public final static String SAUCELABS_USER;
+
+ static {
+ SAUCELABS_PASSWORD =
+ requireNonNull(System.getenv("SAUCELABS_PASSWORD"),
+ "missing SauceLabs password");
+ SAUCELABS_USER =
+ requireNonNull(System.getenv("SAUCELABS_USER"),
+ "missing SauceLabs username");
+ SAUCELABS_URL = String
+ .format("https://%s:%s@ondemand.saucelabs.com:443/wd/hub",
+ SAUCELABS_USER, SAUCELABS_PASSWORD);
+ }
+
+ private WebDriver webDriver;
+
+ @Test
+ public void shouldFind() {
+ // NOTE the search keyword must be unique such that it is not
+ // translated to other languages or written differently
+ val SEARCH_KEYWORD = "testng";
+ webDriver.findElement(By.name("q"))
+ .sendKeys(SEARCH_KEYWORD + Keys.ENTER);
+ assertThat(
+ webDriver.findElements(By.xpath("//a/h3"))
+ .stream()
+ .map(webElement -> webElement.getAttribute("textContent"))
+ .peek(resultTitle -> log.debug("found {}", resultTitle)),
+ allMatch(either(containsStringIgnoringCase("testng"))
+ .or(containsStringIgnoringCase("Try again"))
+ .or(containsStringIgnoringCase("More results"))));
+ }
+
+ @Test
+ public void shouldOpenWeb() {
+ assertThat(webDriver.getTitle(), containsString("Google"));
+ }
+
+ @SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "called by testng framework")
+ @AfterClass(alwaysRun = true) // important, otherwise we may leak resources
+ private void afterClassCloseWebDriver() {
+ webDriver.quit();
+ }
+
+ @SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "called by testng framework")
+ @BeforeClass
+ @SneakyThrows
+ private void beforeClassOpenWebDriver() {
+ log.trace("connecting saucelabs with {}:{}",
+ SAUCELABS_USER, SAUCELABS_PASSWORD);
+ webDriver = new RemoteWebDriver(new URL(SAUCELABS_URL),
+ new DesiredCapabilitiesEx()
+ .with(BROWSER_NAME, "firefox")
+ .with("sauce:name", "selenium 4 test")
+ // NOTE since Selenium 4, non-standard capabilities must be prefixed;
+ // see https://www.w3.org/TR/webdriver1/#capabilities
+ // and https://docs.saucelabs.com/dev/test-configuration-options/
+ // and
+ // https://docs.saucelabs.com/dev/test-configuration-options/#desktop-and-mobile-capabilities-sauce-specific--optional
+ // and
+ // https://docs.saucelabs.com/mobile-apps/automated-testing/appium/appium-2-migration/
+ // For example,
+ // .with("my:capability", "kuku")
+ );
+
+ webDriver.manage().window().maximize();
+ webDriver.manage().timeouts().implicitlyWait(10, SECONDS);
+ webDriver.get("https://google.com?hl=en");
+ }
+}
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingWebApplication.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingWebApplication.java
index 97362bcd96..f66f8ecdfa 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingWebApplication.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingWebApplication.java
@@ -17,19 +17,23 @@
package dev.aherscu.qa.testing.example.scenarios.tutorial3;
import static dev.aherscu.qa.jgiven.commons.utils.UnitilsScenarioTest.*;
+import static dev.aherscu.qa.testing.example.scenarios.tutorial3.TestingRemoteWebApplication.*;
+import static dev.aherscu.qa.testing.utils.StreamMatchers.*;
import static java.util.concurrent.TimeUnit.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
-import static uk.co.probablyfine.matchers.StreamMatchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
+import java.net.*;
import java.util.function.*;
import org.jooq.lambda.*;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.*;
-import org.openqa.selenium.firefox.*;
+import org.openqa.selenium.remote.*;
import org.testng.annotations.*;
+import dev.aherscu.qa.jgiven.commons.utils.*;
import edu.umd.cs.findbugs.annotations.*;
import io.github.bonigarcia.wdm.*;
import lombok.*;
@@ -40,41 +44,37 @@ public class TestingWebApplication {
private final WebDriver webDriver;
@Factory(dataProvider = INTERNAL_DATA_PROVIDER)
- public TestingWebApplication(Supplier webDriver) {
+ public TestingWebApplication(final Supplier webDriver) {
this.webDriver = webDriver.get();
log.trace("testing with {}", webDriver);
}
- @DataProvider
+ // NOTE: parallel with @Factory requires parallel=instances
+ // see https://github.com/testng-team/testng/issues/1951
+ @DataProvider(parallel = true)
private static Object[][] data() {
// NOTE we use suppliers in order to lazily create drivers;
// thus, only when the test is constructed by TestNG
return new Object[][] {
- { Unchecked.supplier(() -> {
- log.trace("setting up firefox driver");
- WebDriverManager.firefoxdriver().setup();
- return new FirefoxDriver();
- }) },
+ // ISSUE Firefox cannot be installed on certain systems
+ // { Unchecked.supplier(() -> {
+ // log.trace("setting up firefox driver");
+ // WebDriverManager.firefoxdriver().setup();
+ // return new FirefoxDriver();
+ // }) },
{ Unchecked.supplier(() -> {
log.trace("setting up chrome driver");
WebDriverManager.chromedriver().setup();
return new ChromeDriver();
}) },
- // TODO setup Selenium on GitHub runner or wait for SauceLabs
- // { Unchecked.supplier(() -> new RemoteWebDriver(
- // new URL("http://localhost:4444"),
- // new DesiredCapabilitiesEx() {
- // {
- // setCapability(BROWSER_NAME, "firefox");
- // }
- // })) }
+ { Unchecked.supplier(() -> {
+ log.trace("setting up remote driver");
+ return new RemoteWebDriver(
+ new URL(SAUCELABS_URL),
+ new DesiredCapabilitiesEx()
+ .with(BROWSER_NAME, "firefox"));
+ }) }
};
-
- }
-
- @Test
- public void shouldOpenWeb() {
- assertThat(webDriver.getTitle(), containsString("Google"));
}
@Test
@@ -82,6 +82,7 @@ public void shouldFind() {
// NOTE the search keyword must be unique such that it is not
// translated to other languages or written differently
val SEARCH_KEYWORD = "testng";
+ log.debug("searching for {} on Google", SEARCH_KEYWORD);
webDriver.findElement(By.name("q"))
.sendKeys(SEARCH_KEYWORD + Keys.ENTER);
assertThat(
@@ -94,6 +95,12 @@ public void shouldFind() {
.or(containsStringIgnoringCase("More results"))));
}
+ @Test
+ public void shouldOpenWeb() {
+ log.debug("window title must contain Google");
+ assertThat(webDriver.getTitle(), containsString("Google"));
+ }
+
@SuppressFBWarnings(
value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "called by testng framework")
@@ -111,6 +118,6 @@ private void beforeClassOpenWebDriver() {
log.trace("before connecting selenium");
webDriver.manage().window().maximize();
webDriver.manage().timeouts().implicitlyWait(10, SECONDS);
- webDriver.get("https://google.com");
+ webDriver.get("https://google.com?hl=en"); // ensure English
}
}
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidApplication.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidApplication.java
index 965f46ddcc..f6818879c7 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidApplication.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidApplication.java
@@ -16,10 +16,13 @@
package dev.aherscu.qa.testing.example.scenarios.tutorial4;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
import static io.appium.java_client.remote.MobilePlatform.*;
+import static io.appium.java_client.remote.options.SupportsAppOption.*;
+import static io.appium.java_client.remote.options.SupportsAutoWebViewOption.*;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.io.*;
import java.net.*;
@@ -38,17 +41,16 @@
public class TestingAndroidApplication {
private WebDriver webDriver;
- @java.lang.SuppressWarnings("serial")
@SneakyThrows
- static AndroidDriver localApp() {
- return new AndroidDriver<>(
+ static AndroidDriver localApp() {
+ return new AndroidDriver(
new URL("http://127.0.0.1:4723/wd/hub"),
new DesiredCapabilities() {
{
setCapability(PLATFORM_NAME, ANDROID);
- setCapability(DEVICE_NAME, "DONTCARE"); // local
- setCapability(AUTO_WEBVIEW, true);
- setCapability(APP,
+ setCapability(DEVICE_NAME_OPTION, "DONTCARE"); // local
+ setCapability(AUTO_WEB_VIEW_OPTION, true);
+ setCapability(APP_OPTION,
new File(System.getProperty("user.dir"), "app.apk")
.toString());
}
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidOnSauceLabs.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
index 6adfd467e3..29c5ed049e 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial4/TestingAndroidOnSauceLabs.java
@@ -16,11 +16,15 @@
package dev.aherscu.qa.testing.example.scenarios.tutorial4;
-import static io.appium.java_client.remote.MobileCapabilityType.*;
import static io.appium.java_client.remote.MobilePlatform.*;
+import static io.appium.java_client.remote.options.SupportsAppOption.APP_OPTION;
+import static io.appium.java_client.remote.options.SupportsAutoWebViewOption.AUTO_WEB_VIEW_OPTION;
+import static io.appium.java_client.remote.options.SupportsDeviceNameOption.DEVICE_NAME_OPTION;
+import static io.appium.java_client.remote.options.SupportsPlatformVersionOption.PLATFORM_VERSION_OPTION;
import static java.util.concurrent.TimeUnit.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
+import static org.openqa.selenium.remote.CapabilityType.*;
import java.net.*;
import java.time.*;
@@ -43,20 +47,20 @@ public class TestingAndroidOnSauceLabs {
@java.lang.SuppressWarnings("serial")
@SneakyThrows
- static AndroidDriver saucelabsApp(
+ static AndroidDriver saucelabsApp(
final String name) {
- return new AndroidDriver<>(new URL(
+ return new AndroidDriver(new URL(
// FIXME should get these credentials from system enviroment
- // SAUCELABS_USERNAME and SAUCELABS_PASSWORD
+ // SAUCELABS_USERNAME and SAUCELABS_PASSWORD
"https://TBD:TBD@ondemand.saucelabs.com:443/wd/hub"),
new DesiredCapabilities() {
{
setCapability(PLATFORM_NAME, ANDROID);
- setCapability(PLATFORM_VERSION, "8");
- setCapability(DEVICE_NAME,
+ setCapability(PLATFORM_VERSION_OPTION, "8");
+ setCapability(DEVICE_NAME_OPTION,
"Samsung Galaxy S9 Plus WQHD GoogleAPI Emulator");
- setCapability(AUTO_WEBVIEW, true);
- setCapability(APP, "sauce-storage:app.apk");
+ setCapability(AUTO_WEB_VIEW_OPTION, true);
+ setCapability(APP_OPTION, "sauce-storage:app.apk");
setCapability("name", name);
setCapability("build", "local-"
+ DateTimeFormatter.ofPattern("yyyyMMddHHmmss")
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial5/TestingWindowsApplication.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial5/TestingWindowsApplication.java
index ddd2e8fd5e..dc2c8cad15 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial5/TestingWindowsApplication.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial5/TestingWindowsApplication.java
@@ -21,6 +21,7 @@
import java.net.*;
+import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import org.testng.annotations.*;
@@ -30,7 +31,7 @@
public class TestingWindowsApplication {
- private WindowsDriver> driver;
+ private WindowsDriver driver;
@Test
public void shouldOpenCalculator() {
@@ -39,10 +40,9 @@ public void shouldOpenCalculator() {
@Test
public void shouldCalculate() {
- driver.findElementByAccessibilityId("CalculatorResults")
+ driver.findElement(By.id("CalculatorResults"))
.sendKeys("8+7=");
- assertThat(driver
- .findElementByAccessibilityId("CalculatorResults")
+ assertThat(driver.findElement(By.id("CalculatorResults"))
.getText(),
stringContainsInOrder("Display is", "15"));
}
@@ -66,7 +66,7 @@ private void beforeClassOpenWebDriver() {
val capabilities = new DesiredCapabilities();
capabilities.setCapability("app",
"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
- driver = new WindowsDriver<>(new URL("http://127.0.0.1:4723"),
+ driver = new WindowsDriver(new URL("http://127.0.0.1:4723"),
capabilities);
// NOTE: should uncomment in order to deal with latencies
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericMockServerRestTest.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericMockServerRestTest.java
index 1391b7bff3..798df83ec6 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericMockServerRestTest.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericMockServerRestTest.java
@@ -17,7 +17,7 @@
import static dev.aherscu.qa.testing.utils.StringUtilsExtensions.*;
import static java.util.Arrays.*;
-import static javax.ws.rs.core.Response.Status.Family.*;
+import static jakarta.ws.rs.core.Response.Status.Family.*;
import static org.hamcrest.Matchers.*;
import static org.mockserver.matchers.Times.*;
import static org.mockserver.model.HttpError.*;
@@ -27,7 +27,7 @@
import java.util.*;
-import javax.ws.rs.client.*;
+import jakarta.ws.rs.client.*;
import org.mockserver.mock.*;
import org.mockserver.model.*;
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericRestTest.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericRestTest.java
index 42eb932e62..01a40d3e72 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericRestTest.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/GenericRestTest.java
@@ -20,7 +20,7 @@
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.equalTo;
-import javax.ws.rs.client.*;
+import jakarta.ws.rs.client.*;
import org.testng.annotations.*;
diff --git a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/StatefulRestTest.java b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/StatefulRestTest.java
index 0fba42566b..6bba0b02b5 100644
--- a/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/StatefulRestTest.java
+++ b/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial6/StatefulRestTest.java
@@ -21,8 +21,8 @@
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.equalTo;
-import javax.ws.rs.client.*;
-import javax.ws.rs.core.*;
+import jakarta.ws.rs.client.*;
+import jakarta.ws.rs.core.*;
import org.testng.annotations.*;
diff --git a/qa-testing-example/src/test/resources/logback-common.xml b/qa-testing-example/src/test/resources/logback-common.xml
index 46a22b52f3..6a5ca90156 100644
--- a/qa-testing-example/src/test/resources/logback-common.xml
+++ b/qa-testing-example/src/test/resources/logback-common.xml
@@ -57,7 +57,7 @@
-
+ target/per-thread-logs/test-${threadId}.logfalse
diff --git a/qa-testing-example/src/test/resources/webdriver.properties b/qa-testing-example/src/test/resources/webdriver.properties
index 6992c01056..627da080ac 100644
--- a/qa-testing-example/src/test/resources/webdriver.properties
+++ b/qa-testing-example/src/test/resources/webdriver.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-commons.appPackage =TBD
+commons.appPackage =TBD
#
# NOTES:
# Appium capabilities are detailed at
@@ -26,20 +26,20 @@ commons.appPackage =TBD
# Common local properties
# Assumes Appium is installed
# https://github.com/appium/appium-desktop/releases
-commons.local.url =http://127.0.0.1:4723/wd/hub
+commons.local.url =http://127.0.0.1:4723/wd/hub
#
#
# Common SauceLabs properties
-commons.saucelabs.url =https://${env:SAUCELABS_USER}:${env:SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
-commons.saucelabs.maxDuration =6000
-commons.saucelabs.idleTimeout =1000
-commons.saucelabs.application.filename =${application.filename}-${release}
+commons.saucelabs.url =https://${env:SAUCELABS_USER}:${env:SAUCELABS_PASSWORD}@ondemand.saucelabs.com:443/wd/hub
+commons.saucelabs.sauce\:maxDuration =6000
+commons.saucelabs.sauce\:idleTimeout =1000
+commons.saucelabs.application.filename =${application.filename}-${release}
#
# Common Selenium properties
-commons.selenium.url =http://localhost:4444/wd/hub
-commons.selenium.maxDuration =6000
-commons.selenium.idleTimeout =1000
-commons.selenium.application.filename =${application.filename}-${release}
+commons.selenium.url =http://localhost:4444/wd/hub
+commons.selenium.sauce\:maxDuration =6000
+commons.selenium.sauce\:idleTimeout =1000
+commons.selenium.application.filename =${application.filename}-${release}
#
#
# Local Windows (desktop) properties
@@ -47,137 +47,135 @@ commons.selenium.application.filename =${application.filename}-${release
# https://github.com/Microsoft/WinAppDriver/releases
# v1.2.1 works with Appium Desktop 1.22.0
#
-provider.local.windows.url =http://127.0.0.1:4723
-provider.local.windows.class =io.appium.java_client.windows.WindowsDriver
-provider.local.windows.platformName =Windows
-provider.local.windows.platformVersion =10
-provider.local.windows.deviceName =WindowsPC
-provider.local.windows.app =${application.filename}
+provider.local.windows.-x\:url =http://127.0.0.1:4723
+provider.local.windows.-x\:class =io.appium.java_client.windows.WindowsDriver
+provider.local.windows.platformName =Windows
+provider.local.windows.appium\:platformVersion =10
+provider.local.windows.appium\:deviceName =WindowsPC
+provider.local.windows.appium\:app =${application.filename}
#
#
# Local Web browser properties
#
-provider.local.web.class =org.openqa.selenium.chrome.ChromeDriver
+provider.local.web.-x\:class =org.openqa.selenium.chrome.ChromeDriver
#
#
# Local Android properties
#
-provider.local.android.url =${commons.local.url}
-provider.local.android.class =io.appium.java_client.android.AndroidDriver
-provider.local.android.nativeWebScreenshot =true
-provider.local.android.automationName =UIAutomator2
-provider.local.android.deviceName =DONTCARE
-provider.local.android.platform =android
-provider.local.android.app =${user.dir}/${application.filename}.apk
-provider.local.android.newCommandTimeout =500
+provider.local.android.-x\:url =${commons.local.url}
+provider.local.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.local.android.appium\:nativeWebScreenshot =true
+provider.local.android.appium\:automationName =UIAutomator2
+provider.local.android.appium\:deviceName =DONTCARE
+provider.local.android.platformName =android
+provider.local.android.appium\:app =${user.dir}/${application.filename}.apk
+provider.local.android.appium\:newCommandTimeout =500
# NOTE: no popups occur on Android
#provider.local.android.autoGrantPermissions =true
#
#
# Local iOS properties
#
-provider.local.ios.url =${commons.local.url}
-provider.local.ios.class =io.appium.java_client.ios.IOSDriver
-provider.local.ios.automationName =XCuiTest
-provider.local.ios.deviceName =iPhone 12 Pro
-provider.local.ios.platform =ios
-provider.local.ios.platformVersion =14.4
-provider.local.ios.udid =TBD
-provider.local.ios.app =${user.dir}/${application.filename}.zip
+provider.local.ios.-x\:url =${commons.local.url}
+provider.local.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.local.ios.appium\:automationName =XCuiTest
+provider.local.ios.appium\:deviceName =iPhone 12 Pro
+provider.local.ios.platformName =ios
+provider.local.ios.appium\:platformVersion =14.4
+provider.local.ios.appium\:udid =TBD
+provider.local.ios.appium\:app =${user.dir}/${application.filename}.zip
# NOTE: has no effect; tested both on local simulator and on SauceLabs
#provider.local.ios.autoAcceptAlerts =true
#
#
# SauceLabs Web browser properties
#
-provider.saucelabs.web.class =org.openqa.selenium.remote.RemoteWebDriver
-provider.saucelabs.web.url =${commons.saucelabs.url}
-provider.saucelabs.web.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.web.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.web.target =${web.url}
-provider.saucelabs.web.browserName =Chrome
-provider.saucelabs.web.platform =
-provider.saucelabs.web.version =
-provider.saucelabs.web.build =${build.label}
-provider.saucelabs.web.tags =${build.tags}
+provider.saucelabs.web.-x\:class =org.openqa.selenium.remote.RemoteWebDriver
+provider.saucelabs.web.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.web.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.web.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.web.-x\:target =${web.url}
+provider.saucelabs.web.browserName =Chrome
+provider.saucelabs.web.sauce\:build =${build.label}
+provider.saucelabs.web.sauce\:tags =${build.tags}
#
#
# SauceLabs Android properties
#
-provider.saucelabs.android.class =io.appium.java_client.android.AndroidDriver
-provider.saucelabs.android.url =${commons.saucelabs.url}
-provider.saucelabs.android.nativeWebScreenshot=true
-provider.saucelabs.android.appium.version =1.18.1
-provider.saucelabs.android.automationName =UIAutomator2
-provider.saucelabs.android.deviceName =Google Pixel 3a XL GoogleAPI Emulator
-provider.saucelabs.android.platformVersion =10.0
-provider.saucelabs.android.platformName =Android
-provider.saucelabs.android.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.android.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.android.app =sauce-storage:${commons.saucelabs.application.filename}.apk
-provider.saucelabs.android.appPackage =${commons.appPackage}
-provider.saucelabs.android.build =${build.label}
-provider.saucelabs.android.tags =${build.tags}
+provider.saucelabs.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.saucelabs.android.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.android.appium\:nativeWebScreenshot=true
+provider.saucelabs.android.appium\:appium.version =1.18.1
+provider.saucelabs.android.appium\:automationName =UIAutomator2
+provider.saucelabs.android.appium\:deviceName =Google Pixel 3a XL GoogleAPI Emulator
+provider.saucelabs.android.appium\:platformVersion =10.0
+provider.saucelabs.android.platformName =Android
+provider.saucelabs.android.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.android.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.android.appium\:app =sauce-storage:${commons.saucelabs.application.filename}.apk
+provider.saucelabs.android.appium\:appPackage =${commons.appPackage}
+provider.saucelabs.android.sauce\:build =${build.label}
+provider.saucelabs.android.sauce\:tags =${build.tags}
#
#
# SauceLabs iOS properties
#
-provider.saucelabs.ios.class =io.appium.java_client.ios.IOSDriver
-provider.saucelabs.ios.url =${commons.saucelabs.url}
-provider.saucelabs.ios.nativeWebScreenshot =true
-provider.saucelabs.ios.appium.version =1.21.0
-provider.saucelabs.ios.automationName =XCuiTest
-provider.saucelabs.ios.deviceName =iPhone 12 Pro Max Simulator
-provider.saucelabs.ios.platformVersion =14.4
-provider.saucelabs.ios.platformName =iOS
-provider.saucelabs.ios.maxDuration =${commons.saucelabs.maxDuration}
-provider.saucelabs.ios.idleTimeout =${commons.saucelabs.idleTimeout}
-provider.saucelabs.ios.app =sauce-storage:${commons.saucelabs.application.filename}.zip
-provider.saucelabs.ios.appPackage =${commons.appPackage}
-provider.saucelabs.ios.build =${build.label}
-provider.saucelabs.ios.tags =${build.tags}
+provider.saucelabs.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.saucelabs.ios.-x\:url =${commons.saucelabs.url}
+provider.saucelabs.ios.appium\:nativeWebScreenshot =true
+provider.saucelabs.ios.appium\:appium.version =1.21.0
+provider.saucelabs.ios.appium\:automationName =XCuiTest
+provider.saucelabs.ios.appium\:deviceName =iPhone 12 Pro Max Simulator
+provider.saucelabs.ios.appium\:platformVersion =14.4
+provider.saucelabs.ios.platformName =iOS
+provider.saucelabs.ios.sauce\:maxDuration =${commons.saucelabs.sauce\:maxDuration}
+provider.saucelabs.ios.sauce\:idleTimeout =${commons.saucelabs.sauce\:idleTimeout}
+provider.saucelabs.ios.appium\:app =sauce-storage:${commons.saucelabs.application.filename}.zip
+provider.saucelabs.ios.appium\:appPackage =${commons.appPackage}
+provider.saucelabs.ios.sauce\:build =${build.label}
+provider.saucelabs.ios.sauce\:tags =${build.tags}
#
# Self-hosted local Selenium Web browser properties
#
-provider.selenium.web.class =org.openqa.selenium.remote.RemoteWebDriver
-provider.selenium.web.url =${commons.selenium.url}
-provider.selenium.web.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.web.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.web.browserName =chrome
-provider.selenium.web.platform =linux
+provider.selenium.web.-x\:class =org.openqa.selenium.remote.RemoteWebDriver
+provider.selenium.web.-x\:url =${commons.selenium.url}
+provider.selenium.web.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.web.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.web.browserName =chrome
+provider.selenium.web.platformName =linux
#
#
# Self-hosted local Android properties
#
-provider.selenium.android.class =io.appium.java_client.android.AndroidDriver
-provider.selenium.android.url =${commons.selenium.url}
-provider.selenium.android.nativeWebScreenshot =true
-provider.selenium.android.appium.version =1.18.1
-provider.selenium.android.automationName =UIAutomator2
-provider.selenium.android.deviceName =Google Pixel 3a XL GoogleAPI Emulator
-provider.selenium.android.platformVersion =10.0
-provider.selenium.android.platformName =Android
-provider.selenium.android.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.android.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.android.app =sauce-storage:${commons.selenium.application.filename}.apk
-provider.selenium.android.appPackage =${commons.appPackage}
-provider.selenium.android.build =${build.label}
-provider.selenium.android.tags =${build.tags}
+provider.selenium.android.-x\:class =io.appium.java_client.android.AndroidDriver
+provider.selenium.android.-x\:url =${commons.selenium.url}
+provider.selenium.android.appium\:nativeWebScreenshot =true
+provider.selenium.android.appium\:appium.version =1.18.1
+provider.selenium.android.appium\:automationName =UIAutomator2
+provider.selenium.android.appium\:deviceName =Google Pixel 3a XL GoogleAPI Emulator
+provider.selenium.android.appium\:platformVersion =10.0
+provider.selenium.android.platformName =Android
+provider.selenium.android.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.android.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.android.appium\:app =sauce-storage:${commons.selenium.application.filename}.apk
+provider.selenium.android.appium\:appPackage =${commons.appPackage}
+provider.selenium.android.sauce\:build =${build.label}
+provider.selenium.android.sauce\:tags =${build.tags}
#
#
# Self-hosted local iOS properties
#
-provider.selenium.ios.class =io.appium.java_client.ios.IOSDriver
-provider.selenium.ios.url =${commons.selenium.url}
-provider.selenium.ios.nativeWebScreenshot =true
-provider.selenium.ios.appium.version =1.21.0
-provider.selenium.ios.automationName =XCuiTest
-provider.selenium.ios.deviceName =iPhone 12 Pro Max Simulator
-provider.selenium.ios.platformVersion =14.4
-provider.selenium.ios.platformName =iOS
-provider.selenium.ios.maxDuration =${commons.selenium.maxDuration}
-provider.selenium.ios.idleTimeout =${commons.selenium.idleTimeout}
-provider.selenium.ios.app =sauce-storage:${commons.selenium.application.filename}.zip
-provider.selenium.ios.appPackage =${commons.appPackage}
-provider.selenium.ios.build =${build.label}
-provider.selenium.ios.tags =${build.tags}
+provider.selenium.ios.-x\:class =io.appium.java_client.ios.IOSDriver
+provider.selenium.ios.-x\:url =${commons.selenium.url}
+provider.selenium.ios.appium\:nativeWebScreenshot =true
+provider.selenium.ios.appium\:appium.version =1.21.0
+provider.selenium.ios.appium\:automationName =XCuiTest
+provider.selenium.ios.appium\:deviceName =iPhone 12 Pro Max Simulator
+provider.selenium.ios.appium\:platformVersion =14.4
+provider.selenium.ios.platformName =iOS
+provider.selenium.ios.sauce\:maxDuration =${commons.selenium.sauce\:maxDuration}
+provider.selenium.ios.sauce\:idleTimeout =${commons.selenium.sauce\:idleTimeout}
+provider.selenium.ios.appium\:app =sauce-storage:${commons.selenium.application.filename}.zip
+provider.selenium.ios.appium\:appPackage =${commons.appPackage}
+provider.selenium.ios.sauce\:build =${build.label}
+provider.selenium.ios.sauce\:tags =${build.tags}
diff --git a/qa-testing-extra/.classpath b/qa-testing-extra/.classpath
index 9eda3c6785..f8aed1925a 100644
--- a/qa-testing-extra/.classpath
+++ b/qa-testing-extra/.classpath
@@ -6,6 +6,8 @@
+
+
@@ -28,7 +30,7 @@
-
+
@@ -40,8 +42,8 @@
-
+
diff --git a/qa-testing-extra/pom.xml b/qa-testing-extra/pom.xml
index 54deb9575e..6d7edf97c6 100644
--- a/qa-testing-extra/pom.xml
+++ b/qa-testing-extra/pom.xml
@@ -20,7 +20,7 @@
dev.aherscu.qaqa-automation
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOTqa-testing-extra
@@ -46,7 +46,7 @@
dev.aherscu.qaqa-testing-utils
- 0.0.35-SNAPSHOT
+ 1.0.0-SNAPSHOT
@@ -60,21 +60,21 @@
- com.google.code.findbugs
- annotations
+ com.github.spotbugs
+ spotbugs-annotationsorg.apache.commonscommons-pool2
- 2.8.0
+ 2.12.0com.amazonawsaws-java-sdk-cognitoidp
- 1.12.418
+ 1.12.565commons-logging
@@ -86,7 +86,7 @@
com.opencsvopencsv
- 4.4
+ 5.8commons-logging
@@ -102,33 +102,21 @@
- com.google.guava
- guava
- 27.0.1-jre
-
-
- com.google.code.findbugs
- jsr305
-
-
-
-
-
- javax.ws.rs
- javax.ws.rs-api
- 2.1.1
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ 3.1.0com.esotericsoftware.yamlbeansyamlbeans
- 1.13
+ 1.15org.apache.commonscommons-lang3
- 3.8.1
+ 3.13.0
@@ -140,7 +128,7 @@
com.github.rodionmoiseev.c10nc10n-core
- 1.2
+ 1.3
@@ -178,6 +166,12 @@
test
+
+ org.jooq
+ jool
+ test
+
+
org.testngtestng
@@ -186,7 +180,7 @@
commons-clicommons-cli
- 1.4
+ 1.5.0
@@ -226,34 +220,6 @@
-
- platform-jdk11
-
- [11,)
-
-
-
- org.jooq
- jool
- test
-
-
-
-
-
- platform-jdk8
-
- 1.8
-
-
-
- org.jooq
- jool-java-8
- test
-
-
-
-
generate-aws-cognito-srp-authenticator
@@ -306,7 +272,7 @@
com.akathist.maven.plugins.launch4jlaunch4j-maven-plugin
- 1.7.25
+ 2.4.1cli-aws-cognito-srp-authenticator
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/CsvUtils.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/CsvUtils.java
index 077b28cdf3..85b98c3fdf 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/CsvUtils.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/CsvUtils.java
@@ -34,7 +34,7 @@ public final class CsvUtils {
/**
* Provides a Java 8 stream wrapper around a CSV I/O stream.
- *
+ *
* @param inputStream
* input stream for CSV data
* @return non parallel stream of CSV lines parsed as String array
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ParallelLoop.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ParallelLoop.java
index 74838c7824..123dc9dbf3 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ParallelLoop.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ParallelLoop.java
@@ -25,7 +25,7 @@
/**
* Parallel looping with specified threads, repetitions and block of code.
- *
+ *
*
* NOTE: there is a library class at
* https://github.com/pablormier/parallel-loops
@@ -56,7 +56,7 @@ public ParallelLoop() {
/**
* Runs specified function in configured loop.
- *
+ *
* @param function
* the function to run; is called with the run identifier and
* expected to return it
@@ -79,7 +79,7 @@ public void run(final Function function) {
/**
* Runs specified consumer in configured loop.
- *
+ *
* @param consumer
* the consumer to run; is called with the run identifier.
*/
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ReadMultiWriteLock.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ReadMultiWriteLock.java
index dbb0c07ac8..b11c505056 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ReadMultiWriteLock.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/ReadMultiWriteLock.java
@@ -26,7 +26,7 @@
/**
* Based on
* http://tutorials.jenkov.com/java-concurrency/read-write-locks.html#simple
- *
+ *
*
* Allows for multiple writers.
*
@@ -94,7 +94,7 @@ public static void writeLocking(final Runnable criticalSection) {
/**
* Waits for writers to finish and accounts for another reader lock.
- *
+ *
* @throws InterruptedException
* if this thread was interrupted
*/
@@ -117,7 +117,7 @@ public synchronized void readingRelease() {
/**
* Waits for readers to finish and accounts for another writer lock.
- *
+ *
* @throws InterruptedException
* if this thread was interrupted
*/
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnable.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnable.java
index 2c03be5d83..2c64ae55cd 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnable.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnable.java
@@ -31,7 +31,7 @@ public class AutoReturnable implements AutoCloseable {
/**
* Returns the object to its pool.
- *
+ *
* @throws Exception
* pooled object is missing reference to originating pool;
* should not happen if borrowed via
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectFactory.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectFactory.java
index cb17a2c59c..420a094b18 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectFactory.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectFactory.java
@@ -31,7 +31,7 @@
/**
* Creates {@link AutoReturnable}s. To be used with
* {@link AutoReturnableObjectPool}.
- *
+ *
* @param
* type of object to pool
*/
@@ -61,7 +61,7 @@ public AutoReturnableObjectFactory(final List objects) {
/**
* As long as there are available objects, creates a pooled object.
- *
+ *
* @return a pooled object
* @throws Exception
* should not happen
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectPool.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectPool.java
index 6d378a3bdc..197f2218f4 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectPool.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/pooling/AutoReturnableObjectPool.java
@@ -29,7 +29,7 @@
* pooled object is borrowed it will not be borrowed to other running test.
* Borrowed pooled objects shall be returned as soon as possible in order not
* block other tests running in parallel.
- *
+ *
* @param
* type of object to pool
*/
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/rest/AwsCognitoSrpRequestFilter.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/rest/AwsCognitoSrpRequestFilter.java
index 84cfe39a69..e7df0dbaa6 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/rest/AwsCognitoSrpRequestFilter.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/rest/AwsCognitoSrpRequestFilter.java
@@ -15,11 +15,11 @@
*/
package dev.aherscu.qa.testing.extra.rest;
-import static javax.ws.rs.core.HttpHeaders.*;
+import static jakarta.ws.rs.core.HttpHeaders.*;
import javax.annotation.concurrent.*;
-import javax.ws.rs.client.*;
+import jakarta.ws.rs.client.*;
import lombok.*;
/**
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/BeanScanner.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/BeanScanner.java
index e93504998b..3dc05fc2ef 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/BeanScanner.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/BeanScanner.java
@@ -23,7 +23,7 @@
/**
* A scanner traversing an object graph.
- *
+ *
* @param
* the type of the traversed items.
*/
@@ -65,7 +65,7 @@ public Scanner find(Class clazz) {
/**
* Traverses the object graph for each items of this scanner and returns a
* scanner emitting all found items of the given type.
- *
+ *
* @param clazz
* the type selector.
* @param
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/Scanner.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/Scanner.java
index 7dcd03ee13..335fb7db5e 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/Scanner.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/Scanner.java
@@ -22,7 +22,7 @@
/**
* Abstraction wrapping a data structure that can be walked through to produce
* streams.
- *
+ *
* @param
* the type of elements composing the data structure.
*/
@@ -74,7 +74,7 @@ public Scanner filter(Predicate predicate) {
* Scans the elements of the source and returns a scanner emitting relevant
* items of the given type. This method can return fewer items according to
* subclass logic. Subclasses implement the actual scanning algorithm.
- *
+ *
* @param clazz
* the type selector.
* @param
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/StreamScanner.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/StreamScanner.java
index 4936acf698..e0f321142d 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/StreamScanner.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/supermachine/StreamScanner.java
@@ -20,7 +20,7 @@
/**
* A scanner iterating over items of a stream. Nothing really fancy.
- *
+ *
* @param
* the types of the stream items.
*/
@@ -32,7 +32,7 @@ private StreamScanner(Stream stream) {
/**
* Create a scanner iterating over a stream.
- *
+ *
* @param stream
* the stream to scan.
* @param
diff --git a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/testng/DisableSslCertificateValidation.java b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/testng/DisableSslCertificateValidation.java
index 396cd513d9..385961e991 100644
--- a/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/testng/DisableSslCertificateValidation.java
+++ b/qa-testing-extra/src/main/java/dev/aherscu/qa/testing/extra/testng/DisableSslCertificateValidation.java
@@ -23,7 +23,7 @@
/**
* Disables SSL certificate validation before the TestNG test suites begins
* execution. This allows running with self-signed certificates.
- *
+ *
*