com.applitools.eyes.appium.AppiumEnvironmentVersions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eyes-appium-java5 Show documentation
Show all versions of eyes-appium-java5 Show documentation
Applitools Eyes SDK for Appium Java WebDriver
package com.applitools.eyes.appium;
import com.applitools.utils.EnvironmentVersions;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.appium.java_client.AppiumDriver;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AppiumEnvironmentVersions extends EnvironmentVersions {
@Override
public String getName() {
return "eyes-appium-java5";
}
@JsonProperty("appium")
public String getAppium() {
Class clazz = AppiumDriver.class;
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
if (classPath.startsWith("jar")) {
Pattern pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+");
Matcher matcher = pattern.matcher(classPath);
if (matcher.find()) {
return matcher.group();
}
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy