1
的正文,名称或ID属性的链接我正在使用打开模式编辑记录的按钮测试页面。InvalidArgumentException:无法找到具有[编辑]
$this->visit('/admin/dashboard/units')
->see($site->name . ' ' . '~' . ' ' . 'Units')
->see($unit_type->name)
->see($unit->unit_type_id)
->see($unit->status)
->click('Edit')
在我的刀片文件我有:
<a class="button warning" data-open="editUnit{{ $unit->id }}">Edit</a>
,但仍然没有工作
,但我得到这个错误:
There was 1 error:
1) UnitsTest::testEditUnit InvalidArgumentException: Could not find a link with a body, name, or ID attribute of [Edit].
更新
我也试过路过一个id这样
<a id="Edit" class="button warning" data-open="editUnit{{ $unit->id }}">Edit</a>
你可以尝试给按钮一个唯一的ID,并按它的ID代替。不知道它为什么找不到按钮 - 它实际上似乎是有效的。 –
很可能它没有找到该对象,因为它在测试过程中未被创建。尝试给它一个ID并搜索它。其他方法是转储输出并搜索实际内容。 – melanholly
我已经将一个ID传递给了一个标签,但仍然没有工作 –