我使用设备群几天了,但我从未遇到忽略testng@Test注释的问题。但是今天当我尝试运行我的测试时,它忽略了一些测试。我不确定我做错了什么。所有的测试都在我的本地机器上成功运行。
我已经查看了*-test. jar文件。其中包括所有类文件。但是在设备场“解析结果”文件中缺少几个类。
我的-test. jar文件输出:
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解析结果:
[
{
"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"
}
]
}
]
用于捆绑包的命令:
MVN clean -DskipTests=true package -P awsIos //I added the -P profile for my own requirement selection.
很抱歉在这里添加了一个问题作为答案,但是当你有机会的时候,你能告诉我们这在设备农场的任何时候是否有效吗?我目前最好的猜测是上传的包中缺少一些东西。你能详细说明你的项目是如何构建的吗?
这是来自awslabs GitHub页面的示例项目,作为有效示例
https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app
希望那有帮助