Package org.zkoss.ztl.util

Examples of org.zkoss.ztl.util.ZKSelenium


   * @param locatorOfObjectToBeDragged the draggable UUID
   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the draggable element, which is dropped to.
   */
  public void dragdropTo(String locatorOfObjectToBeDragged, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfObjectToBeDragged, to);
    browser.mouseUpAt(locatorOfObjectToBeDragged, to);
  }
View Full Code Here


   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the droppable element, which is dropped to.
   */
  public void dragdropToObject(String locatorOfObjectToBeDragged,
      String locatorOfDragDestinationObject, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfDragDestinationObject, to);
    browser.mouseUpAt(locatorOfDragDestinationObject, to);
  }
View Full Code Here

  /**
   *
   * @param comparator an image comparator.
   */
  public void verifyImage(Comparator comparator) {
    ZKSelenium zkSelenium = (ZKSelenium) getCurrent();
        String browserName = zkSelenium.getBrowserName();
        ConfigHelper configHelper = ConfigHelper.getInstance();
        String resultDirStr = configHelper.getImageDest() + File.separator +  format.format(new java.util.Date());
        String baseDirStr = configHelper.getImageSrc();
       
        if (resultDirStr == null || resultDirStr.isEmpty() ||
            baseDirStr == null || baseDirStr.isEmpty()) {
            verifyTrue("Incorrect setting of images' outputing path. Please check config.properties.", false);
            return;
        }
       
        try {
            File resultDir = new File(resultDirStr);
            File baseDir = new File(baseDirStr);
           
            if (!baseDir.exists()) {
                baseDir.mkdir();
            }
           
            if (!resultDir.exists()) {
                resultDir.mkdir();
            }

            String title = this.getEval("document.title");
            byte[] imgByteArr = Base64.decode(zkSelenium.getCmdProcessor().getString("captureEntirePageScreenshotToString", new String[] {title, browserName}));
            BufferedImage testBuffImg = ImageIO.read(new ByteArrayInputStream(imgByteArr));
           
            final String postfix = "_" + recordCount++ + ".png";
            if (configHelper.isComparable()) {
              File basef = new File(baseDir + File.separator + caseID, caseID + "_" + browserName + postfix);
View Full Code Here

      }
     
      private void error(String s, Selenium selenium) {
        if (selenium instanceof ZKSelenium){
         
          ZKSelenium zselenium = ((ZKSelenium)selenium);
          browsers.add("#{{"+zselenium.getBrowserName()+"}}");
          verificationErrors.append("[Browser Brand]: ").append(zselenium.getBrowserBrand()).append(" *"+zselenium.getBrowserName()+"\n").append(s);
        }else
          verificationErrors.append(s);
      }
View Full Code Here

   * @param locatorOfObjectToBeDragged the draggable UUID
   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the draggable element, which is dropped to.
   */
  public void dragdropTo(String locatorOfObjectToBeDragged, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfObjectToBeDragged, to);
    browser.mouseUpAt(locatorOfObjectToBeDragged, to);
  }
View Full Code Here

   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the droppable element, which is dropped to.
   */
  public void dragdropToObject(String locatorOfObjectToBeDragged,
      String locatorOfDragDestinationObject, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfDragDestinationObject, to);
    browser.mouseUpAt(locatorOfDragDestinationObject, to);
  }
View Full Code Here

  /**
   *
   * @param comparator an image comparator.
   */
  public void verifyImage(Comparator comparator) {
    ZKSelenium zkSelenium = (ZKSelenium) getCurrent();
        String browserName = zkSelenium.getBrowserName();
        ConfigHelper configHelper = ConfigHelper.getInstance();
        String resultDirStr = configHelper.getImageDest() + File.separator +  format.format(new java.util.Date());
        String baseDirStr = configHelper.getImageSrc();
       
        if (resultDirStr == null || "".equals(resultDirStr.trim()) ||
            baseDirStr == null || "".equals(baseDirStr.trim())) {
            verifyTrue("Incorrect setting of images' outputing path. Please check config.properties.", false);
            return;
        }
       
        try {
            File resultDir = new File(resultDirStr);
            File baseDir = new File(baseDirStr);
           
            if (!baseDir.exists()) {
                baseDir.mkdir();
            }
           
            if (!resultDir.exists()) {
                resultDir.mkdir();
            }

            String title = this.getEval("document.title");
            byte[] imgByteArr = Base64.decode(zkSelenium.getCmdProcessor().getString("captureEntirePageScreenshotToString", new String[] {title, browserName}));
            BufferedImage testBuffImg = ImageIO.read(new ByteArrayInputStream(imgByteArr));
           
            final String postfix = "_" + recordCount++ + ".png";
            if (configHelper.isComparable()) {
              File basef = new File(baseDir + File.separator + caseID, caseID + "_" + browserName + postfix);
View Full Code Here

   * @param locatorOfObjectToBeDragged the draggable UUID
   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the draggable element, which is dropped to.
   */
  public void dragdropTo(String locatorOfObjectToBeDragged, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfObjectToBeDragged, to);
    browser.mouseUpAt(locatorOfObjectToBeDragged, to);
  }
View Full Code Here

   * @param from the "x,y" value is related to the draggable element, which is dragged from.
   * @param to the "x,y" value is related to the droppable element, which is dropped to.
   */
  public void dragdropToObject(String locatorOfObjectToBeDragged,
      String locatorOfDragDestinationObject, String from, String to) {
    ZKSelenium browser = (ZKSelenium) getCurrent();
    browser.dragdropFrom(locatorOfObjectToBeDragged, from);
    browser.mouseMoveAt(locatorOfDragDestinationObject, to);
    browser.mouseUpAt(locatorOfDragDestinationObject, to);
  }
View Full Code Here

  /**
   *
   * @param comparator an image comparator.
   */
  public void verifyImage(Comparator comparator) {
    ZKSelenium zkSelenium = (ZKSelenium) getCurrent();
        String browserName = zkSelenium.getBrowserName();
        ConfigHelper configHelper = ConfigHelper.getInstance();
        String resultDirStr = configHelper.getImageDest() + File.separator +  format.format(new java.util.Date());
        String baseDirStr = configHelper.getImageSrc();
       
        if (resultDirStr == null || resultDirStr.isEmpty() ||
            baseDirStr == null || baseDirStr.isEmpty()) {
            verifyTrue("Incorrect setting of images' outputing path. Please check config.properties.", false);
            return;
        }
       
        try {
            File resultDir = new File(resultDirStr);
            File baseDir = new File(baseDirStr);
           
            if (!baseDir.exists()) {
                baseDir.mkdirs();
            }

            String title = this.getEval("document.title");
            byte[] imgByteArr = Base64.decode(zkSelenium.getCmdProcessor().getString("captureEntirePageScreenshotToString", new String[] {title, browserName}));
            BufferedImage testBuffImg = ImageIO.read(new ByteArrayInputStream(imgByteArr));
           
            final String postfix = "_" + recordCount++ + ".png";
            if (configHelper.isComparable()) {
              File basef = new File(baseDir + File.separator + caseID, caseID + "_" + browserName + postfix);
View Full Code Here

TOP

Related Classes of org.zkoss.ztl.util.ZKSelenium

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.