org.specrunner.webdriver.assertions
Class PluginCheckAtt

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.AbstractPluginNamed
              extended by org.specrunner.plugins.core.AbstractPluginScoped
                  extended by org.specrunner.plugins.core.AbstractPluginValue
                      extended by org.specrunner.webdriver.AbstractPluginBrowserAware
                          extended by org.specrunner.webdriver.AbstractPluginFind
                              extended by org.specrunner.webdriver.AbstractPluginFindSingle
                                  extended by org.specrunner.webdriver.assertions.PluginCheckAtt
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin

public class PluginCheckAtt
extends AbstractPluginFindSingle

Check if a given attribute element contains a text.

Author:
Thiago Santos

Field Summary
 
Fields inherited from class org.specrunner.webdriver.AbstractPluginFindSingle
index
 
Fields inherited from class org.specrunner.webdriver.AbstractPluginFind
FEATURE_FINDER_INSTANCE, FEATURE_FINDER_TYPE, finder, finderInstance
 
Fields inherited from class org.specrunner.webdriver.AbstractPluginBrowserAware
FEATURE_DIR, FEATURE_INTERVAL, FEATURE_MAXWAIT, FEATURE_TIMEOUT, FEATURE_WAITFOR
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_WAIT
 
Constructor Summary
PluginCheckAtt()
           
 
Method Summary
 ActionType getActionType()
           
 String getAttribute()
          Gets the attribute.
protected  String getMessage(IContext context, Object value)
          The error message.
protected  void process(IContext context, IResultSet result, org.openqa.selenium.WebDriver client, org.openqa.selenium.WebElement element)
          Method delegation which receives the selected element to be used by subclasses.
 void setAttribute(String attribute)
          The attribute value.
protected  boolean test(Object attValue, Object value)
          The testing condition.
 
Methods inherited from class org.specrunner.webdriver.AbstractPluginFindSingle
getIndex, process, setIndex
 
Methods inherited from class org.specrunner.webdriver.AbstractPluginFind
asString, doEnd, getFinder, getFinderInstance, getFinderInstance, getText, initialize, setFinder, setFinderInstance
 
Methods inherited from class org.specrunner.webdriver.AbstractPluginBrowserAware
doEnd, getBrowserName, getDir, getDownload, getInterval, getMaxwait, getWaitCondition, getWaitfor, isWaitForClient, setDir, setDownload, setInterval, setMaxwait, setWaitfor, waitForClient
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginValue
getValue, getValue, isEval, setEval, setValue
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginScoped
getScope, saveGlobal, saveLocal, saveStrict, setScope
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginNamed
getName, setName
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, doStart, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString
 
Methods inherited from class org.specrunner.parameters.core.ParameterHolder
getParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.parameters.IParameterHolder
getParameters, setParameters
 

Constructor Detail

PluginCheckAtt

public PluginCheckAtt()
Method Detail

getActionType

public ActionType getActionType()

getAttribute

public String getAttribute()
Gets the attribute.

Returns:
The attribute.

setAttribute

public void setAttribute(String attribute)
The attribute value.

Parameters:
attribute - The value.

process

protected void process(IContext context,
                       IResultSet result,
                       org.openqa.selenium.WebDriver client,
                       org.openqa.selenium.WebElement element)
                throws PluginException
Description copied from class: AbstractPluginFindSingle
Method delegation which receives the selected element to be used by subclasses.

Specified by:
process in class AbstractPluginFindSingle
Parameters:
context - The test context.
result - A result set.
client - The browser.
element - The selected element.
Throws:
PluginException - On execution errors.

test

protected boolean test(Object attValue,
                       Object value)
The testing condition.

Parameters:
attValue - The attribute returned value.
value - The value that must be part of attribute value.
Returns:
true, is attValue contains value.

getMessage

protected String getMessage(IContext context,
                            Object value)
                     throws PluginException
The error message.

Parameters:
context - The context.
value - The value.
Returns:
The message.
Throws:
PluginException - On finder resume error.


Copyright © 2013. All rights reserved.