edu.samplu.common
Class ITUtil

java.lang.Object
  extended by edu.samplu.common.ITUtil

public class ITUtil
extends Object

TODO:

  1. Keep JUnit or TestNG dependencies out of in this class.
  2. Once and Only Once WAIT_DEFAULT_SECONDS and WebDriverLegacyITBase.DEFAULT_WAIT_SEC
  3. Rename to SmokeTestUtil or such
  4. Extract jiraMatches data to property file

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static String DEFAULT_BASE_URL
          http://localhost:8080/kr-dev
static String DEFAULT_WAIT_FOR_PAGE_TO_LOAD_TIMEOUT
          "30000"
static String DIV_ERROR_LOCATOR
          //div[@class='error']"
static String DIV_EXCOL_LOCATOR
          //div[@class='msg-excol']
static String DONT_TEAR_DOWN_PROPERTY
          remote.driver.dontTearDown
static String DTS
          Calendar.getInstance().getTimeInMillis() + ""
static String DTS_TWO
          Calendar.getInstance().getTimeInMillis() + "" + RandomStringUtils.randomAlphabetic(2).toLowerCase()
static String HUB_DRIVER_PROPERTY
          remote.public.driver
static String HUB_PROPERTY
          remote.public.hub
static String HUB_URL_PROPERTY
          http://localhost:4444/wd/hub
static String JIRA_BROWSE_URL
          https://jira.kuali.org/browse/
static String PORTAL
          /portal.do
static String PORTAL_URL
          ITUtil.getBaseUrlString() + ITUtil.PORTAL
static String PORTAL_URL_ENCODED
          URLEncoder.encode(PORTAL_URL)
static String REMOTE_AUTOLOGIN_PROPERTY
          remote.autologin
static String REMOTE_PUBLIC_URL_PROPERTY
          remote.public.url
static int WAIT_DEFAULT_SECONDS
          60
 
Constructor Summary
ITUtil()
           
 
Method Summary
static String blanketApprovalCleanUpErrorText(String errorText)
           
protected static void checkForIncidentReport(String contents, String linkLocator, Failable failable, String message)
           
static String deLinespace(String contents)
           
static boolean dontTearDownPropertyNotSet()
          Setting the JVM arg remote.driver.dontTearDown to y or t leaves the browser window open when the test has completed.
static void failOnInvalidUserName(String userName, String contents, Failable failable)
           
static void failOnMatchedJira(String contents, Failable failable)
           
static String getBaseUrlString()
          In order to run as a smoke test the ability to set the baseUrl via the JVM arg remote.public.url is required.
static String getHTML(String urlToRead)
           
static String getHubUrlString()
          In order to run as a smoke test under selenium grid the ability to set the hubUrl via the JVM arg remote.public.hub is required.
static String prettyHttp(String baseUrl)
          Append http:// if not present.
protected static void processIncidentReport(String contents, String linkLocator, Failable failable, String message)
           
static String stackTrace(Throwable throwable)
          Write the given stack trace into a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BASE_URL

public static final String DEFAULT_BASE_URL
http://localhost:8080/kr-dev

See Also:
Constant Field Values

PORTAL

public static final String PORTAL
/portal.do

See Also:
Constant Field Values

PORTAL_URL

public static final String PORTAL_URL
ITUtil.getBaseUrlString() + ITUtil.PORTAL


PORTAL_URL_ENCODED

public static final String PORTAL_URL_ENCODED
URLEncoder.encode(PORTAL_URL)


DTS

public static final String DTS
Calendar.getInstance().getTimeInMillis() + ""


DTS_TWO

public static final String DTS_TWO
Calendar.getInstance().getTimeInMillis() + "" + RandomStringUtils.randomAlphabetic(2).toLowerCase()


DIV_ERROR_LOCATOR

public static final String DIV_ERROR_LOCATOR
//div[@class='error']"

See Also:
Constant Field Values

DIV_EXCOL_LOCATOR

public static final String DIV_EXCOL_LOCATOR
//div[@class='msg-excol']

See Also:
Constant Field Values

WAIT_DEFAULT_SECONDS

public static final int WAIT_DEFAULT_SECONDS
60

See Also:
Constant Field Values

DEFAULT_WAIT_FOR_PAGE_TO_LOAD_TIMEOUT

public static final String DEFAULT_WAIT_FOR_PAGE_TO_LOAD_TIMEOUT
"30000"

See Also:
Constant Field Values

REMOTE_PUBLIC_URL_PROPERTY

public static final String REMOTE_PUBLIC_URL_PROPERTY
remote.public.url

See Also:
Constant Field Values

REMOTE_AUTOLOGIN_PROPERTY

public static final String REMOTE_AUTOLOGIN_PROPERTY
remote.autologin

See Also:
Constant Field Values

HUB_PROPERTY

public static final String HUB_PROPERTY
remote.public.hub

See Also:
Constant Field Values

HUB_DRIVER_PROPERTY

public static final String HUB_DRIVER_PROPERTY
remote.public.driver

See Also:
Constant Field Values

HUB_URL_PROPERTY

public static final String HUB_URL_PROPERTY
http://localhost:4444/wd/hub

See Also:
Constant Field Values

DONT_TEAR_DOWN_PROPERTY

public static final String DONT_TEAR_DOWN_PROPERTY
remote.driver.dontTearDown

See Also:
Constant Field Values

JIRA_BROWSE_URL

public static final String JIRA_BROWSE_URL
https://jira.kuali.org/browse/

See Also:
Constant Field Values
Constructor Detail

ITUtil

public ITUtil()
Method Detail

blanketApprovalCleanUpErrorText

public static String blanketApprovalCleanUpErrorText(String errorText)

checkForIncidentReport

protected static void checkForIncidentReport(String contents,
                                             String linkLocator,
                                             Failable failable,
                                             String message)

deLinespace

public static String deLinespace(String contents)

dontTearDownPropertyNotSet

public static boolean dontTearDownPropertyNotSet()
Setting the JVM arg remote.driver.dontTearDown to y or t leaves the browser window open when the test has completed. Valuable when debugging, updating, or creating new tests. When implementing your own tearDown method rather than an inherited one, it is a common courtesy to include this check and not stop and shutdown the browser window to make it easy debug or update your test.

Returns:
true if the dontTearDownProperty is not set.

failOnInvalidUserName

public static void failOnInvalidUserName(String userName,
                                         String contents,
                                         Failable failable)

failOnMatchedJira

public static void failOnMatchedJira(String contents,
                                     Failable failable)

getBaseUrlString

public static String getBaseUrlString()
In order to run as a smoke test the ability to set the baseUrl via the JVM arg remote.public.url is required. Trailing slashes are trimmed. If the remote.public.url does not start with http:// it will be added.

Returns:
http://localhost:8080/kr-dev by default else the value of remote.public.url

getHTML

public static String getHTML(String urlToRead)

getHubUrlString

public static String getHubUrlString()
In order to run as a smoke test under selenium grid the ability to set the hubUrl via the JVM arg remote.public.hub is required. Trailing slashes are trimmed. If the remote.public.hub does not start with http:// it will be added.

Returns:
http://localhost:4444/wd/hub by default else the value of remote.public.hub

prettyHttp

public static String prettyHttp(String baseUrl)
Append http:// if not present. Remove trailing /

Parameters:
baseUrl -
Returns:

processIncidentReport

protected static void processIncidentReport(String contents,
                                            String linkLocator,
                                            Failable failable,
                                            String message)

stackTrace

public static String stackTrace(Throwable throwable)
Write the given stack trace into a String

Parameters:
throwable - whose stack trace to return
Returns:
String of the given throwable's stack trace.


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.