简体   繁体   English

如何从 GUI 的按钮启动 JUnit @Suite?

[英]How can I start JUnit @Suite from GUI's button?

How should I start JUnit @Suite from GUI's button?我应该如何从 GUI 的按钮启动 JUnit @Suite? I created several classes with auto tests.我创建了几个带有自动测试的类。 Every class has autotests with specific functionality.每个 class 都有具有特定功能的自动测试。 Also I made suite for these tests.我还为这些测试制作了套件。 I want start different tests from GUI's button(using JFrame).我想从 GUI 的按钮开始不同的测试(使用 JFrame)。 How can I do it?我该怎么做? (I already made GUI) (我已经做了GUI)

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({Atp.class, Authorization.class, MainMenu.class})
public class SuiteTestClass { }

Please visit: https://www.baeldung.com/junit-tests-run-programmatically-from-java请访问: https://www.baeldung.com/junit-tests-run-programmatically-from-java

3.4. 3.4. Running a Test Suite运行测试套件

it could be helpful for you.它可能对你有帮助。

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

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