1. 首页
  2. 移动开发
  3. 其他
  4. cypress xpath:将XPath命令添加到赛普拉斯测试运行器 源码

cypress xpath:将XPath命令添加到赛普拉斯测试运行器 源码

上传者: 2021-04-06 06:36:55上传 ZIP文件 704.73KB 热度 4次
赛普拉斯 将XPath命令添加到测试运行程序 用npm安装 npm install -D cypress-xpath 用纱安装 yarn add cypress-xpath --dev 然后将其包含在您项目的cypress/support/index.js require ( 'cypress-xpath' ) 使用 安装后,您的cy对象将具有xpath命令。 it ( 'finds list items' , ( ) => { cy . xpath ( '//ul[@class="todo-list"]//li' ) . should ( 'have.length' , 3 ) } ) 您也可以将xpath到另一个命令之外。 it ( 'finds list items' , ( ) => { cy . xpath ( '//ul[@class="todo-list
下载地址
用户评论