describe('参数化案例,输入不同的值', function() { // 定义测试数据 var testdatas = ["北京", "上海", "南京"] // 前置-打开浏览器 before(() => { cy.visit('https://www.baidu.com') }) // 参数化 testdatas.forEach((event) => { it("百度输入框功能", function () { cy.get('#kw').type(event) .should('have.value', event) .clear() .should('have.value', '') }) }) })
Cypress web自动化-参数化和数据驱动
最新推荐文章于 2022-03-03 18:38:05 发布