Skip to content

Commit

Permalink
Test for ChromeOptions setAcceptInsecureCerts()
Browse files Browse the repository at this point in the history
A new test has been added to ChromeOptionsFunctionalTest to
verify this - canSetAcceptInsecureCerts()

Applies to #4791

Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
NickOppersdorff authored and barancev committed Jan 8, 2018
1 parent 266868e commit 734f2b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
Expand Up @@ -230,6 +230,11 @@ public ChromeOptions setUnhandledPromptBehaviour(UnexpectedAlertBehaviour behavi
return this;
}

/**
* Returns ChromeOptions with the capability ACCEPT_INSECURE_CERTS set.
* @param acceptInsecureCerts
* @return ChromeOptions
*/
public ChromeOptions setAcceptInsecureCerts(boolean acceptInsecureCerts) {
setCapability(ACCEPT_INSECURE_CERTS, acceptInsecureCerts);
return this;
Expand Down
Expand Up @@ -26,6 +26,7 @@
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.InProject;
import org.openqa.selenium.testing.JUnit4TestBase;
Expand Down Expand Up @@ -74,6 +75,16 @@ public void optionsStayEqualAfterSerialization() throws Exception {
options1, options2);
}

@NeedsLocalEnvironment
@Test
public void canSetAcceptInsecureCerts() {
ChromeOptions options = new ChromeOptions();
options.setAcceptInsecureCerts(true);
driver = new ChromeDriver(options);

assertEquals(driver.getCapabilities().getCapability(CapabilityType.ACCEPT_SSL_CERTS), true);
}

@NeedsLocalEnvironment
@Test
public void canAddExtensionFromFile() {
Expand Down

0 comments on commit 734f2b9

Please sign in to comment.