我正在使用设备农场几天,但我从未遇到过忽略testng @Test注释的问题。但是今天当我尝试运行我的测试时,它忽略了一些测试。我不知道我做错了什么。所有测试都在我的本地计算机上成功运行。
我查看了* -tests.jar文件。因为包含了所有类文件。 但是在设备场“解析结果”文件中,缺少一些类。
我的-tests.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.
答案 0 :(得分:0)
我很抱歉在这里添加一个问题作为答案,但是当你有机会时,你可以告诉我们这是否适用于Device Farm的任何时间点?我最好的猜测是,正在上传的包中缺少一些东西。你能详细说明你的项目是如何建造的吗?
以下是来自awslabs GitHub页面的示例项目,其中包含有效示例
https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app
希望有所帮助