在命令行上运行单个

在命令行上运行单个

本文介绍了Play 框架:在命令行上运行单个 selenium 测试(无头浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 play 的浏览器 UI 中运行单个 selenium 测试,但是,是否可以在命令行上执行 play selenium 测试?

I can run a single selenium test in play's browser UI, however, is it possible to execute a play selenium test on the command line?

显然,如果我运行 play auto-test,它将执行我所有的 selenium 测试(以及我的 junit 测试).有没有办法让 Play 在命令行上只执行一个 selenium 测试来检查它是否可以使用无头浏览器工作?

Obviously if I run play auto-test it will execute all my selenium tests (as well as my junit tests). Is there a way that I could tell Play to execute just a single selenium test on the command line to check whether it works using the headless browser?

推荐答案

我认为目前的播放框架不可能做到这一点,

I don't think it's possible to do so with the current play framework,

但是看看自动测试是如何工作的https://github.com/playframework/play/blob/master/modules/testrunner/src/play/modules/testrunner/FirePhoque.java .

but see how auto-test works onhttps://github.com/playframework/play/blob/master/modules/testrunner/src/play/modules/testrunner/FirePhoque.java .

它获取 /@tests.list 上的播放测试列表,也许您可​​以尝试覆盖它以提供您想要测试的内容.

It get the play test lists on /@tests.list , maybe you could try to override it providing what you want to test.

无论如何,我没有看到在无头浏览器中只测试一个测试的用例.

Anyway, I don't see the usecase of testing only one test in a headless browser.

这篇关于Play 框架:在命令行上运行单个 selenium 测试(无头浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 15:35