Issues with running my Galen tests on AWS Device Farm

276 Views Asked by At

I am facing issues with running my Galen tests on AWS Device Farm, I am properly packaging my .gspec file under src/tests/java folder and providing the same in my POM.xml, but while running the tests on the farm it throws FileNotFound Exception i.e.:

java.io.FileNotFoundException: src/test/java/HomePage.gspec at
 com.galenframework.speclang2.pagespec.PageSpecReader.read(PageSpecReader.java:43)
 at com.galenframework.api.Galen.checkLayout(Galen.java:68) at
 com.galenframework.api.Galen.checkLayout(Galen.java:59) at
 com.galenframework.api.Galen.checkLayout(Galen.java:154) at
 com.galenframework.api.Galen.checkLayout(Galen.java:128) at

This works like a charm on local devices.

2

There are 2 best solutions below

4
On

Hi Please find the attached screenshot of code snippet where we are using file path and POM file for maven package.

POMFile

FilePathCode

6
On

I am an engineer from the AWS Device Farm team.

I am not familiar with Galen test framework. We have not officially tested the framework to claim that it works on device farm.

However, few things that I can make out from your description:

1. .gspec file: It seems that the framework is looking to read this file to get started. Any test file based on appium/selenium can be placed under src/test/resources while packaging and this should put the file in *SNAPSHOT-tests.jar file under the root of the jar.

This jar file is then available in the CLASSPATH of the test execution environment which means you would can directly access it. It would save you some time by verifying before uploading to device farm by looking in the *tests.jar file for the presence of the .gspec file.

Alternate way would be to place the file under src/test/resources/com (or any package structure). Then to access the file in your test code you can assume that the file is present under the package structure under resources so in your case file path would be "com/yourfile.gspec".

Hope this helps you to proceed further.