【发布时间】:2021-10-13 15:01:24
【问题描述】:
最初,xpath 插件在我的 cypress 项目中运行良好。安装 typescript 插件并从 javascript 移动到 Typescript。现在它开始在 xpath 上抛出错误
Property 'xpath' does not exist on type 'cy & EventEmitter'.ts(2339)
请建议,如何在 Cypress 项目中使用 xpath 和 typescript? cypress-xpath": "^1.6.2", 包含在 package.json 中
package.json 文件如下:
"devDependencies": {
"@types/node": "^14.17.8",
"add": "^2.0.6",
"cypress-cucumber-preprocessor": "^4.3.0",
"cypress-mochawesome-reporter": "^2.2.0",
"cypress-xpath": "^1.6.2",
"typescript": "^4.4.3",
"yarn": "^1.22.10"
},
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
【问题讨论】:
标签: typescript xpath cypress cypress-cucumber-preprocessor