Package org.jboss.jopr.jsfunit.exceptions

Examples of org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException


      // TODO: check the result.

    }
    catch( IOException ex ){
      throw new EmbJoprTestException(ex);
    }

  }
View Full Code Here


      HtmlElement box = tabMenu.getTabContentBox().getElement();
      String xPath = "//td//strong[contains(string(), '"+name+":')]/ancestor::td[1]";
      HtmlElement tableCell = (HtmlElement) box.getFirstByXPath(xPath);
      if( null == tableCell )
        throw new EmbJoprTestException("Value for '"+name+"' not found using XPath: "+xPath);

      String actualValue = tableCell.getLastChild().getTextContent().trim();
      return actualValue;

    }
View Full Code Here

    public TabContentBox getTabContentBox() throws EmbJoprTestException {
     
      HtmlElement contentElement = (HtmlElement) client.getElement("content");
      HtmlElement tabContentBox = (HtmlElement) contentElement.getFirstByXPath("div[@class='tabmenubox']");
      if( null == tabContentBox )
        throw new EmbJoprTestException("Tab content box not found using div[@class='tabmenubox'] XPath");

      return new TabContentBox(tabContentBox);
    }
View Full Code Here

      DomElement element = (DomElement)client.getElement("tabmenu");
      String xPath = "ul/li/span[normalize-space(string())='"+label+"'] | ul/li/a[normalize-space(string())='"+label+"']";
      StyledElement tabContent = element.getFirstByXPath(xPath);

      if( null == tabContent )
        throw new EmbJoprTestException("Tab '"+label+" not found using XPath '"+xPath+"'");

      return tabContent;

    }
View Full Code Here

      //if( !"a".equals( tabContent.getTagName() ) )
      //if( !( tabContent instanceof HtmlAnchor ) )
      //  throw new AssertException("Tab is not an anchor: "+label);

      if( !( tabContent instanceof ClickableElement ) )
        throw new EmbJoprTestException("Tab element <"+tabContent.getTagName()+"> is not clickable: "+label);

      ((ClickableElement)tabContent).click();

    }
View Full Code Here

           nodeArrow.click();
      
           nodeArrow = getNavTreeArrow(nodeName);
           nodeArrow.click();
       } catch (IOException e) {
           throw new EmbJoprTestException("An error occurred when trying " +
                                         "to collapse and then expand the nav tree " +
                                         "arrow for " + nodeName, e);
       }
    }
View Full Code Here

        HtmlDivision contentDiv = (HtmlDivision) client.getElement("content");
        List<?> valueTDs = contentDiv.getByXPath(
                ".//div[@class='tabmenubox']//td[contains(text(),'"+name+"']/following-sibling::td[1]");
        //assertTrue( name + " row not found.", valueTDs.size() == 1 );
        if( valueTDs.size() == 1 )
            throw new EmbJoprTestException( name + " row not found." );
        String value = ((HtmlTableCell) valueTDs).getTextContent();
        return value;
    }
View Full Code Here

     */
    public HtmlElement getContentElement() throws EmbJoprTestException {
        HtmlElement contentElement = (HtmlElement)client.getElement("content");
        //assertNotNull("Content <div> not found.", contentElement);
        if( null == contentElement )
            throw new EmbJoprTestException( "Content <div> not found." );
        return contentElement;
    }
View Full Code Here

    public List<? extends HtmlElement> getElementsByXPath(
            HtmlElement xPathContextElement, String sXPath )
            throws EmbJoprTestException
    {
        if( null == xPathContextElement ){
            throw new EmbJoprTestException("Given XPath context element is null.");
        }

        return (List<? extends HtmlElement>) xPathContextElement.getByXPath(sXPath);
    }
View Full Code Here

    public HtmlElement getFirstElementByXPath( HtmlElement xPathContext, String sXPath )
            throws EmbJoprTestException
    {
      HtmlElement e = findFirstElementByXPath(xPathContext, sXPath);
      if( null == e ){
        throw new EmbJoprTestException("XPath expression found no elements: "+sXPath);
      }
      return e;
    }
View Full Code Here

TOP

Related Classes of org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException

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.