// JUnit 4 public boolean isIgnored(FrameworkMethod method, Object test) { boolean ignored = ignoreComparator.shouldIgnore(test.getClass().getAnnotation(Ignore.class)) || ignoreComparator.shouldIgnore(method.getMethod().getAnnotation(Ignore.class)); ignored |= isIgnoredBecauseOfJUnit4Ignore(test.getClass().getAnnotation(org.junit.Ignore.class)); ignored |= isIgnoredBecauseOfJUnit4Ignore(method.getMethod().getAnnotation(org.junit.Ignore.class)); if (Boolean.getBoolean("ignored_only")) { ignored = !ignored; } ignored |= isIgnoredDueToJavascript(test.getClass().getAnnotation(JavascriptEnabled.class)); ignored |= isIgnoredDueToJavascript(method.getMethod().getAnnotation(JavascriptEnabled.class)); ignored |= isIgnoredBecauseOfNativeEvents(test.getClass().getAnnotation(NativeEventsRequired.class)); ignored |= isIgnoredBecauseOfNativeEvents( method.getMethod().getAnnotation(NativeEventsRequired.class)); ignored |= isIgnoredDueToEnvironmentVariables(method, test); ignored |= isIgnoredDueToBeingOnSauce(method, test); return ignored; }
private void addIgnoresForBrowser(Browser browser, IgnoreComparator comparator) { if (Boolean.getBoolean("selenium.browser.remote") || SauceDriver.shouldUseSauce()) { comparator.addDriver(REMOTE); } switch (browser) { case chrome: comparator.addDriver(CHROME); break; case ff: if (Boolean.getBoolean("webdriver.firefox.marionette")) { comparator.addDriver(MARIONETTE); } else { comparator.addDriver(FIREFOX); } break; case htmlunit: case htmlunit_js: comparator.addDriver(HTMLUNIT); break; case ie: comparator.addDriver(IE); break; case none: comparator.addDriver(ALL); break; case opera: break; case operablink: comparator.addDriver(CHROME); break; case phantomjs: comparator.addDriver(PHANTOMJS); break; case safari: comparator.addDriver(SAFARI); break; default: throw new RuntimeException("Cannot determine which ignore to add ignores rules for"); } }