capybara 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +26 -0
- data/README.md +36 -14
- data/lib/capybara.rb +6 -3
- data/lib/capybara/driver/base.rb +37 -1
- data/lib/capybara/driver/node.rb +10 -2
- data/lib/capybara/helpers.rb +21 -13
- data/lib/capybara/node/base.rb +12 -7
- data/lib/capybara/node/element.rb +17 -1
- data/lib/capybara/node/finders.rb +22 -1
- data/lib/capybara/node/matchers.rb +26 -5
- data/lib/capybara/node/simple.rb +9 -2
- data/lib/capybara/rack_test/css_handlers.rb +3 -1
- data/lib/capybara/rack_test/form.rb +3 -2
- data/lib/capybara/rack_test/node.rb +3 -3
- data/lib/capybara/rspec.rb +1 -0
- data/lib/capybara/rspec/features.rb +2 -1
- data/lib/capybara/rspec/matchers.rb +50 -5
- data/lib/capybara/selenium/driver.rb +76 -12
- data/lib/capybara/selenium/node.rb +8 -0
- data/lib/capybara/server.rb +1 -1
- data/lib/capybara/session.rb +234 -29
- data/lib/capybara/spec/public/jquery.js +1 -1
- data/lib/capybara/spec/public/test.js +7 -0
- data/lib/capybara/spec/session/all_spec.rb +88 -17
- data/lib/capybara/spec/session/assert_selector.rb +6 -0
- data/lib/capybara/spec/session/attach_file_spec.rb +15 -15
- data/lib/capybara/spec/session/body_spec.rb +4 -4
- data/lib/capybara/spec/session/check_spec.rb +16 -16
- data/lib/capybara/spec/session/choose_spec.rb +5 -5
- data/lib/capybara/spec/session/click_button_spec.rb +93 -84
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +8 -8
- data/lib/capybara/spec/session/click_link_spec.rb +26 -19
- data/lib/capybara/spec/session/current_scope_spec.rb +3 -3
- data/lib/capybara/spec/session/current_url_spec.rb +8 -8
- data/lib/capybara/spec/session/evaluate_script_spec.rb +1 -1
- data/lib/capybara/spec/session/execute_script_spec.rb +2 -2
- data/lib/capybara/spec/session/fill_in_spec.rb +22 -22
- data/lib/capybara/spec/session/find_button_spec.rb +4 -4
- data/lib/capybara/spec/session/find_by_id_spec.rb +3 -3
- data/lib/capybara/spec/session/find_field_spec.rb +7 -7
- data/lib/capybara/spec/session/find_link_spec.rb +4 -4
- data/lib/capybara/spec/session/find_spec.rb +46 -46
- data/lib/capybara/spec/session/first_spec.rb +23 -23
- data/lib/capybara/spec/session/go_back_spec.rb +3 -3
- data/lib/capybara/spec/session/go_forward_spec.rb +4 -4
- data/lib/capybara/spec/session/has_button_spec.rb +13 -13
- data/lib/capybara/spec/session/has_css_spec.rb +87 -87
- data/lib/capybara/spec/session/has_field_spec.rb +87 -87
- data/lib/capybara/spec/session/has_link_spec.rb +11 -11
- data/lib/capybara/spec/session/has_select_spec.rb +58 -58
- data/lib/capybara/spec/session/has_selector_spec.rb +48 -48
- data/lib/capybara/spec/session/has_table_spec.rb +7 -7
- data/lib/capybara/spec/session/has_text_spec.rb +73 -73
- data/lib/capybara/spec/session/has_title_spec.rb +10 -10
- data/lib/capybara/spec/session/has_xpath_spec.rb +44 -44
- data/lib/capybara/spec/session/headers.rb +1 -1
- data/lib/capybara/spec/session/html_spec.rb +9 -9
- data/lib/capybara/spec/session/node_spec.rb +81 -65
- data/lib/capybara/spec/session/reset_session_spec.rb +15 -15
- data/lib/capybara/spec/session/response_code.rb +1 -1
- data/lib/capybara/spec/session/save_and_open_screenshot_spec.rb +46 -0
- data/lib/capybara/spec/session/save_page_spec.rb +9 -9
- data/lib/capybara/spec/session/{screenshot.rb → screenshot_spec.rb} +4 -2
- data/lib/capybara/spec/session/select_spec.rb +22 -22
- data/lib/capybara/spec/session/text_spec.rb +15 -10
- data/lib/capybara/spec/session/title_spec.rb +2 -2
- data/lib/capybara/spec/session/uncheck_spec.rb +7 -7
- data/lib/capybara/spec/session/unselect_spec.rb +14 -14
- data/lib/capybara/spec/session/visit_spec.rb +24 -17
- data/lib/capybara/spec/session/window/become_closed_spec.rb +84 -0
- data/lib/capybara/spec/session/window/current_window_spec.rb +25 -0
- data/lib/capybara/spec/session/window/open_new_window_spec.rb +28 -0
- data/lib/capybara/spec/session/window/switch_to_window_spec.rb +114 -0
- data/lib/capybara/spec/session/window/window_opened_by_spec.rb +83 -0
- data/lib/capybara/spec/session/window/window_spec.rb +141 -0
- data/lib/capybara/spec/session/window/windows_spec.rb +31 -0
- data/lib/capybara/spec/session/window/within_window_spec.rb +188 -0
- data/lib/capybara/spec/session/within_frame_spec.rb +9 -9
- data/lib/capybara/spec/session/within_spec.rb +16 -16
- data/lib/capybara/spec/spec_helper.rb +14 -4
- data/lib/capybara/spec/views/form.erb +7 -0
- data/lib/capybara/spec/views/popup_one.erb +1 -1
- data/lib/capybara/spec/views/popup_two.erb +1 -1
- data/lib/capybara/spec/views/with_js.erb +2 -0
- data/lib/capybara/spec/views/with_windows.erb +38 -0
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +123 -0
- data/spec/basic_node_spec.rb +32 -32
- data/spec/capybara_spec.rb +6 -7
- data/spec/dsl_spec.rb +48 -48
- data/spec/fixtures/selenium_driver_rspec_failure.rb +2 -2
- data/spec/fixtures/selenium_driver_rspec_success.rb +2 -2
- data/spec/rack_test_spec.rb +33 -19
- data/spec/result_spec.rb +13 -13
- data/spec/rspec/features_spec.rb +20 -15
- data/spec/rspec/matchers_spec.rb +109 -109
- data/spec/rspec_spec.rb +10 -10
- data/spec/selenium_spec.rb +31 -6
- data/spec/selenium_spec_chrome.rb +2 -2
- data/spec/server_spec.rb +13 -13
- metadata +51 -62
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/capybara/spec/session/within_window_spec.rb +0 -45
- data/lib/capybara/spec/views/within_popups.erb +0 -25
- metadata.gz.sig +0 -0
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
@@ -1,45 +0,0 @@
|
|
1
|
-
Capybara::SpecHelper.spec '#within_window', :requires => [:windows] do
|
2
|
-
before(:each) do
|
3
|
-
@session.visit('/within_popups')
|
4
|
-
end
|
5
|
-
after(:each) do
|
6
|
-
@session.within_window("firstPopup") do
|
7
|
-
@session.evaluate_script('window.close()')
|
8
|
-
end
|
9
|
-
@session.within_window("secondPopup") do
|
10
|
-
@session.evaluate_script('window.close()')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should find the div in firstPopup" do
|
15
|
-
@session.within_window("firstPopup") do
|
16
|
-
@session.find("//*[@id='divInPopupOne']").text.should eql 'This is the text of divInPopupOne'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
it "should find the div in secondPopup" do
|
20
|
-
@session.within_window("secondPopup") do
|
21
|
-
@session.find("//*[@id='divInPopupTwo']").text.should eql 'This is the text of divInPopupTwo'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
it "should find the divs in both popups" do
|
25
|
-
@session.within_window("secondPopup") do
|
26
|
-
@session.find("//*[@id='divInPopupTwo']").text.should eql 'This is the text of divInPopupTwo'
|
27
|
-
end
|
28
|
-
@session.within_window("firstPopup") do
|
29
|
-
@session.find("//*[@id='divInPopupOne']").text.should eql 'This is the text of divInPopupOne'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
it "should find the div in the main window after finding a div in a popup" do
|
33
|
-
@session.within_window("secondPopup") do
|
34
|
-
@session.find("//*[@id='divInPopupTwo']").text.should eql 'This is the text of divInPopupTwo'
|
35
|
-
end
|
36
|
-
@session.find("//*[@id='divInMainWindow']").text.should eql 'This is the text for divInMainWindow'
|
37
|
-
end
|
38
|
-
it "should reset scope when switching windows" do
|
39
|
-
@session.within(:css, '#divInMainWindow') do
|
40
|
-
@session.within_window("secondPopup") do
|
41
|
-
@session.find("//*[@id='divInPopupTwo']").text.should eql 'This is the text of divInPopupTwo'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>With Popups</title>
|
4
|
-
<script language="javascript" type="text/javascript">
|
5
|
-
<!--
|
6
|
-
|
7
|
-
function popItUp(name, url) {
|
8
|
-
newwindow=window.open(url,name,'height=200,width=150');
|
9
|
-
if (window.focus) { newwindow.focus() }
|
10
|
-
return false;
|
11
|
-
}
|
12
|
-
|
13
|
-
function init() {
|
14
|
-
popItUp('firstPopup', '/popup_one');
|
15
|
-
popItUp('secondPopup', '/popup_two');
|
16
|
-
}
|
17
|
-
window.onload = init;
|
18
|
-
|
19
|
-
// -->
|
20
|
-
</script>
|
21
|
-
</head>
|
22
|
-
<body>
|
23
|
-
<div id="divInMainWindow">This is the text for divInMainWindow</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
metadata.gz.sig
DELETED
Binary file
|