opitzconsulting / uitest.js

uitest.js is able to load a webpage into a frame, instrument that page and the javascript in that page (e.g. add additional scripts at the end of the document, ...) and execute actions on that page.
MIT License
67 stars 8 forks source link

Knockout in iFrame #26

Open Stewartarmbrecht opened 11 years ago

Stewartarmbrecht commented 11 years ago

I am not sure if this is UITest related but maybe someone here can help. I am using UITest.js to test a knockout application.
In the application I have a text box. The text input's value is bound to a knockout observable: . When I try to update the value in the UITest window with jquery the knockout binding does not update:
$('#uitestwindow').contents().find('#menuOptionName').val('Test') // $root.selectedName not updated. However, if I do the same thing when the application is loaded in its own window it works: $('#menuOptionName').val('Test').change() // $root.selectedName IS updated. Could there be something in the UITest setup that breaks this?

Stewartarmbrecht commented 11 years ago

BTW - The actual value of the text box is updated and the change event is fired. It's just the knockout binding that doesn't seem to notice it. Also, if I manually update the text box field the binding fires.

Stewartarmbrecht commented 11 years ago

I figured out that there is nothing related to UITest that is causing this issue. Here is a sample of the problem: https://groups.google.com/d/msg/knockoutjs/av0sikLJhxg/PXCrk_hce7EJ The problem is that the third text box is updated by javascript from the parent window and the knockout binding that should cause the save button to show is not firing.

tbosch commented 11 years ago

Hi, will look into this next week. Thanks for reporting!

Tobias