Package net.sf.sahi.client

Examples of net.sf.sahi.client.ElementStub


    element.choose( descriptor.getValue() );
  }

  @Override
  public void verify( ElementDescriptor descriptor, boolean expectedOutcome ) {
    ElementStub element = find( descriptor );
    assertEquals( expectedOutcome,
                  matcher.equals( element.getValue(), descriptor.getValue() ) || matcher.equals(
                      element.getSelectedText(), descriptor.getValue() )
    );
  }
View Full Code Here


    return StringUtils.equalsIgnoreCase( descriptor.getType(), TYPE );
  }

  protected final boolean isMultipleSelect( ElementDescriptor descriptor ){
    if( isSelect( descriptor )) {
      ElementStub element = find( descriptor );
      if ( element.exists() ) {
        return BooleanUtils.toBoolean( element.getAttribute( "multiple" ) );
      }
    }
    return false;
  }
View Full Code Here

  @When("^i fill in the following in " + StandardSahiSteps.ELEMENT_REGEX + ":$")
  public void i_fill_in_the_following_in_parent( String parentType,
                                                 String parentLocator,
                                                 Integer parentPosition,
                                                 List<ElementDescriptor> entries ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );
    for ( ElementDescriptor formElement : entries ) {
      formElement.setParent( parent );
      elementHandleService.set( formElement );
    }
  }
View Full Code Here

    element_in_parent_element_is_not_visible( type, locator, position, parentType, parentLocator, parentPosition );
  }

  @And("^i (?:should|do) not see " + StandardSahiSteps.ELEMENT_REGEX + "$")
  public void i_should_not_see_specific( String type, String locator, Integer position ) throws Throwable {
    ElementStub stub = find( type, locator, position );
    assertFalse( isVisible( stub ) );
  }
View Full Code Here

  @When("^the following (?:elements|fields) in " + StandardSahiSteps.ELEMENT_REGEX + " (?:should exist|exist):$")
  public void the_following_elements_in_parent_exist( String parentType,
                                                      String parentLocator,
                                                      Integer parentPosition,
                                                      List<ElementDescriptor> descriptors ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );
    for ( ElementDescriptor descriptor : descriptors ) {
      descriptor.setParent( parent );
      assertTrue( "Does not exist: " + descriptor.toString(), exists( elementHandleService.find( descriptor ) ) );
    }
  }
View Full Code Here

  @When("^the following (?:elements|fields) in " + StandardSahiSteps.ELEMENT_REGEX + " (?:are|should be) visible:$")
  public void the_following_elements_in_parent_are_visible( String parentType,
                                                            String parentLocator,
                                                            Integer parentPosition,
                                                            List<ElementDescriptor> descriptors ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );
    for ( ElementDescriptor descriptor : descriptors ) {
      descriptor.setParent( parent );
      assertTrue( "Not visible: " + descriptor.toString(), isVisible( elementHandleService.find( descriptor ) ) );
    }
  }
View Full Code Here

  @When("^the following (?:elements|fields) in " + StandardSahiSteps.ELEMENT_REGEX + " (?:do not|should not) exist:$")
  public void the_following_elements_in_parent_do_not_exist( String parentType,
                                                             String parentLocator,
                                                             Integer parentPosition,
                                                             List<ElementDescriptor> descriptors ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );
    if ( exists( parent ) ) {
      for ( ElementDescriptor descriptor : descriptors ) {
        descriptor.setParent( parent );
        assertFalse( "Exists: " + descriptor.toString(), exists( elementHandleService.find( descriptor ) ) );
      }
View Full Code Here

  @When("^the following (?:elements|fields) in " + StandardSahiSteps.ELEMENT_REGEX + " (?:are not|should not be) visible:$")
  public void the_following_elements_in_parent_are_not_visible( String parentType,
                                                                String parentLocator,
                                                                Integer parentPosition,
                                                                List<ElementDescriptor> descriptors ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );
    if ( parent != null && parent.exists() ) {
      for ( ElementDescriptor descriptor : descriptors ) {
        descriptor.setParent( parent );
        assertFalse( "Visible: " + descriptor.toString(),
                     isVisible( elementHandleService.find( descriptor ) ) );
      }
View Full Code Here

    assertTrue( isVisible( find( type, locator, position, find( parentType, parentLocator, parentPosition ) ) ) );
  }

  @And("^" + StandardSahiSteps.ELEMENT_REGEX + " (?:exists|should exist)$")
  public void element_does__exist( String type, String locator, Integer position ) throws Throwable {
    ElementStub stub = find( type, locator, position );
    assertTrue( exists( stub ) );
  }
View Full Code Here

                                                        String locator,
                                                        Integer position,
                                                        String parentType,
                                                        String parentLocator,
                                                        Integer parentPosition ) throws Throwable {
    ElementStub parent = find( parentType, parentLocator, parentPosition );

    if ( exists( parent ) ) {
      ElementStub stub = find( type, locator, position, parent );
      assertFalse( exists( stub ) );
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.sahi.client.ElementStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.