-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#198 add tests for driver arguments support
- Loading branch information
1 parent
83dd7cb
commit 634c271
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/test/java/com/xceptance/neodymium/tests/DriverArgumentsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String, String> 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(); | ||
} | ||
} |