2017-12-01 6 views
0

AWS Device farmでスクリプトを実行しようとしています。しかし、私は上記の解析エラーを取得しています。[TestNG]すべてのクラスを実行しているjarファイル内にtestng.xmlが見つかりませんでした[TestNG] [ERROR]クラスStepDefinition.FreeSPHomeStepsをインスタンス化できません

「テストパッケージの解析エラーが原因でテストがスキップされました。詳細については解析結果を確認してください」 AWSコンソールに表示されています。

プロジェクト詳細:Javaの-TestNGの-キュウリコンボ

プロジェクト構造:また、以下の私のpom.xmlを提供

is here

http://maven.apache.org/xsd/maven- 4.0.0.xsd "> 4.0.0

<groupId>TestSuite</groupId> 
<artifactId>AndroidBusinessApp</artifactId> 
<version>1.1-SNAPSHOT</version> 
<packaging>jar</packaging> 


<!-- <groupId>TestSuite</groupId> <artifactId>AndroidBusinessApp</artifactId> 
    <version>1.1-SNAPSHOT</version> <packaging>jar</packaging> --> 

<name>AndroidBusinessApp</name> 
<url>http://maven.apache.org</url> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

<!-- <id>TestSuite</id> --> 
<build> 

    <plugins> 
     <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.20</version> </plugin> --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jar-plugin</artifactId> 
      <version>2.6</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>test-jar</goal> 
        </goals> 
       </execution> 
      </executions> 

     </plugin> 
     <!-- Adding maven comiler plugin and surefire plugin in Build is manadatory --> 
     <!--****The Compiler Plugin is used to compile the sources of your project**** --> 
     <!-- Enable the forkcount only if you want to run parallel , will trigger 
      #n no of JVM --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 



     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.10</version> 
      <executions> 
       <execution> 
        <id>copy-dependencies</id> 
        <phase>package</phase> 
        <goals> 
         <goal>copy-dependencies</goal> 
        </goals> 
        <configuration> 
         <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.5.4</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>single</goal> 
        </goals> 
        <configuration> 
         <finalName>zip-with-dependencies</finalName> 
         <appendAssemblyId>false</appendAssemblyId> 
         <descriptors> 
          <descriptor>src/main/assembly/zip.xml</descriptor> 
         </descriptors> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-resources-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>copy-testclasses</id> 
        <phase>package</phase> 
        <goals> 
         <goal>testResources</goal> 
        </goals> 
        <configuration> 
         <outputDirectory>${project.build.directory}/upload/test-classes</outputDirectory> 
         <resources> 
          <resource> 
           <directory> 
            ${project.build.testOutputDirectory} 
           </directory> 
          </resource> 
         </resources> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.18.1</version> 
      <configuration> 
       <suiteXmlFiles> 
        <suiteXmlFile>Testng.xml</suiteXmlFile> 
       </suiteXmlFiles> 
       <includes> 
       <include>**/AppiumServerTest.java</include> 
       </includes> 
      </configuration> 
     </plugin> 
    </plugins> 

</build> 


<dependencies> 



    <dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-java</artifactId> 
     <version>2.44.0</version> 
    </dependency> 

    <dependency> 
     <groupId>io.appium</groupId> 
     <artifactId>java-client</artifactId> 
     <version>3.1.0</version> 
    </dependency> 

    <dependency> 
     <groupId>org.testng</groupId> 
     <artifactId>testng</artifactId> 
     <version>6.8.8</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-java</artifactId> 
     <version>1.2.4</version> 
     <scope>test</scope> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-testng --> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-testng</artifactId> 
     <version>1.2.4</version> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit --> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-junit</artifactId> 
     <version>1.2.4</version> 
     <scope>test</scope> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/info.cukes/gherkin --> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>gherkin</artifactId> 
     <version>2.12.2</version> 
     <scope>provided</scope> 
    </dependency> 

    <!-- ********* https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting 
     ******** --> 
    <!-- ********* http://search.maven.org/#search%7Cga%7C1%7Ccucumber-extentsreport 
     ************** --> 
    <!-- 1st is for Cucumber Extent advance Reporting --> 
    <dependency> 
     <groupId>com.vimalselvam</groupId> 
     <artifactId>cucumber-extentsreport</artifactId> 
     <version>3.0.0</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting --> 
    <dependency> 
     <groupId>net.masterthought</groupId> 
     <artifactId>cucumber-reporting</artifactId> 
     <version>3.11.0</version> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports --> 
    <dependency> 
     <groupId>com.aventstack</groupId> 
     <artifactId>extentreports</artifactId> 
     <version>3.0.7</version> 
     <scope>provided</scope> 
    </dependency> 

    <!-- https://mvnrepository.com/artifact/com.relevantcodes/extentreports --> 
    <dependency> 
     <groupId>com.relevantcodes</groupId> 
     <artifactId>extentreports</artifactId> 
     <version>2.41.2</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-picocontainer</artifactId> 
     <version>1.2.4</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
     <scope>test</scope> 
    </dependency> 
    <!-- Add a dependency for the Appium test extensions to execute in Mobile 
     center --> 
    <!-- <dependency> <groupId>com.microsoft.appcenter</groupId> <artifactId>appium-test-extension</artifactId> 
     <version>1.0</version> </dependency> --> 

</dependencies> 

アドバイスありがとうございます!

答えて

0

それはここでzip-with-dependencies.zip

にjarファイルのルートに追加する必要がありますデバイスファーム内のtestng.xml作業がその を行う方法を示すプル要求であることを確認しますhttps://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app/pull/14

私はキュウリthoについてはわかりません。私はそれを試していないが、現在DFarmでサポートされていない可能性があります。

HTH James

+0

ありがとうございます。私は試しましたが、同じエラーが表示されます。私のコードで見逃していることは他にあります。この問題について助言してもらえますか? – user2750187

+0

それはジェームズを働いた。ありがとうございました! testng.xmlを別の場所に追加しました。 src/main/resourcesの中に追加されました:-) – user2750187

関連する問題