Search code examples
amazon-web-servicestestngappiumaws-device-farm

TestNG annotations getting ignored in AWS Device farm


How do I run a specific set of appium java testng test cases in AWS Device farm? I could see that device farm ignores all the annotations for testNG including group and enabled. Is there any way out?


Solution

  • To only run a subset of tests the project will need to include the testng.xml file in the root of the *-tests.jar. Here is a GitHub post I've authored showing how to do that.

    https://github.com/aws-samples/aws-device-farm-appium-tests-for-sample-app/pull/14

    In the standard environment the tests are parse and executed individually. As a result some testng features like priority and nested groups don't get honored. Also tests are executed slower because the Appium server would be restarted between tests.

    https://docs.aws.amazon.com/devicefarm/latest/developerguide/test-environments.html#test-environments-standard

    If these feature are needed the project will need to use the custom environments in Device Farm.

    https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html

    This produces one set of logs and video of all the tests since the test package is not parsed.

    Hth

    -James