package integration;

import com.codeborne.selenide.*;
import org.junit.*;
import org.openqa.selenium.*;

import static com.codeborne.selenide.Selenide.*;
import static org.hamcrest.CoreMatchers.*;

/**
 * Created by vinogradov on 11.01.16.
 */

public class InputFieldTest extends IntegrationTest {

  @Before
  public void setup(){
    open("/html5_input.html?"+System.currentTimeMillis());
  }

  @Ignore (value = "fails - Bug in Selenium should be fixed in 2.49 http://bit.ly/1JKT4AE")
  @Test
  public void selenideClearTest(){
    SelenideElement input=$(By.id("id1"));
    Assert.assertThat(input.getValue(),is(equalTo("")));
    input.clear();
    input.setValue(",.123");
    input.clear();
    input.setValue("456");
    Assert.assertThat(input.getValue(),is(equalTo("456")));
    input.clear();
    input.setValue(",.123");
    input.clear();
    input.setValue("456");
    Assert.assertThat(input.getValue(),is(equalTo("456")));
  }


}

@@ -37,33 +37,47 @@
 eborne.selenide.
-*
+SelenideElement
 ;%0Aimport org.jun
@@ -79,17 +79,22 @@
 g.junit.
-*
+Before
 ;%0Aimport
@@ -102,28 +102,95 @@
 org.
-openqa.selenium.*
+junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport static com.codeborne.selenide.Selenide.$
 ;%0A
-%0A
 impo
@@ -235,52 +235,148 @@
 ide.
-*;%0Aimport static org.hamcrest.CoreMatchers.*
+open;%0Aimport static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertThat
 ;%0A%0A/
@@ -420,17 +420,16 @@
 16.%0A */%0A
-%0A
 public c
@@ -506,16 +506,17 @@
  setup()
+ 
 %7B%0A    op
@@ -542,9 +542,11 @@
 ml?%22
-+
+ + 
 Syst
@@ -588,18 +588,9 @@
 nore
- (value = 
+(
 %22fai
@@ -699,16 +699,17 @@
 arTest()
+ 
 %7B%0A    Se
@@ -731,37 +731,26 @@
 nput
-=$(By.id(%22
+ = $(%22#
 id1%22)
-)
 ;%0A    
-Assert.
 asse
@@ -765,32 +765,33 @@
 nput.getValue(),
+ 
 is(equalTo(%22%22)))
@@ -788,24 +788,29 @@
 alTo(%22%22)));%0A
+    %0A
     input.cl
@@ -887,39 +887,32 @@
 lue(%22456%22);%0A    
-Assert.
 assertThat(input
@@ -915,32 +915,33 @@
 nput.getValue(),
+ 
 is(equalTo(%22456%22
@@ -941,24 +941,29 @@
 o(%22456%22)));%0A
+    %0A
     input.cl
@@ -1048,23 +1048,16 @@
 %22);%0A    
-Assert.
 assertTh
@@ -1076,16 +1076,17 @@
 Value(),
+ 
 is(equal
@@ -1102,12 +1102,10 @@
 ));%0A  %7D%0A
-%0A%0A
 %7D%0A

fix formatting of file