如果想从头学起Cypress,可以看下面的系列文章哦

 

 

作用

获取页面的标题, document.title 

 

语法格式

cy.title()
cy.title(options)

options:只有 timeout 和 log,不再展开讲了

 

正确写法

cy.title()

 

实际栗子

测试文件代码

Cypress系列(31)- title() 命令详解_Cypress教程

 

测试结果

Cypress系列(31)- title() 命令详解_Cypress框架_02

 

再来看看命令在 console 会输出啥

Cypress系列(31)- title() 命令详解_Cypress框架_03

yielded 就是产出的意思

 

结尾

我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=12vd92hxgwgj1