@Deprecated public class SeleneseTestBase extends 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.
| 构造器和说明 |
|---|
SeleneseTestBase()
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
assertEquals(Object expected,
Object actual)
已过时。
Like JUnit's Assert.assertEquals, but knows how to compare string arrays
|
static void |
assertEquals(String[] expected,
String[] actual)
已过时。
Asserts that two string arrays have identical string contents
|
static void |
assertEquals(String expected,
String actual)
已过时。
Like JUnit's Assert.assertEquals, but handles "regexp:" strings like HTML Selenese
|
static void |
assertEquals(String expected,
String[] actual)
已过时。
Like JUnit's Assert.assertEquals, but joins the string array with commas, and handles "regexp:"
strings like HTML Selenese
|
static void |
assertFalse(boolean condition)
已过时。
|
static void |
assertFalse(String message,
boolean condition)
已过时。
|
static void |
assertNotEquals(boolean expected,
boolean actual)
已过时。
Asserts that two booleans are not the same
|
static void |
assertNotEquals(Object expected,
Object actual)
已过时。
Asserts that two objects are not the same (compares using .equals())
|
static void |
assertTrue(boolean condition)
已过时。
|
static void |
assertTrue(String message,
boolean condition)
已过时。
|
void |
checkForVerificationErrors()
已过时。
Asserts that there were no verification errors during the current test, failing immediately if
any are found
|
void |
clearVerificationErrors()
已过时。
Clears out the list of verification errors
|
static void |
fail(String message)
已过时。
|
String |
getText()
已过时。
|
static String |
join(String[] sa,
char c)
已过时。
|
void |
pause(int millisecs)
已过时。
Sleeps for the specified number of milliseconds
|
static boolean |
seleniumEquals(Object expected,
Object actual)
已过时。
Compares two objects, but handles "regexp:" strings like HTML Selenese
|
static boolean |
seleniumEquals(String expectedPattern,
String actual)
已过时。
Compares two strings, but handles "regexp:" strings like HTML Selenese
|
void |
setUp()
已过时。
Calls this.setUp(null)
|
void |
setUp(String url)
已过时。
Calls this.setUp with the specified url and a default browser.
|
void |
setUp(String url,
String browserString)
已过时。
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser
string.
|
void |
setUp(String url,
String browserString,
int port)
已过时。
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser
string.
|
void |
tearDown()
已过时。
checks for verification errors and stops the browser
|
void |
verifyEquals(boolean expected,
boolean actual)
已过时。
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(Object expected,
Object actual)
已过时。
Like assertEquals, but fails at the end of the test (during tearDown)
|
void |
verifyEquals(String[] expected,
String[] actual)
已过时。
Asserts that two string arrays have identical string contents (fails at the end of the test,
during tearDown)
|
void |
verifyFalse(boolean b)
已过时。
Like assertFalse, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(boolean expected,
boolean actual)
已过时。
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyNotEquals(Object expected,
Object actual)
已过时。
Like assertNotEquals, but fails at the end of the test (during tearDown)
|
void |
verifyTrue(boolean b)
已过时。
Like assertTrue, but fails at the end of the test (during tearDown)
|
public void setUp()
throws Exception
Exception - because why notsetUp(String)public void setUp(String url) throws Exception
url - the baseUrl to use for your Selenium testsException - just in casesetUp(String, String)public void setUp(String url, String browserString) throws Exception
url - the baseUrl for your testsbrowserString - the browser to use, e.g. *firefoxException - throws them all!setUp(String, String, int)public void setUp(String url, String browserString, int port) throws Exception
url - the baseUrl for your testsbrowserString - the browser to use, e.g. *firefoxport - the port that you want to run your tests onException - 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 String getText()
public void verifyEquals(Object expected, 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(Object expected, Object actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic static void assertEquals(String expected, String actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic static void assertEquals(String expected, String[] actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic static boolean seleniumEquals(String expectedPattern, String actual)
expectedPattern - expression of expectedactual - expresssion of actualpublic static boolean seleniumEquals(Object expected, Object actual)
actual - the actual object expectedexpected - object that you want to compare to actualseleniumEquals(String, String)public static void assertEquals(String[] expected, String[] actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic void verifyEquals(String[] expected, String[] actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic void verifyNotEquals(Object expected, 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(Object expected, Object actual)
actual - the actual object expectedexpected - object that you want to compare to actualpublic static void fail(String message)
public static void assertTrue(String message, boolean condition)
public static void assertTrue(boolean condition)
public static void assertFalse(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()