问题描述
Polymer Starter Kit 包含用于对自定义元素进行单元测试的 web-component-tester.
The Polymer Starter Kit contains web-component-tester for unit testing your custom elements.
在 wct.conf.json
中,您可以指定运行测试的浏览器.
In wct.conf.json
you can specify the browsers to run the tests in.
{
"suites": ["app/test"],
"plugins": {
"local": {
"browsers": ["firefox"]
}
}
不幸的是,当我通过 gulp 启动测试时,wct 无法找到我本地的 Firefox.我在 GitHub 读到 wct 使用启动板来检测本地浏览器.Afaik,在 Windows 机器上,启动板在默认目录 C:\Program Files\Mozilla Firefox"
中搜索 Firefox.但我将 Firefox 安装在不同的目录中.
Unfortunately, when I launch the tests through gulp, wct is not able to find my local Firefox. I read at GitHub that wct uses launchpad to detect local browsers. Afaik, on a Windows machine, launchpad searches for Firefox in the default directory "C:\Program Files\Mozilla Firefox"
. But I installed Firefox in a different directory.
有没有办法在 wct.conf.json
中配置我的 Firefox 目录的路径?
Is there any way to configure the path to my Firefox dir in wct.conf.json
?
推荐答案
不知道它在配置中是如何工作的,但您可以设置一个环境变量:
Don't know how it works in the config but you can set an environment variable:
LAUNCHPAD_CHROME=/c/Users/you/chromium-v85/chrome.exe npm test
文档:https://github.com/bitovi/launchpad#environment-variables-impacting-local-browsers-detection
这篇关于为 wct-local 测试指定浏览器位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!