Class SeleneseTestNgHelper

    • Constructor Detail

      • SeleneseTestNgHelper

        public SeleneseTestNgHelper()
    • Method Detail

      • setUp

        @BeforeTest
        public void setUp​(java.lang.String url,
                          java.lang.String browserString)
                   throws java.lang.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:
        java.lang.Exception - throws them all!
        See Also:
        SeleneseTestBase.setUp(String, String, int)
      • getSelenium

        @BeforeClass
        public void getSelenium​(boolean restartSession)
      • setTestContext

        @BeforeMethod
        public void setTestContext​(java.lang.reflect.Method method)
      • attachScreenshotListener

        @BeforeSuite
        public void attachScreenshotListener​(java.lang.String host,
                                             java.lang.String port,
                                             org.testng.ITestContext context)
      • checkForVerificationErrors

        @AfterMethod
        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

        @AfterMethod(alwaysRun=true)
        public void selectDefaultWindow()
      • tearDown

        @AfterTest(alwaysRun=true)
        public void tearDown()
                      throws java.lang.Exception
        Description copied from class: SeleneseTestBase
        checks for verification errors and stops the browser
        Overrides:
        tearDown in class SeleneseTestBase
        Throws:
        java.lang.Exception - actually, just AssertionError, but someone was lazy?
      • assertEquals

        public static void assertEquals​(java.lang.Object actual,
                                        java.lang.Object expected)
      • assertEquals

        public static void assertEquals​(java.lang.String actual,
                                        java.lang.String expected)
      • assertEquals

        public static void assertEquals​(java.lang.String actual,
                                        java.lang.String[] expected)
      • assertEquals

        public static void assertEquals​(java.lang.String[] actual,
                                        java.lang.String[] expected)
      • seleniumEquals

        public static boolean seleniumEquals​(java.lang.Object actual,
                                             java.lang.Object expected)
      • seleniumEquals

        public static boolean seleniumEquals​(java.lang.String actual,
                                             java.lang.String expected)
      • verifyEquals

        public void verifyEquals​(java.lang.Object actual,
                                 java.lang.Object expected)
        Description copied from class: SeleneseTestBase
        Like assertEquals, but fails at the end of the test (during tearDown)
        Overrides:
        verifyEquals in class SeleneseTestBase
        Parameters:
        actual - object that you want to compare to actual
        expected - the actual object expected
      • verifyEquals

        public void verifyEquals​(java.lang.String[] actual,
                                 java.lang.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
        Parameters:
        actual - object that you want to compare to actual
        expected - the actual object expected