samedi 17 novembre 2018

Assert element not on page

Really simply question.

I'm writing some authorization/role based front-end end to end tests using testcafe and need to ensure certain menu elements are not showing (negative case assertion) and cannot figure out how to assert that a selector does not match.

I have tried:

  await
 t.expect(Selector('.m-menu__linktext').withText('Overview').innerText).notOk()

But that fails with:

Cannot obtain information about the node because the specified selector does not match any node in the DOM tree.

How do I assert that an selector does not match any element on a page?

Aucun commentaire:

Enregistrer un commentaire