2016-11-16 2 views
0

내 전용 테스트 제품군에서 phantomjs-prebuilt를 사용하여 webdriverio (독립 실행 형)를 실행하고 있습니다. 내 테스트 페이지는 html 태그에 "test-completed"클래스를 첨부합니다. 나는 class가 추가 된 후에 webdriverio가 html을 검사하기를 원하지만 어떤 대기 함수가 작동하지 않는 것처럼 보일 수있다. 내 코드는 그것 없이도 작동합니다 ... 내가 뭘 잘못하고 있는지. 다음은 몇 가지 예는 다음과 같습니다webdriver io 독립 실행 형 wait 명령이 작동하지 않는 것 같음

이 작동 :

webdriverio 
.remote(options) 
.init() 
.url('./tests.html') 
.getTitle().then(function(title) { 
    console.log('Title was: ' + title); 
}) 
.end(); 

이되지 않습니다

webdriverio 
.remote(options) 
.init() 
.url('./tests.html') 
.waitForExist('html.tests-completed') 
.getTitle().then(function(title) { 
    console.log('Title was: ' + title); 
}) 
.end(); 

어느 않습니다 이런 식으로 뭔가 :

webdriverio 
.remote(options) 
.init() 
.url('./tests.html') 
.waitUntil(function(){ 
    return webdriverio.isExisting(
     'html.tests-completed', 1000, 
     'tests not yet complete', 500 
    ); 
}) 
.getTitle().then(function(title) { 
    console.log('Title was: ' + title); 
}) 
.end(); 

누구는 아이디어가?

답변

0

waitForExist 선택에서 HTML을 제거하십시오

webdriverio 
.remote(options) 
.init() 
.url('./tests.html') 
.waitForExist('.tests-completed') 
.getTitle().then(function(title) { 
    console.log('Title was: ' + title); 
}) 
.end();