org.aludratest.service.gui.component.impl
Class FileFieldImpl

java.lang.Object
  extended by org.aludratest.service.gui.component.impl.AbstractGUIComponent
      extended by org.aludratest.service.gui.component.impl.AbstractElement<FileField>
          extended by org.aludratest.service.gui.component.impl.FileFieldImpl
All Implemented Interfaces:
Element<FileField>, FileField, GUIComponent, ValueComponent

public class FileFieldImpl
extends AbstractElement<FileField>
implements ValueComponent, FileField

Default implementation of the FileField interface.


Field Summary
 
Fields inherited from class org.aludratest.service.gui.component.impl.AbstractElement
taskCompletionTimeout
 
Fields inherited from class org.aludratest.service.gui.component.impl.AbstractGUIComponent
aludraGui, elementName, elementType, locator
 
Constructor Summary
FileFieldImpl()
           
 
Method Summary
 void assertTextContains(String expectedText)
          Verifies that this component's text contains the expected text.
 void assertTextContainsIgnoreCaseTrimmed(String expectedText)
          Verifies that this component's text contains the expected text.
 void assertTextEquals(String expectedText)
          Verifies that this component has the expected text.
 void assertTextEqualsIgnoreCaseTrimmed(String expectedText)
          Verifies that this component's text equals the expected text.
 void assertTextMatches(org.databene.commons.Validator<String> validator)
          Asserts that this component's text matches the provided Validator.
 void assertTextNotEquals(String expectedText)
          Verifies that this component does not have the expected text.
 void assertValueGreaterThan(String value)
          Verifies that this component's text (interpreted as numeric value) is greater than the specified value (which will be interpreted as numeric value as well).
 void assertValueLessThan(String value)
          Verifies that this component's text (interpreted as numeric value) is lower than the specified value (which will be interpreted as numeric value as well).
 String getText()
          Reads the value of this component and returns it as a String without conversion/manipulation.
 void setResourceNameAndContent(String fileName, InputStream in)
          Saves the InputStream's content in a new file with the given name.
 
Methods inherited from class org.aludratest.service.gui.component.impl.AbstractElement
assertEnabled, assertFocus, assertNotEnabled, assertNotPresent, assertPresent, assertVisible, click, click, doubleClick, focus, getLocator, isEnabled, isEnabled, isNotPresent, isNotPresent, isPresent, isPresent, isPresentAndInForeground, isVisible, isVisible, waitingUntilTaskCompletion, waitingUntilTaskCompletion
 
Methods inherited from class org.aludratest.service.gui.component.impl.AbstractGUIComponent
check, configure, perform, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aludratest.service.gui.component.Element
assertEnabled, assertFocus, assertNotEnabled, assertNotPresent, assertPresent, assertVisible, click, click, doubleClick, focus, getLocator, isEnabled, isEnabled, isNotPresent, isNotPresent, isPresent, isPresent, isPresentAndInForeground, isVisible, isVisible, waitingUntilTaskCompletion, waitingUntilTaskCompletion
 

Constructor Detail

FileFieldImpl

public FileFieldImpl()
Method Detail

setResourceNameAndContent

public void setResourceNameAndContent(String fileName,
                                      InputStream in)
Saves the InputStream's content in a new file with the given name.

Specified by:
setResourceNameAndContent in interface FileField
Parameters:
fileName - the name by which to save the file
in - the provider of the file content to save

getText

public String getText()
Description copied from interface: ValueComponent
Reads the value of this component and returns it as a String without conversion/manipulation.

Specified by:
getText in interface ValueComponent
Returns:
the text content of this component.

assertTextEquals

public void assertTextEquals(String expectedText)
Description copied from interface: ValueComponent
Verifies that this component has the expected text. If the text parameter is null or marked as null, the operation will not be executed. If the text parameter is marked as empty, it will be replaced with "" before verification.

Specified by:
assertTextEquals in interface ValueComponent
Parameters:
expectedText - Text to compare this component's text against.

assertTextNotEquals

public void assertTextNotEquals(String expectedText)
Description copied from interface: ValueComponent
Verifies that this component does not have the expected text. If the text parameter is null or marked as null, the operation will not be executed. If the text parameter is marked as empty, it will be replaced with "" before verification.

Specified by:
assertTextNotEquals in interface ValueComponent
Parameters:
expectedText - Text to compare this component's text against.

assertTextContains

public void assertTextContains(String expectedText)
Description copied from interface: ValueComponent
Verifies that this component's text contains the expected text. If the text parameter is null or marked as null, the operation will not be executed. before verification.

Specified by:
assertTextContains in interface ValueComponent
Parameters:
expectedText - Text to search in this component's text.

assertTextContainsIgnoreCaseTrimmed

public void assertTextContainsIgnoreCaseTrimmed(String expectedText)
Description copied from interface: ValueComponent
Verifies that this component's text contains the expected text. It trims both strings and ignores the case. If the text parameter is null or marked as null, the operation will not be executed.

Specified by:
assertTextContainsIgnoreCaseTrimmed in interface ValueComponent
Parameters:
expectedText - Text to search in this component's text.

assertTextEqualsIgnoreCaseTrimmed

public void assertTextEqualsIgnoreCaseTrimmed(String expectedText)
Description copied from interface: ValueComponent
Verifies that this component's text equals the expected text. It trims both strings and ignores the case. If the text parameter is null or marked as null, the operation will not be executed.

Specified by:
assertTextEqualsIgnoreCaseTrimmed in interface ValueComponent
Parameters:
expectedText - Text to compare this component's text against.

assertTextMatches

public void assertTextMatches(org.databene.commons.Validator<String> validator)
Description copied from interface: ValueComponent
Asserts that this component's text matches the provided Validator.

Specified by:
assertTextMatches in interface ValueComponent
Parameters:
validator - the validator to apply for text verification.

assertValueGreaterThan

public void assertValueGreaterThan(String value)
Description copied from interface: ValueComponent
Verifies that this component's text (interpreted as numeric value) is greater than the specified value (which will be interpreted as numeric value as well). If the parameter is null or marked as null, the operation will not be executed.

Specified by:
assertValueGreaterThan in interface ValueComponent
Parameters:
value - Value to interpret as numeric value and to compare the component's text (as numeric value) against.

assertValueLessThan

public void assertValueLessThan(String value)
Description copied from interface: ValueComponent
Verifies that this component's text (interpreted as numeric value) is lower than the specified value (which will be interpreted as numeric value as well). If the parameter is null or marked as null, the operation will not be executed.

Specified by:
assertValueLessThan in interface ValueComponent
Parameters:
value - Value to interpret as numeric value and to compare the component's text (as numeric value) against.


Copyright © 2015 aludratest.org. All rights reserved.