I am trying to get attr disabled on a button, it should be "disabled", but I don't seem to get the value. New for angular and protractor!
When I look at the page, this is what the HTML that I get for the button showing disabled is disabled, for example, on the page:
<button type="submit" class="button primary inverse" ng-disabled="!comment.$dirty && comment.$valid" disabled="disabled">Save</button>
In the transporter test, below returns the value "Expected null equal to disabled"
var btnSave = element(by.css('.primary')); expect(btnSave.isPresent()).toBeTruthy(); var attr = element(by.css('.primary')).getAttribute('disabled'); expect(attr).toEqual("disabled");
When I try, I expect `` equal to disabled.
expect(attr).toEqual("disabled");
Any ideas I'm wrong about?
thanks
source share