我将 WDIO 与 Jasmine 和 Chai 一起使用。
我收到以下错误,我已经尝试找到根本原因一天多了。
错误:超时 - 异步函数未在 10000 毫秒内完成(由 jasmine.DEFAULT_TIMEOUT_INTERVAL 设置)
代码:
describe('Lead Routing Functionality', () => {
beforeEach(function () {
LightningLeadPage.open();
LightningLeadPage.login();
console.log('[TEST STEP INFO]: Checking Header: ');
});
it('Verify validation', () => {
LightningLeadPage.click_app_launcher();
});
Run Code Online (Sandbox Code Playgroud)
*************
Run Code Online (Sandbox Code Playgroud)
export default class Lightning_Page {
click_app_launcher() {
console.log("[TEST STEP INFO]: Verify App launcher icon is present. ");
console.log('DEBUG : I am waiting...')
this.appLauncher().waitForExist(this.waitDuration());
console.log("[TEST STEP INFO]: Clicking on App Launcher");
this.appLauncher().click();
}
Run Code Online (Sandbox Code Playgroud)
我注意到 console.log('DEBUG : I am waiting...') …
我的测试作为 Maven 项目运行良好。它从 Git 获取代码。
我想在管道中执行相同的操作,因此我为管道项目编写了以下脚本。
pipeline {
agent any
options {
timestamps()
}
stages{
stage('Just Testing') {
steps {
git "https://github.com/myRepo.git"
script{
sh 'mvn test'
}
step([$class : 'Publisher', reportFilenamePattern : "**/testng-results.xml"])
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我执行时,我收到 mvn: command not found 错误 Java and Maven path is set正确在全局工具配置中(我确信因为我能够执行其他maven项目,只有管道失败。)
控制台输出:
Running on Jenkins in /Users/abacker/.jenkins/workspace/parallelTestNG
[Pipeline] {
[Pipeline] timestamps
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Just Testing)
[Pipeline] git
00:03:52 No credentials specified
00:03:52 > git rev-parse --is-inside-work-tree # timeout=10 …Run Code Online (Sandbox Code Playgroud) 我在 pom.xml 中添加了以下 WebDriverManager maven 依赖项
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
在我的 java 类中,我无法导入 io.github.bonigarcia.wdm.WebDriverManager; 自动地。如果手动编写导入,我会在 io.github 上收到错误,其中显示:导入 io.github 无法解析。
这里有什么问题呢?我在 pom.xml 中尝试了清理、重新启动和不同版本的 webdrivermanager。