public WebDriverFacade proxyFor(final Class<? extends WebDriver> driverClass, final WebDriverFactory webDriverFactory, Configuration configuration) { if (mockDriver != null) { return mockDriver; } else { return new WebDriverFacade(driverClass, webDriverFactory, configuration.getEnvironmentVariables()); } }
public ElementLocatorFactorySelector(Configuration configuration) { this(configuration.getElementTimeout(), configuration.getEnvironmentVariables()); }
public ElementLocatorFactorySelector(Configuration configuration) { this(configuration.getElementTimeout(), configuration.getEnvironmentVariables()); }
public ElementLocatorFactorySelector(Configuration configuration) { this(configuration.getElementTimeout(), configuration.getEnvironmentVariables()); }
private boolean shouldTagErrors() { return ThucydidesSystemProperty.SERENITY_TAG_FAILURES.booleanFrom(configuration.getEnvironmentVariables()); }
private boolean shouldRetryTest() { return configuration.getEnvironmentVariables().getPropertyAsBoolean(ThucydidesSystemProperty.JUNIT_RETRY_TESTS, false); }
public WebDriverFacade proxyFor(WebDriver driver) { return new WebDriverFacade(driver, webDriverFactory, configuration.getEnvironmentVariables()); }
@Inject public ReportService(final Configuration configuration) { this(configuration.getOutputDirectory(), getDefaultReporters(), configuration.getEnvironmentVariables()); }
private boolean isDefinedRemoteUrl() { boolean isRemoteUrl = ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL.isDefinedIn(pages.getConfiguration().getEnvironmentVariables()); boolean isSaucelabsUrl = ThucydidesSystemProperty.SAUCELABS_URL.isDefinedIn(pages.getConfiguration().getEnvironmentVariables()); boolean isBrowserStack = ThucydidesSystemProperty.BROWSERSTACK_URL.isDefinedIn(pages.getConfiguration().getEnvironmentVariables()); return isRemoteUrl || isSaucelabsUrl || isBrowserStack; }
private boolean shouldRestartDriverBeforeEachScenario() { return systemConfiguration.getEnvironmentVariables().getPropertyAsBoolean( ThucydidesJBehaveSystemProperties.RESTART_BROWSER_EACH_SCENARIO.getName(), false); }
private boolean shouldResetStepsBeforeEachScenario() { return systemConfiguration.getEnvironmentVariables().getPropertyAsBoolean( ThucydidesJBehaveSystemProperties.RESET_STEPS_EACH_SCENARIO.getName(), true); }
private TestResult defaulManualTestReportResult() { String manualTestResultValue = ThucydidesSystemProperty.MANUAL_TEST_REPORT_RESULT.from(configuration.getEnvironmentVariables(), TestResult.PENDING.toString()); TestResult manualTestResult = TestResult.PENDING; try { manualTestResult = TestResult.valueOf(manualTestResultValue.toUpperCase()); } catch (IllegalArgumentException e) { LOGGER.warn("Badly configured value for manual.test.report.result: should be one of " + Arrays.toString(TestResult.values())); } return manualTestResult; }
private boolean isDefinedRemoteUrl() { return ThucydidesSystemProperty.WEBDRIVER_REMOTE_URL.isDefinedIn(pages.getConfiguration().getEnvironmentVariables()); }
private String getThreadParameter(Concurrent concurrent) { String systemPropertyThreadValue = configuration.getEnvironmentVariables().getProperty(ThucydidesJUnitSystemProperties.CONCURRENT_THREADS.getName()); String annotatedThreadValue = concurrent.threads(); return (StringUtils.isNotEmpty(systemPropertyThreadValue) ? systemPropertyThreadValue : annotatedThreadValue); }
public WebDriverFacade proxyFor(final Class<? extends WebDriver> driverClass, final WebDriverFactory webDriverFactory, Configuration configuration, String options) { if (mockDriver != null) { return mockDriver; } else { return new WebDriverFacade(driverClass, webDriverFactory, configuration.getEnvironmentVariables()).withOptions(options); } }
private void clearMetadataIfRequired() { if (!configuration.getEnvironmentVariables().getPropertyAsBoolean(ThucydidesSystemProperty.THUCYDIDES_MAINTAIN_SESSION, false)) { Thucydides.getCurrentSession().clearMetaData(); } }
private Optional<TakeScreenshots> overriddenScreenshotPreferenceForClass(Class<?> declaringClass) { java.util.Optional<TakeScreenshots> optionalScreenshotPreference = ScreenshotPreferencesByClass.forClass(declaringClass) .withEnvironmentVariables(configuration.getEnvironmentVariables()).getScreenshotPreference(); return optionalScreenshotPreference; }
@Inject public BatchManagerProvider(Configuration configuration){ EnvironmentVariables environmentVariables = configuration.getEnvironmentVariables(); String batchManagerProperty = ThucydidesSystemProperty.THUCYDIDES_BATCH_STRATEGY.from(environmentVariables, BatchStrategy.DIVIDE_EQUALLY.name()); try { batchManager = BatchStrategy.valueOf(batchManagerProperty).instance(environmentVariables); } catch (Exception e) { throw new UnsupportedBatchStrategyException(batchManagerProperty + " is not a supported batch strategy.", e); } }
@Inject public BatchManagerProvider(Configuration configuration){ EnvironmentVariables environmentVariables = configuration.getEnvironmentVariables(); String batchManagerProperty = ThucydidesSystemProperty.THUCYDIDES_BATCH_STRATEGY.from(environmentVariables, BatchStrategy.DIVIDE_EQUALLY.name()); try { batchManager = BatchStrategy.valueOf(batchManagerProperty).instance(environmentVariables); } catch (Exception e) { throw new UnsupportedBatchStrategyException(batchManagerProperty + " is not a supported batch strategy.", e); } }
@Inject public BatchManagerProvider(Configuration configuration){ EnvironmentVariables environmentVariables = configuration.getEnvironmentVariables(); String batchManagerProperty = ThucydidesSystemProperty.THUCYDIDES_BATCH_STRATEGY.from(environmentVariables, BatchStrategy.DIVIDE_EQUALLY.name()); try { batchManager = BatchStrategy.valueOf(batchManagerProperty).instance(environmentVariables); } catch (Exception e) { throw new UnsupportedBatchStrategyException(batchManagerProperty + " is not a supported batch strategy.", e); } }