停止创建在空手道目标文件夹中创建的 chome 文件?
Stop creation of chome file created in target folder in karate?
在空手道中执行 UI 测试时,在目标文件夹中创建了一个 chrome 文件,当我在反映到的虚拟机上工作时,该文件消耗了大量 space机器的成本 所以无论如何有可能停止创建那个文件,因为我必须手动删除那些文件吗?
根据您的反馈,我们刚刚在驱动程序配置中添加了一个 userDataDir
选项。
详情请见提交:
https://github.com/intuit/karate/commit/0af1ba16f66ef8d1f700edb3bf1f4ba55c865f00
所以你可以这样做:
* configure driver = { type: 'chrome', userDataDir: 'target/chrome-user-dir' }
您甚至可以将其设置为 null
,在这种情况下 Chrome 将使用系统默认值。
请按照此处的说明进行操作并确认这有效,在这种情况下我们可以加快发布:https://github.com/intuit/karate/wiki/Developer-Guide
空手道 0.95 版本,使用硬编码方式在 DriverOptions.java 上定义它。
所以将此设置传递给空手道,不起作用。
因为Chrome.javaoptions.arg("--user-data-dir=" + options.workingDirPath)
没抓到
因此,在调用空手道之前,我刚刚创建了一个批处理文件以使用我的设置启动 chrome。
将其添加到您的功能中,以避免chrome开始:
* configure driver = { type: 'chrome', start: false }
这个批处理文件调用 chrome 没有等待风格,然后调用空手道。
我也删除了我以前的报告。
批处理文件:
cd %~dp0
SET PORT=9222
SET AGENT='Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/18.1 Mobile/16B92 Safari/605.1.15'
SET PROFILE="%~dp0\chrome"
DEL "%~dp0\target" /s /q
START "" /D "C:\Program Files (x86)\Google\Chrome\Application\" chrome.exe "--remote-debugging-port=%PORT%" --no-first-run "--user-data-dir=%PROFILE%" --disable-popup-blocking --disable-infobars -–disable-notifications --disable-dev-shm-usage "--user-agent=%AGENT%"
java -jar karate.jar yourtest-01.feature
EDIT:
The development version 2.0.0, fixed it.
Just add userDataDir to your configuration.
To build follow instructions here:
https://github.com/intuit/karate/wiki/Developer-Guide#build
Take a look for your own: DriverOptions.java#L170
BTW, I issued a PR to fix when userDataDir is defined, workingDir keeps creating chrome folders with empty content!
在空手道中执行 UI 测试时,在目标文件夹中创建了一个 chrome 文件,当我在反映到的虚拟机上工作时,该文件消耗了大量 space机器的成本 所以无论如何有可能停止创建那个文件,因为我必须手动删除那些文件吗?
根据您的反馈,我们刚刚在驱动程序配置中添加了一个 userDataDir
选项。
详情请见提交:
https://github.com/intuit/karate/commit/0af1ba16f66ef8d1f700edb3bf1f4ba55c865f00
所以你可以这样做:
* configure driver = { type: 'chrome', userDataDir: 'target/chrome-user-dir' }
您甚至可以将其设置为 null
,在这种情况下 Chrome 将使用系统默认值。
请按照此处的说明进行操作并确认这有效,在这种情况下我们可以加快发布:https://github.com/intuit/karate/wiki/Developer-Guide
空手道 0.95 版本,使用硬编码方式在 DriverOptions.java 上定义它。
所以将此设置传递给空手道,不起作用。
因为Chrome.javaoptions.arg("--user-data-dir=" + options.workingDirPath)
没抓到
因此,在调用空手道之前,我刚刚创建了一个批处理文件以使用我的设置启动 chrome。
将其添加到您的功能中,以避免chrome开始:
* configure driver = { type: 'chrome', start: false }
这个批处理文件调用 chrome 没有等待风格,然后调用空手道。 我也删除了我以前的报告。
批处理文件:
cd %~dp0
SET PORT=9222
SET AGENT='Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/18.1 Mobile/16B92 Safari/605.1.15'
SET PROFILE="%~dp0\chrome"
DEL "%~dp0\target" /s /q
START "" /D "C:\Program Files (x86)\Google\Chrome\Application\" chrome.exe "--remote-debugging-port=%PORT%" --no-first-run "--user-data-dir=%PROFILE%" --disable-popup-blocking --disable-infobars -–disable-notifications --disable-dev-shm-usage "--user-agent=%AGENT%"
java -jar karate.jar yourtest-01.feature
EDIT: The development version 2.0.0, fixed it.
Just add userDataDir to your configuration.To build follow instructions here:
https://github.com/intuit/karate/wiki/Developer-Guide#buildTake a look for your own: DriverOptions.java#L170
BTW, I issued a PR to fix when userDataDir is defined, workingDir keeps creating chrome folders with empty content!