一、环境构建
1. 下载并安装Node.js
2. 创建一个项目文件夹,执行npm init -y,然后npm install cypeRSS
3. npx cypeRSS open
二、小试牛刀
1. 运行一遍examples代码,即可看到https://example.cypress.io/的示例代码都执行了一遍
三、研究示例帮助和API
1. 自行学习examples代码,分析每个示例脚本,教会了哪些必备技能
Commands
Commands drive your tests in the browser like a real user would. They let you perform actions like typing, clicking, xhr requests, and can also assert things like "my button should be disabled".
- Querying(querying.spec.js)
- Traversal(traversal.spec.js)
- Actions(actions.spec.js)
- Window(window.spec.js)
- Viewport(viewport.spec.js)
- Location(location.spec.js)
- Navigation(navigation.spec.js)
- Assertions(assertions.spec.js)
- Misc(misc.spec.js)
- Connectors(connectors.spec.js)
- Aliasing(aliasing.spec.js)
- Waiting(waiting.spec.js)
- Network Requests(network_requests.spec.js)
- Files(files.spec.js)
- Local Storage(local_storage.spec.js)
- Cookies(cookies.spec.js)
- Spies, Stubs & Clocks(spies_stubs_clocks.spec.js)
Utilities(utilities.spec.js)
Utilities give you access to methods from other commonly used libraries.
Cypress API(cypress_api.spec.js)
The Cypress API enables you to configure the behavior of how Cypress works internally. You can do things like access Environment Variables, change configuration, create custom commands, and more.
四、项目实践
在你的项目中,从登录/登出开始,逐步完成前端UI自动化验证脚本设计和实现;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。