Permalink
Browse files

Add tests for new <input> text field types.

  • Loading branch information...
1 parent 5545f13 commit 00f92d172cc1fa6a24fd117c1536789a7380430a @victorhooi victorhooi committed Jan 17, 2014
Showing with 16 additions and 0 deletions.
  1. +14 −0 tests/form_elements.py
  2. +2 −0 tests/static/index.html
View
@@ -114,3 +114,17 @@ def test_can_fill_more_than_one_field_in_form(self):
self.assertTrue(self.browser.find_option_by_value("rj").selected)
self.assertTrue(self.browser.find_by_name("some-check").checked)
self.assertFalse(self.browser.find_by_name("checked-checkbox").checked)
+
+ def test_can_fill_tel_text_field(self):
+ "should provide a way to change a tel field value"
+ new_telephone = '555-0042'
+ self.browser.fill_form({'telephone': new_telephone})
+ value = self.browser.find_by_name('telephone').value
+ self.assertEqual(new_telephone, value)
+
+ def test_can_fill_unknown_text_field(self):
+ "should provide a way to change a unknown text field type that isn't specifically defined"
+ new_search_keyword = 'foobar'
+ self.browser.fill_form({'search_keyword': new_search_keyword})
+ value = self.browser.find_by_name('search_keyword').value
+ self.assertEqual(new_search_keyword, value)
View
@@ -81,6 +81,8 @@ <h1 id="firstheader">Example Last Header</h1>
<input type="text" name="query" value="default value" />
<input type="text" name="query" value="default last value" />
<input type="password" name="password" />
+ <input type="tel" name="telephone" />
+ <input type="search" name="search_keyword" />
<label for="send">Send</label>
<input type="submit" name="send" />
<input type="radio" name="gender" value="M" id="gender-m" /> Male

0 comments on commit 00f92d1

Please sign in to comment.