i need check, using expect , jasmine, if text of span in button "vigente". how can it?
<button _ngcontent-hke-28="" class="btn btn-success disabled" tabindex="-1"> <span _ngcontent-hke-28="" class="glyphicon glyphicon-check"> </span> vigente</button>
can use xpath this:
/html/body/application/auth-container/layout/div/main-content/div/norma-cadastro/div/form/div[8]/div/button/text(vigente)
first of all, xpath expression asking not correct - vigente
part inside parenthesis not needed. also, try not use absolute xpath expressions more levels in path have, higher chances it'll break. and, xpaths not recommended protractor team.
instead, locate element by partial button text , check presence of element:
expect(element(by.partialbuttontext("vigente")).ispresent()).tobe(true);
or, can locate element by, say, css selector , text:
expect($("button.btn-success").gettext()).tocontain(vigente);
the button.btn-success
css selector though quite broad, see if can improve it.
Comments
Post a Comment