【问题标题】:Finding the Correct Junit Version to use in pom .XML file查找要在 pom .XML 文件中使用的正确 Junit 版本
【发布时间】:2019-01-20 12:04:27
【问题描述】:

我正在创建一个 appium 框架,我想知道我可以使用什么稳定版本的 Junit?在我的 maven 项目(Junit 3.8.1)中找到的默认版本非常非常旧,但是当我尝试在 Eclipse 中使用最新版本的 JUnit 时,它不喜欢它并在我的项目中放置了一个红色的“x” .

那么我可以使用什么

 Java. 1.8
 Appium desktop  1.8.1
 java-client 5.0.4
 selenium-java 3.11.0
 TestNG 6.11

完全不使用 JUnit 会更容易吗?

<dependency>
    <groupId>io.appium</groupId>
    <artifactId>java-client</artifactId>
    <version>5.0.4</version>
</dependency>
  <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.11</version>
    <scope>test</scope>
</dependency>


    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

【问题讨论】:

  • 使用testng for appium就不需要使用junit了。

标签: java maven automation frameworks appium


【解决方案1】:

您应该明确考虑切换到 Junit 4.12。

尝试下载最新版本的 Eclipse(或切换到 IntelliJ,非常棒)。

用途:

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>

否则,您可以尝试像 TestNG 这样的 junit 替代方案。

【讨论】:

  • 对于它的价值,我最近尝试更新我的 Appium 项目的 JUnit,但我根本无法获得任何超过 4.12 的版本。我尝试了 Maven 存储库中列出的每一个较新的版本,只是决定留在 4.12
  • 4.12 不错。它有很多注释,并且可以很好地与 spring-boot 等“新”技术配合使用
  • 谢谢你们,你们都是一群传奇人物。我想我会在 appium 框架中使用 TestNG
猜你喜欢
  • 2018-04-03
  • 2014-04-06
  • 1970-01-01
  • 2017-09-14
  • 2020-08-28
  • 2011-02-16
  • 2014-10-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多