List of usage examples for org.openqa.selenium Keys TAB
Keys TAB
To view the source code for org.openqa.selenium Keys TAB.
Click Source Link
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validateEmail_invalid() { TextFieldElement email = $(TextFieldElement.class).get(1); email.sendKeys("foo"); email.sendKeys(Keys.TAB); assertStatusMessagePresent("The string 'foo' is not a valid email address"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePhone_valid() { TextFieldElement phone = $(TextFieldElement.class).get(1); phone.sendKeys(" + 354 111 222 44 66 7688"); phone.sendKeys(Keys.TAB); Assert.assertTrue(isElementPresent(By.className("v-slot-valid"))); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePhone_invalidTooShort() { TextFieldElement phone = $(TextFieldElement.class).get(1); phone.sendKeys("+354"); phone.sendKeys(Keys.TAB); assertStatusMessagePresent("The string '+354' is not a valid phone number. " + "Phone should start with a plus sign and contain at least 10 digits"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePhone_invalidOnlyCountryCode() { TextFieldElement phone = $(TextFieldElement.class).get(1); phone.sendKeys("+7"); phone.sendKeys(Keys.TAB); assertStatusMessagePresent("The string '+7' is not a valid phone number. " + "Phone should start with a plus sign and contain at least 10 digits"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePhone_invalidContainsLetters() { TextFieldElement phone = $(TextFieldElement.class).get(1); phone.sendKeys("+7 dsfdsf 435345565654"); phone.sendKeys(Keys.TAB); assertStatusMessagePresent("The string '+7 dsfdsf 435345565654' is not a valid phone number. " + "Phone numbers should start with a plus sign followed by digits."); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePasswd_valid() { PasswordFieldElement password = $(PasswordFieldElement.class).get(0); password.sendKeys("aa11bbss33ddd"); password.sendKeys(Keys.TAB); Assert.assertTrue(isElementPresent(By.className("v-slot-valid"))); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePasswd_invalidHasOnlyNumbers() { PasswordFieldElement password = $(PasswordFieldElement.class).get(0); password.sendKeys("33221144"); password.sendKeys(Keys.TAB); assertStatusMessagePresent("Password must contain a letter and a number"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePasswd_invalidHasOnlyLetters() { PasswordFieldElement password = $(PasswordFieldElement.class).get(0); password.sendKeys("aabbcc"); password.sendKeys(Keys.TAB); assertStatusMessagePresent("Password must contain a letter and a number"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validatePasswd_invalidTooShort() { PasswordFieldElement password = $(PasswordFieldElement.class).get(0); password.sendKeys("a1"); password.sendKeys(Keys.TAB); assertStatusMessagePresent("Password should contain at least 6 characters"); WebElement icon = findElement(By.className("v-icon")); Assert.assertEquals(INVALID_ICON_CHAR, icon.getText().charAt(0)); }
From source file:com.vaadin.demo.registration.RegistrationFormIT.java
License:Apache License
@Test public void validateConfirmPasswd_valid() { PasswordFieldElement password = $(PasswordFieldElement.class).get(0); password.sendKeys("aa11bbss33ddd"); password.sendKeys(Keys.TAB); password = $(PasswordFieldElement.class).get(1); password.sendKeys("aa11bbss33ddd"); password.sendKeys(Keys.TAB);//from w ww.ja v a2s.c om Assert.assertTrue(isElementPresent(By.className("v-slot-valid"))); }