Skip to content

Commit

Permalink
add selectbox test
Browse files Browse the repository at this point in the history
  • Loading branch information
asdil12 committed Mar 25, 2013
1 parent 49ad2d1 commit ae9941b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ def test_fill(self):
'email': '[email protected]',
'textarea': 'Here is a sample text.\nWith several lines.',
'checkbox': True,
'selectbox': 'two',
"radio": "first choice"
}
self.ghost.fill('#contact-form', values)
for field in ['text', 'email', 'textarea']:
for field in ['text', 'email', 'textarea', 'selectbox']:
value, resssources = self.ghost\
.evaluate('document.getElementById("%s").value' % field)
self.assertEqual(value, values[field])
Expand Down
7 changes: 7 additions & 0 deletions tests/templates/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ <h1>Form</h1>
<label for="multiple-checkbox-second">multiple checkbox second choice</label>
<input type="checkbox" id="multiple-checkbox-second" name="multiple-checkbox" value="second choice" />
</p>
<p>
<label for="selectbox">selectbox</label>
<select id="selectbox" name="selectbox">
<option value="one" checked="checked">one</option>
<option value="two">two</option>
</select>
</p>
<p>
<label for="radio-first">first choice</label>
<input id="radio-first" type="radio" name="radio" value="first choice" />
Expand Down

0 comments on commit ae9941b

Please sign in to comment.