Skip to content

Commit 734f2b9

Browse files
NickOppersdorffbarancev
authored andcommitted
Test for ChromeOptions setAcceptInsecureCerts()
A new test has been added to ChromeOptionsFunctionalTest to verify this - canSetAcceptInsecureCerts() Applies to #4791 Signed-off-by: Alexei Barantsev <barancev@gmail.com>
1 parent 266868e commit 734f2b9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

java/client/src/org/openqa/selenium/chrome/ChromeOptions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ public ChromeOptions setUnhandledPromptBehaviour(UnexpectedAlertBehaviour behavi
230230
return this;
231231
}
232232

233+
/**
234+
* Returns ChromeOptions with the capability ACCEPT_INSECURE_CERTS set.
235+
* @param acceptInsecureCerts
236+
* @return ChromeOptions
237+
*/
233238
public ChromeOptions setAcceptInsecureCerts(boolean acceptInsecureCerts) {
234239
setCapability(ACCEPT_INSECURE_CERTS, acceptInsecureCerts);
235240
return this;

java/client/test/org/openqa/selenium/chrome/ChromeOptionsFunctionalTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.junit.Test;
2727
import org.openqa.selenium.By;
2828
import org.openqa.selenium.Keys;
29+
import org.openqa.selenium.remote.CapabilityType;
2930
import org.openqa.selenium.support.ui.WebDriverWait;
3031
import org.openqa.selenium.testing.InProject;
3132
import org.openqa.selenium.testing.JUnit4TestBase;
@@ -74,6 +75,16 @@ public void optionsStayEqualAfterSerialization() throws Exception {
7475
options1, options2);
7576
}
7677

78+
@NeedsLocalEnvironment
79+
@Test
80+
public void canSetAcceptInsecureCerts() {
81+
ChromeOptions options = new ChromeOptions();
82+
options.setAcceptInsecureCerts(true);
83+
driver = new ChromeDriver(options);
84+
85+
assertEquals(driver.getCapabilities().getCapability(CapabilityType.ACCEPT_SSL_CERTS), true);
86+
}
87+
7788
@NeedsLocalEnvironment
7889
@Test
7990
public void canAddExtensionFromFile() {

0 commit comments

Comments
 (0)