▲ 《Linux命令大全》▲
长按二维码免费领取
话说 Cypress is a next generation front end testing tool built for the modern web. And Cypress can test anything that runs in a browser.Cypress consists of a free, open source, locally installed Test Runner and a Dashboard Service for recording your tests.
吹的挺好哈华为手机6使用技巧大全 ,那咱也来尝试玩玩,试试,哈哈!
1、在Windows 7以上的环境中,可以直接下载压缩包后,解压使用华为手机6使用技巧大全 。
解压后:
2、Cypress.exe便是该框架的主运行程序华为手机6使用技巧大全 ,双击 打开-->运行:
展开全文
3、如我已经提前新建好一个自己的Web UI测试项目 文件夹华为手机6使用技巧大全 ,命名为“CypressTestPro”,选择此文件夹:
4、选择后华为手机6使用技巧大全 ,选择 "get got it"便可以看到很多示例的写好的js文件:
5、点击任意一个华为手机6使用技巧大全 ,即可运行:
6、可将以上示例js文件删除华为手机6使用技巧大全 ,也可以自己按照Cypress的语法,也即示例的js建造自己的第一个前端测试Web UI 自动化程序,如个人新建
里面包含文件:
7、切换至Cypress运行界面华为手机6使用技巧大全 ,便可看到对应变化:
8、双击运行此sample_spec.js便完成自己的第一个Web UI 使用Cypress的测试程序:
( 备注:一定要找对应的前端开发人员华为手机6使用技巧大全 ,去掉输入验证码的验证)
( 备注:一定要找对应的前端开发人员华为手机6使用技巧大全 ,去掉输入验证码的验证)
9、附带上sample_spec.js的代码片段为:
View Code
// describe(' My First Test', function{
// it('Does not do much!', function{
// expect(true).to.equal(true)
describe('Cypress Web UI自动化登录实践Test', function {
it('SOAM', function {
cy.visit("");
cy.contains('用户名')
cy.get('.box').within( =>{
cy.get('input#username').should('have.attr', 'placeholder', '请输入账号或是用户名')
cy.get('input#password').should('have.attr', 'placeholder', '请输入密码')
cy.get('input#captcha').should('have.attr', 'placeholder', '请输入验证码')
cy.contains('密码')
cy.contains('验证码')
cy.contains('移动端APP下载')
//cy.url.should('include', '/portal/monitor/data')
cy.get('input#username')
.type('1005')
.should('have.value', '1005')
cy.get('input#password')
.type('1')
.should('have.value', '1')
cy.get('#log').click;
10、小技巧:修改
此项目中的cypress.json文件华为手机6使用技巧大全 ,可以改变针对该测试项目的基础配置
如原始cypress.json打开为: 【{}】华为手机6使用技巧大全 ,即内容为空;
如原始cypress.json打开为: 【{}】华为手机6使用技巧大全 ,即内容为空;
将大括号内写入如下代码,标识设置展示的屏幕宽窄为 1920 * 1080像素,若是其它手机屏幕之类,也可对应进行设置,查看效果华为手机6使用技巧大全 。
" viewportWidth": 1920,
" viewportHeight": 1080
学习安排上华为手机6使用技巧大全 !
Linux命令大全
扫描下方二维码免费领取
上文内容不用于商业目的,如涉及知识产权问题,请权利人后台留言联系码同学小编,我们将立即处理华为手机6使用技巧大全 。
转载自:
“在看”点一点
标签: 测试工具 selenium 自动化 更好 Cypress