我遇到了WebdriverIO和Cucumber的问题。
我使用了最新版本的WebdriverIO(@v5.x.x
)和Cucumber v4。当我运行测试套件时,控制台会显示警告消息。另外,在该过程中没有创建黄瓜.json
数据文件。
警告消息:
WARN wdio-cli:无法识别来自工作人员的消息:
这是我的package.json
文件:
"dependencies": {
"@wdio/allure-reporter": "^5.4.16",
"@wdio/cli": "^5.4.17",
"@wdio/local-runner": "^5.4.17",
"@wdio/selenium-standalone-service": "^5.4.14",
"@wdio/spec-reporter": "^5.4.15",
"chai": "^4.2.0",
"cucumber": "^4.0.0",
"moment": "^2.24.0",
"wdio-cucumber-framework": "^2.2.8",
"webdriverio": "^5.4.17"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/register": "^7.0.0"
},
以下是控制台输出:
"C:\Program Files\nodejs\node.exe" D:\Git\Aydes-Wdio\e2e\node_modules\@wdio\cli\bin\wdio.js Conf/wdio.conf.js --suite Test
2019-02-18T08:52:46.911Z DEBUG wdio-config: @wdio/sync not found, running tests asynchronous
2019-02-18T08:52:47.729Z DEBUG wdio-cli:run: Run suite with config Conf/wdio.conf.js and params { _: [ 'Conf/wdio.conf.js' ],
suite: [ 'Test' ],
'$0': 'node_modules\\@wdio\\cli\\bin\\wdio.js' }
c 1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
1 running, 0 passed, 0 failed, 1 total (0% completed)
c
Stdout:
2019-02-18T08:52:48.887Z INFO wdio-cli:Launcher: Run onPrepare hook
2019-02-18T08:52:51.456Z INFO wdio-local-runner: Start worker 0-0 with arg: Conf/wdio.conf.js,--suite,Test
2019-02-18T08:53:05.197Z DEBUG wdio-local-runner: Runner 0-0 finished with exit code 0
2019-02-18T08:53:05.199Z INFO wdio-cli:Launcher: Run onComplete hook
Stderr:
2019-02-18T08:53:00.118Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:start","cid":"0-0","uid":"Demo Page of Google1","title":"Demo Page of Google","pending":false,"parent":null,"type":"suite","file":"Web\\Features\\Test.feature","err":{},"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":"Feature"}, ignoring!
2019-02-18T08:53:00.137Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:start","cid":"0-0","uid":"Search a text in Google3","title":"Search a text in Google","pending":false,"parent":"Demo Page of Google1","type":"suite","file":"Web\\Features\\Test.feature","err":{},"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
2019-02-18T08:53:00.140Z WARN wdio-cli: Can't identify message from worker: {"event":"test:start","cid":"0-0","uid":"I open \"http://www.google.com\" the website4","title":"I open \"http://www.google.com\" the website","pending":false,"parent":"Search a text in Google3","type":"test","file":"Web\\Features\\Test.feature","err":{},"duration":0,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"featureName":"Demo Page of Google","scenarioName":"Search a text in Google","keyword":null}, ignoring!
2019-02-18T08:53:04.769Z WARN wdio-cli: Can't identify message from worker: {"event":"test:pass","cid":"0-0","uid":"I open \"http://www.google.com\" the website4","title":"I open \"http://www.google.com\" the website","pending":false,"parent":"Search a text in Google3","type":"test","file":"Web\\Features\\Test.feature","err":{},"duration":4629,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":"Given "}, ignoring!
2019-02-18T08:53:04.771Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:end","cid":"0-0","uid":"Search a text in Google3","title":"Search a text in Google","pending":false,"parent":"Demo Page of Google1","type":"suite","file":"Web\\Features\\Test.feature","err":{},"duration":4634,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
2019-02-18T08:53:04.773Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:end","cid":"0-0","uid":"Demo Page of Google1","title":"Demo Page of Google","pending":false,"parent":null,"type":"suite","file":"Web\\Features\\Test.feature","err":{},"duration":4655,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
Test Suites: 1 passed, 1 total (100% completed)
Time: 16.46s
Process finished with exit code 0
答案 0 :(得分:1)
我发现了我的错误。
这里是在解释为什么黄瓜不在wdio V5上运行
要使用Cucumber,必须使用WebdriverIO v4,直到将框架迁移到v5