angularjs e2e - how to test if a string DON'T match using protractor -
i'm migrating karma-ng-scenario
tests suite protractor.
// karma-ng-scenario expect(element('legend').text()).not().tobe("login_connect");
in protractor way. seems there isn't not()
function.
i'm using angular-translate
bind longin_connect string multiple languages , want test if string translated.
more globally, there a way test if different ? ... don't have class, don't exists on page, not selected, ...
it worth looking @ api docs. have these open pretty time. there lots of web driver functions can use isenabled()
, isdisplayed()
, isselected()
etc. protractor uses jasmine syntax can use '.tobe(false)' assert things false. check classes, can like:
expect(myelement.getattribute('class')).tocontain('my-class-name');
to compare strings , assert not match use .not
. jasmine docs say:
every matcher's criteria can inverted prepending .not:
expect(x).not.toequal(y); compares objects or primitives x , y , passes if not equivalent
Comments
Post a Comment