如何在赛普拉斯中使用较旧的chrome版本运行测试 [英] How can I run my tests with older chrome version in cypress

查看:78
本文介绍了如何在赛普拉斯中使用较旧的chrome版本运行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我的柏树版本是3.8.2当我打开柏树窗口时,Chrome版本为79.我想在chrome 70版本中运行测试.我在计算机上更新了chrome,现在更新了70版本.

Now my cypress version is 3.8.2 And when I am opening cypress window there are chrome version is 79. I want to run my tests in chrome 70 version. I updated my chrome in my computer and now it 70 version.

使用所选命令运行测试时

When I am running my test with selected command

npx vue-cli-service test:e2e --headless --browser chrome

测试在Chrome 79中运行.如何更改我的chrome版本以运行.

Test is running in Chrome 79. How can I change my chrome version for running.

推荐答案

按照

As per the documentation, the default chrome location to be auto-detected by cypress is "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe". If the other version of chrome is installed in a different location, I guess the available options are to uninstall both 79 & 70 and clean install 70 first to the above said location and later installing 79 to a different location (OR) uninstall 79 (assuming it installed in default location) and re-install to a different location than the default, and finally set a symbolic link to version 70 on the default location something like (which requires admin previleges on the machine, though). This way cypress scans the default location and gets whichever version pointing to the symbolic link.

mklin "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "path to ver70 exe"

但是,毕竟,我认为命令参数似乎略有不同,您可以尝试一下(确保路径指向版本70,而不是默认版本)

But before all, I think the command parameters appear to be slightly off, can you try instead (making sure the path is pointing to the verion 70, not the default one)

npx vue-cli-service test:e2e --headless --browser "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

我怀疑--headless是'cypress run'命令的默认命令,如果您的test:e2e类似于"cypress run",那么您可以简单地忽略它.

I suspect --headless is default for a 'cypress run' command command, if your test:e2e is something like "cypress run", then you can simply omit it.

这篇关于如何在赛普拉斯中使用较旧的chrome版本运行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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