Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package com.zuehlke.cap.example.groovywebtest;
  2.  
  3. import com.canoo.webtest.WebtestCase
  4.  
  5. class TestGroovyWebTest extends WebtestCase {
  6.  
  7.     public TestGroovyWebTest() {
  8.         super();
  9.        
  10.         if(ant == null)
  11.             createAntBuilder()
  12.         ant.setproxy(
  13.             proxyhost:"proxy.mycompany.com",
  14.             proxyport:8080,
  15.             nonproxyhosts:"localhost|127.0.0.1|*.mycompany.com")
  16.     }
  17.  
  18.     void testWebtestOnGoogle() {
  19.         webtest("check that WebTest is Google's top 'WebTest' result") {
  20.             invoke "http://www.google.com/ncr", description: "Go to Google (in English)"
  21.             verifyTitle "Google"
  22.             setInputField name: "q", value: "WebTest"
  23.             clickButton "I'm Feeling Lucky"
  24.             verifyTitle "Canoo WebTest"
  25.         }
  26.     }
  27. }