package com.thoughtworks.selenium;

import junit.framework.*;

import org.openqa.selenium.server.*;

/**
 * A test of the Apache MyFaces JSF AJAX auto-suggest sandbox application at www.irian.at.
 *  
 * 
 *  @author danielf
 *
 */
public class ApacheMyFacesSuggestTest extends TestCase {

    DefaultSelenium selenium;
    
    protected void setUp() throws Exception {
        selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, "*firefox", "http://www.irian.at");
        selenium.start();
    }
    
    public void testAJAX() throws Throwable {
        selenium.open("http://www.irian.at/myfaces-sandbox/inputSuggestAjax.jsf");
        selenium.verifyTextPresent("suggest");
        String elementID = "_idJsp0:_idJsp3";
        selenium.type(elementID, "foo");
        // DGF On Mozilla a keyPress is needed, and types a letter.
        // On IE6, a keyDown is needed, and no letter is typed. :-p
        // NS On firefox, keyPress needed, no letter typed.
        
        boolean isIE = selenium.getEvalBool("isIE");
        boolean isFirefox = selenium.getEvalBool("isFirefox");
        boolean isNetscape = selenium.getEvalBool("isNetscape");
        String verificationText = null;
        if (isIE) {
            selenium.keyDown(elementID, 'x');
        } else {
            selenium.keyPress(elementID, 'x');
        }
        if (isNetscape) {
            verificationText = "foox1";
        } else if (isIE || isFirefox) {
            verificationText = "foo1";
        }
        else {
            fail("which browser is this?");
        }
        Thread.sleep(2000);
        selenium.verifyTextPresent(verificationText);
    }
    
    public void tearDown() {
        selenium.testComplete();
    }
}

@@ -97,16 +97,71 @@
 rver.*;%0D
+%0Aimport org.openqa.selenium.server.browserlaunchers.*;%0D
 %0A%0D%0A/**%0D%0A
@@ -433,24 +433,101 @@
 xception %7B%0D%0A
+        %0D%0A    %7D%0D%0A    %0D%0A    public void testAJAXFirefox() throws Throwable %7B%0D%0A
         sele
@@ -655,24 +655,47 @@
 m.start();%0D%0A
+        ajaxTester();%0D%0A
     %7D%0D%0A    %0D
@@ -719,16 +719,307 @@
 testAJAX
+IExplore() throws Throwable %7B%0D%0A        if (!WindowsUtils.thisIsWindows()) return;%0D%0A        selenium = new DefaultSelenium(%22localhost%22, SeleniumServer.DEFAULT_PORT, %22*iexplore%22, %22http://www.irian.at%22);%0D%0A        selenium.start();%0D%0A        ajaxTester();%0D%0A    %7D%0D%0A    %0D%0A    public void ajaxTester
 () throw
@@ -2188,24 +2188,63 @@
 arDown() %7B%0D%0A
+        if (selenium == null) return;%0D%0A
         sele

Add an IE test to verify proxy support