2017-04-06 1 views
0

분도기 오류 메시지 표시 목록 항목이 없습니다. 내가 페이지에 나타납니다 주석 목록의 수를 확인하기 위해 E2E 테스트를했다분도기 - 오류 메시지 : 예상되는 0을 0으로 같음

conFusion App E2E Testing menu 0 item should show the number of comments Message: Expected 0 to equal 5. Stack: Error: Failed expectation at Object. (/Users/fullStock/anglerJs/conFusion/test/e2e/scenarios.js:37:23)

는 5.I 데이터를 제공하기 위해 JSON 서버를 사용합니다. 문제는 요소가 아직 DOM에 나타나지 않았다고 생각합니다. DOM에 요소가 나타날 때까지 각도기에 기다리는 방법이 있습니까? 코멘트

코드 E2E 테스트

describe('menu 0 item', function() { 
beforeEach(function() { 
    browser.get('index.html#/menu/0'); 
}); 

it('should have a name', function() { 
     var name = element(by.binding('dish.name')); 
     expect(name.getText()). 
     toEqual('Uthapizza Hot $4.99'); 
}); 

it('should show the number of comments as', function() { 
    expect(element.all(by.repeater('comment in dish.comments')) 
     .count()).toEqual(5); 

}); 

코드 HTML

<h4> Customer Comments &nbsp; 
       <span style="font-size:15px;">sorted by:<input type="text" ng-model="FiltText"></span></h4> 
      <blockquote ng-repeat="commet in dish.comments |orderBy:FiltText"> 
       <h5>{{commet.rating}} Stars</h5> 
       <h5>{{commet.comment}}</h5> 
       <footer>{{commet.author}}, <span>{{commet.date|date}}.</span></footer> 

      </blockquote> 

각도기 구성이 업데이트 된 테스트 케이스와

exports.config = { 
    allScriptsTimeout: 11000, 
    specs: [ 
    'e2e/*.js' 
     ], 
    capabilities: { 
    browserName: 'chrome' 
    }, 

baseUrl: 'http://localhost:3001/', 

    framework: 'jasmine', 
    directConnect: true, 

jasmineNodeOpts: { 
    defaultTimeoutInterval:30000 
} 
}; 
+0

수동으로 확인할 기회가 있었습니까? 그리고 한 가지 더 당신의 로케이터가 개선 된 것 같습니다. 이 특정 위치 지정 자에 대한 답변을 게시하겠습니다. 친절하게 확인하고 – krishnarajanr

+0

예를 알려주십시오. 수동으로 확인하십시오. 사실 나는이 웹 application.comment 목록을 제공하기 위해 터미널 꿀꺽 꿀꺽 마시는 시계를 입력합니다. 바로 그게 전부입니다. 그러나 필기 도구를 만들면 테스트가 실패합니다. – munirah

답변

0

확인합니다. 문제는, 당신은 전체 중계기를 가져 가지 않았기 때문입니다.

it('should show the number of comments as', function() { 
    expect(element.all(by.repeater('commet in dish.comments |orderBy:FiltText')) 
     .count()).toEqual(5); 
}); 
+0

나는 그것을했지만 문제를 풀지는 않았다. 같은 문제가 발생합니다. – munirah