-
Notifications
You must be signed in to change notification settings - Fork 76
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
How to control test case execution using testng.xml? #15
Comments
currently we can't control the test case execution. Each test is independently executed in Device Farm's environment. |
Hi! I want to run all test classes in sequence without creating new appium instance. |
@rekha110254 Workaround:With TestNG you can execute tests from a test using a TestNG object. So you can make one test method which then runs the other test classes. Then select only that one test using a testng.xml file. The caveat with this is that Device Farm will see it as one test in the SDK/CLI and web console. So you will need to rely on the generated test results of TestNG using the custom artifacts feature of device farm. You could also use some other custom reporting frameworks like: Note: Using this workaround, other features like priority and the dependsOnMethods work. Here is an example test method which calls other test classes in this sample project.
Note: if you need to only execute certain methods within the classes you will need to create a virtual xml file as describe in the TestNG docs. Here is an example of what that would looks like:
Then the testng.xml file would look like:
Here is instructions on how to include the testng.xml file in a test package. In Device Farm this looks like one test. However, using the custom artifacts you can see that all the tests passed but in the same Appium session. So this might not work for all use cases, but I hope that this helps. Using Allure test report frameworkTo use the allure test report framework in Device Farm and specifically with this workaround first:
So the contents of the file would look like:
Note: after copies the dependencies you may need to update your local maven repository using this command: POM.xml
Note: Allure reports should automatically apply itself to all tests so it's not dependent on this workaround to work in Device Farm.
The xml files are then used to make the HTML report.
I was able to do this via the command line tool for allure. commands used to install and execute:
Then I opened the index.html page generated in FireFox. Note: this page doesn't seem to work in chrome. Extent reports |
@jamesknowsbest How to use allure report format in the AWS device farm? |
@Logakarti I've updated my answer to show how to use allure reports in Device Farm. |
@sapins @rekha110254 @Logakarti @jpeddicord @ahawker |
Does your allure report built from device farm contain the steps correctly? I am missing the steps in my report and I'm struggling to find why. |
How to control test case execution using testng.xml?
Can we control the test case execution using testng.xml while executing appium test case on AWS device farm?
In my local system i am able to perform case execution using testng.xml, however it's not working on AWS device farm.
The text was updated successfully, but these errors were encountered: