laravel - Laravel 黄昏无法输入完整的输入
问题描述
我正在尝试在 Laravel Dusk 上做一个测试用例,我在输入字段中输入,我会看到一些奇怪的功能,有时它不会输入完整的字符并处理下一个断言/测试。
我尝试暂停,但它没有帮助我。
$browser->assertPathIs($this->url())
->type('@stock-update-name', 'keshgjkfsdh289359846359462svfcvbjn8475645ksjdhgjfsg5')
->pause(1000)
->press('@stock-update-submit')//clicked on the button and redirected to table and show the expected filled content
->waitFor('.swal2-shown')
->assertSee('Oops!')
->assertSee('The given data was invalid')
->press('OK')
->assertSee('The name may not be greater than 20 characters.')
->type('@stock-update-name', '@#$786jdf')
->press('@stock-update-submit')//clicked on the button and redirected to table and show the expected filled content
->waitFor('.swal2-shown')
->assertSee('Oops!')
->assertSee('The given data was invalid')
->press('OK')
->assertSee('The name format is invalid.')
->type('@stock-update-name', 'instock')//check for valid stock name
->press('@stock-update-submit')
->waitFor('.swal2-shown')
->assertSee('stock has been updated.')
->press('OK')
->waitForLocation($this->url())
->pause(3000);
它应该输入整个字符,但有时它会输入 3 个字符或 5 个字符,因此我的大多数测试用例都失败了。
解决方案
推荐阅读
- azure - 如何使用数据工厂将多个 csv 文件从 blob 批量复制到多个 sql 数据库表
- matlab - 按 2 个变量分组,一个变量具有独特的颜色,另一个变量具有独特的形状
- python - 在numpy数组上替换double for循环(索引到其他数组)
- jquery - jQuery:同时检测两个不同元素的mouseleave
- python - 多链接结构的递归方法
- powershell - PowerShell - 复制文件 X 次并更改其名称
- python - Python 转 C# 多维数组
- python - 根据数据帧中的子字符串提取字符串的一部分 - python
- animation - 如何在 Elm-UI 中鼠标悬停动画?
- typescript - 打字稿根据字符串区分对象中的联合