Skip to content

Commit

Permalink
Trying to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorFilimonov authored and IlyaMuravjov committed Sep 15, 2024
1 parent 4269933 commit 46163c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/kotlin/automaton/constructor/model/TestingTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ class TestingTests: ApplicationTest() {
private lateinit var app: Application
@BeforeEach
fun setUpClass() {
app = FxToolkit.setupApplication(AutomatonConstructorApp::class.java)
assumeFalse( // crucial to put this check here because otherwise app won't be initialized and tests will fail
assumeFalse(
System.getProperty("testfx.headless") == "true",
"Tests requiring graphical UI will be skipped in headless mode"
)
app = FxToolkit.setupApplication(AutomatonConstructorApp::class.java)
}
override fun start(stage: Stage) {
stage.show()
}

@AfterEach
fun afterEachTest() {
FxToolkit.cleanupApplication(app)
if (::app.isInitialized) {
FxToolkit.cleanupApplication(app)
}
}

private fun openExampleAndRunTest(automaton: String, test: String): String {
Expand Down

0 comments on commit 46163c3

Please sign in to comment.