모카 차이와 악몽으로 테스트를 실행하는 연습을하고 있습니다. 내 평가 블록에 들어갈 때까지 모든 것이 작동하는 것 같습니다.내 악몽 테스트가 내 평가문에 들어 가지 않습니다.
var Nightmare = require('nightmare'),
should = require('chai').should()
describe('Frontend Masters', function() {
this.timeout(20000);
it('should show form when loaded', function(done) {
var nightmare = new Nightmare({show: true})
nightmare
.goto('https://frontendmasters.com/')
.wait('a[href*="https://frontendmasters.com/login/"]')
.click('a[href*="https://frontendmasters.com/login/"]')
.wait('#rcp_login_form')
.evaluate(function() {
return window.document.title;
}, function(result) {
result.should.equal('Login to Frontend Masters');
done();
})
.run(function(){
console.log('done')
});
});
});
나는 콘솔 로그에 던져 버렸고 평가에 넣지 않았다. 여러 셀렉터를 wait() 함수에 전달하려고 시도했지만 효과가없는 것 같습니다. 내가받는 오류는 시간 초과가 초과되었다는 것입니다. 하지만 내가 얼마나 오랫동안 그것을 설정 중요하지 않습니다
evaluate' '와 함께 할 아무것도하지 않는 것 같습니다. 'wait' 시간 초과가 실패하면 이전 클릭이 작동하지 않거나 사이트가 손상됩니다. 그건 그렇고, 두 번의 대기 호출 중 어느 것이 실패 했습니까? –
환경 변수 DEBUG = "nightmare *"로 실행할 때 유용한 결과를 얻었습니까? – yoz