我不明白为什么fillIn找不到“数据测试代码导航选择器”。
我已经暂停了测试,并使用devtools复制了这个DOM摘录。它按预期显示。正如您所看到的,select标记具有所需的属性。
<select label="codingDropdown" class="h-full bg-gray-50 rounded shadow border py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" data-test-code-nav-selector="">
<option value="PDF_I10_PCS_APPENDICES">ICD-10 PCS Appendices</option>
<option value="PDF_I10_PCS_REFERENCE_MANUAL">ICD-10-PCS Reference Manual</option>
</select>
然后,在test.js文件中,我调用具有相同属性的fillIn。
await this.pauseTest();
fillIn('data-test-code-nav-selector', 'PDF_I10_PCS_REFERENCE_MANUAL');
但是测试服务器声明:
global failure: Error: Element not found when calling `fillIn('data-test-code-nav-selector')`.@ 10974 ms
Source:
Error: Element not found when calling `fillIn('data-test-code-nav-selector')`.
Ember.js论坛声明:在stackoverflow上提问。