Skip to content

Commit

Permalink
[java] Deleting REMOTE and GRID "pseudo-browsers" from Browser enum. …
Browse files Browse the repository at this point in the history
…An ability to ignore tests in remote or grid environment is not used at the moment, but if we need this feature it should be implemented as an @ignore annotation parameter (like existing 'travis' parameter).
  • Loading branch information
barancev committed Nov 24, 2018
1 parent 2fd0115 commit 9e71830
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.openqa.selenium.OutputType.BASE64;
import static org.openqa.selenium.testing.drivers.Browser.GRID;
import static org.openqa.selenium.testing.drivers.Browser.HTMLUNIT;

import org.junit.Test;
Expand Down
13 changes: 0 additions & 13 deletions java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,6 @@ private static boolean matches(Browser current, Browser[] drivers) {
if (item == current) {
return true;
}

if (item == Browser.REMOTE) {
if (Boolean.getBoolean("selenium.browser.grid") ||
Boolean.getBoolean("selenium.browser.remote")) {
return true;
}
}

if (item == Browser.GRID) {
if (Boolean.getBoolean("selenium.browser.grid")) {
return true;
}
}
}
return false;
}
Expand Down
23 changes: 2 additions & 21 deletions java/client/test/org/openqa/selenium/testing/TestIgnorance.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
package org.openqa.selenium.testing;

import static com.google.common.base.Preconditions.checkNotNull;
import static org.openqa.selenium.testing.drivers.Browser.GRID;
import static org.openqa.selenium.testing.drivers.Browser.REMOTE;

import org.junit.runner.Description;
import org.openqa.selenium.testing.drivers.Browser;
Expand All @@ -40,7 +38,8 @@ public class TestIgnorance {
private Set<String> ignoreClasses = new HashSet<>();

public TestIgnorance(Browser driver) {
setBrowser(driver);
ignoreComparator.addDriver(checkNotNull(driver,
"Browser to use must be set. Do this by setting the 'selenium.browser' system property"));

String onlyRun = System.getProperty("only_run");
if (onlyRun != null) {
Expand Down Expand Up @@ -91,22 +90,4 @@ private boolean isIgnoredDueToEnvironmentVariables(Description method) {
ignoreMethods.contains(method.getMethodName());
}

public void setBrowser(Browser driver) {
checkNotNull(driver,
"Browser to use must be set. Do this by setting the 'selenium.browser' system property");
addIgnoresForBrowser(driver, ignoreComparator);
}

private void addIgnoresForBrowser(Browser driver, IgnoreComparator comparator) {
if (Boolean.getBoolean("selenium.browser.remote")
|| Boolean.getBoolean("selenium.browser.grid")) {
comparator.addDriver(REMOTE);
}
if (Boolean.getBoolean("selenium.browser.grid")) {
comparator.addDriver(GRID);
}

comparator.addDriver(driver);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ public enum Browser {
MARIONETTE,
OPERA,
OPERABLINK,
SAFARI,

REMOTE,
GRID;
SAFARI;

private static final Logger log = Logger.getLogger(Browser.class.getName());

Expand Down

0 comments on commit 9e71830

Please sign in to comment.