【原创】Cypress Vue CLI前端自动化测试自学与项目实践

一、环境构建

  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".

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自动化验证脚本设计和实现;

上一篇:RPM包制作理论基础篇


下一篇:pyinstaller spec 文件浅谈