当前位置:网站首页>掌握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必须了解的异步和同步命令机制
精选文章
欢迎在文章底部留言、讨论、交流
边栏推荐
- Fabric. JS three methods of changing pictures (including changing pictures in the group and caching)
- JS 将伪数组转换成数组
- AI 考高数得分 81,网友:AI 模型也免不了“内卷”!
- Mysql database basic operation - regular expression
- Flink SQL knows why (19): the transformation between table and datastream (with source code)
- Box layout of Kivy tutorial BoxLayout arranges sub items in vertical or horizontal boxes (tutorial includes source code)
- [sort] bucket sort
- Asp.Net Core1.1版本没了project.json,这样来生成跨平台包
- AI scores 81 in high scores. Netizens: AI model can't avoid "internal examination"!
- The shortage of graphics cards finally came to an end: 3070ti for more than 4000 yuan, 2000 yuan cheaper than the original price, and 3090ti
猜你喜欢
106. How to improve the readability of SAP ui5 application routing URL
Can newly graduated European college students get an offer from a major Internet company in the United States?
CVPR 2022 | interpretation of 6 excellent papers selected by meituan technical team
Flick SQL knows why (10): everyone uses accumulate window to calculate cumulative indicators
Mysql database basic operation - regular expression
The latest BSC can pay dividends. Any B usdt Shib eth dividend destruction marketing can
Brief analysis of tensorboard visual processing cases
Universal dividend source code, supports the dividend of any B on the BSC
2022-02-14 analysis of the startup and request processing process of the incluxdb cluster Coordinator
Logseq evaluation: advantages, disadvantages, evaluation, learning tutorial
随机推荐
Flink SQL knows why (16): dlink, a powerful tool for developing enterprises with Flink SQL
常见的几种最优化方法Matlab原理和深度分析
Server coding bug
MyCms 自媒体商城 v3.4.1 发布,使用手册更新
SVN添加文件时的错误处理:…\conf\svnserve.conf:12: Option expected
顺序表(C语言实现)
mysql更新时条件为一查询
MapReduce实现矩阵乘法–实现代码
106. 如何提高 SAP UI5 应用路由 url 的可读性
JS 将伪数组转换成数组
106. How to improve the readability of SAP ui5 application routing URL
Smbms project
Internet of things completion -- (stm32f407 connects to cloud platform detection data)
阿南的疑惑
Flink code is written like this. It's strange that the window can be triggered (bad programming habits)
18W word Flink SQL God Road manual, born in the sky
父亲和篮球
Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
Asp. Net core1.1 without project JSON, so as to generate cross platform packages
CVPR 2022 | 美团技术团队精选6篇优秀论文解读