com.thoughtworks.selenium
Class SeleneseTestNgHelper

java.lang.Object
  extended by com.thoughtworks.selenium.SeleneseTestBase
      extended by com.thoughtworks.selenium.SeleneseTestNgHelper

public class SeleneseTestNgHelper
extends SeleneseTestBase


Field Summary
 
Fields inherited from class com.thoughtworks.selenium.SeleneseTestBase
selenium, verificationErrors
 
Constructor Summary
SeleneseTestNgHelper()
           
 
Method Summary
static void assertEquals(Object actual, Object expected)
           
static void assertEquals(String[] actual, String[] expected)
           
static void assertEquals(String actual, String expected)
           
static void assertEquals(String actual, String[] expected)
           
 void attachScreenshotListener(String host, String port, org.testng.ITestContext context)
           
 void checkForVerificationErrors()
          Asserts that there were no verification errors during the current test, failing immediately if any are found
 void getSelenium(boolean restartSession)
           
 void selectDefaultWindow()
           
static boolean seleniumEquals(Object actual, Object expected)
           
static boolean seleniumEquals(String actual, String expected)
           
 void setTestContext(Method method)
           
 void setUp(String url, String browserString)
          Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser string.
 void tearDown()
          checks for verification errors and stops the browser
 void verifyEquals(Object actual, Object expected)
          Like assertEquals, but fails at the end of the test (during tearDown)
 void verifyEquals(String[] actual, String[] expected)
          Asserts that two string arrays have identical string contents (fails at the end of the test, during tearDown)
 
Methods inherited from class com.thoughtworks.selenium.SeleneseTestBase
assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertTrue, assertTrue, clearVerificationErrors, fail, getDefaultPort, getText, isCaptureScreenShotOnFailure, join, pause, runtimeBrowserString, setCaptureScreenShotOnFailure, setUp, setUp, setUp, verifyEquals, verifyFalse, verifyNotEquals, verifyNotEquals, verifyTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeleneseTestNgHelper

public SeleneseTestNgHelper()
Method Detail

setUp

public void setUp(String url,
                  String browserString)
           throws Exception
Description copied from class: SeleneseTestBase
Creates a new DefaultSelenium object and starts it using the specified baseUrl and browser string. The port is selected as follows: if the server package's RemoteControlConfiguration class is on the classpath, that class' default port is used. Otherwise, if the "server.port" system property is specified, that is used - failing that, the default of 4444 is used.

Overrides:
setUp in class SeleneseTestBase
Parameters:
url - the baseUrl for your tests
browserString - the browser to use, e.g. *firefox
Throws:
Exception
See Also:
SeleneseTestBase.setUp(String, String, int)

getSelenium

public void getSelenium(boolean restartSession)

setTestContext

public void setTestContext(Method method)

attachScreenshotListener

public void attachScreenshotListener(String host,
                                     String port,
                                     org.testng.ITestContext context)

checkForVerificationErrors

public void checkForVerificationErrors()
Description copied from class: SeleneseTestBase
Asserts that there were no verification errors during the current test, failing immediately if any are found

Overrides:
checkForVerificationErrors in class SeleneseTestBase

selectDefaultWindow

public void selectDefaultWindow()

tearDown

public void tearDown()
              throws Exception
Description copied from class: SeleneseTestBase
checks for verification errors and stops the browser

Overrides:
tearDown in class SeleneseTestBase
Throws:
Exception

assertEquals

public static void assertEquals(Object actual,
                                Object expected)

assertEquals

public static void assertEquals(String actual,
                                String expected)

assertEquals

public static void assertEquals(String actual,
                                String[] expected)

assertEquals

public static void assertEquals(String[] actual,
                                String[] expected)

seleniumEquals

public static boolean seleniumEquals(Object actual,
                                     Object expected)

seleniumEquals

public static boolean seleniumEquals(String actual,
                                     String expected)

verifyEquals

public void verifyEquals(Object actual,
                         Object expected)
Description copied from class: SeleneseTestBase
Like assertEquals, but fails at the end of the test (during tearDown)

Overrides:
verifyEquals in class SeleneseTestBase

verifyEquals

public void verifyEquals(String[] actual,
                         String[] expected)
Description copied from class: SeleneseTestBase
Asserts that two string arrays have identical string contents (fails at the end of the test, during tearDown)

Overrides:
verifyEquals in class SeleneseTestBase


Copyright © 2012. All Rights Reserved.