如果目的是维护无代码测试,TestCafe Studio 无代码测试和实现页面模型的组合是否相互排斥?

发布于 2025-01-13 22:02:27 字数 1021 浏览 4 评论 0 原文

这是 TestCafe 最佳实践到“在测试中使用页面模型"。 TestCafe 页面模型一文介绍用户可以使用页面模型模式通过在 .js 文件中使用 JavaScript 编写测试来创建测试。

同时,TestCafe Studio支持创建*.testcafe 无代码测试

在页面模型中使用 JavaScript 似乎意味着,尝试在使用“无代码”测试的同时实现页面模型并试图将其保持为无代码不会有很好的效果。也就是说,如果记录器用于创建旨在立即转换为 JavaScript 的无代码测试,然后对其进行切片和切块以重新排列以实现页面模型,那么情况就不同了。我假设 Studio 会“在幕后”生成 JavaScript 以进行无代码测试,但如果目的是将测试保持为无代码,那么本质上,该 JavaScript 应被视为不可编辑。

如果目的是维护无代码测试,TestCafe Studio 无代码测试和实现页面模型的组合是否是互斥的?如果目的是维护无代码测试

It is a TestCafe Best Practice to "use the Page Model in your tests". The TestCafe Page Model article instructs the user to use the Page Model pattern to create tests by writing the tests using JavaScript in .js files.

Meanwhile, TestCafe Studio supports the creation of *.testcafe codeless tests.

The use of JavaScript in the Page Model seems to imply that attempting to implement a Page Model while using "codeless" tests with the intent of maintaining them as codeless won't work out very well. That is to say, if the recorder is used to create codeless tests that are intended to immediately be converted to JavaScript, which is then sliced and diced to rearrange it to implement a Page Model, then that's a different story. I assume Studio generates JavaScript 'under the covers' for codeless tests, but if the intent is to maintain the tests as codeless, then essentially, this JavaScript should be considered uneditable.

Is the mix of TestCafe Studio codeless tests and implementing a Page Model mutually exclusive if the intent is to maintain codeless tests?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

筱武穆 2025-01-20 22:02:27

TestCafe Studio 可用于在 编码 (.js/.ts) 和 无代码 (.testcafe< /em>) 格式。但是,PageModel,作为单独的文件,仅支持编码测试。
对于无代码测试,您可以使用 定义元素选择器步骤将选择器与一个测试中的测试操作分开存储。 复制/粘贴操作适用于所有测试步骤,并且可以在这种情况下用于在不同测试文件之间共享存储的选择器。您也可以转换 使用 PageModel 方法组织测试的无代码文件。

TestCafe Studio can be used to record tests both in coded (.js/.ts) and codeless (.testcafe) formats. However, PageModel, as a separate file, is supported only for coded tests.
For codeless tests, you can use Define Element Selector steps to store selectors separately from test actions within one test. Copy/paste actions are available for all test steps and can be used in this case to share stored selectors between different test files. Also you can convert your codeless files to organize your tests using the PageModel approach.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文