Fixes to FirefoxOptions.java
* Fixes to FirefoxOptions.java
Remove unneeded check for both prefs and profile being present:
According to
having both is valid.
Add getProfile method:
Allows for use in intermediate nodes that need to modify the profile
e.g. to add additional certs or extensions.
* Fix type error.
@@ -136,6 +136,10 @@ public FirefoxOptions setProfile(FirefoxProfile profile) {
return this;
}
+ public FirefoxProfile getProfile() {
+ return this.profile;
+ }
+
// Confusing API. Keeping package visible only
FirefoxOptions setProfileSafely(FirefoxProfile profile) {
if (profile == null) {
@@ -183,11 +187,6 @@ public DesiredCapabilities addTo(DesiredCapabilities capabilities) {
Object priorProfile = capabilities.getCapability(PROFILE);
if (priorProfile != null) {
- if (!booleanPrefs.isEmpty() || !intPrefs.isEmpty() || !stringPrefs.isEmpty()) {
- throw new IllegalStateException(
- "Unable to determine if preferences set on this option " +
- "are the same as the profile in the capabilities");
- }
if (!priorProfile.equals(profile)) {
throw new IllegalStateException(
"Profile has been set on both the capabilities and these options, but they're " +
