首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >没有找到要运行的测试

没有找到要运行的测试
EN

Stack Overflow用户
提问于 2021-04-14 21:33:48
回答 1查看 443关注 0票数 1

我有一个父项目"EqcareAutomationFramework“和一个子项目"EqcareDcbtTests”。当我以“runs测试”的形式运行测试时,我得到了以下错误,但是当我作为TestNg运行时运行良好。

代码语言:javascript
运行
复制
***Tests: com.eqcare.integration.tests.CloseSessionTest***

    > Task :EqcareAutomationFramework:compileJava UP-TO-DATE
    > Task :EqcareAutomationFramework:processResources NO-SOURCE
    > Task :EqcareAutomationFramework:classes UP-TO-DATE
    > Task :EqcareAutomationFramework:jar UP-TO-DATE
    > Task :compileJava NO-SOURCE
    > Task :processResources UP-TO-DATE
    > Task :classes UP-TO-DATE
    > Task :compileTestJava NO-SOURCE
    > Task :processTestResources UP-TO-DATE
    > Task :testClasses UP-TO-DATE
    > Task :runSuite NO-SOURCE
    > Task :test NO-SOURCE
    > Task :EqcareAutomationFramework:compileTestJava UP-TO-DATE
    > Task :EqcareAutomationFramework:processTestResources NO-SOURCE
    > Task :EqcareAutomationFramework:testClasses UP-TO-DATE
    > Task :EqcareAutomationFramework:test

FAILURE: Build failed with an exception.

* What went wrong:
No matching tests found in any candidate test task.
    Requested tests:
        Test class com.eqcare.integration.tests.CloseSessionTest

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 803ms
6 actionable tasks: 1 executed, 5 up-to-date

下面是父项目"EqcareAutomationFramework"的build.gradle文件

代码语言:javascript
运行
复制
> /*  * This file was generated by the Gradle 'init' task.  */  apply
> plugin: 'java'  apply plugin: 'eclipse'
> 
>  sourceSets {
>     main {
>         java {
>            srcDir './src'
>         }
>     } 
>     test {
>         java {
>            srcDirs = ["./src"]
>         }
>     }
>      }
> 
> repositories {        
>     mavenCentral()   }
> 
> dependencies {
>       implementation 'org.testng:testng:7.1.0'
>     implementation 'org.seleniumhq.selenium:selenium-server:3.141.59'
>     implementation 'log4j:log4j:1.2.17'
>     implementation 'org.apache.poi:poi:4.1.2'
>     implementation 'org.apache.httpcomponents:httpclient:4.5.13'
>     implementation 'commons-io:commons-io:2.8.0'
>     implementation 'activation:activation:1.0.2'
>     implementation 'javax.mail:mail:1.4.7'
>     implementation 'com.aventstack:extentreports:3.1.5'
>     implementation 'io.appium:java-client:7.4.1'
>     implementation 'com.android.tools.build:gradle:2.3.0' 
>     implementation 'software.amazon.awssdk:aws-sdk-java:2.15.32' 
>     implementation 'jfree:jfreechart:1.0.13' }
> 
> test{     
       useTestNG() 
      }

下面是子项目"EqcareDcbtTests"的build.gradle文件

代码语言:javascript
运行
复制
apply plugin: 'java'


sourceSets {    
           main {           
               resources.srcDirs = ['clinic', 'patient',
 'integration', 'commonUtils']      
             }  
            test{           
              resources.srcDirs =['clinic', 'patient', 
                  'integration','commonUtils']      
                } 
    }
dependencies {  
           implementation project(':EqcareAutomationFramework') 
   }
project repositories {
    mavenCentral() 
   }
 task runSuite (type: Test) {   
     test.testLogging.showStandardStreams = true    
     useTestNG() {
         suites 'testsuite/'+ System.getProperty('suiteName')
    } }

父项目的文件夹结构EqcareAutomationFramework

子项目的文件夹结构EqcareDcbtProject

EN

回答 1

Stack Overflow用户

发布于 2021-04-15 01:45:56

您正在尝试运行一个没有测试的类。您正在尝试执行CloseSessionTest,这似乎不是一个测试类。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67099400

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档