Skip to content
Permalink
Browse files

Release 1.3

* Split into separate modules
* pCloudy PoC
* Refactoring
  • Loading branch information...
martinschneider committed Oct 25, 2018
1 parent 0ca0eec commit 177e463dd4f32e5a88863a05601ee1c610649a30
Showing with 794 additions and 246 deletions.
  1. +2 −2 .gitignore
  2. +6 −7 .travis.yml
  3. +48 −0 justtestlah-browserstack/pom.xml
  4. +20 −20 ...c/main/java/io/github/martinschneider/justtestlah/configuration/BrowserStackWebDriverBuilder.java
  5. +1 −0 justtestlah-core/.gitignore
  6. +189 −0 justtestlah-core/pom.xml
  7. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/base/Base.java
  8. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/base/BasePage.java
  9. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/base/BaseSteps.java
  10. +8 −1 ...}/src/main/java/io/github/martinschneider/justtestlah/configuration/JustTestLahConfiguration.java
  11. +46 −27 ...ore}/src/main/java/io/github/martinschneider/justtestlah/configuration/LocalWebDriverBuilder.java
  12. 0 ...justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/configuration/Platform.java
  13. +40 −7 ...estlah-core}/src/main/java/io/github/martinschneider/justtestlah/configuration/SpringContext.java
  14. +7 −0 ...lah-core}/src/main/java/io/github/martinschneider/justtestlah/configuration/WebDriverBuilder.java
  15. +41 −15 ...usttestlah-core}/src/main/java/io/github/martinschneider/justtestlah/junit/JustTestLahRunner.java
  16. +3 −1 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/junit/JustTestLahTest.java
  17. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/locator/LocatorMap.java
  18. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/locator/LocatorParser.java
  19. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/steps/CucumberHooks.java
  20. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/user/User.java
  21. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/user/UserService.java
  22. 0 { → justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/visual/Match.java
  23. 0 ...justtestlah-core}/src/main/java/io/github/martinschneider/justtestlah/visual/TemplateMatcher.java
  24. 0 { → justtestlah-core}/src/main/resources/logback.xml
  25. 0 { → justtestlah-core}/src/test/java/io/github/martinschneider/justtestlah/base/BaseTest.java
  26. +20 −0 ...testlah-core/src/test/java/io/github/martinschneider/justtestlah/junit/JustTestLahRunnerTest.java
  27. 0 ...ttestlah-core}/src/test/java/io/github/martinschneider/justtestlah/locator/LocatorParserTest.java
  28. 0 { → justtestlah-core}/src/test/java/io/github/martinschneider/justtestlah/user/UserServiceTest.java
  29. 0 ...testlah-core}/src/test/java/io/github/martinschneider/justtestlah/visual/TemplateMatcherTest.java
  30. 0 { → justtestlah-core}/src/test/resources/features/carousell/Login.feature
  31. 0 { → justtestlah-core}/src/test/resources/features/stackoverflow/NewQuestion.feature
  32. 0 { → justtestlah-core}/src/test/resources/features/stackoverflow/Search.feature
  33. BIN { → justtestlah-core}/src/test/resources/images/facebook.png
  34. BIN { → justtestlah-core}/src/test/resources/images/largerMatch.png
  35. BIN { → justtestlah-core}/src/test/resources/images/noMatch.png
  36. BIN { → justtestlah-core}/src/test/resources/images/perfectMatch.png
  37. BIN { → justtestlah-core}/src/test/resources/images/questionIcon.png
  38. BIN { → justtestlah-core}/src/test/resources/images/questionIcon_blurred.png
  39. BIN { → justtestlah-core}/src/test/resources/images/questionIcon_distorted.png
  40. BIN { → justtestlah-core}/src/test/resources/images/questionIcon_rotated.png
  41. BIN { → justtestlah-core}/src/test/resources/images/smallerMatch.png
  42. 0 ...lah-core}/src/test/resources/io/github/martinschneider/justtestlah/base/TestPageObject.properties
  43. +5 −0 ...estlah-core/src/test/resources/io/github/martinschneider/justtestlah/junit/justtestlah.properties
  44. 0 ...lah-core}/src/test/resources/io/github/martinschneider/justtestlah/locator/LocatorParserTest.yaml
  45. 0 { → justtestlah-core}/src/test/resources/io/github/martinschneider/justtestlah/user/users.properties
  46. +58 −0 justtestlah-demos/pom.xml
  47. +18 −0 justtestlah-demos/src/main/resources/logback.xml
  48. 0 { → justtestlah-demos}/src/test/java/TestRunner.java
  49. 0 ...demos}/src/test/java/io/github/martinschneider/justtestlah/examples/carousell/pages/HomePage.java
  50. 0 ...emos}/src/test/java/io/github/martinschneider/justtestlah/examples/carousell/pages/LoginPage.java
  51. 0 ...rc/test/java/io/github/martinschneider/justtestlah/examples/carousell/pages/ios/IOsLoginPage.java
  52. 0 ...src/test/java/io/github/martinschneider/justtestlah/examples/carousell/pages/web/WebHomePage.java
  53. 0 ...mos}/src/test/java/io/github/martinschneider/justtestlah/examples/carousell/steps/LoginSteps.java
  54. 0 ...s}/src/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/HomePage.java
  55. 0 ...rc/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/QuestionPage.java
  56. 0 ...c/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/QuestionsPage.java
  57. 0 ...s}/src/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/TagsPage.java
  58. 0 ...a/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/android/AndroidHomePage.java
  59. 0 ...}/src/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/steps/HomeSteps.java
  60. 0 ...c/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/steps/QuestionSteps.java
  61. 0 ...s}/src/test/java/io/github/martinschneider/justtestlah/examples/stackoverflow/steps/TagSteps.java
  62. +6 −0 justtestlah-demos/src/test/resources/features/carousell/Login.feature
  63. +7 −0 justtestlah-demos/src/test/resources/features/stackoverflow/NewQuestion.feature
  64. +25 −0 justtestlah-demos/src/test/resources/features/stackoverflow/Search.feature
  65. BIN justtestlah-demos/src/test/resources/images/facebook.png
  66. BIN justtestlah-demos/src/test/resources/images/largerMatch.png
  67. BIN justtestlah-demos/src/test/resources/images/noMatch.png
  68. BIN justtestlah-demos/src/test/resources/images/perfectMatch.png
  69. BIN justtestlah-demos/src/test/resources/images/questionIcon.png
  70. BIN justtestlah-demos/src/test/resources/images/questionIcon_blurred.png
  71. BIN justtestlah-demos/src/test/resources/images/questionIcon_distorted.png
  72. BIN justtestlah-demos/src/test/resources/images/questionIcon_rotated.png
  73. BIN justtestlah-demos/src/test/resources/images/smallerMatch.png
  74. +3 −0 ...lah-demos/src/test/resources/io/github/martinschneider/justtestlah/base/TestPageObject.properties
  75. 0 ...}/src/test/resources/io/github/martinschneider/justtestlah/examples/carousell/pages/HomePage.yaml
  76. 0 .../src/test/resources/io/github/martinschneider/justtestlah/examples/carousell/pages/LoginPage.spec
  77. 0 .../src/test/resources/io/github/martinschneider/justtestlah/examples/carousell/pages/LoginPage.yaml
  78. 0 ...c/test/resources/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/HomePage.yaml
  79. 0 ...st/resources/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/QuestionPage.yaml
  80. 0 ...t/resources/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/QuestionsPage.yaml
  81. 0 ...c/test/resources/io/github/martinschneider/justtestlah/examples/stackoverflow/pages/TagsPage.yaml
  82. +14 −0 ...lah-demos/src/test/resources/io/github/martinschneider/justtestlah/locator/LocatorParserTest.yaml
  83. +1 −0 justtestlah-demos/src/test/resources/io/github/martinschneider/justtestlah/user/users.properties
  84. +11 −6 { → justtestlah-demos}/src/test/resources/justtestlah.properties
  85. +11 −0 justtestlah-pcloudy/README.md
  86. BIN justtestlah-pcloudy/pCloudy-java-connector-11.0.5-jar-with-dependencies.jar
  87. +53 −0 justtestlah-pcloudy/pom.xml
  88. +131 −0 ...dy/src/main/java/io/github/martinschneider/justtestlah/configuration/PCloudyWebDriverBuilder.java
  89. +20 −160 pom.xml
