Skip to content

Commit

Permalink
Release 1.9-RC4
Browse files Browse the repository at this point in the history
  • Loading branch information
martinschneider committed Sep 26, 2020
1 parent 96f9127 commit 873d8f6
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 32 deletions.
2 changes: 1 addition & 1 deletion justtestlah-awsdevicefarm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-browserstack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import qa.justtestlah.log.TestLogWriter;
import qa.justtestlah.stubs.AppiumTemplateMatcher;
import qa.justtestlah.stubs.Galen;
import qa.justtestlah.stubs.Match;
import qa.justtestlah.stubs.OCR;
import qa.justtestlah.stubs.TemplateMatcher;
import qa.justtestlah.utils.ImageUtils;
Expand Down Expand Up @@ -133,6 +132,12 @@ public WebElement findImage(String imageName, double threshold) {
((AppiumTemplateMatcher) templateMatcher).setDriver(WebDriverRunner.getWebDriver());
}
String path = ImageUtils.getFullPath(imageName);
if (path == null) {
throw new RuntimeException(
String.format(
"Template image %s not found on classpath. Please make sure it is located in the images folder",
imageName));
}
return new ImageWebElement(
driver,
templateMatcher.match(screenshotFile.getAbsolutePath(), path, threshold).getRect(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package qa.justtestlah.utils;

import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Base64;
Expand Down Expand Up @@ -33,7 +34,8 @@ public static String getImageAsBase64String(String imageName) {
* @return the fully-qualified path to the specified image
*/
public static String getFullPath(String imageName) {
return ImageUtils.class.getClassLoader().getResource(IMAGE_FOLDER + "/" + imageName).getFile();
URL url = ImageUtils.class.getClassLoader().getResource(IMAGE_FOLDER + "/" + imageName);
return (url != null) ? url.getFile() : null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-demos/demos/google.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ testdata.enabled=true
testdata.filter=google
# Mac OS
#tesseract.datapath=/usr/local/Cellar/tesseract/4.1.1/share/tessdata
tesseract.datapath=/usr/share/tesseract-ocr/4.00/tessdata
#tesseract.datapath=/usr/share/tesseract-ocr/4.00/tessdata
opencv.mode=client
galen.enabled=true

Expand Down
2 changes: 1 addition & 1 deletion justtestlah-demos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-galen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-mobile-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<artifactId>justtestlah-quickstart</artifactId>
<name>JustTestLah! Quickstart</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</fileSets>
<requiredProperties>
<requiredProperty key="jtlVersion">
<defaultValue>1.9-RC2</defaultValue>
<defaultValue>1.9-RC4</defaultValue>
</requiredProperty>
<requiredProperty key="awsdevicefarm">
<defaultValue>false</defaultValue>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ testdata.enabled=true
features.directory=src/test/resources/features
cucumber.report.directory=target/report/cucumber
cloudprovider=local
#if (${galen} == 'true' || ${galen} == 'yes' || ${galen} == 'y')
galen.enabled=true
#end

# WEB settings
web.baseUrl=https://www.google.com
Expand Down
2 changes: 1 addition & 1 deletion justtestlah-visual/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</parent>
<licenses>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

Expand All @@ -27,6 +28,9 @@ public class OCR implements qa.justtestlah.stubs.OCR {
private TakesScreenshot driver;
private Tesseract ocr;

@Value("${tesseract.datapath:}")
private String dataPath;

@Autowired
public OCR(Tesseract ocr) {
this.ocr = ocr;
Expand All @@ -47,6 +51,10 @@ public String getText() {
}

private String getText(File file) {
if (dataPath.length() == 0) {
throw new RuntimeException(
"tesseract.datapath not set. Please set this property in justtestlah.properties.");
}
LOG.info("Peforming OCR on file {}", file);
try {
String text = ocr.doOCR(file).trim();
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-parent</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
<name>JustTestLah!</name>
<packaging>pom</packaging>
<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>
Expand Down Expand Up @@ -100,12 +100,12 @@
<slf4j.version>2.0.0-alpha1</slf4j.version>
<logback.version>1.3.0-alpha4</logback.version>
<assertj.version>3.17.2</assertj.version>
<mockito.version>3.5.11</mockito.version>
<mockito.version>3.5.13</mockito.version>
<snakeyaml.version>1.27</snakeyaml.version>
<dd.plist.version>1.23</dd.plist.version>
<apk.parser.version>2.6.10</apk.parser.version>
<zip4j.version>2.6.2</zip4j.version>
<bytebuddy.version>1.10.14</bytebuddy.version>
<zip4j.version>2.6.3</zip4j.version>
<bytebuddy.version>1.10.16</bytebuddy.version>
<gson.version>2.8.6</gson.version>
<jersey.version>2.30.1</jersey.version>
<apache.http.components.version>4.5.12</apache.http.components.version>
Expand Down Expand Up @@ -142,7 +142,7 @@
<classgraph.version>4.8.90</classgraph.version>
<fmt.version>2.10</fmt.version>
<jsch.version>0.1.55</jsch.version>
<aws.sdk.version>1.11.864</aws.sdk.version>
<aws.sdk.version>1.11.870</aws.sdk.version>
<aopalliance.version>3.0.0-M2</aopalliance.version>
<jackson.version>2.11.2</jackson.version>
<guava.version>29.0-jre</guava.version>
Expand Down
30 changes: 15 additions & 15 deletions src/site/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ Add the following to your `pom.xml`:
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-core</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

### Option 3: Manual setup using Gradle
Add the following to your `build.gradle`:

```yaml
compile group: 'qa.justtestlah', name: 'justtestlah-core', version: '1.9-RC3'
compile group: 'qa.justtestlah', name: 'justtestlah-core', version: '1.9-RC4'
```
### Option 4: Manual setup
Add `justtestlah-core-1.9-RC3.jar` to your classpath.
Add `justtestlah-core-1.9-RC4.jar` to your classpath.

## Page objects, steps and feature files
There are three main ingredients for tests in JustTestLah!:
Expand Down Expand Up @@ -326,7 +326,7 @@ browserstack.appiumLogs=true
browserstack.video=true
browserstack.geoLocation=SG
browserstack.timezone=SG
browserstack.appium_version=1.9-RC3.0
browserstack.appium_version=1.9-RC4.0
browserstack.acceptSslCerts=true

# AWS DEVICEFARM settings (requires `cloudprovider=aws` and `justtestlah-awsdevicefarm` on the classpath)
Expand Down Expand Up @@ -556,16 +556,16 @@ browserstack.geoLocation=SG
browserstack.networkProfile=
browserstack.customNetwork=
browserstack.timezone=SG
browserstack.appium_version=1.9-RC3.0
browserstack.appium_version=1.9-RC4.0
```

Make sure `justtestlah-browserstack-1.9-RC3.jar` is on your classpath:
Make sure `justtestlah-browserstack-1.9-RC4.jar` is on your classpath:

```xml
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-browserstack</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

Expand Down Expand Up @@ -622,13 +622,13 @@ aws.jobTimeOut=
aws.skipAppResign=
```

Make sure `justtestlah-awsdevicefarm-1.9-RC3.jar` is on your classpath:
Make sure `justtestlah-awsdevicefarm-1.9-RC4.jar` is on your classpath:

```xml
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-awsdevicefarm</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

Expand All @@ -637,13 +637,13 @@ You can refer to [this article](https://medium.com/@mart.schneider/mobile-test-a
Please note that AWS Devicefarm is a paid service.

## Visual and layout testing
Make sure `justtestlah-visual-1.9-RC3.jar` is on your classpath:
Make sure `justtestlah-visual-1.9-RC4.jar` is on your classpath:

```xml
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-visual</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

Expand Down Expand Up @@ -674,13 +674,13 @@ There are two modes to use template matching which can be configured in `justtes

JustTestLah! integrates [Tesseract](https://github.com/tesseract-ocr/tesseract) to perform [Optical character recognition](https://en.wikipedia.org/wiki/Optical_character_recognition).

This requires `justtestlah-visual-1.9-RC3.jar` on the classpath:
This requires `justtestlah-visual-1.9-RC4.jar` on the classpath:

```xml
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-visual</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

Expand Down Expand Up @@ -730,13 +730,13 @@ assertThat(googlePage.getLogoText()).isEqualTo("Google");

### Galen

Make sure `justtestlah-galen-1.9-RC3.jar` is on your classpath:
Make sure `justtestlah-galen-1.9-RC4.jar` is on your classpath:

```xml
<dependency>
<groupId>qa.justtestlah</groupId>
<artifactId>justtestlah-galen</artifactId>
<version>1.9-RC3</version>
<version>1.9-RC4</version>
</dependency>
```

Expand Down

0 comments on commit 873d8f6

Please sign in to comment.