laravel dusk 随机 select 防止第一个选项
laravel dusk random select prevent the first option
这是一个select
<select id='fruit' name='fruit'>
<option value="">please select one fruit</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
<option value="orange">orange</option>
</select>
这是我的测试
/** @test */
public function form_test()
{
$this->browse(function (Browser $browser) {
$browser->select('fruit');
}
}
当我测试表格时,我需要随机 select 水果而不是第一个 "please select one fruit" 元素,但是当我使用 ->select()
时,有时它 select第一个 "please select one fruit" 元素,有没有办法防止?
请将disable
添加到其属性。
<select id='fruit' name='fruit'>
<option value="" disabled>please select one fruit</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
<option value="orange">orange</option>
</select>
这是一个select
<select id='fruit' name='fruit'>
<option value="">please select one fruit</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
<option value="orange">orange</option>
</select>
这是我的测试
/** @test */
public function form_test()
{
$this->browse(function (Browser $browser) {
$browser->select('fruit');
}
}
当我测试表格时,我需要随机 select 水果而不是第一个 "please select one fruit" 元素,但是当我使用 ->select()
时,有时它 select第一个 "please select one fruit" 元素,有没有办法防止?
请将disable
添加到其属性。
<select id='fruit' name='fruit'>
<option value="" disabled>please select one fruit</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
<option value="orange">orange</option>
</select>