[英]How to add cypress-plugin-tab to my Angular e2e testing?
我正在使用 Angular12、NX、賽普拉斯和 KendoUI。 我需要通過表單元素測試制表符。 如何將 cypress-plugin-tab 添加到我的 e2e 測試中?
該指南說在 suppport/index.ts 文件中使用 require - 這對我不起作用。
我已執行npm install -D cypress-plugin-tab
並將require('cypress-plugin-tab')
添加到 suppport/index.ts 我已將此代碼添加到我的測試中:
let password = 'Password';
let input = cy.focused();
input.type(username).tab().type(password);
您需要在 tsconfig.json 中添加 compilerOptions > 鍵入 cypress-plugin-tab src 路徑。
"compilerOptions": {
"strict": true,
"target": "es6",
"lib": ["es6", "dom"],
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"types": ["node", "cypress", "cypress-plugin-tab/src"],
"allowSyntheticDefaultImports": true
},
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.