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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -