-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added testng.xml and modified pom for running tests locally #14
base: master
Are you sure you want to change the base?
Conversation
How can we use same thing on AWS device farm? |
So if you add the testng.xml to the root of the jar it will be valid in Device Farm. The above offers some options for doing that. However these annotations cannot be used currently inside of the test classes: BeforeSuite, To use them you will need to make a base class and then extend the base class using the test classes. [Edit] |
@jamesknowsbest When will TestNG annotations be supported in device farm? `Failed to generate the test suites from the test package. See the information below for more details. Jul 20, 2018 1:41:32 AM com.amazon.aatp.DryRunAnnotationTransformer transform |
@kevin-liu-agriwebb
The failure to parse and dry run the tests can happen for a few reasons from my experience
If both of these possible issues are not the case, can you paste a code snippet from the |
I figured out it's because my LoginAndSyncTest inherits a parent class, and it seems the inheritance is not After removing inheritance from my tests, Test, BeforeTest and AfterTest annotations work well. |
@kevin-liu-agriwebb |
@kevin-liu-agriwebb @sapins TestNG docs: https://testng.org/doc/documentation-main.html#running-testng
HTH |
@sapins |
I'm facing some errors to execute my ios tests in aws farm, can someone help me? |
Stackoverflow might be a better option than this github post for that. You can make a questions with the tag If there are specific questions about AWS Device Farm you can reach out for support on the aws forums Or you can open a support case if you have a support plan |
Issue
When uploading appium testNG test package to aws Device Farm it is required to have the testng.xml file in the root of the jar. This is not clearly documented and this pull request should help with resolving and preventing future issues customers may face
Short Description
This pull request describes how to include the testng.xml files in the root of the jar file created using a maven command from awslabs github project.
Resolution
What I did
To exemplify using the testng.xml file we'll use the sample appium java project [1]and the sample android project [2]from awslabs github page.
cd aws-device-farm-appium-tests-for-sample-app/
mkdir src/test/resources
Content added to the src/test/resources directory gets added because of this tag in the super pom which is configured to added all files to the jar that are in the resources directory [3] . To view the super pom of the project run this command:
mvn help:effective-pom
Alternatively, we can implement the testResources tags in the pom.xml to explictly reference another directory besides src/test/resources as in this maven doc:
https://maven.apache.org/pom.html#The_Super_POM
From docs:
I then created the testng.xml file in the src/test/resources directory and added this content to it to only run the AlertPageTest class:
mvn clean package -DskipTests=true
This created the zip-with-dependencies.zip file in the target directory with the two jar files. I extracted the jar to verify that the test.xml was in the root (see screenshot targetDirectoryBeforeExtraction.png and targetDirectoryAfterExtraction.png) using this command [5]:
jar xf nameOfTheProjectFromPom-1.0-SNAPSHOT-tests.jar
Related information:
[1] https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app
[2] https://github.com/awslabs/aws-device-farm-sample-app-for-android
[3]https://maven.apache.org/pom.html#Resources
[4]https://maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html
[5]http://docs.aws.amazon.com/devicefarm/latest/developerguide/troubleshooting-appium-web-java-testng.html