如何将 cypress-plugin-tab 添加到我的 Angular e2e 测试中?

问题描述

我正在使用 Angular12、NX、Cypress 和 KendoUI。 我需要通过表单元素测试标签。 如何将 cypress-plugin-tab 添加到我的 e2e 测试中?

指南说在 support/index.ts 文件中使用 require - 这对我不起作用。

我已执行 npm install -D cypress-plugin-tab 并将 require('cypress-plugin-tab') 添加到 support/index.ts 我已将此代码添加到我的测试中:

   let password = 'Password';
   let input = cy.focused();
   
   input.type(username).tab().type(password);

这不起作用,因为它说它找不到“标签”。 如何让“标签”在 Angular 中工作?

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)