[英]Laravel Dusk is throwing up error
This is my test function 这是我的测试功能
$this->browse(
function (Browser $browser)
{
$browser->visit('/')->clickLink('Login')->value('#mobile', '9790772695')->value('#password', 'password')->check('remember')->click('#login')->assertPathIs('/dashboard');
for ($i = 0; $i < 1024; $i++) {
$browser->visit('/invoice/new')->assertPathIs('/invoice/new')->select('#ClientName');
$browser->driver->executeScript('window.scrollTo(0, 100);');
$browser->pause(1000)->check('#autoins')->keys('#item_1', 'freak')->keys('.qty', '1')->select('#invoiceStatus', 'paid')->value('#grand', 1251)->value('#amountPaid', 1251)->value('#amountPaid', 1251)->value('#amountDue', 0);
$browser->driver->executeScript('window.scrollTo(0, 1000);');
$browser->click('.invoice-save-btn')->pause(3000);
}
});
This is the error 这是错误
1) Tests\\Browser\\InvoiceTest::testExample ErrorException: array_rand(): Array is empty 1)Tests \\ Browser \\ InvoiceTest :: testExample ErrorException:array_rand():数组为空
C:\\xampp\\htdocs\\agashtyav1\\vendor\\laravel\\dusk\\src\\Concerns\\InteractsWithElemen>ts.php:201 C:\\xampp\\htdocs\\agashtyav1\\tests\\Browser\\InvoiceTest.php:23 C:\\xampp\\htdocs\\agashtyav1\\vendor\\laravel\\dusk\\src\\TestCase.php:91 C:\\xampp\\htdocs\\agashtyav1\\tests\\Browser\\InvoiceTest.php:29 C:\\ xampp \\ htdocs \\ agashtyav1 \\ vendor \\ laravel \\ dusk \\ src \\ Concerns \\ InteractsWithElemen> ts.php:201 C:\\ xampp \\ htdocs \\ agashtyav1 \\ tests \\ Browser \\ InvoiceTest.php:23 C:\\ xampp \\ htdocs \\ agashtyav1 \\ vendor \\ laravel \\ dusk \\ src \\ TestCase.php:91 C:\\ xampp \\ htdocs \\ agashtyav1 \\ tests \\ Browser \\ InvoiceTest.php:29
What is weird is that I don't get any errors if I remove the 奇怪的是,如果我删除了
->select('#ClientName'); ->选择('#ClientName');
command on line 23. 第23行的命令。
The issue is solved. 问题已解决。 The problem was not with dusk, but with a controller function which populates the drop down list 问题不在于黄昏,而在于填充下拉列表的控制器功能
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.