如果想从头学起Cypress,可以看下面的系列文章哦
https://www.cnblogs.com/poloyy/category/1768839.html
前言
策略一:数据通过 JS 的方式创建
@H_404_22@describe('测试数据放在前置条件里',function () { let testDatas = testDatas = [ {'name': 'yy','password': 'helloqa'},{'name': 'age','password': 'helloqa2'}] // 循环生成测试用例 for (const data in testDatas) { it(`测试外部数据${data}`, () { cy.log(testDatas[data].name,testDatas[data].password) }); } })