These are chat archives for Behat/Behat

Nov 2016
Laura Hartwell
Nov 08 2016 22:20

ARrrggh.. I need help. I am very new at automated testing and testing in general. I am using behat/mink/selenium to write my tests with. I have to assert the value of an input field but that field is populated using knockout.js and the normal behat asserts are not working. How do I get at the value of the field when I can visibly see it, but behat can’t see it.

Here’s what I see when I inspect it:

<input id="txt-expires-entry-1-0-0" class="txt-expires" data-bind="disable: $root.signed().signed, value: expires, event: { change: $root.vialSaveData }, attr: { id: 'txt-expires-entry-' + type_id() + '-' + $index() + '-' + dilutions() }" type="text">

This passes:
Then I should see 1 "#txt-expires-entry-1-0-0” element

This doesn’t:
Then I should see "05/08/2017"
The text "05/08/2017" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)

Please, help? I’m frustrated with this.

Screen Shot 2016-11-08 at 2.13.02 PM.png
Andrew Kovalyov
Nov 08 2016 23:50
@fuel-lhartwell input value is not part of page text.
Laura Hartwell
Nov 08 2016 23:52
Ok, thank you. :)
I think I got it figured out now. I had to edit the php of the page itself, add the value attribute from the knockout value. I have a pull request in for that.