@@ -223,5 +223,5 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

report/**
build/**
**/report/**
**/build/**
@@ -1,10 +1,10 @@
branches:
only:
- master
- playground

language: java

cache:
directories: $HOME/.m2

install: mvn install:install-file -Dfile=justtestlah-pcloudy/pCloudy-java-connector-11.0.5-jar-with-dependencies.jar -DgroupId=pCloudy-java-connector -DartifactId=pCloudy-java-connector -Dversion=11.0.5 -Dpackaging=jar

addons:
apt:
sources:
@@ -16,8 +16,7 @@ addons:
token:
secure: Jy11hm6mSF1KkMl00MxmkWcI9v5MN5CFiC5l3ze3dS/Uss8LO12I84/KBAiVPwdNA2KQLcuXePT2G/imvMhnvQIkhFvI0JsQXYGQFLV/ubsOICE1HQ30MpHwclUPrVfRc/b9rVz0Fdt2iiaIhrSShdVepQB9o4GQdtud4S8/CDMs6S6MdOUs/KWzqrfMoM19iXH72TvOc9OHZVqMPpKGQ9PY8zCgb1kvuOVmBBNEXmtyT5aRf9wt2BKMbWTy84LaLV5ITVK2VxyRPoDPXRm/AjjT9csEnx/bIKJ5nTwBvSxYYf/EUnKO6Bn333A4m60FTt6GkapLE9PFhOTldy/8ovkKaNw+M1oNmhPtUmPSqZrRaIcDFi53/iayDkdvkTAcas7nm0S8cXnRvDWmSEntOz+JqTamgoyPhyBq9a3UBnuaZ/w5imcbikSo/zJo2wqocs1QjsvlX4UYW1mk9AOyd+KbFgzRxb21uUJcAYShxNEcvMr+khI90+hExq+2r0ccIKS2GpLWQMjbZfKcgNNB51n6D31BKcRx5MxYLSjmw2QCBn5ONBq9yJOp2p+j0I3GxPNN1KzUPqoCQNUAxpJK3q2Nvhe0/xyV+eo1B71EDYiCZU+v/bUN5x+KV6cSDfwtCw8+tZ25Ur57VU0TlwKk80ZeA4U4Zmz6eh0cwXYDu/w=

script:
- mvn clean install -Dchromeoptions.args=--no-sandbox
script: mvn clean install -Dchromeoptions.args=--no-sandbox

after_success:
- mvn sonar:sonar
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>justtestlah-browserstack</artifactId>
<name>JustTestLah! Browserstack</name>
<description>JustTestLah! is a JAVA test framework targeting projects that support multiple platforms, in particular Web, Android and iOS. It follows a BDD approach and allows testing against all platforms using the same feature files. JustTestLah's main aim is to make the configuration and the actual test code as easy as possible.</description>
<parent>
<groupId>io.github.martinschneider</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.3</version>
</parent>
<developers>
<developer>
<name>Martin Schneider</name>
<email>mart.schneider@gmail.com</email>
</developer>
</developers>
<url>https://martinschneider.github.io/justtestlah</url>
<scm>
<url>https://github.com/martinschneider/JustTestLah</url>
<connection>scm:git:git://github.com/martinschneider/JustTestLah.git</connection>
</scm>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.org/martinschneider/justtestlah</url>
</ciManagement>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/martinschneider/JustTestLah/issues</url>
</issueManagement>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>io.github.martinschneider</groupId>
<artifactId>justtestlah-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
@@ -1,8 +1,5 @@
package io.github.martinschneider.justtestlah.configuration;

import static io.appium.java_client.remote.AndroidMobileCapabilityType.APP_ACTIVITY;
import static io.appium.java_client.remote.AndroidMobileCapabilityType.APP_PACKAGE;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.ios.IOSElement;
@@ -35,15 +32,8 @@
*/
@Override
public WebDriver getAndroidDriver() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", androidDeviceName);
capabilities.setCapability("app", androidAppPath);
capabilities.setCapability(APP_PACKAGE, appPackage);
capabilities.setCapability(APP_ACTIVITY, appActivity);
capabilities.setCapability("platformName", "android");
capabilities.setCapability("browserstack.debug", debug);
return new AppiumDriver<AndroidElement>(
buildBrowserStackUrl(accessKey, username), capabilities);
return new AppiumDriver<AndroidElement>(buildBrowserStackUrl(accessKey, username),
addAndroidCapabilities(new DesiredCapabilities()));
}

