Skip to content

Commit

Permalink
[java] Fixing and adding to the suite a couple of lost WDBS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 28, 2019
1 parent 5a56387 commit 263074f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
Expand Up @@ -26,18 +26,18 @@ public void testWithJavaScript() {
selenium
.setContext("A real test, using the real Selenium on the browser side served by Jetty, driven from Java");
selenium.setBrowserLogLevel(SeleniumLogLevels.DEBUG);
selenium.open("/selenium-server/tests/html/test_click_page1.html");
selenium.open("test_click_page1.html");
assertTrue("link 'link' doesn't contain expected text",
selenium.getText("link").indexOf("Click here for next page") != -1);
String[] links = selenium.getAllLinks();
assertTrue(links.length > 3);
assertEquals(links[3], "linkToAnchorOnThisPage");
selenium.click("link");
selenium.waitForPageToLoad("10000");
assertTrue(selenium.getLocation().endsWith("/selenium-server/tests/html/test_click_page2.html"));
assertTrue(selenium.getLocation().endsWith("test_click_page2.html"));
selenium.click("previousPage");
selenium.waitForPageToLoad("10000");
assertTrue(selenium.getLocation().endsWith("/selenium-server/tests/html/test_click_page1.html"));
assertTrue(selenium.getLocation().endsWith("test_click_page1.html"));
}

@Test
Expand All @@ -49,7 +49,7 @@ public void testAgain() {
public void testFailure() {
selenium
.setContext("A real negative test, using the real Selenium on the browser side served by Jetty, driven from Java");
selenium.open("/selenium-server/tests/html/test_click_page1.html");
selenium.open("test_click_page1.html");
String badElementName = "This element doesn't exist, so Selenium should throw an exception";
try {
selenium.getText(badElementName);
Expand Down
Expand Up @@ -151,6 +151,7 @@
TestJavaScriptAttributes.class,
TestJavascriptParameters.class,
TestLocators.class,
TestLargeHtml.class,
TestModalDialog.class,
TestMultiSelect.class,
TestOpen.class,
Expand Down Expand Up @@ -183,12 +184,7 @@
TestWaitInPopupWindow.class,
TestXPathLocatorInXHtml.class,
TestXPathLocators.class,

// v1 tests
CacheBlockTest.class,
RealDealIntegrationTest.class,
// SessionExtensionJsTest.class,
TestLargeHtml.class,
RealDealIntegrationTest.class
// TestNativeKeys.class
})
public class SeleniumRcTestSuite extends BaseSuite {
Expand Down
4 changes: 2 additions & 2 deletions java/client/test/com/thoughtworks/selenium/TestLargeHtml.java
Expand Up @@ -23,9 +23,9 @@
public class TestLargeHtml extends InternalSelenseTestBase {
@Test
public void testLargeHtml() {
selenium.open("/selenium-server/tests/html/test_large_html.html");
selenium.open("test_large_html.html");
String source = selenium.getHtmlSource().trim();
String expectedEndsWith = "</body>";
String expectedEndsWith = "</html>";
int index = source.length() - expectedEndsWith.length();
String actualEndsWith = source.substring(index).toLowerCase();
Assert.assertEquals("source doesn't end correctly", actualEndsWith, expectedEndsWith);
Expand Down
Expand Up @@ -25,7 +25,7 @@
public class TestNativeKeys extends InternalSelenseTestBase {
@Test
public void testKeyPressNative() {
selenium.open("/selenium-server/tests/html/test_type_page1.html");
selenium.open("test_type_page1.html");
selenium.focus("username");
selenium.keyPressNative(Integer.toString(KeyEvent.VK_H));
Assert.assertEquals(selenium.getValue("username"), "h");
Expand Down
Expand Up @@ -136,6 +136,7 @@
TestImplicitLocators.class,
TestJavaScriptAttributes.class,
// TestJavascriptParameters.class,
TestLargeHtml.class,
TestLocators.class,
TestMultiSelect.class,
// TestModalDialog.class,
Expand Down Expand Up @@ -168,7 +169,8 @@
TestWaitForNot.class,
TestWaitInPopupWindow.class,
// TestXPathLocatorInXHtml.class,
TestXPathLocators.class
TestXPathLocators.class,
RealDealIntegrationTest.class
})
public class WebDriverSeleniumTestSuite extends BaseSuite {
// Empty
Expand Down

0 comments on commit 263074f

Please sign in to comment.