等待不起作用JAVA+;APPIUM+;黄瓜
我目前在使用java库时遇到了一个奇怪的问题。 我使用等待性等待一分钟,并使用下面的语句检查一个条件等待不起作用JAVA+;APPIUM+;黄瓜,java,cucumber,awaitility,Java,Cucumber,Awaitility,我目前在使用java库时遇到了一个奇怪的问题。 我使用等待性等待一分钟,并使用下面的语句检查一个条件 String currentTime = getAvailableDriveTime(); await("Wait for time") .atMost(60, TimeUnit.SECONDS) .until(this::getDriveTime, not(currentTime)); 奇怪的是,上面的语句在示例Appium测试脚本中运行良好,但在cucumber+Appi
String currentTime = getAvailableDriveTime();
await("Wait for time")
.atMost(60, TimeUnit.SECONDS)
.until(this::getDriveTime, not(currentTime));
奇怪的是,上面的语句在示例Appium测试脚本中运行良好,但在cucumber+Appium+java框架中不起作用,并抛出以下错误
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)
at org.awaitility.core.AbstractHamcrestCondition.getMismatchMessage(AbstractHamcrestCondition.java:76)
at org.awaitility.core.AbstractHamcrestCondition.access$300(AbstractHamcrestCondition.java:25)
at org.awaitility.core.AbstractHamcrestCondition$1.eval(AbstractHamcrestCondition.java:55)
at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:190)
at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:177)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at ✽.Driving time in the driving overview screen will be updated(file:src/main/resources/EFSFeatureFiles/HOS&DVIR/VehicleMotionFeature/EFSVehicleMotion_DriverLoggedIn.feature:83)
你能回答你的问题并包含getDriveTime的代码吗?我已经添加了getDriveTime的代码。谢谢,你能把堆栈跟踪也添加到你的问题中吗?我已经添加了堆栈跟踪。谢谢你能回答你的问题并包含getDriveTime的代码吗?我已经添加了getDriveTime的代码。谢谢,你能把堆栈跟踪也添加到你的问题中吗?我已经添加了堆栈跟踪。非常感谢。
java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)
at org.awaitility.core.AbstractHamcrestCondition.getMismatchMessage(AbstractHamcrestCondition.java:76)
at org.awaitility.core.AbstractHamcrestCondition.access$300(AbstractHamcrestCondition.java:25)
at org.awaitility.core.AbstractHamcrestCondition$1.eval(AbstractHamcrestCondition.java:55)
at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:190)
at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:177)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at ✽.Driving time in the driving overview screen will be updated(file:src/main/resources/EFSFeatureFiles/HOS&DVIR/VehicleMotionFeature/EFSVehicleMotion_DriverLoggedIn.feature:83)