hinthealth / behave

Front-end testing helpers
MIT License
1 stars 0 forks source link

Find couldn't find text #15

Open blakewest opened 9 years ago

blakewest commented 9 years ago

Given the following html file...

<div class='signin well' test-me='user-well'>
  <app-alerts></app-alerts>
  <h3 class='text-center'>Create Account</h3>
  <form class='form-signin' name='loginForm' ng-class="{'has-error': error.bad_invite_code}">
    <div class='form-group form-group-compact'>
      <input class='form-control' name='invite_code' placeholder='Enter invite code here' autofocus='' ng-model='vm.invite_code' test-me='invite-code'>
    </div>
    <div class='form-group'>
      <span class='help-block' ng-show='vm.error.bad_invite_code' test-me='user-failed-code'>
        That invite code is incorrect. Please
        <a href='http://www.hint.com/#contact' target='_blank' test-me='get-invite-code'>contact us</a>
        to get yours!
      </span>
    </div>
    <div class='form-group'>
      <button class='btn btn-block btn-lg btn-primary' type='submit' ng-click='vm.verifyCode(vm.invite_code)' ng-disabled='!vm.invite_code' test-me='user-submit'>Create Account</button>
    </div>
  </form>
</div>

doing find('incorrect') did not return anything. Unclear why... seems like it should have found the text within the 'user-failed-code' span.