Javascript laravel 5.1测试动态表格

Javascript laravel 5.1测试动态表格,javascript,laravel,testing,dojo,Javascript,Laravel,Testing,Dojo,我在测试laravel 5.1应用程序表单时遇到了一个问题,该应用程序表单的输入值取决于其他输入,例如,当加载页面时,第二个输入被禁用,然后在用户选择select控件上的一个选项(该控件使用javascript设置第二个select的数据存储并启用它)后,第二个输入被启用允许他们输入。表单在浏览器上工作,但在测试时,即使在显式选择/键入第一个输入后,也不会启用禁用的控件 这是我的测试代码 $this->visit('/forms/document')->submitForm('sub

我在测试laravel 5.1应用程序表单时遇到了一个问题,该应用程序表单的输入值取决于其他输入,例如,当加载页面时,第二个输入被禁用,然后在用户选择select控件上的一个选项(该控件使用javascript设置第二个select的数据存储并启用它)后,第二个输入被启用允许他们输入。表单在浏览器上工作,但在测试时,即使在显式选择/键入第一个输入后,也不会启用禁用的控件

这是我的测试代码

$this->visit('/forms/document')->submitForm('submit', ['username' => 'Superuser','password' => 'sample'])
        ->see('Upload Document')

        //test sending blank form
        ->submitForm('save',['owner' => ''])
        ->see('Name is Required')
        ->see('Type is Required')
        ->see('Owner is Required')
        ->see('File is Required')

        //test sending properly filled form
        ->type('user', '#type')
        ->type('1', '#owner')
        ->type('Test Document', 'name')
        ->attach(dirname(__FILE__).'/test_document.pdf','file')
        ->press('save')
        ->see('Test Document')
        ->see('Never')
        ->see(date("M d, Y"));
还有一段我的表单代码

<tr>
            <td align="right">Attachment Type</td>
            <td >
                <select name='type' id='type' required='1' dojotype='dijit.form.FilteringSelect'
                value='{{$document->type}}'>
                    <option value=''>Please Select</option>
                    <option value='user'>System User</option>
                    <option value='company'>Company Document</option>
                    <option value='voucher'>Finance Voucher</option>
                    <option value='pipline'>Sales Voucher</option>
                    <script type="dojo/method" event="onChange">
                         children(this,'owner',null,"{{url('/')}}");
                    </script>
                </select>     
            </td>
        </tr>
        <tr>
            <td align="right">Attached To (Owner)</td>
            <td>
                <select id='owner' name='owner' dojotype='dijit.form.FilteringSelect' disabled searchattr='name'></select>
            </td>
        </tr>
        <tr>
            <td align="center" colspan='2'>
                <button name='save' type='submit' dojotype='dijit.form.Button'>Save Document</button>
                <button name='new' type='submit' dojotype='dijit.form.Button'>Save and New</button>
            </td>
        </tr>

在使用Integrated(作为一个单独的软件包)和Laravel5.0时,这不是一个问题,但在我升级到5.1(因为多维表单控件测试)之后,出现了问题。我已经尝试了我能想到的一切,但到目前为止还没有任何乐趣(请提供帮助。

@Bogdan在Laravel 5.0下,更改“type”值的测试指令将触发“onChange”事件,该事件将触发子项()javascript函数,除其他外,它删除了所有者字段的“disabled”属性,允许将其与其他输入一起发送到服务器。此功能在安装Laravel 5.1后出现故障。对不起,我的错误是,我忽略了Selenium可能涉及到这一事实。忽略我之前的评论:).我在使用Laravel dusk时遇到了类似的问题,我想我通过在检查输入或选项是否启用之前延迟几秒钟来解决了这个问题。
//changing the data store of child from the value of the parent
function children(parent,child,parameters,url)
{
    var value = dijit.byId(parent).value.toLowerCase().split(' ')[0];
    if(parameters !==null){
        parameters = parameters.join('/');
    }
    var node = dijit.byId(child);
    node.set('disabled', false);
    node.set('displayedValue', '');
    var store = new dojo.data.ItemFileReadStore({url: url+"/store/"+value+"/"+parameters});
    node.set('store', store);
}