@Deprecated
public class SeleneseTestBase
extends java.lang.Object
This class adds a number of "verify" commands, which are like "assert" commands, but they don't stop the test when they fail. Instead, verification errors are all thrown at once during tearDown.
Modifier and Type | Field and Description |
---|---|
protected Selenium |
selenium
Deprecated.
Use this object to run all of your selenium tests
|
protected java.lang.StringBuffer |
verificationErrors
Deprecated.
|
Constructor and Description |
---|
SeleneseTestBase()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(java.lang.Object expected,
java.lang.Object actual)
Deprecated.
Like JUnit's Assert.assertEquals, but knows how to compare string arrays
|
static void |
assertEquals(java.lang.String[] expected,
java.lang.String[] actual)
Deprecated.
Asserts that two string arrays have identical string contents
|
static void |
assertEquals(java.lang.String expected,
java.lang.String actual)
Deprecated.
Like JUnit's Assert.assertEquals, but handles "regexp:" strings like HTML Selenese
|
static void |
assertEquals(java.lang.String expected,
java.lang.String[] actual)
Deprecated.
Like JUnit's Assert.assertEquals, but joins the string array with commas, and handles "regexp:"
strings like HTML Selenese
|
static void |
assertFalse(boolean condition)
Deprecated.
|
static void |
assertFalse(java.lang.String message,
boolean condition)
Deprecated.
|
static void |
assertNotEquals(boolean expected,
boolean actual)
Deprecated.
Asserts that two booleans are not the same
|
static void |
assertNotEquals(java.lang.Object expected,
java.lang.Object actual)
Deprecated.
Asserts that two objects are not the same (compares using .equals())
|
static void |
assertTrue(boolean condition)
Deprecated.
|
static void |
assertTrue(java.lang.String message,
boolean condition)
Deprecated.
|
void |
checkForVerificationErrors()
Deprecated.
Asserts that there were no verification errors during the current test, failing immediately if
any are found
|
void |
clearVerificationErrors()
Deprecated.
Clears out the list of verification errors
|
static void |
fail(java.lang.String message)
Deprecated.
|
protected int |
getDefaultPort()
Deprecated.
|
java.lang.String |
getText()
Deprecated.
|
protected boolean |
isCaptureScreenShotOnFailure()
Deprecated.
|
static java.lang.String |
join(java.lang.String[] sa,
char c)
Deprecated.
|
void |
pause(int millisecs)
Deprecated.
Sleeps for the specified number of milliseconds
|
protected java.lang.String |
runtimeBrowserString()
Deprecated.
|
static boolean |
seleniumEquals(java.lang.Object expected,
java.lang.Object actual)
Deprecated.
Compares two objects, but handles "regexp:" strings like HTML Selenese
|
static boolean |
seleniumEquals(java.lang.String expectedPattern,
java.lang.String actual)
Deprecated.
Compares two strings, but handles "regexp:" strings like HTML Selenese
|
protected void |
setCaptureScreenShotOnFailure(boolean captureScreenShotOnFailure)
Deprecated.
|
void |
setUp()
Deprecated.
Calls this.setUp(null)
|
void |
setUp(java.lang.String url)
Deprecated.
Calls this.setUp with the specified url and a default browser.
|
void |
setUp(java.lang.String url,
java.lang.String browserString)
Deprecated.
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser
string.
|
void |
setUp(java.lang.String url,
java.lang.String browserString,
int port)
Deprecated.
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser
string.
|
void |
tearDown()
Deprecated.
checks for verification errors and stops the browser
|
void |
verifyEquals(boolean expected,
boolean actual)
Deprecated.
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(java.lang.Object expected,
java.lang.Object actual)
Deprecated.
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(java.lang.String[] expected,
java.lang.String[] actual)
Deprecated.
Asserts that two string arrays have identical string contents (fails at the end of the test,
during tearDown)
|
void |
verifyFalse(boolean b)
Deprecated.
Like assertFalse, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(boolean expected,
boolean actual)
Deprecated.
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(java.lang.Object expected,
java.lang.Object actual)
Deprecated.
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyTrue(boolean b)
Deprecated.
Like assertTrue, but fails at the end of the test (during tearDown)
|
protected Selenium selenium
protected java.lang.StringBuffer verificationErrors
public void setUp() throws java.lang.Exception
java.lang.Exception
- because why notsetUp(String)
public void setUp(java.lang.String url) throws java.lang.Exception
url
- the baseUrl to use for your Selenium testsjava.lang.Exception
- just in casesetUp(String, String)
protected java.lang.String runtimeBrowserString()
public void setUp(java.lang.String url, java.lang.String browserString) throws java.lang.Exception
url
- the baseUrl for your testsbrowserString
- the browser to use, e.g. *firefoxjava.lang.Exception
- throws them all!setUp(String, String, int)
protected int getDefaultPort()
public void setUp(java.lang.String url, java.lang.String browserString, int port) throws java.lang.Exception
url
- the baseUrl for your testsbrowserString
- the browser to use, e.g. *firefoxport
- the port that you want to run your tests onjava.lang.Exception
- exception all the things!setUp(String, String, int)
public void verifyTrue(boolean b)
b
- boolean to verify is truepublic void verifyFalse(boolean b)
b
- boolean to verify is falsepublic java.lang.String getText()
public void verifyEquals(java.lang.Object expected, java.lang.Object actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic void verifyEquals(boolean expected, boolean actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static void assertEquals(java.lang.Object expected, java.lang.Object actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static void assertEquals(java.lang.String expected, java.lang.String actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static void assertEquals(java.lang.String expected, java.lang.String[] actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static boolean seleniumEquals(java.lang.String expectedPattern, java.lang.String actual)
expectedPattern
- expression of expectedactual
- expression of actualpublic static boolean seleniumEquals(java.lang.Object expected, java.lang.Object actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualseleniumEquals(String, String)
public static void assertEquals(java.lang.String[] expected, java.lang.String[] actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic void verifyEquals(java.lang.String[] expected, java.lang.String[] actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static java.lang.String join(java.lang.String[] sa, char c)
public void verifyNotEquals(java.lang.Object expected, java.lang.Object actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic void verifyNotEquals(boolean expected, boolean actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static void assertNotEquals(java.lang.Object expected, java.lang.Object actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic static void fail(java.lang.String message)
public static void assertTrue(java.lang.String message, boolean condition)
public static void assertTrue(boolean condition)
public static void assertFalse(java.lang.String message, boolean condition)
public static void assertFalse(boolean condition)
public static void assertNotEquals(boolean expected, boolean actual)
actual
- the actual object expectedexpected
- object that you want to compare to actualpublic void pause(int millisecs)
millisecs
- number ofpublic void checkForVerificationErrors()
public void clearVerificationErrors()
public void tearDown() throws java.lang.Exception
java.lang.Exception
- actually, just AssertionError, but someone was lazy?protected boolean isCaptureScreenShotOnFailure()
protected void setCaptureScreenShotOnFailure(boolean captureScreenShotOnFailure)