org.aludratest.service.gui
Interface GUIVerification

All Superinterfaces:
Action, Verification
All Known Subinterfaces:
WebGUIVerification
All Known Implementing Classes:
Selenium1Verification, Selenium2Verification

public interface GUIVerification
extends Verification

The interface Verification provides several methods to verify values in the active screen of the application under test. Every class which implements this interface must assure that a call of one of these methods verifies the expected value with the current in the application under test.
Methods with locators accept two types of locators.

  1. The first type is a by the caller typed locator.
  2. The second type is just a String which will be automatically transformed into the default locator. In which locator the String will be transformed depends on the implementation of each method of this interface.
For interactions with the application under test see Interaction.

Author:
Marcel Malitz, Volker Bergmann

Method Summary
 void assertChecked(String elementType, String elementName, boolean expected, GUIElementLocator locator)
          Verifies for an element identified by a locator that its checked status (e.g. radio buttons or checkboxes) matches the given expected state.
 void assertChecked(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that is is checked (e.g. radio buttons or checkboxes).
 void assertContainsLabels(String elementType, String elementName, GUIElementLocator locator, String[] labels)
          Verifies for an element identified by a locator (usually a dropdownbox) that it contains the given labels (and possibly more).
 void assertDropDownEntrySelectionMatches(String elementType, String elementName, GUIElementLocator locator, org.databene.commons.Validator<String> validator)
          Verifies for a dropdownbox identified by a locator that its selection matches the given Validator.
 void assertEditable(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is editable.
 void assertElementNotPresent(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is not present in the GUI (not either visible nor invisible).
 void assertElementPresent(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is present in the GUI (maybe visible or invisible).
 void assertEnabled(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is enabled, i.e. not disabled.
 void assertHasFocus(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it has the input focus.
 void assertHasLabels(String elementType, String elementName, GUIElementLocator locator, String[] expectedLabels)
          Verifies for an element identified by a locator (usually a dropdownbox) that it has the given labels (and only these).
 void assertHasValues(String elementType, String elementName, GUIElementLocator locator, String[] expectedValues)
          Verifies for an element identified by a locator (usually a dropdownbox) that it has the given values (and only these).
 void assertNotEditable(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is not editable.
 void assertNotEnabled(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is not enabled, i.e. disabled.
 void assertTextMatches(String elementType, String elementName, GUIElementLocator locator, org.databene.commons.Validator<String> validator)
          Verifies that one specific GUI element exhibits a text that matches a Validator.
 void assertValueMatches(String elementType, String elementName, GUIElementLocator locator, org.databene.commons.Validator<String> validator)
          Verifies for an input element identified by a locator (usually an input field, a button, or similar) that its value matches the given Validator.
 void assertVisible(String elementType, String elementName, GUIElementLocator locator)
          Verifies for an element identified by a locator that it is visible.
 
Methods inherited from interface org.aludratest.service.Action
createAttachments, createDebugAttachments, setSystemConnector
 

Method Detail

assertTextMatches

void assertTextMatches(String elementType,
                       String elementName,
                       GUIElementLocator locator,
                       org.databene.commons.Validator<String> validator)
Verifies that one specific GUI element exhibits a text that matches a Validator.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
validator - A Validator that decides if the text is correct

assertVisible

void assertVisible(String elementType,
                   String elementName,
                   GUIElementLocator locator)
Verifies for an element identified by a locator that it is visible. Elements not being visible will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertEditable

void assertEditable(String elementType,
                    String elementName,
                    GUIElementLocator locator)
Verifies for an element identified by a locator that it is editable. Read-only elements will raise an exception which will be handled by the test framework.
Usually, an "editable" state only applies to text input components, which can have a "read-only" state. Other components are always treated as not editable. Use assertEnabled(String, String, GUIElementLocator) to verify the "enabled" state, which applies to most components.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertNotEditable

void assertNotEditable(String elementType,
                       String elementName,
                       GUIElementLocator locator)
Verifies for an element identified by a locator that it is not editable. Editable elements will raise an exception which will be handled by the test framework.
Usually, an "editable" state only applies to text input components, which can have a "read-only" state. Other components are always treated as not editable. Use assertNotEnabled(String, String, GUIElementLocator) to verify the "enabled" state, which applies to most components.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertEnabled

void assertEnabled(String elementType,
                   String elementName,
                   GUIElementLocator locator)
Verifies for an element identified by a locator that it is enabled, i.e. not disabled. The "disabled" state is defined by the GUI implementation, but in most GUIs, disabled components are shown in a somewhat "grayed" state and do not accept any user input.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertNotEnabled

void assertNotEnabled(String elementType,
                      String elementName,
                      GUIElementLocator locator)
Verifies for an element identified by a locator that it is not enabled, i.e. disabled. The "disabled" state is defined by the GUI implementation, but in most GUIs, disabled components are shown in a somewhat "grayed" state and do not accept any user input.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertElementPresent

void assertElementPresent(String elementType,
                          String elementName,
                          GUIElementLocator locator)
Verifies for an element identified by a locator that it is present in the GUI (maybe visible or invisible). Elements not being present will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertChecked

void assertChecked(String elementType,
                   String elementName,
                   GUIElementLocator locator)
Verifies for an element identified by a locator that is is checked (e.g. radio buttons or checkboxes). Elements not being checked will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertChecked

void assertChecked(String elementType,
                   String elementName,
                   boolean expected,
                   GUIElementLocator locator)
Verifies for an element identified by a locator that its checked status (e.g. radio buttons or checkboxes) matches the given expected state. Elements having a checked state different than the expected state will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
expected - The expected checked state (true for checked, false for unchecked)
locator - Locator of the element.

assertHasFocus

void assertHasFocus(String elementType,
                    String elementName,
                    GUIElementLocator locator)
Verifies for an element identified by a locator that it has the input focus. Elements not having the input focus will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertHasValues

void assertHasValues(String elementType,
                     String elementName,
                     GUIElementLocator locator,
                     String[] expectedValues)
Verifies for an element identified by a locator (usually a dropdownbox) that it has the given values (and only these). Elements not having the given values will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
expectedValues - Values which are expexted in the element.

assertHasLabels

void assertHasLabels(String elementType,
                     String elementName,
                     GUIElementLocator locator,
                     String[] expectedLabels)
Verifies for an element identified by a locator (usually a dropdownbox) that it has the given labels (and only these). Elements not having the given labels will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
expectedLabels - Labels which are expexted in the element.

assertValueMatches

void assertValueMatches(String elementType,
                        String elementName,
                        GUIElementLocator locator,
                        org.databene.commons.Validator<String> validator)
Verifies for an input element identified by a locator (usually an input field, a button, or similar) that its value matches the given Validator. Elements with an unmatched value will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
validator - Validator to validate the value of the element.

assertContainsLabels

void assertContainsLabels(String elementType,
                          String elementName,
                          GUIElementLocator locator,
                          String[] labels)
Verifies for an element identified by a locator (usually a dropdownbox) that it contains the given labels (and possibly more). Elements not containing the given labels will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
labels - Labels which are expexted to be contained in the element.

assertElementNotPresent

void assertElementNotPresent(String elementType,
                             String elementName,
                             GUIElementLocator locator)
Verifies for an element identified by a locator that it is not present in the GUI (not either visible nor invisible). Elements being present (visible or invisible) will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.

assertDropDownEntrySelectionMatches

void assertDropDownEntrySelectionMatches(String elementType,
                                         String elementName,
                                         GUIElementLocator locator,
                                         org.databene.commons.Validator<String> validator)
Verifies for a dropdownbox identified by a locator that its selection matches the given Validator. Elements with an unmatching selection will raise an exception which will be handled by the test framework.

Parameters:
elementType - Type of the element, depending on the implementation.
elementName - Name of the element.
locator - Locator of the element.
validator - Validator to validate the selection of the element.


Copyright © 2015 aludratest.org. All rights reserved.