mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Added failing tests for click_button to find and submit image input buttons using the text of the alt attribute
This commit is contained in:
parent
99a3bd8f82
commit
125478fe26
2 changed files with 13 additions and 1 deletions
|
@ -113,6 +113,18 @@ shared_examples_for "click_button" do
|
|||
@session.body.should include('You landed')
|
||||
end
|
||||
end
|
||||
|
||||
context "with alt given on an image button" do
|
||||
it "should submit the associated form" do
|
||||
@session.click_button('oh hai thar')
|
||||
extract_results(@session)['first_name'].should == 'John'
|
||||
end
|
||||
|
||||
it "should work with partial matches" do
|
||||
@session.click_button('hai')
|
||||
extract_results(@session)['first_name'].should == 'John'
|
||||
end
|
||||
end
|
||||
|
||||
context "with value given on an image button" do
|
||||
it "should submit the associated form" do
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
<input type="button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
|
||||
<input type="submit" name="form[awesome]" id="awe123" value="awesome"/>
|
||||
<input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
|
||||
<input type="image" name="form[okay]" id="okay556" value="okay"/>
|
||||
<input type="image" name="form[okay]" id="okay556" value="okay" alt="oh hai thar"/>
|
||||
<button type="submit" id="click_me_123" value="click_me">Click me!</button>
|
||||
</p>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Reference in a new issue