0
votes

I am using device farm for a couple of days but I never encountered the issue of ignoring the testng @Test annotations.But today when I try to run my tests it is ignoring few tests.I am not sure what I did wrong.All the tests are running successfully on my local machine.

I had looked in the *-tests.jar file. In that all the class files are included. But in the device farm "parsing result" file few classes are missing.

My -tests.jar file output:

0 Mon Sep 25 10:57:06 AEST 2017 META-INF/
136 Mon Sep 25 10:57:06 AEST 2017 META-INF/MANIFEST.MF
0 Mon Sep 25 10:56:58 AEST 2017 com/
0 Mon Sep 25 10:57:04 AEST 2017 com/kidsIview/
0 Mon Sep 25 10:56:58 AEST 2017 com/kidsIview/config/
0 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/fixtures/
0 Mon Sep 25 10:57:02 AEST 2017 com/kidsIview/mobileApps/
0 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/pages/
0 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/
0 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/util/
272 Mon Sep 25 10:57:04 AEST 2017 com/kidsIview/config/androidConfig.properties
245 Mon Sep 25 10:57:04 AEST 2017 com/kidsIview/config/iosConfig.properties
147 Mon Sep 25 10:57:04 AEST 2017 com/kidsIview/config/platformConfig.properties
714 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/fixtures/SettingsConstant.class
493 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/fixtures/Wait.class
27491759 Mon Sep 25 10:57:04 AEST 2017 com/kidsIview/mobileApps/kidsiviewandroid.apk
23356602 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/mobileApps/kidsiviewiphone.ipa
5761 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/pages/HomePage.class
5728 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/pages/PlayerPage.class
3889 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/pages/SeriesPage.class
10968 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/pages/SettingsPage.class
971 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/HomePageTest.class
1067 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/PlayerPageTest.class
1173 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/SeriesPageTest.class
1233 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/SettingsPageTest.class
4924 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/tests/TestBase.class
4355 Mon Sep 25 10:57:06 AEST 2017 com/kidsIview/util/Util.class
0 Mon Sep 25 10:57:12 AEST 2017 META-INF/maven/
0 Mon Sep 25 10:57:12 AEST 2017 META-INF/maven/KidsIviewPhonesAutomation/
0 Mon Sep 25 10:57:12 AEST 2017 META-INF/maven/KidsIviewPhonesAutomation/KidsIviewPhonesAutomation/
5910 Fri Sep 22 14:14:54 AEST 2017 META-INF/maven/KidsIviewPhonesAutomation/KidsIviewPhonesAutomation/pom.xml
150 Mon Sep 25 10:57:06 AEST 2017 META-INF/maven/KidsIviewPhonesAutomation/KidsIviewPhonesAutomation/pom.properties

Device Farm parsing result:

[
  {
    "name": "Setup Suite",
    "tests": [
      {
        "name": "Setup Test"
      }
    ]
  },
  {
    "name": "com.kidsIview.tests.SeriesPageTest",
    "suite": "com.kidsIview.tests.SeriesPageTest",
    "tests": [
      {
        "name": "checkSeriesPageSwiping",
        "test": "checkSeriesPageSwiping"
      },
      {
        "name": "checkSeriesPage",
        "test": "checkSeriesPage"
      }
    ]
  },
  {
    "name": "com.kidsIview.tests.SettingsPageTest",
    "suite": "com.kidsIview.tests.SettingsPageTest",
    "tests": [
      {
        "name": "checkSettingsPage",
        "test": "checkSettingsPage"
      },
      {
        "name": "checkSettingsPageNavigation",
        "test": "checkSettingsPageNavigation"
      }
    ]
  },
  {
    "name": "Teardown Suite",
    "tests": [
      {
        "name": "Teardown Test"
      }
    ]
  }
]

Command used to bundle the package:

MVN clean -DskipTests=true package -P awsIos //I added the -P profile for my own requirement selection.
1
Have you tried looking at the jar contents to see if your tests are being packed ? Also please help add additional context to your issue. What you have shared is not sufficient to figure out where the issue could be.Krishnan Mahadevan
Have you added annotations/properties in addition to @Test annotation?NikofTime

1 Answers

0
votes

My apologies for adding a question as an answer here, but when you get the chance can you let us know if this worked at any point in time for Device Farm? My best guess at the moment is that there is something missing from the package being uploaded. Could you elaborate on how your project is being built?

Here is an example project from awslabs GitHub page for a valid example

https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app

Hope that helps