Package org.jenkinsci.test.acceptance
Class FallbackConfig
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- org.jenkinsci.test.acceptance.FallbackConfig
-
- All Implemented Interfaces:
com.google.inject.Module
public class FallbackConfig extends com.google.inject.AbstractModule
The default configuration for running tests.See
Config
for how to override it.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static String
DOM_DISABLE_BEFOREUNLOAD
static String
DOM_MAX_CHROME_SCRIPT_RUN_TIME
static String
DOM_MAX_SCRIPT_RUN_TIME
static int
IMPLICIT_WAIT_TIMEOUT
static int
PAGE_LOAD_TIMEOUT
-
Constructor Summary
Constructors Constructor Description FallbackConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
JenkinsController
createController(com.google.inject.Injector injector, com.cloudbees.sdk.extensibility.ExtensionList<JenkinsControllerFactory> factories)
Instantiates a controller through the "TYPE" attribute andJenkinsControllerFactory
.ExercisedPluginsReporter
createExercisedPluginReporter()
Provides a mechanism to create a report on which plugins were used during the test executionJenkins
createJenkins(com.google.inject.Injector injector, JenkinsController controller)
org.openqa.selenium.WebDriver
createWebDriver(TestCleaner cleaner, TestName testName, ElasticTime time)
Creates aWebDriver
for each test, then make sure to clean it up at the end.static String
getBrowserDisplay()
Get display number to run browser on.ElasticTime
getElasticTime()
File
getJenkinsWar(org.eclipse.aether.RepositorySystem repositorySystem, org.eclipse.aether.RepositorySystemSession repositorySystemSession)
Get the file with Jenkins to run.boolean
getQuite()
Returns whether Jenkins should be quite and should not report any logging information.File
getSocket()
Name of the socket file used to communicate between jut-server and JUnit.String
getWorkspace()
directory on the computer where this code is running that points to a directory where test code can place log files, cache files, etc.-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Field Detail
-
DOM_MAX_SCRIPT_RUN_TIME
public static final String DOM_MAX_SCRIPT_RUN_TIME
- See Also:
- Constant Field Values
-
DOM_MAX_CHROME_SCRIPT_RUN_TIME
public static final String DOM_MAX_CHROME_SCRIPT_RUN_TIME
- See Also:
- Constant Field Values
-
DOM_DISABLE_BEFOREUNLOAD
public static final String DOM_DISABLE_BEFOREUNLOAD
- See Also:
- Constant Field Values
-
PAGE_LOAD_TIMEOUT
public static final int PAGE_LOAD_TIMEOUT
- See Also:
- Constant Field Values
-
IMPLICIT_WAIT_TIMEOUT
public static final int IMPLICIT_WAIT_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
protected void configure()
- Overrides:
configure
in classcom.google.inject.AbstractModule
-
getBrowserDisplay
@CheckForNull public static String getBrowserDisplay()
Get display number to run browser on.Custom property
BROWSER_DISPLAY
has the preference. If not providedDISPLAY
is used.
-
createWebDriver
@Provides @TestScope public org.openqa.selenium.WebDriver createWebDriver(TestCleaner cleaner, TestName testName, ElasticTime time) throws IOException
Creates aWebDriver
for each test, then make sure to clean it up at the end.- Throws:
IOException
-
getElasticTime
@Provides public ElasticTime getElasticTime()
-
createController
@Provides @TestScope public JenkinsController createController(com.google.inject.Injector injector, com.cloudbees.sdk.extensibility.ExtensionList<JenkinsControllerFactory> factories) throws IOException
Instantiates a controller through the "TYPE" attribute andJenkinsControllerFactory
.- Throws:
IOException
-
createJenkins
@Provides @TestScope public Jenkins createJenkins(com.google.inject.Injector injector, JenkinsController controller)
-
getQuite
@Provides @Named("quite") public boolean getQuite()
Returns whether Jenkins should be quite and should not report any logging information.- Returns:
true
if Jenkins should be quite during the tests
-
getWorkspace
@Provides @Named("WORKSPACE") public String getWorkspace()
directory on the computer where this code is running that points to a directory where test code can place log files, cache files, etc. Note that this directory might not exist on the Jenkins master, since it can be running on a separate computer.
-
getSocket
@Provides @Named("socket") public File getSocket()
Name of the socket file used to communicate between jut-server and JUnit. Seedocs/PRELAUNCH.md
- Returns:
- the name of the socket
- See Also:
JenkinsControllerPoolProcess
-
getJenkinsWar
@Provides @Named("jenkins.war") public File getJenkinsWar(org.eclipse.aether.RepositorySystem repositorySystem, org.eclipse.aether.RepositorySystemSession repositorySystemSession)
Get the file with Jenkins to run.The file will exist on machine where tests run.
-
createExercisedPluginReporter
@Provides @Named("ExercisedPluginReporter") public ExercisedPluginsReporter createExercisedPluginReporter()
Provides a mechanism to create a report on which plugins were used during the test execution- Returns:
- An ExercisedPluginReporter based on env var EXERCISEDPLUGINREPORTER
-
-