java - 我们如何使用并行运行器或分布式测试针对多个浏览器执行 WebUI 功能文件?
问题描述
我能够使用并行运行器和在 karate-config.js 中定义的驱动程序针对单个浏览器(Zalenium)执行 WebUI 功能文件。我们如何使用并行运行程序或分布式测试针对多个浏览器(Zalenium)执行 WebUI 功能文件?
解决方案
使用 aScenario Outline
和parallel runner。Examples
空手道将并行运行表格的每一行。但是您必须将驱动程序配置移动到Feature
.
只需在此示例项目中添加一个并行运行器并尝试:https ://github.com/intuit/karate/tree/master/examples/ui-test
Scenario Outline: <type>
* def webUrlBase = karate.properties['web.url.base']
* configure driver = { type: '#(type)', showDriverLog: true }
* driver webUrlBase + '/page-01'
* match text('#placeholder') == 'Before'
* click('{}Click Me')
* match text('#placeholder') == 'After'
Examples:
| type |
| chrome |
| geckodriver |
您可以尝试其他方法,这是另一种模式,当您有正常Scenario
输入时main.feature
-您可以稍后从Scenario Outline
单独的“特殊”功能中调用该功能-仅在您想要进行这种并行时使用- UI测试的化。
Scenario Outline: <config>
* configure driver = config
* call read('main.feature')
Examples:
| config! |
| { type: 'chromedriver' } |
| { type: 'geckodriver' } |
| { type: 'safaridriver' } |
编辑 - 也看到这个答案:https ://stackoverflow.com/a/62325328/143475
对于其他想法:https ://stackoverflow.com/a/61685169/143475
编辑 - 可以为所有测试重复使用相同的浏览器实例,并且空手道 CI 回归测试这样做,值得研究的想法:https ://stackoverflow.com/a/66762430/143475
推荐阅读
- python - 您如何列出具有相同外键对象的所有对象?
- c++ - std::list of move-only type: 在 VC++ 中不能进入 std::vector
- ansible - 如何组合一堆具有相同缓慢设置和拆卸的 Ansible 剧本?
- java - 如何从 javafx.scene.image.Image 对象中获取字节数组?
- sockets - boost async_accept 不适用于 boost asio use_future 选项
- javascript - 使用“GMT”获取“toISOString”字符串详细信息
- oracle - CURRENT_DATE 甲骨文
- firebase - Firedatabase.SetPersistent (true) minimiza 下载数据吗?
- python - 如何使用管道中的最佳估计器来预测测试集?
- python - AI 问题(即使不应该发生碰撞)