|
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.actimind.actiwate.testing.ActiwateTestCase
Base test case class for all tests.
| Field Summary |
| Fields inherited from interface com.actimind.actiwate.testing.html.UserDialogExpect |
PRESS_CANCEL, PRESS_OK |
| Constructor Summary | |
protected |
ActiwateTestCase()
|
protected |
ActiwateTestCase(java.util.Properties customProperties)
Constructs test case with custom actiwate test properties. |
protected |
ActiwateTestCase(java.lang.String name)
|
protected |
ActiwateTestCase(java.lang.String name,
java.util.Properties customProperties)
Constructs test case with the given name and custom actiwate test properties. |
| Method Summary | |
void |
addAuthCredentials(java.lang.String hostname,
java.lang.String realm,
java.lang.String username,
java.lang.String password)
Adds credentials to a CURRENT SESSION only for the given authentication realm on the given host. |
void |
assertImageWithURLNotPresent(java.lang.String imageURL)
Asserts that page does not contain image with specified URL. |
void |
assertImageWithURLPresent(java.lang.String imageURL)
Asserts that page contains image with specified URL. |
void |
assertLinkWithTextNotPresent(java.lang.String textInLink)
Asserts that page does not contain link with specified text. |
void |
assertLinkWithTextPresent(java.lang.String textInLink)
Asserts that link with specified text contained within this page. |
void |
assertTextNotPresent(java.lang.String notExpectedText)
Asserts that page does not contain notExpectedText as substring. |
void |
assertTextPresent(java.lang.String expectedText)
Asserts that page contains expectedText as substring. |
void |
assertTitleEquals(java.lang.String expectedTitle)
Asserts that page has title equal to expectedTitle. |
void |
back()
Emulates browser back function |
Button |
button(int index)
Returns button within this page by specified index. |
Button |
button(java.lang.String nameOrId)
Searches for a button with specified name or id. |
Button |
button(java.lang.String nameOrId,
int index)
Searches for a buttons with specified name/id and returns button having specified index. |
Button |
buttonByText(java.lang.String value)
The search is done by visible button caption text: this means that for <button> tags this is a text within button and for all other types of button this is a text within button value. |
Checkbox |
checkbox(java.lang.String nameOrId)
Searches for checkbox with specified name or id attribute |
Checkbox |
checkbox(java.lang.String nameOrId,
java.lang.String value)
Searches for checkbox with specified name/id and value |
Checkbox[] |
checkboxes(java.lang.String nameOrId)
Searches for checkboxes with specified nameOrId or id attribute |
void |
chooseFile(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Emulates result of a file choose dialog when a user clicks "Browse" button in the browser. |
void |
click(Area area,
Image image)
Emulates single mouse click on an Area element. |
void |
click(ClickableElement element)
Emulates single mouse click on an object. |
void |
click(org.w3c.dom.html.HTMLElement element)
Emulates single mouse click on an arbitrary HTML element. |
static void |
debug(java.lang.String message)
Logs debug message in the log |
void |
disableJavaScript(boolean deferred)
Disables JavaScript support in this session for all the session windows and frames. |
void |
enableJavaScript()
Enables JavaScript support for all the session windows and frames. |
static void |
error(java.lang.String message)
Logs error message in the log |
java.lang.Object |
executeJavaScript(java.lang.String script)
Executes specified JavaScript statements in the scope of the current page. |
java.lang.Object |
executeJavaScript(java.lang.String script,
org.w3c.dom.html.HTMLElement element)
Executes specified JavaScript statements in the scope of the current page. |
void |
expectAlert(AlertAssert alertAssert,
java.lang.String expectedAlertDescription)
Setups custom alert expectation. |
void |
expectAlert(java.lang.String expectedText)
Setups alert expectation with specified text. |
void |
expectAnyAlert()
Setups any alert expectation. |
void |
expectAnyConfirm(int whatToPress)
Setups any confirmation dialog expectation. |
void |
expectAnyPrompt(java.lang.String newValue)
Setups prompt dialog expectation. |
void |
expectConfirm(ConfirmAssert confirmAssert,
java.lang.String expectedConfirmDescription,
int whatToPress)
Setups custom confirmation dialog expectation. |
void |
expectConfirm(java.lang.String expectedText,
int whatToPress)
Setups confirmation dialog expectation with specified text. |
void |
expectPrompt(PromptAssert promptAssert,
java.lang.String expectedPromptdescription,
java.lang.String newValue)
Setups custom prompt dialog expectation. |
void |
expectPromptWithText(java.lang.String expectedText,
java.lang.String newValue)
Setups prompt dialog expectation with expected text. |
void |
expectPromptWithTextAndValue(java.lang.String expectedText,
java.lang.String expectedValue,
java.lang.String newValue)
Setups prompt dialog expectation with expected text and initial value. |
static void |
fatal(java.lang.String message)
Logs fatal message in the log |
FileField |
fileField(java.lang.String nameOrId)
Searches for a file field with specified name or id. |
FileField |
fileField(java.lang.String nameOrId,
int index)
Searches for a file fields with specified name or id and returns field with specified order index. |
FileField[] |
fileFields(java.lang.String nameOrId)
Returns all file fields with specified name or id. |
void |
forward()
Emulates browser forward function |
AsyncEvents |
getAsyncEvents()
Returns AsyncEvents class containing all sheduled but not executed async events.
|
boolean |
getAutoExecMetaRefreshes()
Returns value specified in setAutoExecMetaRefreshes(boolean) method. |
java.lang.String |
getBaseURL()
Returns base URL for this session. |
boolean |
getExecAsyncEventsAutomatically()
Returns value specified in setExecAsyncEventsAutomatically(boolean). |
long |
getExecAsyncEventsOffset()
Returns value specified in setExecAsyncEventsOffset(long). |
com.actimind.actiwate.testing.logging.log4j.FailureReporter |
getFailureReporter()
|
ActiwateSession |
getSession()
Returns current actiwate session. |
java.lang.String |
getTestCaseName()
|
java.lang.String |
getTestMethodName()
|
java.util.Date |
getTestStartTimestamp()
|
java.lang.String |
getURL(java.lang.String URL)
Returns URL for specified relative URL. |
XmlHttpRequestConfig |
getXmlHttpRequestConfig()
Returns configuration for XmlHttpRequest async events. |
void |
goTo(HttpRequest request)
Sends arbitrary HTTP request. |
void |
goTo(java.lang.String URL)
Sends GET request to the specified URL. |
Image |
image(java.lang.String nameOrId)
Searches for image or image button by name or id attribute value. |
Image |
imageByAlt(java.lang.String altText)
Searches for image or image button by alt attribute value. |
Image |
imageByURL(java.lang.String url)
Searches for image or image button by specified url. |
ImageMap |
imageMap(int idx)
Returns map by index on a page. |
ImageMap |
imageMap(java.lang.String nameOrId)
Searches for map by name or id attribute value. |
ImageMap[] |
imageMaps()
Returns all HTML maps found on a page. |
Image[] |
images()
Returns all images and image buttons. |
static void |
info(java.lang.String message)
Logs info message in the log |
boolean |
isJavaScriptAutoRunningEnabled()
Returns value indicating whether or not JavaScript support is enabled. |
Link |
link(int index)
Returns link contained in this page by its index. |
Link |
linkById(java.lang.String id)
Searches for link by specified id attribute. |
Link |
linkByText(java.lang.String linkText)
Searches for link having specified text. |
Link |
linkByTitle(java.lang.String title)
Searches for link by title attribute value. |
Link[] |
links()
Returns all links. |
MultipleSelect |
multiSelect(java.lang.String nameOrId)
Searches for HTML multiple select with specified name or id attribute. |
static ActiwateSession |
newSession()
Creates new actiwate session. |
static ActiwateSession |
newSession(java.util.Properties testProperties)
Creates new actiwate session with specified test properties. |
Window |
newWindow()
Creates new window. |
Page |
page()
Returns current page. |
PasswordField |
passwordField(java.lang.String nameOrId)
Searches for a password field with specified name or id. |
RadioButton |
radioButton(java.lang.String groupNameOrId,
int index)
Searches for group of radio buttons with specified name or id and returns radio button with specified index. |
RadioButton |
radioButton(java.lang.String groupNameOrId,
java.lang.String value)
Searches for radio button with specified name/id and value. |
RadioButton[] |
radioButtons(java.lang.String groupNameOrId)
Searches for group of radio buttons with specified name or id attribute |
void |
reload()
Reloads the current page |
void |
runBare()
|
void |
runPageScripts()
Loads and executes all scripts associated with the current page. |
Screen |
screen()
Returns the Screen interface containing parameters of the screen within
the current session. |
void |
selectOption(Option optionToSelect)
Emulates option selection in drop down or multiple select. |
void |
setAutoExecMetaRefreshes(boolean enabled)
Specifies one of two modes of processing of Meta Refreshes for the current session: parameter enabled=true -
Browser will process Meta-refreshes automatically
(without necessity of calling |
void |
setBaseURL(java.lang.String URL)
Sets base URL for this session. |
void |
setConnectTimeout(int seconds)
Sets the timeout until HTTP connection with a server is established. |
void |
setDataTimeout(int seconds)
Sets the time which actiWATE waits for data server after connection is established. |
void |
setExecAsyncEventsAutomatically(boolean auto)
Specifies one of two modes of processing of async events: parameter auto=true -
Browser will execute async events automatically.
|
void |
setExecAsyncEventsOffset(long offsetMillis)
Sets offset for automatic async events execution. |
void |
setFailureReporter(com.actimind.actiwate.testing.logging.log4j.FailureReporter failureReporter)
|
void |
setFile(FileField field,
java.io.File fileToUpload,
java.lang.String contentType)
Emulates file setting to the file upload field. |
void |
setFileName(FileField fileField,
java.lang.String filePath)
Emulates manual enter of text into a file field. |
void |
setFileName(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Emulates manual enter of text into a file field. |
void |
setSession(ActiwateSession session)
Sets specified session as current session. |
void |
setText(PasswordField passwordField,
java.lang.String text)
Emulates text insert operation in a password field object. |
void |
setText(Textarea textarea,
java.lang.String text)
Emulates text insert operation in a textarea object. |
void |
setText(TextField textField,
java.lang.String text)
Emulates text insert operation in a text field object. |
void |
setXmlHttpRequestConfig(XmlHttpRequestConfig xmlHttpRequestConfig)
Sets configuration for XmlHttpRequest async events. |
void |
shiftTime(long milliseconds)
Moves time ahead on the specified number of milliseconds. |
SingleSelect |
singleSelect(java.lang.String nameOrId)
Searches for HTML single select (drop down) with specified name or id attribute. |
void |
switchTo(Page page)
Switches context to the specified page. |
Table |
table(int index)
Returns table by index on a page. |
Table |
tableById(java.lang.String id)
Searches for table having specified value in id attribute. |
Table |
tableByText(java.lang.String textWithinTable)
Returns table having containing specified text in one of it's cells. |
protected void |
tearDown()
Performs verification of expected user dialogs. |
Textarea |
textarea(java.lang.String nameOrId)
Searches for a textarea with specified name or id. |
TextField |
textField(java.lang.String nameOrId)
Searches for a text field with specified name or id. |
TextField |
textField(java.lang.String nameOrId,
int index)
Searches for a text fields with specified name or id and returns field with specified index. |
TextField[] |
textFields(java.lang.String nameOrId)
Returns all text fields with specified name or id. |
void |
toggleOption(Option optionToToggle)
Emulates option toggling in multiple select (Ctrl + mouse click). |
void |
verifyUserDialogs()
Verifies that all expected user dialogs are occurred. |
static void |
warn(java.lang.String message)
Logs warning message in the log |
Window |
window()
Returns window containing current context. |
Window |
window(int creationOrder)
Returns window by creation index. |
Window |
window(java.lang.String name)
Returns window by its name. |
Window |
windowWithTitle(java.lang.String windowTitle)
Returns first window with specified title substring. |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected ActiwateTestCase()
protected ActiwateTestCase(java.lang.String name)
protected ActiwateTestCase(java.util.Properties customProperties)
protected ActiwateTestCase(java.lang.String name,
java.util.Properties customProperties)
| Method Detail |
public ActiwateSession getSession()
public void setSession(ActiwateSession session)
session - session to replace current session.
java.lang.IllegalArgumentException - if session is null.public static ActiwateSession newSession()
public static ActiwateSession newSession(java.util.Properties testProperties)
testProperties - test properties.
public void addAuthCredentials(java.lang.String hostname,
java.lang.String realm,
java.lang.String username,
java.lang.String password)
addAuthCredentials in interface ActiwateSessionhostname - the host the credentials belongs torealm - the authentication realmusername - usernamepassword - passwordpublic Screen screen()
Screen interface containing parameters of the screen within
the current session.
screen in interface ActiwateSessionpublic void setBaseURL(java.lang.String URL)
ActiwateSession
setBaseURL in interface ActiwateSessionURL - absolute URL, can be nullpublic java.lang.String getBaseURL()
ActiwateSession
getBaseURL in interface ActiwateSessionpublic java.lang.String getURL(java.lang.String URL)
ActiwateSession
getURL in interface ActiwateSessionURL - relative URL
public Window window(int creationOrder)
throws WindowNotFoundException
ActiwateSession
window in interface ActiwateSessioncreationOrder - creation index, starting from zero
WindowNotFoundException - if window with specified creation index does not exist.
public Window window(java.lang.String name)
throws WindowNotFoundException
ActiwateSession
window in interface ActiwateSessionname - name of the window to search for
WindowNotFoundException - if window with specified name does not exist.
public Window windowWithTitle(java.lang.String windowTitle)
throws WindowNotFoundException
ActiwateSession
windowWithTitle in interface ActiwateSessionwindowTitle - title substring searched window must have
WindowNotFoundException - if window with specified title does not exist.public Window newWindow()
ActiwateSession
newWindow in interface ActiwateSessionpublic Window window()
ActiwateSession
window in interface ActiwateSessionpublic void goTo(java.lang.String URL)
Action
goTo in interface ActionURL - relative or absolute URLpublic void switchTo(Page page)
ActiwateSession
switchTo in interface ActiwateSessionpage - Page the context should be switched to
public void click(ClickableElement element)
throws java.lang.IllegalArgumentException
Action
click in interface Actionelement - - element user is able to click
java.lang.IllegalArgumentException - if clickable is null
public void click(Area area,
Image image)
throws java.lang.IllegalArgumentException
ActionAction.click(com.actimind.actiwate.testing.html.objects.ClickableElement) and
Action.click(org.w3c.dom.html.HTMLElement). But in case there are several images that use the same map
then the mentioned methods will generate error, so you need to use this method to specify
which image should be actually clicked.
click in interface Actionarea - - area elementimage - - image element specifying an exact image to click on.
java.lang.IllegalArgumentException
public void click(org.w3c.dom.html.HTMLElement element)
throws java.lang.IllegalArgumentException
Action
click in interface Actionelement - - element user is able to click
java.lang.IllegalArgumentException - if element is null
public void setText(TextField textField,
java.lang.String text)
throws java.lang.IllegalArgumentException
Action
setText in interface ActiontextField - - TextField object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if textField or text is null
public void setText(PasswordField passwordField,
java.lang.String text)
throws java.lang.IllegalArgumentException
Action
setText in interface ActionpasswordField - - PasswordField object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if passwordField or text is null
public void setText(Textarea textarea,
java.lang.String text)
throws java.lang.IllegalArgumentException
Action
setText in interface Actiontextarea - - textarea object where user inserts texttext - - text to insert
java.lang.IllegalArgumentException - if textarea or text is null
public void setFile(FileField field,
java.io.File fileToUpload,
java.lang.String contentType)
throws java.lang.IllegalArgumentException
Action
setFile in interface Actionfield - - file upload fieldfileToUpload - - file for uploadcontentType - - content type of a file to upload (for example, "image/gif"),
if null "application/octet-stream" will be used.
java.lang.IllegalArgumentException - if field or fileToUpload is null
public void setFileName(FileField fileField,
java.lang.String filePath)
Action
setFileName in interface ActionfileField - - file upload fieldfilePath - - absolute path to file for upload
public void setFileName(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Action
setFileName in interface ActionfileField - - file upload fieldfilePath - - absolute path to file for uploadstreamFactory - - factory to create stream containing file for uploadcontentType - - content type of a file to upload (for example, "image/gif")com.actimind.actiwate.testing.util.FileStreamFactory, ByteArrayStreamFactory
public void chooseFile(FileField fileField,
java.lang.String filePath,
InputStreamFactory streamFactory,
java.lang.String contentType)
Action
chooseFile in interface ActionfileField - - file upload fieldfilePath - - absolute path to file for uploadstreamFactory - - factory to create stream containing file for uploadcontentType - - content type of a file to upload (for example, "image/gif"),com.actimind.actiwate.testing.util.FileStreamFactory, ByteArrayStreamFactory
public void selectOption(Option optionToSelect)
throws java.lang.IllegalArgumentException
Action
selectOption in interface ActionoptionToSelect - option to select
java.lang.IllegalArgumentException - if option is null
public void toggleOption(Option optionToToggle)
throws java.lang.IllegalArgumentException
Action
toggleOption in interface ActionoptionToToggle - option to toggle
java.lang.IllegalArgumentException - if option is null or option from single select is passed
public TextField textField(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
textField in interface PageObjectLookupnameOrId - name or id of a text field
LookupException - if text field was not found
public TextField textField(java.lang.String nameOrId,
int index)
throws LookupException
PageObjectLookup
textField in interface PageObjectLookupnameOrId - name or id of a text fieldindex - index of a field with specified name or id to return, starts from zero
LookupException - if text field was not found
public TextField[] textFields(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
textFields in interface PageObjectLookupnameOrId - name or id of a text field
LookupException - if there are no text fields with specified name or id
public PasswordField passwordField(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
passwordField in interface PageObjectLookupnameOrId - name or id of a password field
LookupException - if password field was not found
public Textarea textarea(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
textarea in interface PageObjectLookupnameOrId - name or id of a textarea
LookupException - if textarea was not found
public FileField fileField(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
fileField in interface PageObjectLookupnameOrId - name or id of a file field
LookupException - if file field was not found
public FileField fileField(java.lang.String nameOrId,
int index)
throws LookupException
PageObjectLookup
fileField in interface PageObjectLookupnameOrId - name or id of a fieldindex - index of a field with specified name or id to return, starts from zero
LookupException - if file field was not found
public FileField[] fileFields(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
fileFields in interface PageObjectLookupnameOrId - name or id of a file field
LookupException - if there are no file fields with specified name or id
public Link link(int index)
throws LookupException
PageObjectLookup
link in interface PageObjectLookupindex - index of link on the page, starting from zero
LookupException - if link was not found.
public Link linkByText(java.lang.String linkText)
throws LookupException
PageObjectLookup
linkByText in interface PageObjectLookuplinkText - text link should contain
LookupException - if link was not found
public Link linkById(java.lang.String id)
throws LookupException
PageObjectLookup
linkById in interface PageObjectLookupid - value of id attribute
LookupException - if link was not found
public Link linkByTitle(java.lang.String title)
throws LookupException
PageObjectLookup
linkByTitle in interface PageObjectLookuptitle - value of title attribute
LookupException - if link was not foundpublic Link[] links()
PageObjectLookup
links in interface PageObjectLookup
public Button button(int index)
throws LookupException
PageObjectLookup
button in interface PageObjectLookupindex - index of a button among other buttons
LookupException - if button was not found
public Button button(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
button in interface PageObjectLookupnameOrId - name or id of a button
LookupException - if button was not found
public Button button(java.lang.String nameOrId,
int index)
throws LookupException
PageObjectLookup
button in interface PageObjectLookupnameOrId - name or id of a buttonindex - index of a button among other buttons with same name/id
LookupException - if button was not found
public Button buttonByText(java.lang.String value)
throws LookupException
PageObjectLookup
buttonByText in interface PageObjectLookupvalue - visible caption of a button
LookupException - if button was not found
public Checkbox checkbox(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
checkbox in interface PageObjectLookupnameOrId - name or id attribute value
LookupException - if checkbox was not found
public Checkbox[] checkboxes(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
checkboxes in interface PageObjectLookupnameOrId - name or id attribute value
LookupException - if there are no checkboxes with specified name or id
public Checkbox checkbox(java.lang.String nameOrId,
java.lang.String value)
throws LookupException
PageObjectLookup
checkbox in interface PageObjectLookupnameOrId - name or id of checkboxvalue - value of checkbox
LookupException - if checkbox was not found
public RadioButton radioButton(java.lang.String groupNameOrId,
int index)
throws LookupException
PageObjectLookup
radioButton in interface PageObjectLookupgroupNameOrId - name or id attribute valueindex - index of a radio button with specified name or id to return, starts from zero
LookupException - if radio button was not found
public RadioButton radioButton(java.lang.String groupNameOrId,
java.lang.String value)
throws LookupException
PageObjectLookup
radioButton in interface PageObjectLookupgroupNameOrId - name or id of radio buttonvalue - value of radio button in the group
LookupException - if radio button was not found
public RadioButton[] radioButtons(java.lang.String groupNameOrId)
throws LookupException
PageObjectLookup
radioButtons in interface PageObjectLookupgroupNameOrId - name or id attribute value
LookupException - if there are no radio buttons with specified name or id
public SingleSelect singleSelect(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
singleSelect in interface PageObjectLookupnameOrId - name or id attribute value
LookupException - if drop down was not found
public MultipleSelect multiSelect(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
multiSelect in interface PageObjectLookupnameOrId - name or id attribute value
LookupException - if multiple select was not foundpublic Table table(int index)
PageObjectLookup
table in interface PageObjectLookupindex - index of table among other not nested tables on a page, starting from zero.
public Table tableByText(java.lang.String textWithinTable)
PageObjectLookup
tableByText in interface PageObjectLookuptextWithinTable - text expected to be in the table cell
public Table tableById(java.lang.String id)
throws LookupException
PageObjectLookup
tableById in interface PageObjectLookupid - value of id attribute
LookupException - if table was not found
public Image image(java.lang.String nameOrId)
throws LookupException
PageObjectLookup
image in interface PageObjectLookupnameOrId - name or id attribute value
LookupException - if image was not found
public Image imageByAlt(java.lang.String altText)
throws LookupException
PageObjectLookup
imageByAlt in interface PageObjectLookupaltText - text within alt attribute
LookupException - if image was not found
public Image imageByURL(java.lang.String url)
throws LookupException,
java.lang.IllegalArgumentException
PageObjectLookupImage location will be calculated from location of the current page and value specified in src attribute (if src contains servlet session id - it will be ignored).
imageByURL in interface PageObjectLookupurl - absolute or relative url of searched image
LookupException - if image was not found
java.lang.IllegalArgumentException - if url is null, or url is relative and current base URL is null.
public Image[] images()
throws LookupException
PageObjectLookup
images in interface PageObjectLookupLookupExceptionpublic void assertTitleEquals(java.lang.String expectedTitle)
PageAssert
assertTitleEquals in interface PageAssertexpectedTitle - title being expected on a pagepublic void assertTextPresent(java.lang.String expectedText)
PageAssert
assertTextPresent in interface PageAssertexpectedText - text being expected on a page (within body element)public void assertTextNotPresent(java.lang.String notExpectedText)
PageAssert
assertTextNotPresent in interface PageAssertnotExpectedText - text NOT being expected on a page (within body element)public void assertLinkWithTextPresent(java.lang.String textInLink)
PageAssert
assertLinkWithTextPresent in interface PageAsserttextInLink - text searched link must havepublic void assertLinkWithTextNotPresent(java.lang.String textInLink)
PageAssert
assertLinkWithTextNotPresent in interface PageAsserttextInLink - text to search in linkpublic void assertImageWithURLPresent(java.lang.String imageURL)
PageAssertImage location will be calculated from location of the current page and value specified in image src attribute (if src contains servlet session id - it will be ignored).
assertImageWithURLPresent in interface PageAssertimageURL - absolute or relative url of searched imagepublic void assertImageWithURLNotPresent(java.lang.String imageURL)
PageAssertImage location will be calculated from location of the current page and value specified in image src attribute (if src contains servlet session id - it will be ignored).
assertImageWithURLNotPresent in interface PageAssertimageURL - absolute or relative url of searched imagepublic void expectAnyAlert()
UserDialogExpect
expectAnyAlert in interface UserDialogExpectpublic void expectAlert(java.lang.String expectedText)
UserDialogExpectText shown in alert will be normalized before comparing with expectedText argument.
expectAlert in interface UserDialogExpectexpectedText - text an alert must have
public void expectAlert(AlertAssert alertAssert,
java.lang.String expectedAlertDescription)
UserDialogExpect
expectAlert in interface UserDialogExpectalertAssert - custom alert assertion implementation making actual assertion.expectedAlertDescription - Description for an expected alert dialog. This description is shown in logs in case when the expected dialog didn't occur.public void expectAnyConfirm(int whatToPress)
UserDialogExpect
expectAnyConfirm in interface UserDialogExpectwhatToPress - button to press in confirm: either UserDialogExpect.PRESS_OK or UserDialogExpect.PRESS_CANCEL constant must be used.
public void expectConfirm(java.lang.String expectedText,
int whatToPress)
UserDialogExpect
expectConfirm in interface UserDialogExpectexpectedText - text a confirm must havewhatToPress - button to press in confirm: either UserDialogExpect.PRESS_OK or UserDialogExpect.PRESS_CANCEL constant must be used.
public void expectConfirm(ConfirmAssert confirmAssert,
java.lang.String expectedConfirmDescription,
int whatToPress)
UserDialogExpect
expectConfirm in interface UserDialogExpectconfirmAssert - custom confirmation assertion implementation making actual assertionexpectedConfirmDescription - Description for an expected confirmation dialog. This description is shown in logs in case when the expected dialog didn't occur.whatToPress - button to press in confirm: either UserDialogExpect.PRESS_OK or UserDialogExpect.PRESS_CANCEL constant must be used.public void expectAnyPrompt(java.lang.String newValue)
UserDialogExpect
expectAnyPrompt in interface UserDialogExpectnewValue - value to specify in prompt, if null then prompt will be cancelled
public void expectPromptWithText(java.lang.String expectedText,
java.lang.String newValue)
UserDialogExpect
expectPromptWithText in interface UserDialogExpectexpectedText - text a prompt must havenewValue - value to specify in prompt, if null then prompt will be cancelled
public void expectPromptWithTextAndValue(java.lang.String expectedText,
java.lang.String expectedValue,
java.lang.String newValue)
UserDialogExpect
expectPromptWithTextAndValue in interface UserDialogExpectexpectedText - text a prompt must haveexpectedValue - initial value a prompt must havenewValue - value to specify in prompt, if null then prompt will be cancelled
public void expectPrompt(PromptAssert promptAssert,
java.lang.String expectedPromptdescription,
java.lang.String newValue)
UserDialogExpect
expectPrompt in interface UserDialogExpectpromptAssert - custom prompt assertion implementation making actual assertionexpectedPromptdescription - Description for an expected prompt dialog. This description is shown in logs in case when the expected dialog didn't occur.newValue - value to specify in prompt, if null then prompt will be cancelledpublic void disableJavaScript(boolean deferred)
ActiwateSession
disableJavaScript in interface ActiwateSessiondeferred - if false then JavaScript will be disabled immediately.
If true then JavaScript support will be disabled only after loading of a new HTML page
in this session, no matter in which window or frame.ActiwateSession.enableJavaScript(),
ActiwateSession.isJavaScriptAutoRunningEnabled(),
Action.executeJavaScript(java.lang.String),
Action.executeJavaScript(java.lang.String, org.w3c.dom.html.HTMLElement),
Action.executeJavaScript(java.lang.String),
Action.executeJavaScript(java.lang.String, org.w3c.dom.html.HTMLElement)public void enableJavaScript()
ActiwateSession
enableJavaScript in interface ActiwateSessionActiwateSession.disableJavaScript(boolean),
ActiwateSession.isJavaScriptAutoRunningEnabled()public boolean isJavaScriptAutoRunningEnabled()
ActiwateSession
isJavaScriptAutoRunningEnabled in interface ActiwateSessionActiwateSession.enableJavaScript(),
ActiwateSession.disableJavaScript(boolean)public java.lang.Object executeJavaScript(java.lang.String script)
Action
executeJavaScript in interface Actionscript - JavaScript code to execute.
public java.lang.Object executeJavaScript(java.lang.String script,
org.w3c.dom.html.HTMLElement element)
Action
executeJavaScript in interface Actionscript - JavaScript code to execute.element - scope of script execution.
public void runPageScripts()
Action
runPageScripts in interface Action
public void back()
throws HistoryExhaustedException,
PageExpiredException
Action
back in interface ActionHistoryExhaustedException - if there is no entries for the back operation in the history
PageExpiredException - if a previous request was a POST request
public void forward()
throws HistoryExhaustedException,
PageExpiredException
Action
forward in interface ActionHistoryExhaustedException - if there is no entries for the forward operation in the history
PageExpiredException - if a previous request was a POST request
public void reload()
throws PageExpiredException
Action
reload in interface ActionPageExpiredException - if the current page is a result of a POST request
public void goTo(HttpRequest request)
throws java.lang.UnsupportedOperationException
Action
goTo in interface Actionrequest - request to send
java.lang.UnsupportedOperationException - if this method is called for frame or iframe.public void shiftTime(long milliseconds)
ActiwateSession
shiftTime in interface ActiwateSessionmilliseconds - time to shift current time for (in milliseconds)public AsyncEvents getAsyncEvents()
ActiwateSessionAsyncEvents class containing all sheduled but not executed async events.
AsyncEvent.
getAsyncEvents in interface ActiwateSessionAsyncEvents class containing all sheduled but not executed async events.public boolean getExecAsyncEventsAutomatically()
ActiwateSessionActiwateSession.setExecAsyncEventsAutomatically(boolean).
getExecAsyncEventsAutomatically in interface ActiwateSessionActiwateSession.setExecAsyncEventsAutomatically(boolean).public void setExecAsyncEventsAutomatically(boolean auto)
ActiwateSessionauto=true -
Browser will execute async events automatically.
After each user action browser will execute all async tasks with offset less or equal to the value
specified in ActiwateSession.setExecAsyncEventsOffset(long).
auto=false -
Browser won't execute async events until one of
AsyncEvents.executeNextEvent(),
AsyncEvents.executeByTimeOffset(long),
AsyncEvents.executeAllUntilEmpty(),
AsyncEvents.executeTillLatestEventOffset()
methods is called.
setExecAsyncEventsAutomatically in interface ActiwateSessionauto - see abovepublic XmlHttpRequestConfig getXmlHttpRequestConfig()
ActiwateSession
getXmlHttpRequestConfig in interface ActiwateSessionpublic long getExecAsyncEventsOffset()
ActiwateSessionActiwateSession.setExecAsyncEventsOffset(long).
getExecAsyncEventsOffset in interface ActiwateSessionActiwateSession.setExecAsyncEventsOffset(long).public void setExecAsyncEventsOffset(long offsetMillis)
ActiwateSession
setExecAsyncEventsOffset in interface ActiwateSessionoffsetMillis - offset for automatic async events execution.ActiwateSession.setExecAsyncEventsAutomatically(boolean)public void setXmlHttpRequestConfig(XmlHttpRequestConfig xmlHttpRequestConfig)
ActiwateSession
setXmlHttpRequestConfig in interface ActiwateSessionxmlHttpRequestConfig - configuration for XmlHttpRequest async events.public void setAutoExecMetaRefreshes(boolean enabled)
enabled=true -
Browser will process Meta-refreshes automatically
(without necessity of calling shiftTime(long) method).
In this case Meta's timeout specified on a page doesn't make sence -
a refresh is executed immediately.
enabled=false -
Browser won't process Meta-refreshes until shiftTime(long) method
is called.
setAutoExecMetaRefreshes in interface ActiwateSessionenabled - see abovepublic boolean getAutoExecMetaRefreshes()
setAutoExecMetaRefreshes(boolean) method.
getAutoExecMetaRefreshes in interface ActiwateSessionsetAutoExecMetaRefreshes(boolean) method.public void setConnectTimeout(int seconds)
ActiwateSession
setConnectTimeout in interface ActiwateSessionseconds - Timeout value in secondspublic void setDataTimeout(int seconds)
ActiwateSession
setDataTimeout in interface ActiwateSessionseconds - Timeout value in secondsprotected void tearDown()
public void verifyUserDialogs()
UserDialogExpect
verifyUserDialogs in interface UserDialogExpectpublic Page page()
ActiwateSession
page in interface ActiwateSessionpublic ImageMap imageMap(java.lang.String nameOrId)
PageObjectLookup
imageMap in interface PageObjectLookupnameOrId - name or id attribute value
public ImageMap imageMap(int idx)
PageObjectLookup
imageMap in interface PageObjectLookupidx - index of map among other maps on a page, starting from zero.
public ImageMap[] imageMaps()
PageObjectLookup
imageMaps in interface PageObjectLookuppublic static void debug(java.lang.String message)
message - public static void info(java.lang.String message)
message - public static void warn(java.lang.String message)
message - public static void error(java.lang.String message)
message - public static void fatal(java.lang.String message)
message - public java.lang.String getTestCaseName()
getTestCaseName in interface com.actimind.actiwate.testing.logging.TestRunInfopublic java.lang.String getTestMethodName()
getTestMethodName in interface com.actimind.actiwate.testing.logging.TestRunInfopublic java.util.Date getTestStartTimestamp()
getTestStartTimestamp in interface com.actimind.actiwate.testing.logging.TestRunInfopublic void setFailureReporter(com.actimind.actiwate.testing.logging.log4j.FailureReporter failureReporter)
setFailureReporter in interface com.actimind.actiwate.testing.logging.TestRunInfopublic com.actimind.actiwate.testing.logging.log4j.FailureReporter getFailureReporter()
getFailureReporter in interface com.actimind.actiwate.testing.logging.TestRunInfo
public void runBare()
throws java.lang.Throwable
java.lang.Throwable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||