简体   繁体   English

TestCafe:实现页面对象模型

[英]TestCafe: Implement Page Object Model

I am trying to implement the Page Object Model in my TestCafe project.我正在尝试在我的 TestCafe 项目中实现页面对象模型。 How do I implement page transitions from one page to another?如何实现从一页到另一页的页面转换? For eg Move from Login page object to obtain Home page object, both pages have different properties/fields.例如,从登录页面对象移动到主页对象,两个页面都有不同的属性/字段。 In Selenium there is a PageFactory and webdriver to work with, how should I implement it in TestCafe?在 Selenium 中有一个 PageFactory 和 webdriver 可以使用,我应该如何在 TestCafe 中实现它?

You don't need to worry about page transitions.您无需担心页面转换。 TestCafe's Selectors are lazy by default.默认情况下,TestCafe 的选择器是惰性的。 Just declare the necessary Page Objects in the fixture file and use it.只需在夹具文件中声明必要的页面对象并使用它。 See the detailed example in the Use Page Model help topic.请参阅使用页面模型帮助主题中的详细示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 testcafe 页面对象模型中找到依赖于其他元素的元素 - Trouble to find element depending from other element in testcafe page object model TestCafe:页面对象模型 - 使用公共单一引用访问所有实例化对象 - TestCafe: Page Object Model - accessing all the instantiated objects with a common single reference 将参数传递给页面模型中的 TestCafe Selector - Passing arguments to TestCafe Selector in page model 将字符串 arguments 传递到页面 model 中的 TestCafe 选择器 - Passing string arguments to TestCafe Selector in page model 如何在Testcafe中打印页面对象的字符串值? - How to print string value of a page object in Testcafe? Testcafe - 页面对象结构和默认类 - Testcafe - Page object structure and default class 如何在 TestCafe 中实现 Percy - How to implement Percy in TestCafe Testcafe 页面重新加载 - Testcafe Page reload 如果意图是维护无代码测试,那么 TestCafe Studio 无代码测试和实现页面 Model 的混合是否相互排斥? - Is the mix of TestCafe Studio codeless tests and implementing a Page Model mutually exclusive if the intent is to maintain codeless tests? 如何在 testcafe Cucumberjs 中重新加载页面 - How to reload a page in testcafe cucumberjs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM