首页 > 解决方案 > Testcafe:在 boundTestRun 中使用测试控制器不起作用

问题描述

我正在尝试在我的 Testcafe 项目中使用影子根。处理它有点复杂。我创建了一个与 Selector().find() 行为相同的自定义函数,但我遇到了这个错误:

The "boundTestRun" option value is expected to be a test controller.

当我按照此处记录的方式进行操作时:

import { Selector, t } from 'testcafe'

getInShadowRoot = Selector( 
        // More code here
    )
const boundedGetInShadowRoot = this.getInShadowRoot.with({ boundTestRun: t })

我创建了一个要点来说明我的问题:https ://gist.github.com/HugoDel/a600f3e120674e3f255884f3dc84fee3

谢谢你的帮助!

编辑: 我终于摆脱了它,因为我不需要添加.with({ boundTestRun: t })来使它工作。

标签: node.jsweb-componente2e-testingshadow-domtestcafe

解决方案


推荐阅读