/*
@@ -53,15 +43,25 @@ public WebDriver getAndroidDriver() {
*/
@Override
public WebDriver getIOsDriver() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", iosDeviceName);
capabilities.setCapability("app", iosAppPath);
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability("showXcodeLog", true);
capabilities.setCapability("startIWDP", true);
return new AppiumDriver<IOSElement>(buildBrowserStackUrl(accessKey, username),
addIOsCapabilities(new DesiredCapabilities()));
}

protected DesiredCapabilities addCommonCapabilities(DesiredCapabilities capabilities) {
super.addCommonCapabilities(capabilities);
capabilities.setCapability("browserstack.debug", debug);
return new AppiumDriver<IOSElement>(buildBrowserStackUrl(accessKey, username), capabilities);
return capabilities;
}

/*
* (non-Javadoc)
*
* @see io.github.martinschneider.justtestlah.configuration.WebDriverBuilder#getWebDriver()
*/
@Override
public WebDriver getWebDriver() {
throw new UnsupportedOperationException(
"For Browserstack only mobile testing is supported at the moment.");
}

private URL buildBrowserStackUrl(String accessKey, String username) {
@@ -0,0 +1 @@
/report/
@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>justtestlah-core</artifactId>
<name>JustTestLah! Core</name>
<description>JustTestLah! is a JAVA test framework targeting projects that support multiple platforms, in particular Web, Android and iOS. It follows a BDD approach and allows testing against all platforms using the same feature files. JustTestLah's main aim is to make the configuration and the actual test code as easy as possible.</description>
<parent>
<groupId>io.github.martinschneider</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.3</version>
</parent>
<developers>
<developer>
<name>Martin Schneider</name>
<email>mart.schneider@gmail.com</email>
</developer>
</developers>
<url>https://martinschneider.github.io/justtestlah</url>
<scm>
<url>https://github.com/martinschneider/JustTestLah</url>
<connection>scm:git:git://github.com/martinschneider/JustTestLah.git</connection>
</scm>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.org/martinschneider/justtestlah</url>
</ciManagement>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/martinschneider/JustTestLah/issues</url>
</issueManagement>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>${appium.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>gherkin</artifactId>
<version>${gherkin.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>${selenide.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons.collections.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openpnp</groupId>
<artifactId>opencv</artifactId>
<version>${opencv.version}</version>
</dependency>
<dependency>
<groupId>com.applitools</groupId>
<artifactId>eyes-selenium-java3</artifactId>
<version>${applitools.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.galenframework</groupId>
<artifactId>galen-java-support</artifactId>
<version>${galen.version}</version>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<version>${junit.dataprovider.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
</dependencies>
</project>
@@ -48,6 +48,9 @@

@Value("${galen.report.directory:" + DEFAULT_GALEN_REPORT_DIRECTORY + "}")
private String galenReportDirectory;

@Value("${cloudprovider:local}")
private String cloudProvider;

private WebDriverBuilder webDriverBuilder;

@@ -68,7 +71,7 @@ public void initCucumberConfig() {
/** Set the correct
* {@link org.openqa.selenium.WebDriver}. */
public void initWebDriver() {
// for web the Selenide default behavior is sufficient
// for web and local testing the Selenide default behavior is sufficient
System.setProperty("browser", browser);
Configuration.headless = headless;
// for Android and IOS we construct the {@link WebDriver} ourselves
@@ -77,6 +80,10 @@ public void initWebDriver() {
} else if (platform.equals(Platform.IOS)) {
WebDriverRunner.setWebDriver(webDriverBuilder.getIOsDriver());
}
else if (platform.equals(Platform.WEB) && cloudProvider.equals("browserstack"))
{
WebDriverRunner.setWebDriver(webDriverBuilder.getWebDriver());
}
}

/**
Oops, something went wrong.

0 comments on commit 177e463

Please sign in to comment.
You can’t perform that action at this time.