VirtualEarthTest.java :  » JBoss » richfaces-ui-3.3.2 » org » richfaces » testng » Java Open Source

Java Open Source » JBoss » richfaces ui 3.3.2 
richfaces ui 3.3.2 » org » richfaces » testng » VirtualEarthTest.java
package org.richfaces.testng;

import java.util.HashMap;
import java.util.Map;

import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;

public class VirtualEarthTest  extends SeleniumTestBase {

    /**
     *    component is present on the page together with map images and there are no JS errors
     */
  @Test(groups=FAILURES_GROUP)
  public void testImages(Template template) {
      AutoTester autoTester = getAutoTester(this);
      autoTester.renderPage(template, null);
      Assert.assertTrue(selenium.getXpathCount("id('" + autoTester.getClientId(AutoTester.COMPONENT_ID) + "')//img").intValue() != 0);
      runScript("map.ZoomIn()");
  }

    /**
     *    component with rendered = false is not present on the page,
     *    style and classes, standard HTML attributes are output to client
     */
  @Test(groups=FAILURES_GROUP)
  public void testStandardAttributes(Template template) {
      AutoTester autoTester = getAutoTester(this);
      autoTester.renderPage(template, null);
      autoTester.testRendered();
      Map<String, String> styleAttributes = new HashMap<String, String>();
      styleAttributes.put("width", "100%");
      styleAttributes.put("color", "yellow");
      autoTester.testStyleAndClasses(new String[]{"noname"}, styleAttributes);
      autoTester.testHTMLEvents();
  }

  @Override
  public String getTestUrl() {
    throw new UnsupportedOperationException();
  }

  @Override
  public String getAutoTestUrl() {
    return "pages/virtualEarth/virtualEarthAutoTest.xhtml";
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.