0
페이지로드시 특정 ng-model
이 정의되지 않았는지 확인하려고합니다. 그러나 ng-model
을 정의하는 div
은이 테스트에서 false로 평가되는 ng-if
문을 사용하며 각도기가 지정된 바인딩을 가진 요소를 찾을 수없는 것 같습니다. 보기 코드를 변경하지 않고 내 모델 값을 확인하는 방법이 있습니까?각도기에서 바인딩의 값이 정의되지 않았다고 주장하는 방법은 무엇입니까?
현재 내 테스트는 다음과 같습니다
describe('loading the create invoice page for the first time', function() {
it('should have an undefined invoice.messages value', function() {
browser.get('http://persianturtle.com/app/#/invoice/create');
expect(element(by.binding('invoice.messages'))).toBe(undefined);
});
});
그리고 테스트의 결과 : 당신은 isPresent()
을 사용할 수 있습니다
NoSuchElementError: No element found using locator: by.binding("invoice.messages")
감사합니다! 이것은 내가 찾고 있었던 바로 그 것이다. –