|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.samplu.common.ITUtil
public class ITUtil
Common selenium test methods that should be reused rather than recreated for each test.
Field Summary | |
---|---|
static String |
DEFAULT_WAIT_FOR_PAGE_TO_LOAD_TIMEOUT
|
static String |
DIV_ERROR_LOCATOR
|
static String |
DIV_EXCOL_LOCATOR
|
static String |
DTS
|
static String |
DTS_TWO
|
static String |
KUALI_PORTAL_TITLE
|
static String |
PORTAL
|
static String |
REMOTE_AUTOLOGIN_PROPERTY
|
static int |
WAIT_DEFAULT_SECONDS
|
static String |
WAIT_TO_END_TEST
|
Constructor Summary | |
---|---|
ITUtil()
|
Method Summary | |
---|---|
static void |
assertDocFinal(com.thoughtworks.selenium.Selenium selenium,
String docId)
"FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]" |
protected static String |
blanketApprovalCleanUpErrorText(String errorText)
|
static void |
blanketApprove(com.thoughtworks.selenium.Selenium selenium)
Generic blanket approve behavior |
static void |
checkErrorMessageItem(com.thoughtworks.selenium.Selenium selenium,
String message)
"//li[@class='uif-errorMessageItem']" |
static void |
checkForIncidentReport(com.thoughtworks.selenium.Selenium selenium,
String linkLocator)
Check the selenium contents for an Incident Report failure with Incident Report Details |
static void |
checkForIncidentReport(com.thoughtworks.selenium.Selenium selenium,
String linkLocator,
String message)
Fails if a Incident Report is detected, extracting and reporting the View Id, Document Id, and StackTrace |
protected static void |
checkForIncidentReport(String contents,
String linkLocator,
String message)
|
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 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 |
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 org.openqa.selenium.WebDriver |
getWebDriver()
remote.public.driver set to chrome or firefox (null assumes firefox) if remote.public.hub is set a RemoteWebDriver is created (Selenium Grid) |
static void |
login(org.openqa.selenium.WebDriver driver,
String userName)
If the JVM arg remote.autologin is set, auto login as admin will not be done. |
static void |
loginSe(com.thoughtworks.selenium.Selenium selenium)
If the JVM arg remote.autologin is set, auto login as admin will not be done. |
static void |
loginSe(com.thoughtworks.selenium.Selenium selenium,
String user)
If the JVM arg remote.autologin is set, auto login as admin will not be done. |
static String |
prettyHttp(String baseUrl)
Append http:// if not present. |
static String |
stackTrace(Throwable throwable)
Write the given stack trace into a String |
static void |
waitAndClick(com.thoughtworks.selenium.Selenium selenium,
String elementLocator)
Wait 60 seconds for the elementLocator to be present or fail. |
static void |
waitAndClick(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitAndClick(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds,
String message)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitAndClick(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
String message)
Wait 60 seconds for the elementLocator to be present or fail. |
static void |
waitAndType(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds,
String text,
String message)
Wait the given seconds for the elementLocator to be present or fail, when present type the text. |
static void |
waitAndType(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
String text)
Wait the 60 seconds for the elementLocator to be present or fail, when present type the text. |
static void |
waitAndType(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
String text,
String message)
Wait the 60 seconds for the elementLocator to be present or fail, when present type the text. |
static void |
waitForElement(com.thoughtworks.selenium.Selenium selenium,
String elementLocator)
Wait 60 seconds for the elementLocator to be present or fail |
static void |
waitForElement(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitForElement(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds,
String message)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitForElement(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
String message)
Wait 60 seconds for the elementLocator to be present or fail |
static void |
waitForElementVisible(com.thoughtworks.selenium.Selenium selenium,
String elementLocator)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitForElementVisible(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
int seconds,
String message)
Wait the given seconds for the elementLocator to be present or fail |
static void |
waitForElementVisible(com.thoughtworks.selenium.Selenium selenium,
String elementLocator,
String message)
Wait 60 seconds for the elementLocator to be present or fail including the given message |
static void |
waitForTitleToEqual(com.thoughtworks.selenium.Selenium selenium,
String title)
Wait for 60 seconds for the selenium.getTitle to match the given title then fail. |
static void |
waitForTitleToEqual(com.thoughtworks.selenium.Selenium selenium,
String title,
String message)
Wait for 60 seconds for the selenium.getTitle to match the given title then fail including the given message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KUALI_PORTAL_TITLE
public static final String PORTAL
public static final String DTS
public static final String DTS_TWO
public static String WAIT_TO_END_TEST
public static final String DIV_ERROR_LOCATOR
public static final String DIV_EXCOL_LOCATOR
public static final int WAIT_DEFAULT_SECONDS
public static final String DEFAULT_WAIT_FOR_PAGE_TO_LOAD_TIMEOUT
public static final String REMOTE_AUTOLOGIN_PROPERTY
Constructor Detail |
---|
public ITUtil()
Method Detail |
---|
public static void assertDocFinal(com.thoughtworks.selenium.Selenium selenium, String docId)
selenium
- docId
- protected static String blanketApprovalCleanUpErrorText(String errorText)
public static void blanketApprove(com.thoughtworks.selenium.Selenium selenium) throws InterruptedException
selenium
-
InterruptedException
public static void checkErrorMessageItem(com.thoughtworks.selenium.Selenium selenium, String message)
selenium
- message
- public static String getBaseUrlString()
public static String prettyHttp(String baseUrl)
baseUrl
-
public static String getHubUrlString()
public static org.openqa.selenium.WebDriver getWebDriver()
public static void loginSe(com.thoughtworks.selenium.Selenium selenium)
selenium
- to login withpublic static void login(org.openqa.selenium.WebDriver driver, String userName) throws InterruptedException
driver
- userName
-
InterruptedException
public static void loginSe(com.thoughtworks.selenium.Selenium selenium, String user)
selenium
- to login withpublic static String stackTrace(Throwable throwable)
throwable
- whose stack trace to return
public static boolean dontTearDownPropertyNotSet()
public static void waitAndClick(com.thoughtworks.selenium.Selenium selenium, String elementLocator) throws InterruptedException
selenium
- elementLocator
-
InterruptedException
public static void waitAndClick(com.thoughtworks.selenium.Selenium selenium, String elementLocator, String message) throws InterruptedException
selenium
- elementLocator
- message
-
InterruptedException
public static void waitAndClick(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds) throws InterruptedException
selenium
- elementLocator
- seconds
-
InterruptedException
public static void waitAndClick(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds, String message) throws InterruptedException
selenium
- elementLocator
- seconds
- message
-
InterruptedException
public static void waitAndType(com.thoughtworks.selenium.Selenium selenium, String elementLocator, String text) throws InterruptedException
selenium
- elementLocator
- text
-
InterruptedException
public static void waitAndType(com.thoughtworks.selenium.Selenium selenium, String elementLocator, String text, String message) throws InterruptedException
selenium
- elementLocator
- text
- message
-
InterruptedException
public static void waitAndType(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds, String text, String message) throws InterruptedException
selenium
- elementLocator
- seconds
- text
- message
-
InterruptedException
public static void waitForElement(com.thoughtworks.selenium.Selenium selenium, String elementLocator) throws InterruptedException
selenium
- elementLocator
-
InterruptedException
public static void waitForElement(com.thoughtworks.selenium.Selenium selenium, String elementLocator, String message) throws InterruptedException
selenium
- elementLocator
- message
-
InterruptedException
public static void waitForElement(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds) throws InterruptedException
selenium
- elementLocator
- seconds
-
InterruptedException
public static void waitForElement(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds, String message) throws InterruptedException
selenium
- elementLocator
- seconds
- message
-
InterruptedException
public static void waitForElementVisible(com.thoughtworks.selenium.Selenium selenium, String elementLocator) throws InterruptedException
selenium
- elementLocator
-
InterruptedException
public static void waitForElementVisible(com.thoughtworks.selenium.Selenium selenium, String elementLocator, String message) throws InterruptedException
selenium
- elementLocator
- message
-
InterruptedException
public static void waitForElementVisible(com.thoughtworks.selenium.Selenium selenium, String elementLocator, int seconds, String message) throws InterruptedException
selenium
- elementLocator
- seconds
-
InterruptedException
public static void waitForTitleToEqual(com.thoughtworks.selenium.Selenium selenium, String title) throws InterruptedException
selenium
- title
-
InterruptedException
public static void waitForTitleToEqual(com.thoughtworks.selenium.Selenium selenium, String title, String message) throws InterruptedException
selenium
- title
- message
-
InterruptedException
public static void checkForIncidentReport(com.thoughtworks.selenium.Selenium selenium, String linkLocator)
selenium
- linkLocator
- public static void checkForIncidentReport(com.thoughtworks.selenium.Selenium selenium, String linkLocator, String message)
selenium
- linkLocator
- used only in the failure messageprotected static void checkForIncidentReport(String contents, String linkLocator, String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |