Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auto-sdk-java-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-common</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.applause.auto.logging.ResultPropertyMap;
import com.applause.auto.templates.TemplateManager;
import com.google.common.base.Suppliers;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import freemarker.template.Template;
import java.nio.file.Path;
import java.util.HashMap;
Expand All @@ -36,6 +37,9 @@
@AllArgsConstructor
@Data
@RequiredArgsConstructor
@SuppressFBWarnings(
value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
justification = "Lombok @Data generates equals/hashCode; null checks are redundant.")
public class FrameworkContext {
@Setter(value = AccessLevel.NONE)
private final String contextId = UUID.randomUUID().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,26 @@
import java.time.Duration;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

/** Additional options used by the PageObjectContext that change how the PageObjectModel behaves */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@Getter
@Setter
@EqualsAndHashCode
@ToString
public class PageObjectOptions {
/** Default timeout for locating elements */
private @NonNull @Builder.Default Duration timeout = Duration.ofSeconds(10);
@Builder.Default private Duration timeout = Duration.ofSeconds(10);

/** Default polling interval for locating elements */
private @NonNull @Builder.Default Duration pollingInterval = Duration.ofSeconds(1);
@Builder.Default private Duration pollingInterval = Duration.ofSeconds(1);

/**
* For lazy list implementations, this flag determines if we throw an exception when no elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,73 @@
*/
@Getter
public enum Platform {
/** Default platform, used as a fallback when no specific platform is matched. */
DEFAULT("Default", null),
/** Represents all mobile platforms. */
MOBILE("Mobile", DEFAULT),
/** Represents all Android mobile devices. */
MOBILE_ANDROID("MobileAndroid", MOBILE),
/** Represents Android mobile phones. */
MOBILE_ANDROID_PHONE("MobileAndroidPhone", MOBILE_ANDROID),
/** Represents Android tablets. */
MOBILE_ANDROID_TABLET("MobileAndroidTablet", MOBILE_ANDROID),
/** Represents small Android tablets. */
MOBILE_ANDROID_SMALL_TABLET("MobileAndroidSmallTablet", MOBILE_ANDROID),
/** Represents all iOS mobile devices. */
MOBILE_IOS("MobileIOS", MOBILE),
/** Represents iOS mobile phones. */
MOBILE_IOS_PHONE("MobileIOSPhone", MOBILE_IOS),
/** Represents iOS tablets. */
MOBILE_IOS_TABLET("MobileIOSTablet", MOBILE_IOS),
/** Represents small iOS tablets. */
MOBILE_IOS_SMALL_TABLET("MobileIOSSmallTablet", MOBILE_IOS),
/** Represents all web platforms. */
WEB("Web", DEFAULT),
/** Represents desktop web platforms. */
WEB_DESKTOP("WebDesktop", WEB),
/** Represents Chrome browser on desktop. */
WEB_DESKTOP_CHROME("WebDesktopChrome", WEB_DESKTOP),
/** Represents Edge browser on desktop. */
WEB_DESKTOP_EDGE("WebDesktopEdge", WEB_DESKTOP),
/** Represents Firefox browser on desktop. */
WEB_DESKTOP_FIREFOX("WebDesktopFirefox", WEB_DESKTOP),
/** Represents Internet Explorer browser on desktop. */
WEB_DESKTOP_IE("WebDesktopIE", WEB_DESKTOP),
/** Represents Safari browser on desktop. */
WEB_DESKTOP_SAFARI("WebDesktopSafari", WEB_DESKTOP),
/** Represents all web mobile platforms. */
WEB_MOBILE("WebMobile", WEB),
/** Represents web mobile phones. */
WEB_MOBILE_PHONE("WebMobilePhone", WEB_MOBILE),
/** Represents Android web mobile phones. */
WEB_ANDROID_PHONE("WebAndroidPhone", WEB_MOBILE_PHONE),
/** Represents iOS web mobile phones. */
WEB_IOS_PHONE("WebIOSPhone", WEB_MOBILE_PHONE),
/** Represents web mobile tablets. */
WEB_MOBILE_TABLET("WebMobileTablet", WEB_MOBILE),
/** Represents Android web mobile tablets. */
WEB_ANDROID_TABLET("WebAndroidTablet", WEB_MOBILE_TABLET),
/** Represents iOS web mobile tablets. */
WEB_IOS_TABLET("WebIOSTablet", WEB_MOBILE_TABLET),
/** Represents web mobile small tablets. */
WEB_MOBILE_SMALL_TABLET("WebMobileSmallTablet", WEB_MOBILE),
/** Represents Android web mobile small tablets. */
WEB_ANDROID_SMALL_TABLET("WebAndroidSmallTablet", WEB_MOBILE_SMALL_TABLET),
/** Represents iOS web mobile small tablets. */
WEB_IOS_SMALL_TABLET("WebIOSSmallTablet", WEB_MOBILE_SMALL_TABLET),
/** Represents all OTT (over-the-top) platforms. */
OTT("OTT", DEFAULT),
/** Represents Amazon Fire TV OTT platform. */
OTT_FIRE_TV("OttFireTv", OTT),
/** Represents Amazon Fire TV 4K OTT platform. */
OTT_FIRE_TV_4K("OttFireTv4k", OTT_FIRE_TV),
/** Represents Apple TV OTT platform. */
OTT_APPLE_TV("OttAppleTv", OTT),
/** Represents Apple TV 4K OTT platform. */
OTT_APPLE_TV_4K("OttAppleTv4k", OTT_APPLE_TV),
/** Represents Google Chromecast OTT platform. */
OTT_CHROMECAST("OttChromecast", OTT),
/** Represents Android TV OTT platform. */
OTT_ANDROID_TV("OttAndroidTv", OTT);

private static final Logger logger = LogManager.getLogger(Platform.class);
Expand Down Expand Up @@ -120,14 +154,15 @@ public static boolean hasNativeFallback(final @NonNull Platform p) {
* @param p the current Platform
* @return if chain falls back to MobileNative (Platform.MOBILE)
*/
@SuppressWarnings({"PMD.AvoidBranchingStatementAsLastInLoop", "PMD.SimplifyBooleanReturns"})
public boolean hasFallback(final @NonNull Platform p) {
boolean result = false;
// If the platforms match, then this falls back to the provided platform
if (this == p) {
return true;
result = true;
} else if (this.fallback != null) {
result = this.fallback.hasFallback(p);
}
// If we have a fallback, check if it falls back to the requested platform
return this.fallback != null && this.fallback.hasFallback(p);
return result;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public Pair<Point, Point> getSwipeVector(final int width, final int height) {
start = new Point((int) (width * 0.15), height / 2);
yield new Point((int) (width * 0.85), height / 2);
}
default ->
throw new IllegalArgumentException(
"Invalid SwipeDirection value specified, somehow.");
};
return Pair.of(start, end);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ public final class ResultPropertyConverter extends LogEventPatternConverter {
*
* @param properties options, may be null.
*/
@SuppressWarnings({
"PMD.UnusedFormalParameter",
"PMD.UseVarargs",
})
private ResultPropertyConverter(final String... properties) {
super("ResultProperty", "resultProperty");
this.properties = new ArrayList<>();
Expand Down Expand Up @@ -94,10 +90,6 @@ private ResultPropertyConverter(final String... properties) {
* @param properties options, may be null.
* @return instance of pattern converter.
*/
@SuppressWarnings({
"PMD.UnusedFormalParameter",
"PMD.UseVarargs",
})
public static ResultPropertyConverter newInstance(final String... properties) {
return new ResultPropertyConverter(properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
package com.applause.auto.logging;

import com.google.common.base.Charsets;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
Expand Down Expand Up @@ -79,6 +79,6 @@ public static ServerSideRemoteLogAppender createAppender(
@Override
public void append(final LogEvent logEvent) {
// code inspired by Log4J source to behave like their other appender
LogOutputSingleton.put(new String(layout.toByteArray(logEvent), Charsets.UTF_8));
LogOutputSingleton.put(new String(layout.toByteArray(logEvent), StandardCharsets.UTF_8));
}
}
2 changes: 1 addition & 1 deletion auto-sdk-java-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-config</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ static String hidePasswordOrKey(final String value) {
return sb.toString();
}

@SuppressWarnings("PMD.CognitiveComplexity")
static <T extends Config> String callForValueAsString(
final @NonNull Method method, final @NonNull T configBean) {
String defaultReturnValue = NO_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
@LoadPolicy(LoadType.MERGE)
@Sources({"classpath:props/system.properties"})
@SuppressWarnings("PMD.ExcessivePublicCount")
public interface SdkConfigBean extends Config {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
@LoadPolicy(LoadType.MERGE)
// testrail.properties comes from the user of the SDK.
@Sources({"classpath:props/testrail.properties", "classpath:cfg/testrail_default.properties"})
@SuppressWarnings({"PMD.JUnit4TestShouldUseTestAnnotation"})
public interface TestRailConfigBean extends Config {

/**
Expand Down
2 changes: 1 addition & 1 deletion auto-sdk-java-cucumber/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-cucumber</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

/** Convenience class that maps the TestRail config interface into a class */
@Getter
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
public final class TestRailConfigBeanMapper {

private TestRailConfigBeanMapper() {
Expand Down
2 changes: 1 addition & 1 deletion auto-sdk-java-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-framework</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@RequiredArgsConstructor
@Log4j2
public abstract class AbstractDriverManager {
protected static final Gson gsonLenient = new GsonBuilder().setLenient().create();
protected static final Gson gsonLenient = new GsonBuilder().create();
private final RetryPolicyBuilder<Object> policyBuilder =
RetryPolicy.builder()
.handle(WebDriverException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.common.net.HttpHeaders;
import dev.failsafe.Failsafe;
import dev.failsafe.RetryPolicy;
import jakarta.ws.rs.HttpMethod;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
Expand All @@ -39,7 +40,6 @@
import java.util.Locale;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import javax.ws.rs.HttpMethod;
import lombok.NonNull;
import okhttp3.Call;
import okhttp3.Credentials;
Expand Down
2 changes: 1 addition & 1 deletion auto-sdk-java-helpers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-helpers</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.openqa.selenium.support.ui.WebDriverWait;

/** Utility class to handle waiting for elements and locating elements. */
@SuppressWarnings({"PMD.ExcessivePublicCount", "PMD.GodClass"})
@AllArgsConstructor
public class SyncHelper implements IPageObjectExtension {
private static final Logger logger = LogManager.getLogger(SyncHelper.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* This interceptor is added to classes in the PageObjectFactory to facilitate running code before
* and after methods. Currently, the only use case is for the @AnalyticsCall annotation.
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException") // since we're intercepting this is okay
public class AnalyticsInterceptor extends ComponentInterceptor {
private final AnalyticsHelper analyticsHelper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
import org.apache.logging.log4j.Logger;

/** extends regular analytics entry with network info */
@SuppressWarnings({
"PMD.GodClass",
"checkstyle:CyclomaticComplexity",
"checkstyle:MultipleStringLiterals"
})
@SuppressWarnings({"checkstyle:CyclomaticComplexity", "checkstyle:MultipleStringLiterals"})
public class NetworkEntry extends AnalyticsEntry {
private static final Logger logger = LogManager.getLogger(NetworkEntry.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;

/** Functional Interface that is representing object mapper method for REST API */
@FunctionalInterface
public interface IRestObjectMapper {
ObjectMapper restJsonObjectMapper();
}
2 changes: 1 addition & 1 deletion auto-sdk-java-integrations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-integrations</artifactId>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
// system.properties comes from the user of the SDK.
// applause_environment.properties is in this project and contains the defaults
@Sources({"classpath:props/system.properties", "classpath:applause_environment.properties"})
@SuppressWarnings("PMD.ExcessivePublicCount")
public interface ApplauseSdkConfigBean extends Config {
/**
* Gets Applause API Key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.common.net.HttpHeaders;
import dev.failsafe.Failsafe;
import dev.failsafe.RetryPolicy;
import jakarta.ws.rs.HttpMethod;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
Expand All @@ -46,7 +47,6 @@
import java.util.Base64;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import javax.ws.rs.HttpMethod;
import lombok.NonNull;
import okhttp3.Call;
import okhttp3.HttpUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class BasicAuthInterceptor implements Interceptor {

private final String credentials;

@SuppressWarnings("PMD.NullAssignment")
BasicAuthInterceptor(final String user, final String password) {
if (null != user && null != password) {
this.credentials = Credentials.basic(user, password);
Expand Down
2 changes: 1 addition & 1 deletion auto-sdk-java-page-object/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.applause</groupId>
<artifactId>auto-sdk-java</artifactId>
<version>6.0.5-SNAPSHOT</version>
<version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>auto-sdk-java-page-object</artifactId>
<properties>
Expand Down
Loading