Skip to content

Commit

Permalink
old Firefox web driver factory moved to specific package
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiitek committed Jun 16, 2018
1 parent 3b2e2b7 commit 659ffb5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ public HttpRequestExecutor getHttpRequestExecutor() {
return requestExecutor;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ private FirefoxProfileBuilder() {
firefoxProfile = new FirefoxProfile();
}

static FirefoxProfileBuilder newInstance() {
public static FirefoxProfileBuilder newInstance() {
return new FirefoxProfileBuilder();
}

FirefoxProfileBuilder withJavaScriptErrorCollectorPlugin() {
public FirefoxProfileBuilder withJavaScriptErrorCollectorPlugin() {
try {
JavaScriptError.addExtension(firefoxProfile);
} catch (IOException e) {
Expand All @@ -45,34 +45,34 @@ FirefoxProfileBuilder withJavaScriptErrorCollectorPlugin() {
return this;
}

FirefoxProfileBuilder withUnstableAndFastLoadStrategy() {
public FirefoxProfileBuilder withUnstableAndFastLoadStrategy() {
firefoxProfile.setPreference("webdriver.load.strategy", "unstable");
return this;
}


FirefoxProfileBuilder withLogfilePath(String logfilePath) {
public FirefoxProfileBuilder withLogfilePath(String logfilePath) {
firefoxProfile.setPreference("webdriver.firefox.logfile", logfilePath);
return this;
}

FirefoxProfileBuilder withFlashSwitchedOff() {
public FirefoxProfileBuilder withFlashSwitchedOff() {
firefoxProfile.setPreference("plugin.state.flash", 0);
return this;
}

FirefoxProfileBuilder withDevtoolsStorageEnabled() {
public FirefoxProfileBuilder withDevtoolsStorageEnabled() {
firefoxProfile.setPreference("devtools.storage.enabled", true);
return this;
}

FirefoxProfileBuilder withAllCookiesAccepted() {
public FirefoxProfileBuilder withAllCookiesAccepted() {
firefoxProfile.setPreference("network.cookie.cookieBehavior", 0);
firefoxProfile.setPreference("network.cookie.alwaysAcceptSessionCookies", true);
return this;
}

FirefoxProfileBuilder withRandomPort() {
public FirefoxProfileBuilder withRandomPort() {
firefoxProfile
.setPreference(FirefoxProfile.PORT_PREFERENCE, new Random().nextInt(64510) + 1024);
return this;
Expand All @@ -96,17 +96,17 @@ FirefoxProfileBuilder withClearingCacheAfterBrowserShutdown() {
* The possible settings are: 0 = default, 1 = aliased, 2 = GDI Classic, 3 = GDI Natural, 4 =
* Natural, 5 = Natural Symmetric
*/
FirefoxProfileBuilder withForcedAliasing() {
public FirefoxProfileBuilder withForcedAliasing() {
firefoxProfile.setPreference("gfx.font_rendering.cleartype_params.rendering_mode", 0);
return this;
}

FirefoxProfileBuilder withUpdateDisabled() {
public FirefoxProfileBuilder withUpdateDisabled() {
firefoxProfile.setPreference("app.update.enabled", false);
return this;
}

FirefoxProfile build() {
public FirefoxProfile build() {
return firefoxProfile;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.cognifide.aet.worker.drivers.firefox;
package com.cognifide.aet.worker.drivers.firefox.local;

import static com.cognifide.aet.worker.drivers.WebDriverHelper.NAME;
import static com.cognifide.aet.worker.drivers.WebDriverHelper.NAME_LABEL;
import static com.cognifide.aet.worker.drivers.WebDriverHelper.PATH;

import com.cognifide.aet.worker.drivers.firefox.FirefoxCommunicationWrapperImpl;
import com.cognifide.aet.worker.drivers.firefox.FirefoxProfileBuilder;
import com.cognifide.aet.job.api.collector.HttpRequestExecutorFactory;
import com.cognifide.aet.job.api.collector.ProxyServerWrapper;
import com.cognifide.aet.job.api.collector.WebCommunicationWrapper;
Expand Down

0 comments on commit 659ffb5

Please sign in to comment.