当前位置:网站首页>掌握Cypress命令行选项,是真正掌握Cypress的基础
掌握Cypress命令行选项,是真正掌握Cypress的基础
2022-07-03 13:01:00 【开源优测】

精华推荐:20篇精选前沿理论、技术和经验总结专辑
掌握Cypress命令行选项,是真正掌握Cypress的基础,如果你对Cypress命令和命令选项不是很了解,那你就不足以利用Cypress在企业实践中很好地产出。
废话少讲,直接上Cypress命令选项表:
命令格式 cypress run [Option]
| Option(选项) | Description(描述) |
|---|---|
--browser, -b | 以指定的浏览器名或浏览器路径运行Cypress |
--ci-build-id | 给当前运行指定唯一标识,以启用分组或并行化 |
--config, -c | 指定配置 |
--config-file, -C | 指定配置文件 |
--env, -e | 指定环境变量 |
--group | 将当前运行的测试记录进行分组 |
--headed | 指定浏览器GUI模式运行 |
--headless | 指定浏览器headless模式运行 |
--help, -h | 显示命令帮助信息 |
--key, -k | 指定秘钥 |
--no-exit | 在执行完测试后,不退出Cypress |
--parallel | 通过多台机器并行运行 |
--port,-p | 指定Cypress启动端口 |
--project, -P | 指定Cypress启动时项目 |
--record | 是否记录测试 |
--reporter, -r | 指定是否生成Mocha报告 |
--reporter-options, -o | 指定生成Mocha报告选项 |
--spec, -s | 指定运行的文件 |
--tag, -t | 使用tag标识测试 |
Cypress实例!!!
启动chrome浏览器运行Cypress,命令如下:
cypress run --browser chrome
或
cypress run -b chrome
或
cypress run --browser /usr/bin/chrome
或
cypress run -b /usr/bin/chrome
注: 浏览器可以是chrome, chromium, edge, electron, firefox
指定运行时的一些配置,例如指定页面加载timeout,文件监控开关配置:
cypress run --config pageLoadTimeout=100000,watchForFileChanges=false
注:多个变量用西文逗号分隔开
加载指定的配置文件来启动cypress,配置文件一般是存储json串的文本文件:
cypress run --config-file tests/cypress-config.json
其他的就不一一举例了,下来列举几个关键的东西
1. Cypress配置选项,这个有点多, 直接看官网文档吧:
https://docs.cypress.io/guides/references/configuration.html#Intelligent-Code-Completion
2. 环境变量,也挺多的,直接看官方文档吧:
https://docs.cypress.io/guides/guides/environment-variables.html#Option-3-CYPRESS
加我微信入群一起交流,注明:入群,加入微信群

上一篇文章:Cypress必须了解的异步和同步命令机制
精选文章
欢迎在文章底部留言、讨论、交流
边栏推荐
- TensorBoard可视化处理案例简析
- File uploading and email sending
- This math book, which has been written by senior ml researchers for 7 years, is available in free electronic version
- (first) the most complete way to become God of Flink SQL in history (full text 180000 words, 138 cases, 42 pictures)
- Ubuntu 14.04 下开启PHP错误提示
- Mycms we media mall v3.4.1 release, user manual update
- CVPR 2022 | 美团技术团队精选6篇优秀论文解读
- In the promotion season, how to reduce the preparation time of defense materials by 50% and adjust the mentality (personal experience summary)
- PowerPoint tutorial, how to save a presentation as a video in PowerPoint?
- AI 考高数得分 81,网友:AI 模型也免不了“内卷”!
猜你喜欢

MySQL_ JDBC

106. 如何提高 SAP UI5 应用路由 url 的可读性

TensorBoard可视化处理案例简析

Mysql database basic operation - regular expression

Libuv库 - 设计概述(中文版)
![[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]](/img/8b/bef94d11ac22e3762a570dab3a96fa.jpg)
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]

刚毕业的欧洲大学生,就能拿到美国互联网大厂 Offer?

Introduction to the implementation principle of rxjs observable filter operator

The principle of human voice transformer

Smbms project
随机推荐
71 articles on Flink practice and principle analysis (necessary for interview)
【历史上的今天】7 月 3 日:人体工程学标准法案;消费电子领域先驱诞生;育碧发布 Uplay
使用Tensorflow进行完整的深度神经网络CNN训练完成图片识别案例2
This math book, which has been written by senior ml researchers for 7 years, is available in free electronic version
Flink SQL knows why (13): is it difficult to join streams? (next)
106. 如何提高 SAP UI5 应用路由 url 的可读性
[sort] bucket sort
【R】 [density clustering, hierarchical clustering, expectation maximization clustering]
已解决TypeError: Argument ‘parser‘ has incorrect type (expected lxml.etree._BaseParser, got type)
阿南的疑惑
Start signing up CCF C ³- [email protected] chianxin: Perspective of Russian Ukrainian cyber war - Security confrontation and sanctions g
The difference between stratifiedkfold (classification) and kfold (regression)
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]
The difference between session and cookie
Kivy教程之 如何通过字符串方式载入kv文件设计界面(教程含源码)
Flutter动态化 | Fair 2.5.0 新版本特性
Resource Cost Optimization Practice of R & D team
ThreadPoolExecutor realizes multi-threaded concurrency and obtains the return value (elegant and concise way)
Ubuntu 14.04 下开启PHP错误提示
R language uses the data function to obtain the sample datasets available in the current R environment: obtain all the sample datasets in the datasets package, obtain the datasets of all packages, and