
Cypress web自动化5-table表格元素(别名使用Aliasing)
发布日期:2021-05-09 09:02:54
浏览次数:15
分类:博客文章
本文共 1789 字,大约阅读时间需要 5 分钟。
������
������������������������������������������������������������������������������������������������������������������������������������������������������������
.as()������������������������
table������������������������������������
Column 1 | Column 2 |
---|---|
Row 1: Cell 1 | Row 1: Cell 2 |
Row 2: Cell 1 | Row 2: Cell 2 |
// The following DOM command chain is unwieldy.// To avoid repeating it, let's use `.as()`!cy.get('.as-table') .find('tbody>tr').first() .find('td').first() .find('button').as('firstBtn')// To reference the alias we created, we place an// @ in front of its namecy.get('@firstBtn').click()cy.get('@firstBtn') .should('have.class', 'btn-success') .and('contain', 'Changed')
.as() ������������������
���������������������������������������������������������������������������������reponse
������������������������������������������������������������������������������������������������������������������������200
// Alias the route to wait for its responsecy.server()cy.route('GET', 'comments/*').as('getComment')// we have code that gets a comment when// the button is clicked in scripts.jscy.get('.network-btn').click()// https://on.cypress.io/waitcy.wait('@getComment').its('status').should('eq', 200)
QQ������������939110556
发表评论
最新留言
关注你微信了!
[***.104.42.241]2025年04月07日 05时22分17秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
JSONPath小试牛刀之Snack3
2021-05-09
Jenkins - 部署在Tomcat容器里的Jenkins,提示“反向代理设置有误”
2021-05-09
2017年前端框架、类库、工具大比拼
2021-05-09
wxWidgets源码分析(1) - App启动过程
2021-05-09
wxWidgets源码分析(3) - 消息映射表
2021-05-09
wxWidgets源码分析(5) - 窗口管理
2021-05-09
wxWidgets源码分析(6) - 窗口关闭过程
2021-05-09
wxWidgets源码分析(7) - 窗口尺寸
2021-05-09
wxWidgets源码分析(8) - MVC架构
2021-05-09
wxWidgets源码分析(9) - wxString
2021-05-09
Mybatis Generator最完整配置详解
2021-05-09
[白话解析] 深入浅出熵的概念 & 决策树之ID3算法
2021-05-09
[梁山好汉说IT] 梁山好汉和抢劫银行
2021-05-09
[源码解析] 消息队列 Kombu 之 基本架构
2021-05-09
[源码分析] 消息队列 Kombu 之 启动过程
2021-05-09
[源码分析] 消息队列 Kombu 之 Consumer
2021-05-09
[源码分析] 消息队列 Kombu 之 mailbox
2021-05-09
抉择之苦
2021-05-09
wx.NET CLI wrapper for wxWidgets
2021-05-09