运行测试时,正在执行it块并且我正在获得此输出。
我无法理解为什么npm命令退出并出错?
3) GAMETRIBE CELL C WAP DOI - SUCCESS FLOW Webdriver should target and click the subscription CTA:
An element could not be located on the page using the given search parameters ("[class='button']").
running phantomjs
Error: An element could not be located on the page using the given search parameters ("[class='button']").
at getText() - index.js:312:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webdriver_typescript@1.0.0 test-cellc: `node ./node_modules/typescript/lib/tsc.js && node ./node_modules/webdriverio/bin/wdio ./dist/wdio.conf.mcm.js --suite cellcWapDoi`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webdriver_typescript@1.0.0 test-cellc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/davidabes/.npm/_logs/2017-12-14T06_44_07_155Z-debug.log
我的测试用例如下:
export default function() {
it('Webdriver should target and click the subscription CTA', function() {
const yesLink = browser.element("[class='button']");
console.log(yesLink.getText());
console.log(yesLink.getTagName());
yesLink.click();
});
答案 0 :(得分:0)
似乎任何测试都失败了,那么似乎mocha退出时的错误代码为1 ......我只是不记得我在文档中的哪个位置读过这个。