|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.jelly.TagSupport net.sf.jameleon.LocationAwareTagSupport net.sf.jameleon.JameleonTagSupport net.sf.jameleon.function.FunctionTag net.sf.jameleon.plugin.httpunit.HttpUnitFunctionTag net.sf.jameleon.plugin.httpunit.HtmlPageValidation
public class HtmlPageValidation
Generic page validation for page title, text, and links. This validator does not use
the setDefaultVariableValue method because this same tag is likely to be used multiple times
in the same test case. This means that the attributes defined in the test case will override
any variables predefined in the csv file.
NOTE: This tag uses the context. Normally this is okay, but for generic tags the context
should not be used as it limits the user as to what variables they can use. Generic tags should
be easy to extend in such a way that they can easily become data-driven.
Field Summary | |
---|---|
protected String |
formNameOrId
Sets the form name or id for which the form parameters will be compared against. |
protected List |
imagesNotPresent
Image that shouldn't be present |
protected List |
imagesPresent
Image that needs to be present |
protected List |
linksNotPresent
Link that shouldn't be in the response. |
protected List |
linksPresent
Link that should be in the response. |
protected boolean |
stripHtmlComments
Whether to strip HTML comments or not for textPresent and textNotPresent |
protected List |
textNotPresent
Text that shouldn't be in the response. |
protected List |
textPresent
Text that should be in the response. |
protected String |
title
Title of the page need to be validated. |
protected String |
titleContains
Text to be contained in the title. |
protected boolean |
trimWhitespace
Whether leading and trailing whitespace should be trimmed from the title on the page before comparing.. |
protected boolean |
validateImageResource
If set to true validate the image, or images, refer to an existing resource. |
protected boolean |
validateLinkResource
If set to true validate the link, or links, point to an existing resource. |
protected boolean |
validationOccured
|
Fields inherited from class net.sf.jameleon.plugin.httpunit.HttpUnitFunctionTag |
---|
currentPage, httpUnitFrameName, listener, requestTime, session |
Fields inherited from class net.sf.jameleon.function.FunctionTag |
---|
addt, breakPoint, expectException, expectFailure, fResults, functionDelay, functionId, lastFileWritten, log, NO_DELAY, params, postcondition, precondition, st, state, tct, vpt |
Fields inherited from class net.sf.jameleon.JameleonTagSupport |
---|
attributes, broker, contextVars, fp, unsupportedAttributes |
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport |
---|
columnNumber, elementTagName, lineNumber, scriptFileName |
Fields inherited from class org.apache.commons.jelly.TagSupport |
---|
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary | |
---|---|
HtmlPageValidation()
|
Method Summary | |
---|---|
protected void |
assertResourceValid(String resourceType,
WebRequest request)
|
void |
setup()
|
void |
tearDown()
|
void |
testBlock()
|
protected void |
validateFormTypes()
|
protected void |
validateImagesNotPresent()
|
protected void |
validateImagesPresent()
|
protected void |
validateLinksNotPresent()
|
protected void |
validateLinksPresent()
|
protected void |
validateTextNotPresent()
|
protected void |
validateTextPresent()
|
Methods inherited from class net.sf.jameleon.JameleonTagSupport |
---|
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught |
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport |
---|
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber |
Methods inherited from class org.apache.commons.jelly.TagSupport |
---|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.jelly.Tag |
---|
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent |
Field Detail |
---|
protected String title
protected String titleContains
protected boolean trimWhitespace
protected List textPresent
protected List textNotPresent
protected List imagesPresent
protected List imagesNotPresent
protected boolean validateImageResource
protected List linksNotPresent
protected List linksPresent
protected boolean validateLinkResource
protected boolean stripHtmlComments
protected String formNameOrId
protected boolean validationOccured
Constructor Detail |
---|
public HtmlPageValidation()
Method Detail |
---|
public void testBlock()
testBlock
in class FunctionTag
public void setup()
setup
in class FunctionTag
protected void validateTextPresent()
protected void validateTextNotPresent()
protected void validateLinksNotPresent()
protected void validateImagesNotPresent()
protected void validateImagesPresent()
protected void validateLinksPresent()
protected void assertResourceValid(String resourceType, WebRequest request)
protected void validateFormTypes()
public void tearDown()
tearDown
in class FunctionTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |