diff --git a/config/browser.properties b/config/browser.properties index b7b989ab9..8ae93adf8 100644 --- a/config/browser.properties +++ b/config/browser.properties @@ -15,7 +15,7 @@ # ################################################################################ # -# Mandatory properties +# Mandatory properties # ################################################################################# # @@ -37,7 +37,7 @@ # ################################################################################ # -# Global properties +# Global properties # ################################################################################# # @@ -131,6 +131,12 @@ browserprofile.FF_1024x768.name = Firefox 1024x768 browserprofile.FF_1024x768.browser = firefox browserprofile.FF_1024x768.browserResolution = 1024x768 +# Small headless Firefox +browserprofile.FF_headless.name = Firefox Headless +browserprofile.FF_headless.browser = firefox +browserprofile.FF_headless.browserResolution = 1024x768 +browserprofile.FF_headless.headless = true + # Local Firefox but with larger window size browserprofile.FF_1500x1000.name = Latest local Firefox 1500x1000 browserprofile.FF_1500x1000.browser = firefox diff --git a/src/test/java/com/xceptance/neodymium/tests/DriverArgumentsTest.java b/src/test/java/com/xceptance/neodymium/tests/DriverArgumentsTest.java new file mode 100644 index 000000000..7677f4e2b --- /dev/null +++ b/src/test/java/com/xceptance/neodymium/tests/DriverArgumentsTest.java @@ -0,0 +1,48 @@ +package com.xceptance.neodymium.tests; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.junit.After; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.codeborne.selenide.Selenide; +import com.xceptance.neodymium.NeodymiumRunner; +import com.xceptance.neodymium.module.statement.browser.multibrowser.Browser; + +@RunWith(NeodymiumRunner.class) +@Browser("Chrome_headless") +@Browser("FF_headless") +public class DriverArgumentsTest extends NeodymiumTest +{ + private static String randomLogFileName = "target/" + UUID.randomUUID().toString() + ".log"; + + @BeforeClass + public static void createSettings() + { + Map properties1 = new HashMap<>(); + properties1.put("neodymium.webDriver.chrome.driverArguments", "--silent ; --log-path=" + randomLogFileName); + properties1.put("neodymium.webDriver.firefox.driverArguments", "--log ; fatal ; --log-path=" + randomLogFileName); + File tempConfigFile1 = new File("./config/dev-neodymium.properties"); + tempFiles.add(tempConfigFile1); + writeMapToPropertiesFile(properties1, tempConfigFile1); + } + + @Test + public void test() + { + Selenide.open("https://www.xceptance.com/en/"); + Assert.assertTrue("No log file found", new File(randomLogFileName).exists()); + } + + @After + public void cleanup() + { + new File(randomLogFileName).delete(); + } +}