|
30 | 30 | import static org.junit.Assert.assertTrue; |
31 | 31 | import static org.junit.Assume.assumeFalse; |
32 | 32 | import static org.openqa.selenium.testing.Driver.ALL; |
33 | | -import static org.openqa.selenium.testing.Driver.HTMLUNIT; |
34 | 33 | import static org.openqa.selenium.testing.Driver.IE; |
35 | 34 | import static org.openqa.selenium.testing.Driver.MARIONETTE; |
36 | 35 |
|
37 | 36 | import org.hamcrest.Description; |
38 | 37 | import org.hamcrest.Matcher; |
39 | 38 | import org.hamcrest.TypeSafeMatcher; |
40 | 39 | import org.junit.Test; |
| 40 | +import org.openqa.selenium.environment.webserver.Page; |
41 | 41 | import org.openqa.selenium.testing.Ignore; |
42 | 42 | import org.openqa.selenium.testing.JUnit4TestBase; |
43 | 43 | import org.openqa.selenium.testing.JavascriptEnabled; |
@@ -412,4 +412,16 @@ public void testShouldTrimTextWithMultiByteWhitespaces() { |
412 | 412 | assertEquals("test", text); |
413 | 413 | } |
414 | 414 |
|
| 415 | + @Test |
| 416 | + public void canHandleTextThatLooksLikeANumber() { |
| 417 | + driver.get(appServer.create(new Page() |
| 418 | + .withBody("<div id='point'>12.345</div>", |
| 419 | + "<div id='comma'>12,345</div>", |
| 420 | + "<div id='space'>12 345</div>"))); |
| 421 | + |
| 422 | + assertThat(driver.findElement(By.id("point")).getText(), is("12.345")); |
| 423 | + assertThat(driver.findElement(By.id("comma")).getText(), is("12,345")); |
| 424 | + assertThat(driver.findElement(By.id("space")).getText(), is("12 345")); |
| 425 | + } |
| 426 | + |
415 | 427 | } |
0 commit comments