Instagram uses the linkState method from ReactLink:
http://facebook.imtqy.com/react/docs/two-way-binding-helpers.html
The login page refers to bundles/Login.js , which contains the compressed code as follows:
o.createElement("input", { className:"lfFieldInput", type:"text", name:"username", maxLength:30, autoCapitalize:!1, autoCorrect:!1, valueLink:this.linkState("username") }))
If you look at the documentation for ReactLink, this means that the value of the input field only returns to the state when the change event is fired in the input fields. However, it is not as simple as simply triggering a change event on a node in the question - I think it is because React normalizes browser events. React docs specifically say that onChange in React is not quite the same as onChange in the browser for various reasons:
http://facebook.imtqy.com/react/docs/dom-differences.html
Fortunately, in your case, Instagram uses React with Addons included, which gives you access to React TestUtils, so you can do:
var frm = window.frames[1].document.forms[0]; var fReact = window.frames[1].React; fReact.addons.TestUtils.Simulate.change(frm.elements[0], {target: {value: 'qacitester' }}); fReact.addons.TestUtils.Simulate.change(frm.elements[1], {target: {value: 'qatester' }}); frm.elements[2].click();
Further documentation here:
http://facebook.imtqy.com/react/docs/test-utils.html
Please note: since the login form is in an iframe, you must use a React instance from this iframe, otherwise TestUtils will not be able to find the nodes correctly.
This will only work in situations where React Addons are included on the page. The normal assembly of Non-Addons React will require a different solution. However, if you are specifically talking about ReactLink, then this is an addon, so this is not a problem.