简体   繁体   English

如何通过命令行将Java类作为JUnit测试运行

[英]How to run java class as a JUnit test through command line

So I am making an eclipse project with cucumber and selenium in order to automate execution of some test cases.I have a runner class,which can be executed as a Junit test and lead to execution of all feature files consecutively. 因此,我使用黄瓜和硒制作了一个Eclipse项目,以自动执行一些测试用例。我有一个Runner类,可以作为Junit测试执行,并导致连续执行所有功能文件。 My question is can I execute this runner class through windows 7 cmd. 我的问题是我可以通过Windows 7 cmd执行此跑步者课程吗? The idea is to make a script(cron job/scheduled task) who can trigger tests execution at given time. 这个想法是制作一个脚本(定时作业/计划任务),该脚本可以在给定时间触发测试执行。

Follow this to see how you can schedule it: 请按照以下步骤查看如何安排它:

http://www.digitalcitizen.life/how-create-task-basic-task-wizard . http://www.digitalcitizen.life/how-create-task-basic-task-wizard Not pasting the contents of this article since it contains a lot of images. 由于其中包含大量图像,因此不粘贴本文的内容。

In the scheduler, go to the directory, and run mvn test -Dtest=com.package.ClassName 在调度程序中,转到目录,然后运行mvn test -Dtest=com.package.ClassName

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

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