public class FitnesseMarkup extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_VALUE_SEPARATOR
Constant representing type separator [type]=[value]
|
static String |
OFF_VALUE
off value constant, see
booleanToOnOrOff(Object) |
static String |
ON_VALUE
on value constant, see
booleanToOnOrOff(Object) |
static String |
SELECTOR_ATTRIBUTE_SEPARATOR
Constants representing selector separators [selector]@[atributte]$[value]
|
static String |
SELECTOR_VALUE_DENY_INDICATOR
Constant representing the negation flag in
SELECTOR_VALUE_SEPARATOR |
static String |
SELECTOR_VALUE_SEPARATOR
Constant representing the value separator in selector [selector]@[atributte]->[value]
|
| Constructor and Description |
|---|
FitnesseMarkup() |
| Modifier and Type | Method and Description |
|---|---|
String |
booleanToOnOrOff(Object value)
|
String |
clean(Object symbol)
Cleans FitNesse markup from symbols such as:
Extracts a keyboard special key value from special key markup.
|
org.apache.commons.lang3.tuple.Pair<String,String> |
cleanAndParseKeyValue(Object value,
String separator)
Cleans and split the value in [key][separator][value] format.
|
File |
cleanFile(Object... value) |
boolean |
compare(Object expected,
Object obtained)
Compares two values emulating FitNesse comparisons:
|
String |
exceptionMessage(Object originalMessage,
String screenshotData,
Object... args)
Produces a custom SLIM response containing the original exception message along with a screenshot, probably taken when the exception occured.
|
String |
formatWidthAndHeight(Object width,
Object height) |
String |
imgLink(Object img)
Creates img markup to be viewed in test page.
|
String |
imgLinkFromExceptionMessage(String exceptionMessage)
Creates img markup to be viewed in test page.
|
boolean |
onOrOffToBoolean(Object value)
|
org.apache.commons.lang3.tuple.Pair<Integer,Integer> |
parseWidthAndHeight(String widthAndHeight) |
void |
registerKeyboardSpecialKey(String keyName,
String keyValue)
Registers a system property (
System.setProperty(String, String)) allowing user to develop tests referencing special keys such as tab and enter by using variables. |
org.apache.commons.lang3.tuple.Pair<String,String> |
swapValueToCheck(String stringWithValue,
String stringToGetValue) |
public static final String SELECTOR_VALUE_SEPARATOR
public static final String SELECTOR_VALUE_DENY_INDICATOR
SELECTOR_VALUE_SEPARATORpublic static final String SELECTOR_ATTRIBUTE_SEPARATOR
public static final String KEY_VALUE_SEPARATOR
public static final String ON_VALUE
booleanToOnOrOff(Object)public static final String OFF_VALUE
booleanToOnOrOff(Object)public boolean compare(Object expected, Object obtained)
http://fitnesse.org/FitNesse.FullReferenceGuide.UserGuide.WritingAcceptanceTests.SliM.ValueComparisons
For now supports only exact equal and regular expression comparisonsexpected - valueobtained - valuepublic String clean(Object symbol)
symbol - to be cleanedpublic String imgLink(Object img)
img - File containing the imagepublic String imgLinkFromExceptionMessage(String exceptionMessage)
exceptionMessage(Object, String, Object...)exceptionMessage - to be parsedpublic void registerKeyboardSpecialKey(String keyName, String keyValue)
System.setProperty(String, String)) allowing user to develop tests referencing special keys such as tab and enter by using variables. For example:
If keyName="tab" and keyValue="" then ${KEY_TAB} will resolve to "<span keycode="">tab</span>"
keyName - Special keyboard key namekeyValue - Special keyboard key valuepublic org.apache.commons.lang3.tuple.Pair<String,String> swapValueToCheck(String stringWithValue, String stringToGetValue)
public File cleanFile(Object... value)
value - file path partspublic org.apache.commons.lang3.tuple.Pair<String,String> cleanAndParseKeyValue(Object value, String separator)
value - to parse, should be in [key][separator][value]separator - to be usedPair containing key and valuepublic boolean onOrOffToBoolean(Object value)
value - to be convertedON_VALUE, false otherwisepublic String formatWidthAndHeight(Object width, Object height)
width - Numeric value representing a width valueheight - Numeric value representing a height valuepublic org.apache.commons.lang3.tuple.Pair<Integer,Integer> parseWidthAndHeight(String widthAndHeight)
widthAndHeight - String containing width and height, separated by WIDTH_HEIGHT_SEPARATOR. Example: 1920x1080, 1280x720.Pair containing width in Pair.getLeft() and height in Pair.getRight()public String exceptionMessage(Object originalMessage, String screenshotData, Object... args)
originalMessage - message taken from the exceptionscreenshotData - screenshot data in base64 formatargs - extra arguments to be interpolated in Format.format(Object)Copyright © 2018. All rights reserved.