edu.samplu.common
Class ITUtil

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

public class ITUtil
extends Object

TODO:

  1. Keep WebDriver dependencies out of this class, those should be in WebDriverUtil
  2. Keep JUnit or TestNG dependencies out of in this class.
  3. Extract Hub specific logic?/li>
  4. Rename to SmokeTestUtil or such

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

Field Summary
static String DEFAULT_BASE_URL
          http://localhost:8080/kr-dev
static String DEFAULT_BASE_URL_KRAD
          http://localhost:8080/krad-dev
static String DIV_ERROR_LOCATOR
          //div[@class='error']"
static String DIV_EXCOL_LOCATOR
          //div[@class='msg-excol']
static String DOC_FORM_KEY
          &docFormKey=
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 HIDE_RETURN_LINK
          &hideReturnLink=true
static String HIDE_RETURN_LINK_FALSE
          &hideReturnLink=false
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 KNS_LOOKUP_METHOD
          /kr/lookup.do?methodToCall=start&businessObjectClassName=
static String KRAD_LOOKUP_METHOD
          /kr-krad/lookup?methodToCall=start&dataObjectClassName=
static String KRAD_PORTAL
          /kr-krad/kradsampleapp?viewId=KradSampleAppHome
static String KRAD_PORTAL_URL
          /kr-krad/kradsampleapp?viewId=KradSampleAppHome
static String LABS
          /kr-krad/labs?viewId=LabsMenuView
static String LABS_URL
          ITUtil.getBaseUrlString() + LABS
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 String REMOTE_UIF_KNS
          KNS
static String REMOTE_UIF_KRAD
          KRAD
static String SHOW_MAINTENANCE_LINKS
          &showMaintenanceLinks=true
 
Constructor Summary
ITUtil()
           
 
Method Summary
static String blanketApprovalCleanUpErrorText(String errorText)
           
protected static void checkForIncidentReport(String contents, String linkLocator, Failable failable, String message)
           
static String createUniqueDtsPlusTwoRandomChars()
           
static String createUniqueDtsPlusTwoRandomCharsNot9Digits()
           
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 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 remove the ats in an attempt to not cause Jenkins problems.
 
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

DEFAULT_BASE_URL_KRAD

public static final String DEFAULT_BASE_URL_KRAD
http://localhost:8080/krad-dev

See Also:
Constant Field Values

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

DONT_TEAR_DOWN_PROPERTY

public static final String DONT_TEAR_DOWN_PROPERTY
remote.driver.dontTearDown

See Also:
Constant Field Values

DTS

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


DTS_TWO

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


HIDE_RETURN_LINK

public static final String HIDE_RETURN_LINK
&hideReturnLink=true

See Also:
Constant Field Values

HIDE_RETURN_LINK_FALSE

public static final String HIDE_RETURN_LINK_FALSE
&hideReturnLink=false

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

KRAD_LOOKUP_METHOD

public static final String KRAD_LOOKUP_METHOD
/kr-krad/lookup?methodToCall=start&dataObjectClassName=

See Also:
Constant Field Values

KNS_LOOKUP_METHOD

public static final String KNS_LOOKUP_METHOD
/kr/lookup.do?methodToCall=start&businessObjectClassName=

See Also:
Constant Field Values

KRAD_PORTAL

public static final String KRAD_PORTAL
/kr-krad/kradsampleapp?viewId=KradSampleAppHome

See Also:
Constant Field Values

KRAD_PORTAL_URL

public static final String KRAD_PORTAL_URL
/kr-krad/kradsampleapp?viewId=KradSampleAppHome


LABS

public static final String LABS
/kr-krad/labs?viewId=LabsMenuView

See Also:
Constant Field Values

LABS_URL

public static final String LABS_URL
ITUtil.getBaseUrlString() + LABS


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)


SHOW_MAINTENANCE_LINKS

public static final String SHOW_MAINTENANCE_LINKS
&showMaintenanceLinks=true

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

REMOTE_UIF_KRAD

public static final String REMOTE_UIF_KRAD
KRAD

See Also:
Constant Field Values

REMOTE_UIF_KNS

public static final String REMOTE_UIF_KNS
KNS

See Also:
Constant Field Values

DOC_FORM_KEY

public static final String DOC_FORM_KEY
&docFormKey=

See Also:
Constant Field Values
Constructor Detail

ITUtil

public ITUtil()
Method Detail

blanketApprovalCleanUpErrorText

public static String blanketApprovalCleanUpErrorText(String errorText)

createUniqueDtsPlusTwoRandomChars

public static String createUniqueDtsPlusTwoRandomChars()

createUniqueDtsPlusTwoRandomCharsNot9Digits

public static String createUniqueDtsPlusTwoRandomCharsNot9Digits()

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)

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 remove the ats in an attempt to not cause Jenkins problems.

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.