简体   繁体   English

将Laravel Dusk测试分发到硒网格

[英]Distribute Laravel Dusk Tests to Selenium Grid

I have a Laravel Project (5.4) with about 8 Dusk Test files. 我有一个Laravel项目(5.4),其中包含约8个Dusk Test文件。 I also have a Selenium Grid running with 8 Chrome Nodes. 我还有一个运行8个Chrome节点的Selenium Grid。

I want to send one Laravel Dusk Test file to each Chrome Node. 我想向每个Chrome节点发送一个Laravel Dusk测试文件。 Is there an easy way to do so? 有一个简单的方法吗? or is it even feasible? 甚至可行吗? I have a way now but it is manually typing in each @group tag when running dusk. 我现在有一种方法,但是运行黄昏时,它是手动输入每个@group标记。

ie I open multiple powershell windows and type php artisan dusk --group=NAME_OF_TEST into each and press enter. 即我打开多个Powershell窗口,并在每个窗口中键入php artisan dusk --group=NAME_OF_TEST ,然后按Enter。


Ex. 例如 php artisan dusk --distribute

This would then start multiple Chromedrivers in DuskTestCase.php and send them, at the same time, to the Selenium Grid's URL. 然后,这将在DuskTestCase.php启动多个Chromedriver,并将它们同时发送到Selenium Grid的URL。


Thanks again for your time! 感谢你的宝贵时间!

Found a better work around. 找到了更好的解决方法。 I grab all the groups that are listed above my Testing functions and paste them into a text file. 我抓取了我的“测试”功能上方列出的所有组,并将它们粘贴到文本文件中。 From there, I can "read" it line by line (with something like a python script) and call dusk on each line. 从那里,我可以逐行“读取”它(使用类似python脚本的东西),并在每行上调用黄昏。

Example: 例:

php artisan dusk --list-group will return all available "groups" ( @group blah ) that are written above any test functions. php artisan dusk --list-group将返回写在任何测试功能上方的所有可用“组”( @group blah )。 So I can do php artisan dusk --list-group > file.txt and that will paste all the groups into a text file. 所以我可以做php artisan dusk --list-group > file.txt ,它将所有组粘贴到文本文件中。 Then I can open the text file in python and read it line by line. 然后,我可以在python中打开文本文件并逐行读取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM