capybara 3.8.1 → 3.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/History.md +465 -0
- data/License.txt +1 -1
- data/README.md +58 -57
- data/lib/capybara/config.rb +10 -4
- data/lib/capybara/cucumber.rb +1 -1
- data/lib/capybara/driver/base.rb +2 -2
- data/lib/capybara/driver/node.rb +26 -5
- data/lib/capybara/dsl.rb +12 -4
- data/lib/capybara/helpers.rb +8 -4
- data/lib/capybara/minitest/spec.rb +162 -85
- data/lib/capybara/minitest.rb +248 -148
- data/lib/capybara/node/actions.rb +149 -96
- data/lib/capybara/node/base.rb +27 -10
- data/lib/capybara/node/document.rb +12 -0
- data/lib/capybara/node/document_matchers.rb +9 -5
- data/lib/capybara/node/element.rb +254 -109
- data/lib/capybara/node/finders.rb +83 -76
- data/lib/capybara/node/matchers.rb +279 -141
- data/lib/capybara/node/simple.rb +25 -6
- data/lib/capybara/queries/ancestor_query.rb +5 -7
- data/lib/capybara/queries/base_query.rb +11 -5
- data/lib/capybara/queries/current_path_query.rb +3 -3
- data/lib/capybara/queries/match_query.rb +1 -0
- data/lib/capybara/queries/selector_query.rb +467 -103
- data/lib/capybara/queries/sibling_query.rb +5 -4
- data/lib/capybara/queries/style_query.rb +6 -2
- data/lib/capybara/queries/text_query.rb +17 -3
- data/lib/capybara/queries/title_query.rb +2 -2
- data/lib/capybara/rack_test/browser.rb +22 -15
- data/lib/capybara/rack_test/driver.rb +10 -1
- data/lib/capybara/rack_test/errors.rb +6 -0
- data/lib/capybara/rack_test/form.rb +33 -28
- data/lib/capybara/rack_test/node.rb +74 -6
- data/lib/capybara/registration_container.rb +44 -0
- data/lib/capybara/registrations/drivers.rb +36 -0
- data/lib/capybara/registrations/patches/puma_ssl.rb +27 -0
- data/lib/capybara/registrations/servers.rb +44 -0
- data/lib/capybara/result.rb +55 -23
- data/lib/capybara/rspec/features.rb +4 -4
- data/lib/capybara/rspec/matcher_proxies.rb +36 -15
- data/lib/capybara/rspec/matchers/base.rb +111 -0
- data/lib/capybara/rspec/matchers/become_closed.rb +33 -0
- data/lib/capybara/rspec/matchers/compound.rb +88 -0
- data/lib/capybara/rspec/matchers/count_sugar.rb +37 -0
- data/lib/capybara/rspec/matchers/have_ancestor.rb +28 -0
- data/lib/capybara/rspec/matchers/have_current_path.rb +29 -0
- data/lib/capybara/rspec/matchers/have_selector.rb +77 -0
- data/lib/capybara/rspec/matchers/have_sibling.rb +27 -0
- data/lib/capybara/rspec/matchers/have_text.rb +33 -0
- data/lib/capybara/rspec/matchers/have_title.rb +29 -0
- data/lib/capybara/rspec/matchers/match_selector.rb +27 -0
- data/lib/capybara/rspec/matchers/match_style.rb +38 -0
- data/lib/capybara/rspec/matchers/spatial_sugar.rb +39 -0
- data/lib/capybara/rspec/matchers.rb +117 -311
- data/lib/capybara/selector/builders/css_builder.rb +84 -0
- data/lib/capybara/selector/builders/xpath_builder.rb +69 -0
- data/lib/capybara/selector/css.rb +17 -15
- data/lib/capybara/selector/definition/button.rb +52 -0
- data/lib/capybara/selector/definition/checkbox.rb +26 -0
- data/lib/capybara/selector/definition/css.rb +10 -0
- data/lib/capybara/selector/definition/datalist_input.rb +35 -0
- data/lib/capybara/selector/definition/datalist_option.rb +25 -0
- data/lib/capybara/selector/definition/element.rb +27 -0
- data/lib/capybara/selector/definition/field.rb +40 -0
- data/lib/capybara/selector/definition/fieldset.rb +14 -0
- data/lib/capybara/selector/definition/file_field.rb +13 -0
- data/lib/capybara/selector/definition/fillable_field.rb +33 -0
- data/lib/capybara/selector/definition/frame.rb +17 -0
- data/lib/capybara/selector/definition/id.rb +6 -0
- data/lib/capybara/selector/definition/label.rb +62 -0
- data/lib/capybara/selector/definition/link.rb +54 -0
- data/lib/capybara/selector/definition/link_or_button.rb +16 -0
- data/lib/capybara/selector/definition/option.rb +27 -0
- data/lib/capybara/selector/definition/radio_button.rb +27 -0
- data/lib/capybara/selector/definition/select.rb +81 -0
- data/lib/capybara/selector/definition/table.rb +109 -0
- data/lib/capybara/selector/definition/table_row.rb +21 -0
- data/lib/capybara/selector/definition/xpath.rb +5 -0
- data/lib/capybara/selector/definition.rb +277 -0
- data/lib/capybara/selector/filter.rb +1 -0
- data/lib/capybara/selector/filter_set.rb +26 -19
- data/lib/capybara/selector/filters/base.rb +24 -5
- data/lib/capybara/selector/filters/expression_filter.rb +3 -3
- data/lib/capybara/selector/filters/locator_filter.rb +29 -0
- data/lib/capybara/selector/filters/node_filter.rb +16 -2
- data/lib/capybara/selector/regexp_disassembler.rb +214 -0
- data/lib/capybara/selector/selector.rb +73 -367
- data/lib/capybara/selector/xpath_extensions.rb +17 -0
- data/lib/capybara/selector.rb +221 -480
- data/lib/capybara/selenium/atoms/getAttribute.min.js +1 -0
- data/lib/capybara/selenium/atoms/isDisplayed.min.js +1 -0
- data/lib/capybara/selenium/atoms/src/getAttribute.js +161 -0
- data/lib/capybara/selenium/atoms/src/isDisplayed.js +454 -0
- data/lib/capybara/selenium/driver.rb +203 -86
- data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +88 -14
- data/lib/capybara/selenium/driver_specializations/edge_driver.rb +124 -0
- data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +89 -0
- data/lib/capybara/selenium/driver_specializations/internet_explorer_driver.rb +26 -0
- data/lib/capybara/selenium/driver_specializations/safari_driver.rb +24 -0
- data/lib/capybara/selenium/extensions/file_input_click_emulation.rb +34 -0
- data/lib/capybara/selenium/extensions/find.rb +110 -0
- data/lib/capybara/selenium/extensions/html5_drag.rb +191 -22
- data/lib/capybara/selenium/extensions/modifier_keys_stack.rb +28 -0
- data/lib/capybara/selenium/extensions/scroll.rb +78 -0
- data/lib/capybara/selenium/logger_suppressor.rb +34 -0
- data/lib/capybara/selenium/node.rb +298 -93
- data/lib/capybara/selenium/nodes/chrome_node.rb +100 -8
- data/lib/capybara/selenium/nodes/edge_node.rb +104 -0
- data/lib/capybara/selenium/nodes/firefox_node.rb +131 -0
- data/lib/capybara/selenium/nodes/ie_node.rb +22 -0
- data/lib/capybara/selenium/nodes/safari_node.rb +118 -0
- data/lib/capybara/selenium/patches/action_pauser.rb +26 -0
- data/lib/capybara/selenium/patches/atoms.rb +18 -0
- data/lib/capybara/selenium/patches/is_displayed.rb +16 -0
- data/lib/capybara/selenium/patches/logs.rb +45 -0
- data/lib/capybara/selenium/patches/pause_duration_fix.rb +1 -3
- data/lib/capybara/selenium/patches/persistent_client.rb +20 -0
- data/lib/capybara/server/animation_disabler.rb +4 -3
- data/lib/capybara/server/checker.rb +6 -2
- data/lib/capybara/server/middleware.rb +23 -13
- data/lib/capybara/server.rb +30 -7
- data/lib/capybara/session/config.rb +14 -10
- data/lib/capybara/session/matchers.rb +11 -7
- data/lib/capybara/session.rb +152 -111
- data/lib/capybara/spec/public/offset.js +6 -0
- data/lib/capybara/spec/public/test.js +101 -10
- data/lib/capybara/spec/session/all_spec.rb +96 -6
- data/lib/capybara/spec/session/ancestor_spec.rb +5 -0
- data/lib/capybara/spec/session/assert_all_of_selectors_spec.rb +29 -0
- data/lib/capybara/spec/session/assert_current_path_spec.rb +5 -2
- data/lib/capybara/spec/session/assert_selector_spec.rb +0 -10
- data/lib/capybara/spec/session/assert_style_spec.rb +4 -4
- data/lib/capybara/spec/session/assert_text_spec.rb +9 -5
- data/lib/capybara/spec/session/attach_file_spec.rb +63 -36
- data/lib/capybara/spec/session/check_spec.rb +10 -4
- data/lib/capybara/spec/session/choose_spec.rb +8 -2
- data/lib/capybara/spec/session/click_button_spec.rb +117 -61
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +16 -0
- data/lib/capybara/spec/session/click_link_spec.rb +17 -6
- data/lib/capybara/spec/session/element/matches_selector_spec.rb +40 -39
- data/lib/capybara/spec/session/evaluate_script_spec.rb +13 -0
- data/lib/capybara/spec/session/execute_script_spec.rb +1 -0
- data/lib/capybara/spec/session/fill_in_spec.rb +47 -6
- data/lib/capybara/spec/session/find_field_spec.rb +1 -1
- data/lib/capybara/spec/session/find_spec.rb +74 -4
- data/lib/capybara/spec/session/first_spec.rb +1 -1
- data/lib/capybara/spec/session/frame/switch_to_frame_spec.rb +13 -1
- data/lib/capybara/spec/session/frame/within_frame_spec.rb +12 -1
- data/lib/capybara/spec/session/has_all_selectors_spec.rb +1 -1
- data/lib/capybara/spec/session/has_ancestor_spec.rb +46 -0
- data/lib/capybara/spec/session/has_any_selectors_spec.rb +25 -0
- data/lib/capybara/spec/session/has_button_spec.rb +16 -0
- data/lib/capybara/spec/session/has_css_spec.rb +122 -12
- data/lib/capybara/spec/session/has_current_path_spec.rb +6 -4
- data/lib/capybara/spec/session/has_field_spec.rb +55 -0
- data/lib/capybara/spec/session/has_select_spec.rb +34 -6
- data/lib/capybara/spec/session/has_selector_spec.rb +11 -4
- data/lib/capybara/spec/session/has_sibling_spec.rb +50 -0
- data/lib/capybara/spec/session/has_table_spec.rb +166 -0
- data/lib/capybara/spec/session/has_text_spec.rb +48 -1
- data/lib/capybara/spec/session/has_xpath_spec.rb +17 -0
- data/lib/capybara/spec/session/html_spec.rb +7 -0
- data/lib/capybara/spec/session/matches_style_spec.rb +35 -0
- data/lib/capybara/spec/session/node_spec.rb +643 -18
- data/lib/capybara/spec/session/node_wrapper_spec.rb +1 -1
- data/lib/capybara/spec/session/refresh_spec.rb +4 -0
- data/lib/capybara/spec/session/reset_session_spec.rb +23 -8
- data/lib/capybara/spec/session/save_and_open_screenshot_spec.rb +2 -2
- data/lib/capybara/spec/session/save_screenshot_spec.rb +4 -4
- data/lib/capybara/spec/session/scroll_spec.rb +117 -0
- data/lib/capybara/spec/session/select_spec.rb +10 -10
- data/lib/capybara/spec/session/selectors_spec.rb +36 -5
- data/lib/capybara/spec/session/uncheck_spec.rb +2 -2
- data/lib/capybara/spec/session/unselect_spec.rb +1 -1
- data/lib/capybara/spec/session/window/become_closed_spec.rb +20 -17
- data/lib/capybara/spec/session/window/switch_to_window_spec.rb +4 -0
- data/lib/capybara/spec/session/window/window_opened_by_spec.rb +4 -0
- data/lib/capybara/spec/session/window/window_spec.rb +59 -58
- data/lib/capybara/spec/session/window/windows_spec.rb +4 -0
- data/lib/capybara/spec/session/within_spec.rb +23 -0
- data/lib/capybara/spec/spec_helper.rb +16 -6
- data/lib/capybara/spec/test_app.rb +28 -23
- data/lib/capybara/spec/views/animated.erb +49 -0
- data/lib/capybara/spec/views/form.erb +48 -7
- data/lib/capybara/spec/views/frame_child.erb +3 -2
- data/lib/capybara/spec/views/frame_one.erb +1 -0
- data/lib/capybara/spec/views/obscured.erb +47 -0
- data/lib/capybara/spec/views/offset.erb +32 -0
- data/lib/capybara/spec/views/react.erb +45 -0
- data/lib/capybara/spec/views/scroll.erb +20 -0
- data/lib/capybara/spec/views/spatial.erb +31 -0
- data/lib/capybara/spec/views/tables.erb +67 -0
- data/lib/capybara/spec/views/with_animation.erb +29 -1
- data/lib/capybara/spec/views/with_dragula.erb +24 -0
- data/lib/capybara/spec/views/with_hover.erb +1 -0
- data/lib/capybara/spec/views/with_hover1.erb +10 -0
- data/lib/capybara/spec/views/with_html.erb +32 -6
- data/lib/capybara/spec/views/with_js.erb +3 -1
- data/lib/capybara/spec/views/with_jstree.erb +26 -0
- data/lib/capybara/spec/views/with_scope_other.erb +6 -0
- data/lib/capybara/spec/views/with_sortable_js.erb +21 -0
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +11 -11
- data/lib/capybara.rb +118 -111
- data/spec/basic_node_spec.rb +14 -3
- data/spec/capybara_spec.rb +29 -29
- data/spec/css_builder_spec.rb +101 -0
- data/spec/dsl_spec.rb +46 -21
- data/spec/filter_set_spec.rb +5 -5
- data/spec/fixtures/selenium_driver_rspec_failure.rb +1 -1
- data/spec/fixtures/selenium_driver_rspec_success.rb +1 -1
- data/spec/minitest_spec.rb +18 -4
- data/spec/minitest_spec_spec.rb +59 -44
- data/spec/rack_test_spec.rb +117 -89
- data/spec/regexp_dissassembler_spec.rb +250 -0
- data/spec/result_spec.rb +51 -49
- data/spec/rspec/features_spec.rb +3 -0
- data/spec/rspec/shared_spec_matchers.rb +112 -97
- data/spec/rspec_spec.rb +35 -17
- data/spec/sauce_spec_chrome.rb +43 -0
- data/spec/selector_spec.rb +244 -28
- data/spec/selenium_spec_chrome.rb +125 -54
- data/spec/selenium_spec_chrome_remote.rb +26 -12
- data/spec/selenium_spec_edge.rb +23 -8
- data/spec/selenium_spec_firefox.rb +208 -0
- data/spec/selenium_spec_firefox_remote.rb +15 -18
- data/spec/selenium_spec_ie.rb +82 -13
- data/spec/selenium_spec_safari.rb +148 -0
- data/spec/server_spec.rb +118 -77
- data/spec/session_spec.rb +19 -3
- data/spec/shared_selenium_node.rb +83 -0
- data/spec/shared_selenium_session.rb +110 -65
- data/spec/spec_helper.rb +57 -9
- data/spec/xpath_builder_spec.rb +93 -0
- metadata +257 -17
- data/lib/capybara/rspec/compound.rb +0 -94
- data/lib/capybara/selenium/driver_specializations/marionette_driver.rb +0 -49
- data/lib/capybara/selenium/nodes/marionette_node.rb +0 -121
- data/lib/capybara/spec/session/has_style_spec.rb +0 -25
- data/spec/selenium_spec_marionette.rb +0 -172
@@ -0,0 +1,47 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<title>Obscured</title>
|
5
|
+
<style>
|
6
|
+
div {
|
7
|
+
width: 200px;
|
8
|
+
height: 200px;
|
9
|
+
}
|
10
|
+
#cover, #offscreen, #offscreen_wrapper {
|
11
|
+
position: absolute;
|
12
|
+
}
|
13
|
+
#obscured {
|
14
|
+
z-index: 1;
|
15
|
+
background-color: red;
|
16
|
+
}
|
17
|
+
#cover {
|
18
|
+
top: 0px;
|
19
|
+
z-index: 2;
|
20
|
+
background-color: blue;
|
21
|
+
}
|
22
|
+
#offscreen {
|
23
|
+
top: 2000px;
|
24
|
+
left: 2000px;
|
25
|
+
background-color: green;
|
26
|
+
}
|
27
|
+
#offscreen_wrapper {
|
28
|
+
top: 2000px;
|
29
|
+
left: 2000px;
|
30
|
+
overflow-x: scroll;
|
31
|
+
background-color: yellow;
|
32
|
+
}
|
33
|
+
</style>
|
34
|
+
</head>
|
35
|
+
<body>
|
36
|
+
<div id="obscured">
|
37
|
+
<input id="obscured_input"/>
|
38
|
+
</div>
|
39
|
+
<div id="cover"></div>
|
40
|
+
<iframe id="frameOne" height="10px" src="/frame_one"></iframe>
|
41
|
+
<iframe id="nestedFrames" src="/frame_parent"></iframe>
|
42
|
+
<div id="offscreen_wrapper">
|
43
|
+
<div id="offscreen"></div>
|
44
|
+
</div>
|
45
|
+
</body>
|
46
|
+
</html>
|
47
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<title>Offset</title>
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
margin: 0px;
|
8
|
+
}
|
9
|
+
#wrapper {
|
10
|
+
width: 300px;
|
11
|
+
height: 300px;
|
12
|
+
margin: 0px;
|
13
|
+
}
|
14
|
+
#clicker {
|
15
|
+
position: relative;
|
16
|
+
width: 100px;
|
17
|
+
height: 100px;
|
18
|
+
top: 100px;
|
19
|
+
left: 100px;
|
20
|
+
background-color: red;
|
21
|
+
margin: 0px;
|
22
|
+
}
|
23
|
+
</style>
|
24
|
+
<script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
|
25
|
+
<script src="/offset.js" type="text/javascript" charset="utf-8"></script>
|
26
|
+
</head>
|
27
|
+
<body>
|
28
|
+
<div id="wrapper">
|
29
|
+
<div id="clicker"></div>
|
30
|
+
</div>
|
31
|
+
</body>
|
32
|
+
</html>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<script src="https://unpkg.com/react/umd/react.development.js"></script>
|
5
|
+
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<div id="root"></div>
|
9
|
+
<script>
|
10
|
+
// https://codepen.io/gaearon/pen/VmmPgp?editors=0010
|
11
|
+
class NameForm extends React.Component {
|
12
|
+
constructor(props) {
|
13
|
+
super(props);
|
14
|
+
this.state = { value: '' };
|
15
|
+
|
16
|
+
this.handleChange = this.handleChange.bind(this);
|
17
|
+
this.handleSubmit = this.handleSubmit.bind(this);
|
18
|
+
}
|
19
|
+
|
20
|
+
handleChange(event) {
|
21
|
+
this.setState({ value: event.target.value });
|
22
|
+
}
|
23
|
+
|
24
|
+
handleSubmit(event) {
|
25
|
+
alert('A name was submitted: ' + this.state.value);
|
26
|
+
event.preventDefault();
|
27
|
+
}
|
28
|
+
|
29
|
+
render() {
|
30
|
+
return (
|
31
|
+
React.createElement("form", { onSubmit: this.handleSubmit },
|
32
|
+
React.createElement("label", null, "Name:",
|
33
|
+
|
34
|
+
React.createElement("input", { type: "text", value: this.state.value, onChange: this.handleChange })),
|
35
|
+
|
36
|
+
React.createElement("input", { type: "submit", value: "Submit" })));
|
37
|
+
}}
|
38
|
+
|
39
|
+
|
40
|
+
ReactDOM.render(
|
41
|
+
React.createElement(NameForm, null),
|
42
|
+
document.getElementById('root'));
|
43
|
+
</script>
|
44
|
+
</body>
|
45
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<html style="height: 250%; width: 150%">
|
2
|
+
<head>
|
3
|
+
<style>
|
4
|
+
* { padding: 0; }
|
5
|
+
div { position: absolute; }
|
6
|
+
#scroll { top: 125%; }
|
7
|
+
#scrollable { top: 150%; overflow-y: scroll; overflow-x: scroll; height: 50px; width: 50px; position: relative; border: 1px solid black;}
|
8
|
+
#inner { top: 50%; }
|
9
|
+
</style>
|
10
|
+
</head>
|
11
|
+
<body style="height: 100%; width: 100%">
|
12
|
+
<div id="scroll" style = "top: 125%">scroll</div>
|
13
|
+
<div id="scrollable">
|
14
|
+
<div style="height: 200px; width: 200px; poistion: relative">
|
15
|
+
<div id="inner">inner</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<title>spatial</title>
|
5
|
+
<style>
|
6
|
+
#spatial {
|
7
|
+
display: grid;
|
8
|
+
grid-template-columns: repeat(3, 1fr);
|
9
|
+
grid-gap: 10px;
|
10
|
+
grid-auto-rows: minmax(100px, auto);
|
11
|
+
}
|
12
|
+
.footer {
|
13
|
+
grid-column: 1 / 4;
|
14
|
+
}
|
15
|
+
</style>
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body id="spatial">
|
19
|
+
<div class="corner">1</div>
|
20
|
+
<div class="distance">2</div>
|
21
|
+
<div class="corner">3</div>
|
22
|
+
<div>4</div>
|
23
|
+
<div class="center">5</div>
|
24
|
+
<div>6</div>
|
25
|
+
<div class="corner">7</div>
|
26
|
+
<div>8</div>
|
27
|
+
<div class="corner">9</div>
|
28
|
+
<div class="footer distance">10</div>
|
29
|
+
</body>
|
30
|
+
</html>
|
31
|
+
|
@@ -61,3 +61,70 @@
|
|
61
61
|
</tr>
|
62
62
|
</table>
|
63
63
|
</form>
|
64
|
+
|
65
|
+
<table>
|
66
|
+
<caption>Horizontal Headers</caption>
|
67
|
+
<thead>
|
68
|
+
<tr>
|
69
|
+
<th>First Name</th>
|
70
|
+
<th>Last Name</th>
|
71
|
+
<th>City</th>
|
72
|
+
</tr>
|
73
|
+
</thead>
|
74
|
+
<tbody>
|
75
|
+
<tr>
|
76
|
+
<td>Thomas</td>
|
77
|
+
<td>Walpole</td>
|
78
|
+
<td>Oceanside</td>
|
79
|
+
</tr>
|
80
|
+
<tr>
|
81
|
+
<td>Danilo</td>
|
82
|
+
<td>Wilkinson</td>
|
83
|
+
<td>Johnsonville</td>
|
84
|
+
</tr>
|
85
|
+
<tr>
|
86
|
+
<td>Vern</td>
|
87
|
+
<td>Konopelski</td>
|
88
|
+
<td>Everette</td>
|
89
|
+
</tr>
|
90
|
+
<tr>
|
91
|
+
<td>Ratke</td>
|
92
|
+
<td>Lawrence</td>
|
93
|
+
<td>East Sorayashire</td>
|
94
|
+
</tr>
|
95
|
+
<tr>
|
96
|
+
<td>Palmer</td>
|
97
|
+
<td>Sawayn</td>
|
98
|
+
<td>West Trinidad</td>
|
99
|
+
</tr>
|
100
|
+
</tbody>
|
101
|
+
</table>
|
102
|
+
|
103
|
+
<table>
|
104
|
+
<caption>Vertical Headers</caption>
|
105
|
+
<tr>
|
106
|
+
<th>First Name</th>
|
107
|
+
<td>Thomas</td>
|
108
|
+
<td>Danilo</td>
|
109
|
+
<td>Vern</td>
|
110
|
+
<td>Ratke</td>
|
111
|
+
<td>Palmer</td>
|
112
|
+
</tr>
|
113
|
+
<tr>
|
114
|
+
<th>Last Name</th>
|
115
|
+
<td>Walpole</td>
|
116
|
+
<td>Wilkinson</td>
|
117
|
+
<td>Konopelski</td>
|
118
|
+
<td>Lawrence</td>
|
119
|
+
<td>Sawayn</td>
|
120
|
+
</tr>
|
121
|
+
<tr>
|
122
|
+
<th>City</th>
|
123
|
+
<td>Oceanside</td>
|
124
|
+
<td>Johnsonville</td>
|
125
|
+
<td>Everette</td>
|
126
|
+
<td>East Sorayashire</td>
|
127
|
+
<td>West Trinidad</td>
|
128
|
+
</tr>
|
129
|
+
</table>
|
130
|
+
|
@@ -6,6 +6,17 @@
|
|
6
6
|
<script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
|
7
7
|
<script src="/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
|
8
8
|
<script src="/test.js" type="text/javascript" charset="utf-8"></script>
|
9
|
+
<script type="text/javascript">
|
10
|
+
$(document).on('transitionend', function(){
|
11
|
+
$(document.body).append('<div>Transition Ended</div>')
|
12
|
+
});
|
13
|
+
$(document).on('animationend', function(){
|
14
|
+
$(document.body).append('<div>Animation Ended</div>')
|
15
|
+
});
|
16
|
+
$(document).on('contextmenu', function(e){
|
17
|
+
e.preventDefault();
|
18
|
+
});
|
19
|
+
</script>
|
9
20
|
<style>
|
10
21
|
.transition.away {
|
11
22
|
width: 0%;
|
@@ -17,6 +28,13 @@
|
|
17
28
|
overflow: hidden;
|
18
29
|
}
|
19
30
|
|
31
|
+
a::after {
|
32
|
+
content: "";
|
33
|
+
width: 0px;
|
34
|
+
height: 0px;
|
35
|
+
background-color: blue;
|
36
|
+
}
|
37
|
+
|
20
38
|
a:not(.away) {
|
21
39
|
height: 20px;
|
22
40
|
}
|
@@ -35,12 +53,22 @@
|
|
35
53
|
animation-duration: 3s;
|
36
54
|
animation-fill-mode: forwards;
|
37
55
|
}
|
56
|
+
|
57
|
+
@keyframes pseudo_grow {
|
58
|
+
100% { height: 100px, width: 100px };
|
59
|
+
}
|
60
|
+
|
61
|
+
a.animation.pseudo::after {
|
62
|
+
animation: pseudo_grow 3s forwards;
|
63
|
+
}
|
38
64
|
</style>
|
39
65
|
</head>
|
40
66
|
|
41
67
|
<body id="with_animation">
|
42
68
|
<a href='#' class='transition' onclick='this.classList.add("away")'>transition me away</a>
|
43
|
-
<a href='#' class='animation' onclick='this.classList.add("away")'
|
69
|
+
<a href='#' class='animation' onclick='this.classList.add("away")' oncontextmenu='this.classList.add("pseudo")'>
|
70
|
+
animate me away
|
71
|
+
</a>
|
44
72
|
</body>
|
45
73
|
</html>
|
46
74
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<title>with_dragula</title>
|
5
|
+
|
6
|
+
</head>
|
7
|
+
|
8
|
+
<body id="with_dragula">
|
9
|
+
<div id="sortable">
|
10
|
+
<div class="item1">Item 1</div>
|
11
|
+
<div class="item2">Item 2</div>
|
12
|
+
<div class="item3">Item 3</div>
|
13
|
+
<div class="item4">Item 4</div>
|
14
|
+
<div class="item5">Item 5</div>
|
15
|
+
</div>
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/dragula/3.7.2/dragula.js" type="text/javascript"></script>
|
17
|
+
<script>
|
18
|
+
let container = document.getElementById("sortable");
|
19
|
+
dragula([container]);
|
20
|
+
container.className = "ready"
|
21
|
+
</script>
|
22
|
+
</body>
|
23
|
+
</html>
|
24
|
+
|
@@ -10,6 +10,7 @@
|
|
10
10
|
.hidden_until_hover {display: none;}
|
11
11
|
.wrapper:hover .hidden_until_hover { display: block }
|
12
12
|
</style>
|
13
|
+
<a href='with_hover1'>Other hover page</a>
|
13
14
|
<div class="wrapper">
|
14
15
|
Some text here so the wrapper has size
|
15
16
|
<div class="hidden_until_hover">Here I am</div>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<h2 class="no text"></h2>
|
11
11
|
<h2 class="head" id="h2one">Header Class Test One</h2>
|
12
12
|
<h2 class="head" id="h2two">Header Class Test Two</h2>
|
13
|
-
<h2 class="head">Header Class Test Three</h2>
|
13
|
+
<h2 class="head" id="h2_">Header Class Test Three</h2>
|
14
14
|
<h2 class="head">Header Class Test Four</h2>
|
15
|
-
<h2 class="head">Header Class Test Five</h2>
|
15
|
+
<h2 class="head">Header Class <span style="display: none">Random</span>Test Five</h2>
|
16
16
|
|
17
17
|
<span class="number">42</span>
|
18
18
|
<span>Other span</span>
|
@@ -21,9 +21,9 @@
|
|
21
21
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
22
22
|
tempor incididunt ut <a href="/with_simple_html" title="awesome title" class="simple">labore</a>
|
23
23
|
et dolore magna aliqua. Ut enim ad minim veniam,
|
24
|
-
quis nostrud exercitation <a href="/foo" id="foo">ullamco</a> laboris nisi
|
24
|
+
quis nostrud exercitation <a href="/foo" id="foo" data-test-id="test-foo">ullamco</a> laboris nisi
|
25
25
|
ut aliquip ex ea commodo consequat.
|
26
|
-
<a href="/with_simple_html" aria-label="Go to simple"><img id="first_image" width="20" height="20" alt="awesome image" /></a>
|
26
|
+
<a href="/with_simple_html" aria-label="Go to simple" data-test-id="test-simple"><img id="first_image" width="20" height="20" alt="awesome image" src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="/></a>
|
27
27
|
</p>
|
28
28
|
|
29
29
|
<p class="para" id="second" style="display: inline;">
|
@@ -36,8 +36,8 @@
|
|
36
36
|
</p>
|
37
37
|
|
38
38
|
<p>
|
39
|
-
<input type="text" id="test_field" data-test-id="test_id" value="monkey"/>
|
40
|
-
<input type="text" readonly="readonly" value="should not change" />
|
39
|
+
<input type="text" id="test_field" spellcheck="TRUE" data-test-id="test_id" value="monkey"/>
|
40
|
+
<input type="text" readonly="readonly" spellcheck="FALSE" value="should not change" />
|
41
41
|
<textarea id="normal" data-other-test-id="test_id">
|
42
42
|
banana</textarea>
|
43
43
|
<textarea id="additional_newline">
|
@@ -138,6 +138,9 @@ banana</textarea>
|
|
138
138
|
Ancestor
|
139
139
|
<div id="child">Child</div>
|
140
140
|
</div>
|
141
|
+
<div id="ancestor1_sibiling">
|
142
|
+
ASibling
|
143
|
+
</div>
|
141
144
|
</div>
|
142
145
|
<button id="ancestor_button" type="submit" disabled>
|
143
146
|
<img id="button_img" width="20" height="20" alt="button img"/>
|
@@ -178,5 +181,28 @@ banana</textarea>
|
|
178
181
|
                   
|
179
182
|
</div>
|
180
183
|
|
184
|
+
<details id="closed_details">
|
185
|
+
<summary>
|
186
|
+
<h6>Something</h6>
|
187
|
+
</summary>
|
188
|
+
<ul>
|
189
|
+
<li>Random</li>
|
190
|
+
<li>Things</li>
|
191
|
+
</ul>
|
192
|
+
</details>
|
193
|
+
|
194
|
+
<details id="open_details" open>
|
195
|
+
<summary>
|
196
|
+
<h6>Summary</h6>
|
197
|
+
</summary>
|
198
|
+
<div>
|
199
|
+
Contents
|
200
|
+
</div>
|
201
|
+
</details>
|
202
|
+
|
203
|
+
<template id="template">
|
204
|
+
<input />
|
205
|
+
</template>
|
206
|
+
|
181
207
|
<a href="/download.csv" download>Download Me</a>
|
182
208
|
<a href="/download.csv" download="other.csv">Download Other</a>
|
@@ -28,13 +28,14 @@
|
|
28
28
|
<div id="drag_html5" draggable="true">
|
29
29
|
<p>This is an HTML5 draggable element.</p>
|
30
30
|
</div>
|
31
|
-
<a id="drag_link_html5" href="#">This is an HTML5 draggable link</a>
|
31
|
+
<a id="drag_link_html5" href="#"><p>This is an HTML5 draggable link</p></a>
|
32
32
|
<div id="drop_html5" class="drop">
|
33
33
|
<p>It should be dropped here.</p>
|
34
34
|
</div>
|
35
35
|
|
36
36
|
<p><a href="#" id="clickable">Click me</a></p>
|
37
37
|
<p><a href="#" id="slow-click">Slowly</a></p>
|
38
|
+
<p><span id="aria-button" role="button">ARIA button</span></p>
|
38
39
|
|
39
40
|
<p>
|
40
41
|
<select id="waiter">
|
@@ -137,6 +138,7 @@
|
|
137
138
|
|
138
139
|
<p>
|
139
140
|
<input type="file" id="hidden_file" style="opacity:0; display: none;">
|
141
|
+
<label for="hidden_file">Label for hidden file input</label>
|
140
142
|
</p>
|
141
143
|
|
142
144
|
<p>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
5
|
+
<title>with_jstree</title>
|
6
|
+
</head>
|
7
|
+
<body id="with_jstree">
|
8
|
+
<div id="container">
|
9
|
+
<ul>
|
10
|
+
<li>Child node A</li>
|
11
|
+
<li>Child node B</li>
|
12
|
+
<li>Child node C</li>
|
13
|
+
</ul>
|
14
|
+
</div>
|
15
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.8/jstree.min.js"></script>
|
17
|
+
<script>
|
18
|
+
$(function () {
|
19
|
+
$('#container').jstree({
|
20
|
+
"core" : { "check_callback" : true }, // so that operations work
|
21
|
+
"plugins" : ["dnd"]
|
22
|
+
});
|
23
|
+
});
|
24
|
+
</script>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
4
|
+
<title>with_sortable_js</title>
|
5
|
+
<script src="https://sortablejs.github.io/Sortable/Sortable.js" type="text/javascript"></script>
|
6
|
+
</head>
|
7
|
+
|
8
|
+
<body id="with_sortable_js">
|
9
|
+
<div id="sortable">
|
10
|
+
<div class="item1">Item 1</div>
|
11
|
+
<div class="item2">Item 2</div>
|
12
|
+
<div class="item3">Item 3</div>
|
13
|
+
<div class="item4">Item 4</div>
|
14
|
+
<div class="item5">Item 5</div>
|
15
|
+
</div>
|
16
|
+
<script>
|
17
|
+
new Sortable(document.getElementById("sortable"));
|
18
|
+
</script>
|
19
|
+
</body>
|
20
|
+
</html>
|
21
|
+
|
data/lib/capybara/version.rb
CHANGED
data/lib/capybara/window.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Capybara
|
4
4
|
##
|
5
|
-
# The Window class represents a browser window.
|
5
|
+
# The {Window} class represents a browser window.
|
6
6
|
#
|
7
7
|
# You can get an instance of the class by calling either of:
|
8
8
|
#
|
@@ -12,12 +12,12 @@ module Capybara
|
|
12
12
|
# * {Capybara::Session#switch_to_window}
|
13
13
|
#
|
14
14
|
# Note that some drivers (e.g. Selenium) support getting size of/resizing/closing only
|
15
|
-
#
|
15
|
+
# current window. So if you invoke such method for:
|
16
16
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
17
|
+
# * window that is current, Capybara will make 2 Selenium method invocations
|
18
|
+
# (get handle of current window + get size/resize/close).
|
19
|
+
# * window that is not current, Capybara will make 4 Selenium method invocations
|
20
|
+
# (get handle of current window + switch to given handle + get size/resize/close + switch to original handle)
|
21
21
|
#
|
22
22
|
class Window
|
23
23
|
# @return [String] a string that uniquely identifies window within session
|
@@ -57,12 +57,12 @@ module Capybara
|
|
57
57
|
# Close window.
|
58
58
|
#
|
59
59
|
# If this method was called for window that is current, then after calling this method
|
60
|
-
#
|
61
|
-
#
|
60
|
+
# future invocations of other Capybara methods should raise
|
61
|
+
# {Capybara::Driver::Base#no_such_window_error session.driver.no_such_window_error} until another window will be switched to.
|
62
62
|
#
|
63
63
|
# @!macro about_current
|
64
64
|
# If this method was called for window that is not current, then after calling this method
|
65
|
-
# current window
|
65
|
+
# current window should remain the same as it was before calling this method.
|
66
66
|
#
|
67
67
|
def close
|
68
68
|
@driver.close_window(handle)
|
@@ -93,7 +93,7 @@ module Capybara
|
|
93
93
|
# Maximize window.
|
94
94
|
#
|
95
95
|
# If a particular driver (e.g. headless driver) doesn't have concept of maximizing it
|
96
|
-
#
|
96
|
+
# may not support this method.
|
97
97
|
#
|
98
98
|
# @macro about_current
|
99
99
|
#
|
@@ -132,7 +132,7 @@ module Capybara
|
|
132
132
|
timer = Capybara::Helpers.timer(expire_in: seconds)
|
133
133
|
loop do
|
134
134
|
prev_size = size
|
135
|
-
sleep 0.
|
135
|
+
sleep 0.025
|
136
136
|
return res if prev_size == size
|
137
137
|
break if timer.expired?
|
138
138
|
end
|