nus-cs2103-AY1718S1 / forum

Discussion Forum
5 stars 0 forks source link

Headless testing with IntelliJ? #69

Closed Xenonym closed 7 years ago

Xenonym commented 7 years ago

Hey all!

Does anyone know of a way to run headless tests from intelliJ? Headless only seems to work when I run them from Gradle; IntelliJ still runs with a visible GUI.

danielbrzn commented 7 years ago

Hi, not sure if this counts, but you can run it through the console inside IntelliJ.

Use the command "gradlew clean headless allTests"

Zhiyuan-Amos commented 7 years ago

Hi, not sure if this counts, but you can run it through the console inside IntelliJ.Use the command "gradlew clean headless allTests"

That's still running using Gradle isn't it haha :P

@Xenonym try adding -Dtestfx.headless=true in your VM options in Run/Debug Configurations. (The image below shows only for StatusBarFooterTest, so make sure you are editing the configuration for all tests ^^)

image

Xenonym commented 7 years ago

@Zhiyuan-Amos thanks for the suggestion! However, adding the command line flag results in really strange behaviour: the window doesn't show but my mouse is still moving around :O

Zhiyuan-Amos commented 7 years ago

image

Alright updated solution: This is in your build.gradle file. Just do -Dattributename=attributevalue for all 5 of these. Then it should work fine ^^

(don't ask me what this code does :P idk either HAHA)

Xenonym commented 7 years ago

thanks @Zhiyuan-Amos! Adding those attributes work :D