2017-12-14 18 views
0

테스트를 실행하면 it 블록이 실행되고이 출력이 표시됩니다.WDIO Javascript 예상치 못한 경우 Mocha/Chai 충돌 NPM

내가 이해할 수없는 것은 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! [email protected] 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 [email protected] 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(); 
}); 
+1

흥미 진진한데, 왜 [class = "button"]'대신'browser.element ('. button')'을 사용하지 않습니까? – tehbeardedone

+0

필요한 요소 ([class = 'button'])가 없습니다. 그래도 예상되는 동작입니다. 어떤 조치를 취하기 전에 browser.waitForVisible() 명령을 추가해야합니다. – dzvert

답변

0

, 그것은 하나의 오류 코드 모카 종료 것 같다 ... 난 그냥 기억이 안나요 문서에서 나는 이것을 읽었습니다.