text() cy.log(btnTxt) }) 清除文本 //清除input输入的值 cy.get('div>a').clear() cycy.get('div>a').clear().type() 操作单选/多选按钮 //选中 cy.get('radio').check('us) //取消选中 cy.get('radio').uncheck('us) 操作下拉菜单 cy.get('select').select('下拉选项的值') cy...
cy.get('input[name=username]').type(username) cy.get('input[name=password]').type(password) cy.get('form').submit //断言 cy.url.should('include','/goods_view') cy.get('title').should('contain','电子商务系统') }) }) }) 2、元素查找 - get <inputtype="text"class="s_ipt"name...
function(){ it('登录成功,调到商品列表页面',function(){ cy.visit('http://127.0.0.1:8000') cy.get('input[name=username]').type(username) cy.get('input[name=password]').type(password) cy.get('form').submit() //断言 cy.url().should('include','/goods_view...
cy.get('input[name=username]').type(username) cy.get('input[name=password]').type(password) cy.get('form').submit() //断言 cy.url().should('include','/goods_view') cy.get('title').should('contain','电子商务系统') }) }) }) 2、元素查找 - get <input type="text" class="s...
1.变量通过“ ”引号引起来 如下所示,可以得到结果为 is null #!/bin/bash para1= if[!
<input type="text"class="s_ipt"name="wd"id="kw"maxlength="100"autocomplete="off"> 根据元素 id 查找 代码语言:javascript 复制 cy.get('#kw') 根据元素名称查找 代码语言:javascript 复制 cy.get('input[name="wd"]') 根据元素的类名查找 ...
cy.get('input[name=password]').type(password) cy.get('form').submit() //断言 cy.url().should('include','/goods_view') cy.get('title').should('contain','电子商务系统') }) }) }) 2、元素查找 - get <input type="text" class="s_ipt" name="wd" id="kw" maxlength="100" aut...
cy.get('.action-input-hidden').should('be.visible') .rightclick() 右击DOM 元素 cy.get('.action-div').rightclick().should('not.be.visible') cy.get('.action-input-hidden').should('be.visible') .check() 检查checkbox or radio 选项框 ...
clear()、清空input或textarea的内容,比如 cy.get('.ant-input').clear()submit()、提交表单,比如 cy.get('.ant-form').submit()dblclick()、元素双击,比如 cy.get('.ant-btn').dblclick()rightclick()、元素右击,比如 cy.get('.ant-btn').rightclick()select(String)、对元素选择,比如check()、勾...
cy.get('input[type=text]').clear() cy.get('input[type=text]').type('123456') ``` 如果我们需要操作单选框或复选框,使用 .check(),取消勾选用 .uncheck() ``` <input type="radio" class="ivu-radio-input" name="ivuRadioGroup_1591061954307_27" value="accept"> ...