有没有办法在没有 copy/paste 来自另一个测试的情况下在 testcafe studio 上使用钩子?

Is there a way to use a hook on testcafe studio without copy/paste from another test?

因为我总是需要登录才能执行测试,而且每次我都需要重新执行登录步骤,所以很难维护

我发现 testcafe.js 可以使用钩子作为解决方法,但这不是最佳方式

我需要保存一个常量 login/password 并仅在需要时更改它们一次,就像代码一样,但在 testcafe studio 上

我们计划在本月或下个月发布新版本的 TestCafe Studio。此版本将包含 hooks 功能,该功能将建立在 TestCafe hooks (https://devexpress.github.io/testcafe/documentation/test-api/test-code-structure.html#initialization-and-clean-up)

之上

因此,您将能够在挂钩中仅使用一次登录步骤而无需复制。

此外,稍后,我们计划在测试中发布对自定义 nodejs 代码的支持,这将允许使用 Roles 机制。