简体   繁体   中英

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. My question is can I execute this runner class through 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 . 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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