有没有办法在本地机器上运行并行柏树测试,例如 5 个流 [英] Is there any way to run parallel cypress tests on local machine, for example 5 streams

查看:10
本文介绍了有没有办法在本地机器上运行并行柏树测试,例如 5 个流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在本地机器上设置 cypress 并运行并行测试.但我找不到一些信息如何做到这一点.

I'm trying to setup cypress on my local machine and run parallel tests. But I can't find some information how to do this.

推荐答案

从技术上讲,这是可能的.Cypress 不建议这样做,因为在同一台机器上运行多个 cypress 实例会消耗大量资源(总体而言是 CPU),并且会降低整个机器的性能并导致无用的结果.

Technically, it's possible. Cypress does not recommend it since running multiple cypress instances on the same machine consumes lots of resources (CPU over all) and it slows down the entire machine performances with useless results.

无论如何,如果您的资源有限并且您无法使用官方仪表板或者您没有多个 CI 服务器可用,您可以在单台机器上运行测试启动 cypress run 多次将您的测试套件划分到多个文件夹中.

Anyway if you have limited resources and you cannot use the official dashboard or you don't have more than one CI server available, you can run your test on a single machine launching cypress run multiple times dividing your test suite in multiple folders.

我创建了一个名为 cypress-parallel 的 npm 库(https:///github.com/tnicola/cypress-parallel),它(在第一次运行之后)根据测试运行历史记录平衡和拆分测试套件为多个子集,并为每个子集启动一个 Cypress 命令.它还从所有规范文件中收集结果,并在执行结束时记录它们.在性能方面,似乎使用 2 个进程可以将整体测试执行时间提高 40%.

I've created a npm library called cypress-parallel (https://github.com/tnicola/cypress-parallel) that (after the first run), balances and splits the test suite in multiple subsets, based on the tests run history and for each subset it launches a Cypress command. It also collect the results from all the specs file, logging them at the end of the execution. In terms of performances, it seems that with 2 processes you can improve your overall tests execution time time up to 40%.

这篇关于有没有办法在本地机器上运行并行柏树测试,例如 5 个流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