[HtmlUnit] SVN: [15437] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ javascript/host/html/HTMLInputElementTest.java

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15437
          http://sourceforge.net/p/htmlunit/code/15437
Author:   rbri
Date:     2018-07-05 07:35:45 +0000 (Thu, 05 Jul 2018)
Log Message:
-----------
ff60 support (wip)

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java	2018-07-05 07:25:40 UTC (rev 15436)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLInputElementTest.java	2018-07-05 07:35:45 UTC (rev 15437)
@@ -25,6 +25,7 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
@@ -795,10 +796,10 @@
             + "<p>hello world</p>\n"
             + "<form name='form1'>\n"
             + "  <input type='text' name='text1' id='text1'>\n"
-            + "<input name='myButton' type='button' onclick='document.form1.text1.value=\"from button\"'>\n"
+            + "  <input name='myButton' type='button' onclick='document.form1.text1.value=\"from button\"'>\n"
             + "</form>\n"
             + "<script>\n"
-            + "document.getElementById('text1').onchange = function(event) { alert(this.value) };\n"
+            + "  document.getElementById('text1').onchange = function(event) { alert(this.value) };\n"
             + "</script>\n"
             + "</body></html>";
 
@@ -809,7 +810,8 @@
         final WebElement button = driver.findElement(By.name("myButton"));
         button.click();
         verifyAlerts(driver, getExpectedAlerts());
-        Thread.sleep(10);
+
+        Thread.sleep(100);
         assertEquals("from button", textinput.getAttribute("value"));
     }
 
@@ -1106,13 +1108,15 @@
         final WebElement textField = webDriver.findElement(By.id("text1"));
         textField.sendKeys("123456789");
         assertEquals("12345", textField.getAttribute("value"));
-        textField.sendKeys("\b7");
+        textField.sendKeys(Keys.BACK_SPACE);
+        textField.sendKeys("7");
         assertEquals("12347", textField.getAttribute("value"));
 
         final WebElement passwordField = webDriver.findElement(By.id("password1"));
         passwordField.sendKeys("123456789");
         assertEquals("123456", passwordField.getAttribute("value"));
-        passwordField.sendKeys("\b7");
+        passwordField.sendKeys(Keys.BACK_SPACE);
+        passwordField.sendKeys("7");
         assertEquals("123457", passwordField.getAttribute("value"));
     }
 
@@ -1160,13 +1164,15 @@
         final WebElement textField = webDriver.findElement(By.id("text1"));
         textField.sendKeys("123456789");
         assertEquals("12", textField.getAttribute("value"));
-        textField.sendKeys("\b7");
+        textField.sendKeys(Keys.BACK_SPACE);
+        textField.sendKeys("7");
         assertEquals("17", textField.getAttribute("value"));
 
         final WebElement passwordField = webDriver.findElement(By.id("password1"));
         passwordField.sendKeys("123456789");
         assertEquals("1234", passwordField.getAttribute("value"));
-        passwordField.sendKeys("\b7");
+        passwordField.sendKeys(Keys.BACK_SPACE);
+        passwordField.sendKeys("7");
         assertEquals("1237", passwordField.getAttribute("value"));
     }
 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.