watir 1.4.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +4 -0
- data/.github/ISSUE_TEMPLATE.md +16 -0
- data/.github/workflows/chrome.yml +55 -0
- data/.github/workflows/edge.yml +44 -0
- data/.github/workflows/firefox.yml +55 -0
- data/.github/workflows/ie.yml +30 -0
- data/.github/workflows/safari.yml +38 -0
- data/.github/workflows/unit.yml +60 -0
- data/.gitignore +21 -0
- data/.rubocop.yml +114 -0
- data/.rubocop_todo.yml +17 -0
- data/CHANGES.md +2212 -0
- data/Gemfile +15 -0
- data/LICENSE +24 -0
- data/README.md +113 -0
- data/Rakefile +173 -0
- data/lib/watir/adjacent.rb +128 -0
- data/lib/watir/after_hooks.rb +135 -0
- data/lib/watir/alert.rb +113 -0
- data/lib/watir/aliases.rb +8 -0
- data/lib/watir/attribute_helper.rb +97 -0
- data/lib/watir/browser.rb +323 -0
- data/lib/watir/capabilities.rb +179 -0
- data/lib/watir/cell_container.rb +25 -0
- data/lib/watir/container.rb +33 -0
- data/lib/watir/cookies.rb +130 -0
- data/lib/watir/element_collection.rb +223 -0
- data/lib/watir/elements/button.rb +28 -0
- data/lib/watir/elements/cell.rb +18 -0
- data/lib/watir/elements/checkbox.rb +56 -0
- data/lib/watir/elements/date_field.rb +42 -0
- data/lib/watir/elements/date_time_field.rb +42 -0
- data/lib/watir/elements/dlist.rb +12 -0
- data/lib/watir/elements/element.rb +807 -0
- data/lib/watir/elements/file_field.rb +43 -0
- data/lib/watir/elements/font.rb +26 -0
- data/lib/watir/elements/form.rb +16 -0
- data/lib/watir/elements/hidden.rb +26 -0
- data/lib/watir/elements/html_elements.rb +1981 -0
- data/lib/watir/elements/iframe.rb +156 -0
- data/lib/watir/elements/image.rb +22 -0
- data/lib/watir/elements/input.rb +15 -0
- data/lib/watir/elements/link.rb +8 -0
- data/lib/watir/elements/list.rb +51 -0
- data/lib/watir/elements/option.rb +60 -0
- data/lib/watir/elements/radio.rb +65 -0
- data/lib/watir/elements/row.rb +18 -0
- data/lib/watir/elements/select.rb +214 -0
- data/lib/watir/elements/svg_elements.rb +497 -0
- data/lib/watir/elements/table.rb +77 -0
- data/lib/watir/elements/table_cell.rb +32 -0
- data/lib/watir/elements/table_row.rb +34 -0
- data/lib/watir/elements/table_section.rb +17 -0
- data/lib/watir/elements/text_area.rb +7 -0
- data/lib/watir/elements/text_field.rb +39 -0
- data/lib/watir/exception.rb +16 -0
- data/lib/watir/extensions/nokogiri.rb +14 -0
- data/lib/watir/generator/base/generator.rb +114 -0
- data/lib/watir/generator/base/idl_sorter.rb +51 -0
- data/lib/watir/generator/base/spec_extractor.rb +158 -0
- data/lib/watir/generator/base/util.rb +21 -0
- data/lib/watir/generator/base/visitor.rb +133 -0
- data/lib/watir/generator/base.rb +12 -0
- data/lib/watir/generator/html/generator.rb +36 -0
- data/lib/watir/generator/html/spec_extractor.rb +52 -0
- data/lib/watir/generator/html/visitor.rb +23 -0
- data/lib/watir/generator/html.rb +17 -0
- data/lib/watir/generator/svg/generator.rb +38 -0
- data/lib/watir/generator/svg/spec_extractor.rb +55 -0
- data/lib/watir/generator/svg/visitor.rb +23 -0
- data/lib/watir/generator/svg.rb +9 -0
- data/lib/watir/generator.rb +5 -0
- data/lib/watir/has_window.rb +72 -0
- data/lib/watir/http_client.rb +11 -0
- data/lib/watir/js_execution.rb +165 -0
- data/lib/watir/js_snippets/attributeValues.js +11 -0
- data/lib/watir/js_snippets/backgroundColor.js +7 -0
- data/lib/watir/js_snippets/elementObscured.js +14 -0
- data/lib/watir/js_snippets/fireEvent.js +31 -0
- data/lib/watir/js_snippets/focus.js +3 -0
- data/lib/watir/js_snippets/getElementTags.js +3 -0
- data/lib/watir/js_snippets/getInnerHtml.js +19 -0
- data/lib/watir/js_snippets/getInnerText.js +19 -0
- data/lib/watir/js_snippets/getOuterHtml.js +20 -0
- data/lib/watir/js_snippets/getTextContent.js +19 -0
- data/lib/watir/js_snippets/isElementInViewport.js +20 -0
- data/lib/watir/js_snippets/isImageLoaded.js +3 -0
- data/lib/watir/js_snippets/selectOptionsLabel.js +10 -0
- data/lib/watir/js_snippets/selectOptionsText.js +10 -0
- data/lib/watir/js_snippets/selectOptionsValue.js +10 -0
- data/lib/watir/js_snippets/selectText.js +64 -0
- data/lib/watir/js_snippets/selectedOptions.js +11 -0
- data/lib/watir/js_snippets/selectedText.js +17 -0
- data/lib/watir/js_snippets/setText.js +3 -0
- data/lib/watir/js_snippets/setValue.js +3 -0
- data/lib/watir/js_snippets.rb +18 -0
- data/lib/watir/locators/anchor/selector_builder.rb +43 -0
- data/lib/watir/locators/button/matcher.rb +19 -0
- data/lib/watir/locators/button/selector_builder/xpath.rb +69 -0
- data/lib/watir/locators/button/selector_builder.rb +10 -0
- data/lib/watir/locators/cell/selector_builder/xpath.rb +23 -0
- data/lib/watir/locators/cell/selector_builder.rb +13 -0
- data/lib/watir/locators/element/locator.rb +81 -0
- data/lib/watir/locators/element/matcher.rb +118 -0
- data/lib/watir/locators/element/selector_builder/regexp_disassembler.rb +69 -0
- data/lib/watir/locators/element/selector_builder/xpath.rb +268 -0
- data/lib/watir/locators/element/selector_builder/xpath_support.rb +29 -0
- data/lib/watir/locators/element/selector_builder.rb +164 -0
- data/lib/watir/locators/option/matcher.rb +26 -0
- data/lib/watir/locators/option/selector_builder/xpath.rb +39 -0
- data/lib/watir/locators/option/selector_builder.rb +10 -0
- data/lib/watir/locators/row/selector_builder/xpath.rb +53 -0
- data/lib/watir/locators/row/selector_builder.rb +18 -0
- data/lib/watir/locators/text_area/selector_builder/xpath.rb +21 -0
- data/lib/watir/locators/text_area/selector_builder.rb +10 -0
- data/lib/watir/locators/text_field/matcher.rb +37 -0
- data/lib/watir/locators/text_field/selector_builder/xpath.rb +50 -0
- data/lib/watir/locators/text_field/selector_builder.rb +10 -0
- data/lib/watir/locators.rb +77 -0
- data/lib/watir/logger.rb +30 -0
- data/lib/watir/navigation.rb +51 -0
- data/lib/watir/radio_set.rb +230 -0
- data/lib/watir/row_container.rb +36 -0
- data/lib/watir/screenshot.rb +51 -0
- data/lib/watir/scroll.rb +95 -0
- data/lib/watir/search_context.rb +96 -0
- data/lib/watir/shadow_root.rb +60 -0
- data/lib/watir/user_editable.rb +85 -0
- data/lib/watir/version.rb +5 -0
- data/lib/watir/wait/timer.rb +52 -0
- data/lib/watir/wait.rb +171 -0
- data/lib/watir/window.rb +276 -0
- data/lib/watir/window_collection.rb +82 -0
- data/lib/watir.rb +108 -0
- data/lib/watirspec/guards.rb +65 -0
- data/lib/watirspec/implementation.rb +56 -0
- data/lib/watirspec/rake_tasks.rb +118 -0
- data/lib/watirspec/remote_server.rb +39 -0
- data/lib/watirspec/runner.rb +64 -0
- data/lib/watirspec/server/app.rb +86 -0
- data/lib/watirspec/server.rb +104 -0
- data/lib/watirspec.rb +93 -0
- data/spec/locator_spec_helper.rb +88 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/unit/capabilities_spec.rb +670 -0
- data/spec/unit/element_locator_spec.rb +97 -0
- data/spec/unit/match_elements/button_spec.rb +76 -0
- data/spec/unit/match_elements/element_spec.rb +424 -0
- data/spec/unit/match_elements/text_field_spec.rb +84 -0
- data/spec/unit/selector_builder/anchor_spec.rb +59 -0
- data/spec/unit/selector_builder/button_spec.rb +217 -0
- data/spec/unit/selector_builder/cell_spec.rb +71 -0
- data/spec/unit/selector_builder/element_spec.rb +804 -0
- data/spec/unit/selector_builder/row_spec.rb +128 -0
- data/spec/unit/selector_builder/text_field_spec.rb +203 -0
- data/spec/unit/selector_builder/textarea_spec.rb +35 -0
- data/spec/unit/unit_helper.rb +4 -0
- data/spec/unit/wait_spec.rb +99 -0
- data/spec/watirspec/adjacent_spec.rb +256 -0
- data/spec/watirspec/after_hooks_spec.rb +204 -0
- data/spec/watirspec/alert_spec.rb +89 -0
- data/spec/watirspec/browser_spec.rb +536 -0
- data/spec/watirspec/capabilities_spec.rb +556 -0
- data/spec/watirspec/cookies_spec.rb +196 -0
- data/spec/watirspec/drag_and_drop_spec.rb +38 -0
- data/spec/watirspec/element_hidden_spec.rb +86 -0
- data/spec/watirspec/elements/area_spec.rb +69 -0
- data/spec/watirspec/elements/areas_spec.rb +44 -0
- data/spec/watirspec/elements/button_spec.rb +265 -0
- data/spec/watirspec/elements/buttons_spec.rb +57 -0
- data/spec/watirspec/elements/checkbox_spec.rb +290 -0
- data/spec/watirspec/elements/checkboxes_spec.rb +46 -0
- data/spec/watirspec/elements/collections_spec.rb +132 -0
- data/spec/watirspec/elements/date_field_spec.rb +209 -0
- data/spec/watirspec/elements/date_fields_spec.rb +46 -0
- data/spec/watirspec/elements/date_time_field_spec.rb +223 -0
- data/spec/watirspec/elements/date_time_fields_spec.rb +47 -0
- data/spec/watirspec/elements/dd_spec.rb +108 -0
- data/spec/watirspec/elements/dds_spec.rb +44 -0
- data/spec/watirspec/elements/del_spec.rb +113 -0
- data/spec/watirspec/elements/dels_spec.rb +42 -0
- data/spec/watirspec/elements/div_spec.rb +232 -0
- data/spec/watirspec/elements/divs_spec.rb +56 -0
- data/spec/watirspec/elements/dl_spec.rb +117 -0
- data/spec/watirspec/elements/dls_spec.rb +45 -0
- data/spec/watirspec/elements/dt_spec.rb +107 -0
- data/spec/watirspec/elements/dts_spec.rb +44 -0
- data/spec/watirspec/elements/element_spec.rb +1069 -0
- data/spec/watirspec/elements/elements_spec.rb +60 -0
- data/spec/watirspec/elements/em_spec.rb +85 -0
- data/spec/watirspec/elements/ems_spec.rb +45 -0
- data/spec/watirspec/elements/filefield_spec.rb +135 -0
- data/spec/watirspec/elements/filefields_spec.rb +45 -0
- data/spec/watirspec/elements/font_spec.rb +31 -0
- data/spec/watirspec/elements/form_spec.rb +70 -0
- data/spec/watirspec/elements/forms_spec.rb +46 -0
- data/spec/watirspec/elements/frame_spec.rb +117 -0
- data/spec/watirspec/elements/frames_spec.rb +43 -0
- data/spec/watirspec/elements/hidden_spec.rb +106 -0
- data/spec/watirspec/elements/hiddens_spec.rb +45 -0
- data/spec/watirspec/elements/hn_spec.rb +80 -0
- data/spec/watirspec/elements/hns_spec.rb +42 -0
- data/spec/watirspec/elements/iframe_spec.rb +244 -0
- data/spec/watirspec/elements/iframes_spec.rb +49 -0
- data/spec/watirspec/elements/image_spec.rb +160 -0
- data/spec/watirspec/elements/images_spec.rb +42 -0
- data/spec/watirspec/elements/input_spec.rb +17 -0
- data/spec/watirspec/elements/ins_spec.rb +113 -0
- data/spec/watirspec/elements/inses_spec.rb +42 -0
- data/spec/watirspec/elements/label_spec.rb +77 -0
- data/spec/watirspec/elements/labels_spec.rb +42 -0
- data/spec/watirspec/elements/li_spec.rb +99 -0
- data/spec/watirspec/elements/link_spec.rb +180 -0
- data/spec/watirspec/elements/links_spec.rb +66 -0
- data/spec/watirspec/elements/lis_spec.rb +44 -0
- data/spec/watirspec/elements/list_spec.rb +50 -0
- data/spec/watirspec/elements/map_spec.rb +78 -0
- data/spec/watirspec/elements/maps_spec.rb +43 -0
- data/spec/watirspec/elements/meta_spec.rb +27 -0
- data/spec/watirspec/elements/metas_spec.rb +42 -0
- data/spec/watirspec/elements/ol_spec.rb +63 -0
- data/spec/watirspec/elements/ols_spec.rb +42 -0
- data/spec/watirspec/elements/option_spec.rb +113 -0
- data/spec/watirspec/elements/p_spec.rb +102 -0
- data/spec/watirspec/elements/pre_spec.rb +100 -0
- data/spec/watirspec/elements/pres_spec.rb +42 -0
- data/spec/watirspec/elements/ps_spec.rb +42 -0
- data/spec/watirspec/elements/radio_spec.rb +259 -0
- data/spec/watirspec/elements/radios_spec.rb +45 -0
- data/spec/watirspec/elements/select_list_spec.rb +701 -0
- data/spec/watirspec/elements/select_lists_spec.rb +49 -0
- data/spec/watirspec/elements/span_spec.rb +119 -0
- data/spec/watirspec/elements/spans_spec.rb +42 -0
- data/spec/watirspec/elements/strong_spec.rb +78 -0
- data/spec/watirspec/elements/strongs_spec.rb +45 -0
- data/spec/watirspec/elements/table_spec.rb +210 -0
- data/spec/watirspec/elements/tables_spec.rb +44 -0
- data/spec/watirspec/elements/tbody_spec.rb +94 -0
- data/spec/watirspec/elements/tbodys_spec.rb +64 -0
- data/spec/watirspec/elements/td_spec.rb +92 -0
- data/spec/watirspec/elements/tds_spec.rb +55 -0
- data/spec/watirspec/elements/text_field_spec.rb +223 -0
- data/spec/watirspec/elements/text_fields_spec.rb +47 -0
- data/spec/watirspec/elements/textarea_spec.rb +30 -0
- data/spec/watirspec/elements/textareas_spec.rb +28 -0
- data/spec/watirspec/elements/tfoot_spec.rb +89 -0
- data/spec/watirspec/elements/tfoots_spec.rb +72 -0
- data/spec/watirspec/elements/thead_spec.rb +88 -0
- data/spec/watirspec/elements/theads_spec.rb +72 -0
- data/spec/watirspec/elements/tr_spec.rb +69 -0
- data/spec/watirspec/elements/trs_spec.rb +63 -0
- data/spec/watirspec/elements/ul_spec.rb +63 -0
- data/spec/watirspec/elements/uls_spec.rb +42 -0
- data/spec/watirspec/html/alerts.html +12 -0
- data/spec/watirspec/html/aria_attributes.html +9 -0
- data/spec/watirspec/html/child_frame.html +29 -0
- data/spec/watirspec/html/class_locator.html +11 -0
- data/spec/watirspec/html/clicks.html +19 -0
- data/spec/watirspec/html/closeable.html +21 -0
- data/spec/watirspec/html/collections.html +15 -0
- data/spec/watirspec/html/css/jquery-ui-1.8.17.custom.css +287 -0
- data/spec/watirspec/html/data_attributes.html +10 -0
- data/spec/watirspec/html/definition_lists.html +48 -0
- data/spec/watirspec/html/drag_and_drop.html +106 -0
- data/spec/watirspec/html/font.html +10 -0
- data/spec/watirspec/html/forms_with_input_elements.html +194 -0
- data/spec/watirspec/html/frame_1.html +22 -0
- data/spec/watirspec/html/frame_2.html +16 -0
- data/spec/watirspec/html/frames.html +11 -0
- data/spec/watirspec/html/iframe_1.html +22 -0
- data/spec/watirspec/html/iframes.html +15 -0
- data/spec/watirspec/html/images/button.png +0 -0
- data/spec/watirspec/html/images/circle.png +0 -0
- data/spec/watirspec/html/images/map.gif +0 -0
- data/spec/watirspec/html/images/map2.gif +0 -0
- data/spec/watirspec/html/images/originaltriangle.png +0 -0
- data/spec/watirspec/html/images/square.png +0 -0
- data/spec/watirspec/html/images/triangle.png +0 -0
- data/spec/watirspec/html/images.html +28 -0
- data/spec/watirspec/html/inner_outer.html +5 -0
- data/spec/watirspec/html/javascript/angular.min.js +332 -0
- data/spec/watirspec/html/javascript/helpers.js +16 -0
- data/spec/watirspec/html/javascript/jquery-1.7.1.min.js +4 -0
- data/spec/watirspec/html/javascript/jquery-ui-1.8.17.custom.min.js +68 -0
- data/spec/watirspec/html/keylogger.html +15 -0
- data/spec/watirspec/html/modal_dialog.html +9 -0
- data/spec/watirspec/html/multiple_ids.html +15 -0
- data/spec/watirspec/html/nested_elements.html +44 -0
- data/spec/watirspec/html/nested_frame_1.html +1 -0
- data/spec/watirspec/html/nested_frame_2.html +9 -0
- data/spec/watirspec/html/nested_frame_3.html +14 -0
- data/spec/watirspec/html/nested_frames.html +10 -0
- data/spec/watirspec/html/nested_iframe_2.html +12 -0
- data/spec/watirspec/html/nested_iframes.html +13 -0
- data/spec/watirspec/html/nested_tables.html +203 -0
- data/spec/watirspec/html/non_control_elements.html +145 -0
- data/spec/watirspec/html/obscured.html +36 -0
- data/spec/watirspec/html/removed_element.html +24 -0
- data/spec/watirspec/html/right_click.html +23 -0
- data/spec/watirspec/html/scroll.html +15 -0
- data/spec/watirspec/html/scroll_nested.html +17 -0
- data/spec/watirspec/html/scroll_nested_offscreen.html +18 -0
- data/spec/watirspec/html/shadow_dom.html +28 -0
- data/spec/watirspec/html/special_chars.html +15 -0
- data/spec/watirspec/html/sticky_elements.html +10 -0
- data/spec/watirspec/html/tables.html +121 -0
- data/spec/watirspec/html/timeout_window_location.html +19 -0
- data/spec/watirspec/html/uneven_table.html +20 -0
- data/spec/watirspec/html/wait.html +99 -0
- data/spec/watirspec/html/watirspec.css +0 -0
- data/spec/watirspec/html/window_switching.html +22 -0
- data/spec/watirspec/radio_set_spec.rb +346 -0
- data/spec/watirspec/screenshot_spec.rb +33 -0
- data/spec/watirspec/scroll_spec.rb +208 -0
- data/spec/watirspec/shadow_root_spec.rb +108 -0
- data/spec/watirspec/support/rspec_matchers.rb +161 -0
- data/spec/watirspec/user_editable_spec.rb +207 -0
- data/spec/watirspec/wait_spec.rb +345 -0
- data/spec/watirspec/window_switching_spec.rb +580 -0
- data/spec/watirspec_helper.rb +163 -0
- data/support/doctest_helper.rb +101 -0
- data/support/version_differ.rb +60 -0
- data/watir.gemspec +50 -0
- metadata +652 -148
- data/readme.rb +0 -211
- data/unittests/WindowLogonExample.rb +0 -30
- data/unittests/WindowLogonExtra.rb +0 -7
- data/unittests/all_tests.rb +0 -10
- data/unittests/all_tests_concurrent.rb +0 -57
- data/unittests/attachToExistingWindow_test.rb +0 -40
- data/unittests/buttons_test.rb +0 -131
- data/unittests/checkbox_test.rb +0 -149
- data/unittests/core_tests.rb +0 -9
- data/unittests/css_test.rb +0 -60
- data/unittests/div_test.rb +0 -179
- data/unittests/errorchecker_test.rb +0 -29
- data/unittests/filefield_test.rb +0 -35
- data/unittests/form_test.rb +0 -279
- data/unittests/frame_test.rb +0 -141
- data/unittests/html/blankpage.html +0 -12
- data/unittests/html/buttons1.html +0 -40
- data/unittests/html/checkboxes1.html +0 -69
- data/unittests/html/complex_table.html +0 -36
- data/unittests/html/cssTest.html +0 -42
- data/unittests/html/div.html +0 -105
- data/unittests/html/fileupload.html +0 -45
- data/unittests/html/formTest1.html +0 -39
- data/unittests/html/forms2.html +0 -45
- data/unittests/html/forms3.html +0 -132
- data/unittests/html/forms4.html +0 -27
- data/unittests/html/frame_buttons.html +0 -4
- data/unittests/html/frame_links.html +0 -4
- data/unittests/html/frame_multi.html +0 -5
- data/unittests/html/iframeTest.html +0 -13
- data/unittests/html/iframeTest1.html +0 -7
- data/unittests/html/iframeTest2.html +0 -6
- data/unittests/html/images/button.jpg +0 -0
- data/unittests/html/images/circle.jpg +0 -0
- data/unittests/html/images/originaltriangle.jpg +0 -0
- data/unittests/html/images/square.jpg +0 -0
- data/unittests/html/images/triangle.jpg +0 -0
- data/unittests/html/images1.html +0 -52
- data/unittests/html/javascriptevents.html +0 -39
- data/unittests/html/link_pass.html +0 -11
- data/unittests/html/links1.html +0 -37
- data/unittests/html/links2.html +0 -11
- data/unittests/html/nestedFrames.html +0 -6
- data/unittests/html/pass.html +0 -10
- data/unittests/html/popups1.html +0 -60
- data/unittests/html/radioButtons1.html +0 -71
- data/unittests/html/select_tealeaf.html +0 -54
- data/unittests/html/selectboxes1.html +0 -55
- data/unittests/html/simple_table.html +0 -26
- data/unittests/html/simple_table_buttons.html +0 -104
- data/unittests/html/simple_table_columns.html +0 -76
- data/unittests/html/table1.html +0 -142
- data/unittests/html/textarea.html +0 -30
- data/unittests/html/textfields1.html +0 -87
- data/unittests/html/textsearch.html +0 -44
- data/unittests/ie_mock.rb +0 -93
- data/unittests/ie_test.rb +0 -50
- data/unittests/images_test.rb +0 -179
- data/unittests/iostring.rb +0 -30
- data/unittests/iostring_test.rb +0 -48
- data/unittests/js_events_test.rb +0 -77
- data/unittests/jscriptExtraAlert.rb +0 -6
- data/unittests/jscriptExtraConfirmCancel.rb +0 -7
- data/unittests/jscriptExtraConfirmOk.rb +0 -7
- data/unittests/jscriptPushButton.rb +0 -5
- data/unittests/jscript_test.rb +0 -57
- data/unittests/links_test.rb +0 -169
- data/unittests/minmax_test.rb +0 -31
- data/unittests/navigate_test.rb +0 -56
- data/unittests/non_core_tests.rb +0 -9
- data/unittests/pagecontainstext_test.rb +0 -49
- data/unittests/popups_test.rb +0 -44
- data/unittests/radios_test.rb +0 -164
- data/unittests/screen_capture_test.rb +0 -53
- data/unittests/selectbox_test.rb +0 -197
- data/unittests/send_keys_test.rb +0 -29
- data/unittests/setup.rb +0 -47
- data/unittests/table_test.rb +0 -306
- data/unittests/textAreafields_test.rb +0 -81
- data/unittests/textfields_test.rb +0 -239
- data/watir/AutoItX3.dll +0 -0
- data/watir/WindowHelper.rb +0 -47
- data/watir/camel_case.rb +0 -37
- data/watir/clickJSDialog.rb +0 -19
- data/watir/cookiemanager.rb +0 -53
- data/watir/exceptions.rb +0 -60
- data/watir/screen_capture.rb +0 -115
- data/watir/setFileDialog.rb +0 -16
- data/watir/testUnitAddons.rb +0 -47
- data/watir/watir_simple.rb +0 -475
- data/watir/winClicker.rb +0 -505
- data/watir.rb +0 -3744
- /data/{unittests → spec/watirspec}/html/images/1.gif +0 -0
- /data/{unittests/html/images/2.GIF → spec/watirspec/html/images/2.gif} +0 -0
- /data/{unittests/html/images/3.GIF → spec/watirspec/html/images/3.gif} +0 -0
- /data/{unittests/html/images/minus.GIF → spec/watirspec/html/images/minus.gif} +0 -0
- /data/{unittests → spec/watirspec}/html/images/plus.gif +0 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
# Autogenerated from SVG specification. Edits may be lost.
|
|
2
|
+
module Watir
|
|
3
|
+
class SVGElement < HTMLElement
|
|
4
|
+
attribute(String, :classname, :className)
|
|
5
|
+
attribute(String, :ownersvgelement, :ownerSVGElement)
|
|
6
|
+
attribute(String, :viewportelement, :viewportElement)
|
|
7
|
+
attribute(String, :correspondingelement, :correspondingElement)
|
|
8
|
+
attribute(String, :correspondinguseelement, :correspondingUseElement)
|
|
9
|
+
end
|
|
10
|
+
class SVGElementCollection < ElementCollection
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class View < SVGElement
|
|
14
|
+
attribute(String, :viewbox, :viewBox)
|
|
15
|
+
attribute(String, :preserveaspectratio, :preserveAspectRatio)
|
|
16
|
+
attribute(Integer, :zoomandpan, :zoomAndPan)
|
|
17
|
+
end
|
|
18
|
+
class ViewCollection < ElementCollection
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class Pattern < SVGElement
|
|
22
|
+
attribute(String, :patternunits, :patternUnits)
|
|
23
|
+
attribute(String, :patterncontentunits, :patternContentUnits)
|
|
24
|
+
attribute(String, :patterntransform, :patternTransform)
|
|
25
|
+
attribute(Integer, :x, :x)
|
|
26
|
+
attribute(Integer, :y, :y)
|
|
27
|
+
attribute(Integer, :width, :width)
|
|
28
|
+
attribute(Integer, :height, :height)
|
|
29
|
+
attribute(String, :viewbox, :viewBox)
|
|
30
|
+
attribute(String, :preserveaspectratio, :preserveAspectRatio)
|
|
31
|
+
attribute(String, :href, :href)
|
|
32
|
+
end
|
|
33
|
+
class PatternCollection < ElementCollection
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class Stop < SVGElement
|
|
37
|
+
attribute(String, :offset, :offset)
|
|
38
|
+
end
|
|
39
|
+
class StopCollection < ElementCollection
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class Gradient < SVGElement
|
|
43
|
+
attribute(String, :gradientunits, :gradientUnits)
|
|
44
|
+
attribute(String, :gradienttransform, :gradientTransform)
|
|
45
|
+
attribute(String, :spreadmethod, :spreadMethod)
|
|
46
|
+
attribute(String, :href, :href)
|
|
47
|
+
end
|
|
48
|
+
class GradientCollection < ElementCollection
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class RadialGradient < Gradient
|
|
52
|
+
attribute(Integer, :cx, :cx)
|
|
53
|
+
attribute(Integer, :cy, :cy)
|
|
54
|
+
attribute(Integer, :r, :r)
|
|
55
|
+
attribute(Integer, :fx, :fx)
|
|
56
|
+
attribute(Integer, :fy, :fy)
|
|
57
|
+
attribute(Integer, :fr, :fr)
|
|
58
|
+
end
|
|
59
|
+
class RadialGradientCollection < ElementCollection
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class LinearGradient < Gradient
|
|
63
|
+
attribute(Integer, :x1, :x1)
|
|
64
|
+
attribute(Integer, :y1, :y1)
|
|
65
|
+
attribute(Integer, :x2, :x2)
|
|
66
|
+
attribute(Integer, :y2, :y2)
|
|
67
|
+
end
|
|
68
|
+
class LinearGradientCollection < ElementCollection
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class Marker < SVGElement
|
|
72
|
+
attribute(Integer, :refx, :refX)
|
|
73
|
+
attribute(Integer, :refy, :refY)
|
|
74
|
+
attribute(String, :markerunits, :markerUnits)
|
|
75
|
+
attribute(Integer, :markerwidth, :markerWidth)
|
|
76
|
+
attribute(Integer, :markerheight, :markerHeight)
|
|
77
|
+
attribute(String, :orienttype, :orientType)
|
|
78
|
+
attribute(String, :orientangle, :orientAngle)
|
|
79
|
+
attribute(String, :orient, :orient)
|
|
80
|
+
attribute(String, :viewbox, :viewBox)
|
|
81
|
+
attribute(String, :preserveaspectratio, :preserveAspectRatio)
|
|
82
|
+
end
|
|
83
|
+
class MarkerCollection < ElementCollection
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
class Metadata < SVGElement
|
|
87
|
+
end
|
|
88
|
+
class MetadataCollection < ElementCollection
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class Desc < SVGElement
|
|
92
|
+
end
|
|
93
|
+
class DescCollection < ElementCollection
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
class Graphics < SVGElement
|
|
97
|
+
attribute(String, :transform, :transform)
|
|
98
|
+
attribute(String, :requiredextensions, :requiredExtensions)
|
|
99
|
+
attribute(String, :systemlanguage, :systemLanguage)
|
|
100
|
+
end
|
|
101
|
+
class GraphicsCollection < ElementCollection
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
class ForeignObject < Graphics
|
|
105
|
+
attribute(Integer, :x, :x)
|
|
106
|
+
attribute(Integer, :y, :y)
|
|
107
|
+
attribute(Integer, :width, :width)
|
|
108
|
+
attribute(Integer, :height, :height)
|
|
109
|
+
end
|
|
110
|
+
class ForeignObjectCollection < ElementCollection
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class TextContent < Graphics
|
|
114
|
+
attribute(Integer, :textlength, :textLength)
|
|
115
|
+
attribute(String, :lengthadjust, :lengthAdjust)
|
|
116
|
+
end
|
|
117
|
+
class TextContentCollection < ElementCollection
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
class TextPath < TextContent
|
|
121
|
+
attribute(Integer, :startoffset, :startOffset)
|
|
122
|
+
attribute(String, :method, :method)
|
|
123
|
+
attribute(String, :spacing, :spacing)
|
|
124
|
+
attribute(String, :href, :href)
|
|
125
|
+
end
|
|
126
|
+
class TextPathCollection < ElementCollection
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
class TextPositioning < TextContent
|
|
130
|
+
attribute(String, :x, :x)
|
|
131
|
+
attribute(String, :y, :y)
|
|
132
|
+
attribute(String, :dx, :dx)
|
|
133
|
+
attribute(String, :dy, :dy)
|
|
134
|
+
attribute(String, :rotate, :rotate)
|
|
135
|
+
end
|
|
136
|
+
class TextPositioningCollection < ElementCollection
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
class TSpan < TextPositioning
|
|
140
|
+
end
|
|
141
|
+
class TSpanCollection < ElementCollection
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
class Switch < Graphics
|
|
145
|
+
end
|
|
146
|
+
class SwitchCollection < ElementCollection
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
class Use < Graphics
|
|
150
|
+
attribute(Integer, :x, :x)
|
|
151
|
+
attribute(Integer, :y, :y)
|
|
152
|
+
attribute(Integer, :width, :width)
|
|
153
|
+
attribute(Integer, :height, :height)
|
|
154
|
+
attribute(String, :instanceroot, :instanceRoot)
|
|
155
|
+
attribute(String, :animatedinstanceroot, :animatedInstanceRoot)
|
|
156
|
+
attribute(String, :href, :href)
|
|
157
|
+
end
|
|
158
|
+
class UseCollection < ElementCollection
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
class Symbol < Graphics
|
|
162
|
+
attribute(String, :viewbox, :viewBox)
|
|
163
|
+
attribute(String, :preserveaspectratio, :preserveAspectRatio)
|
|
164
|
+
end
|
|
165
|
+
class SymbolCollection < ElementCollection
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
class Defs < Graphics
|
|
169
|
+
end
|
|
170
|
+
class DefsCollection < ElementCollection
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
class G < Graphics
|
|
174
|
+
end
|
|
175
|
+
class GCollection < ElementCollection
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
class SVG < Graphics
|
|
179
|
+
attribute(Integer, :x, :x)
|
|
180
|
+
attribute(Integer, :y, :y)
|
|
181
|
+
attribute(Integer, :width, :width)
|
|
182
|
+
attribute(Integer, :height, :height)
|
|
183
|
+
attribute(Float, :currentscale, :currentScale)
|
|
184
|
+
attribute(String, :currenttranslate, :currentTranslate)
|
|
185
|
+
attribute(String, :viewbox, :viewBox)
|
|
186
|
+
attribute(String, :preserveaspectratio, :preserveAspectRatio)
|
|
187
|
+
attribute(Integer, :zoomandpan, :zoomAndPan)
|
|
188
|
+
end
|
|
189
|
+
class SVGCollection < ElementCollection
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
class Geometry < Graphics
|
|
193
|
+
attribute(String, :pathlength, :pathLength)
|
|
194
|
+
end
|
|
195
|
+
class GeometryCollection < ElementCollection
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
class Polygon < Geometry
|
|
199
|
+
attribute(String, :points, :points)
|
|
200
|
+
attribute(String, :animatedpoints, :animatedPoints)
|
|
201
|
+
end
|
|
202
|
+
class PolygonCollection < ElementCollection
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
class Polyline < Geometry
|
|
206
|
+
attribute(String, :points, :points)
|
|
207
|
+
attribute(String, :animatedpoints, :animatedPoints)
|
|
208
|
+
end
|
|
209
|
+
class PolylineCollection < ElementCollection
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
class Line < Geometry
|
|
213
|
+
attribute(Integer, :x1, :x1)
|
|
214
|
+
attribute(Integer, :y1, :y1)
|
|
215
|
+
attribute(Integer, :x2, :x2)
|
|
216
|
+
attribute(Integer, :y2, :y2)
|
|
217
|
+
end
|
|
218
|
+
class LineCollection < ElementCollection
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
class Ellipse < Geometry
|
|
222
|
+
attribute(Integer, :cx, :cx)
|
|
223
|
+
attribute(Integer, :cy, :cy)
|
|
224
|
+
attribute(Integer, :rx, :rx)
|
|
225
|
+
attribute(Integer, :ry, :ry)
|
|
226
|
+
end
|
|
227
|
+
class EllipseCollection < ElementCollection
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
class Circle < Geometry
|
|
231
|
+
attribute(Integer, :cx, :cx)
|
|
232
|
+
attribute(Integer, :cy, :cy)
|
|
233
|
+
attribute(Integer, :r, :r)
|
|
234
|
+
end
|
|
235
|
+
class CircleCollection < ElementCollection
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
class Rect < Geometry
|
|
239
|
+
attribute(Integer, :x, :x)
|
|
240
|
+
attribute(Integer, :y, :y)
|
|
241
|
+
attribute(Integer, :width, :width)
|
|
242
|
+
attribute(Integer, :height, :height)
|
|
243
|
+
attribute(Integer, :rx, :rx)
|
|
244
|
+
attribute(Integer, :ry, :ry)
|
|
245
|
+
end
|
|
246
|
+
class RectCollection < ElementCollection
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
class Path < Geometry
|
|
250
|
+
end
|
|
251
|
+
class PathCollection < ElementCollection
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
module Container
|
|
256
|
+
|
|
257
|
+
# @return [Circle]
|
|
258
|
+
def circle(opts = {})
|
|
259
|
+
Circle.new(self, opts.merge(tag_name: "circle"))
|
|
260
|
+
end
|
|
261
|
+
# @return [CircleCollection]
|
|
262
|
+
def circles(opts = {})
|
|
263
|
+
CircleCollection.new(self, opts.merge(tag_name: "circle"))
|
|
264
|
+
end
|
|
265
|
+
Watir.tag_to_class[:circle] = Circle
|
|
266
|
+
|
|
267
|
+
# @return [Defs]
|
|
268
|
+
def defs(opts = {})
|
|
269
|
+
Defs.new(self, opts.merge(tag_name: "defs"))
|
|
270
|
+
end
|
|
271
|
+
# @return [DefsCollection]
|
|
272
|
+
def defss(opts = {})
|
|
273
|
+
DefsCollection.new(self, opts.merge(tag_name: "defs"))
|
|
274
|
+
end
|
|
275
|
+
Watir.tag_to_class[:defs] = Defs
|
|
276
|
+
|
|
277
|
+
# @return [Desc]
|
|
278
|
+
def desc(opts = {})
|
|
279
|
+
Desc.new(self, opts.merge(tag_name: "desc"))
|
|
280
|
+
end
|
|
281
|
+
# @return [DescCollection]
|
|
282
|
+
def descs(opts = {})
|
|
283
|
+
DescCollection.new(self, opts.merge(tag_name: "desc"))
|
|
284
|
+
end
|
|
285
|
+
Watir.tag_to_class[:desc] = Desc
|
|
286
|
+
|
|
287
|
+
# @return [Ellipse]
|
|
288
|
+
def ellipse(opts = {})
|
|
289
|
+
Ellipse.new(self, opts.merge(tag_name: "ellipse"))
|
|
290
|
+
end
|
|
291
|
+
# @return [EllipseCollection]
|
|
292
|
+
def ellipses(opts = {})
|
|
293
|
+
EllipseCollection.new(self, opts.merge(tag_name: "ellipse"))
|
|
294
|
+
end
|
|
295
|
+
Watir.tag_to_class[:ellipse] = Ellipse
|
|
296
|
+
|
|
297
|
+
# @return [ForeignObject]
|
|
298
|
+
def foreign_object(opts = {})
|
|
299
|
+
ForeignObject.new(self, opts.merge(tag_name: "foreignObject"))
|
|
300
|
+
end
|
|
301
|
+
# @return [ForeignObjectCollection]
|
|
302
|
+
def foreign_objects(opts = {})
|
|
303
|
+
ForeignObjectCollection.new(self, opts.merge(tag_name: "foreignObject"))
|
|
304
|
+
end
|
|
305
|
+
Watir.tag_to_class[:foreignObject] = ForeignObject
|
|
306
|
+
|
|
307
|
+
# @return [G]
|
|
308
|
+
def g(opts = {})
|
|
309
|
+
G.new(self, opts.merge(tag_name: "g"))
|
|
310
|
+
end
|
|
311
|
+
# @return [GCollection]
|
|
312
|
+
def gs(opts = {})
|
|
313
|
+
GCollection.new(self, opts.merge(tag_name: "g"))
|
|
314
|
+
end
|
|
315
|
+
Watir.tag_to_class[:g] = G
|
|
316
|
+
|
|
317
|
+
# @return [Line]
|
|
318
|
+
def line(opts = {})
|
|
319
|
+
Line.new(self, opts.merge(tag_name: "line"))
|
|
320
|
+
end
|
|
321
|
+
# @return [LineCollection]
|
|
322
|
+
def lines(opts = {})
|
|
323
|
+
LineCollection.new(self, opts.merge(tag_name: "line"))
|
|
324
|
+
end
|
|
325
|
+
Watir.tag_to_class[:line] = Line
|
|
326
|
+
|
|
327
|
+
# @return [LinearGradient]
|
|
328
|
+
def linear_gradient(opts = {})
|
|
329
|
+
LinearGradient.new(self, opts.merge(tag_name: "linearGradient"))
|
|
330
|
+
end
|
|
331
|
+
# @return [LinearGradientCollection]
|
|
332
|
+
def linear_gradients(opts = {})
|
|
333
|
+
LinearGradientCollection.new(self, opts.merge(tag_name: "linearGradient"))
|
|
334
|
+
end
|
|
335
|
+
Watir.tag_to_class[:linearGradient] = LinearGradient
|
|
336
|
+
|
|
337
|
+
# @return [Marker]
|
|
338
|
+
def marker(opts = {})
|
|
339
|
+
Marker.new(self, opts.merge(tag_name: "marker"))
|
|
340
|
+
end
|
|
341
|
+
# @return [MarkerCollection]
|
|
342
|
+
def markers(opts = {})
|
|
343
|
+
MarkerCollection.new(self, opts.merge(tag_name: "marker"))
|
|
344
|
+
end
|
|
345
|
+
Watir.tag_to_class[:marker] = Marker
|
|
346
|
+
|
|
347
|
+
# @return [Metadata]
|
|
348
|
+
def metadata(opts = {})
|
|
349
|
+
Metadata.new(self, opts.merge(tag_name: "metadata"))
|
|
350
|
+
end
|
|
351
|
+
# @return [MetadataCollection]
|
|
352
|
+
def metadatas(opts = {})
|
|
353
|
+
MetadataCollection.new(self, opts.merge(tag_name: "metadata"))
|
|
354
|
+
end
|
|
355
|
+
Watir.tag_to_class[:metadata] = Metadata
|
|
356
|
+
|
|
357
|
+
# @return [Path]
|
|
358
|
+
def path(opts = {})
|
|
359
|
+
Path.new(self, opts.merge(tag_name: "path"))
|
|
360
|
+
end
|
|
361
|
+
# @return [PathCollection]
|
|
362
|
+
def paths(opts = {})
|
|
363
|
+
PathCollection.new(self, opts.merge(tag_name: "path"))
|
|
364
|
+
end
|
|
365
|
+
Watir.tag_to_class[:path] = Path
|
|
366
|
+
|
|
367
|
+
# @return [Pattern]
|
|
368
|
+
def pattern(opts = {})
|
|
369
|
+
Pattern.new(self, opts.merge(tag_name: "pattern"))
|
|
370
|
+
end
|
|
371
|
+
# @return [PatternCollection]
|
|
372
|
+
def patterns(opts = {})
|
|
373
|
+
PatternCollection.new(self, opts.merge(tag_name: "pattern"))
|
|
374
|
+
end
|
|
375
|
+
Watir.tag_to_class[:pattern] = Pattern
|
|
376
|
+
|
|
377
|
+
# @return [Polygon]
|
|
378
|
+
def polygon(opts = {})
|
|
379
|
+
Polygon.new(self, opts.merge(tag_name: "polygon"))
|
|
380
|
+
end
|
|
381
|
+
# @return [PolygonCollection]
|
|
382
|
+
def polygons(opts = {})
|
|
383
|
+
PolygonCollection.new(self, opts.merge(tag_name: "polygon"))
|
|
384
|
+
end
|
|
385
|
+
Watir.tag_to_class[:polygon] = Polygon
|
|
386
|
+
|
|
387
|
+
# @return [Polyline]
|
|
388
|
+
def polyline(opts = {})
|
|
389
|
+
Polyline.new(self, opts.merge(tag_name: "polyline"))
|
|
390
|
+
end
|
|
391
|
+
# @return [PolylineCollection]
|
|
392
|
+
def polylines(opts = {})
|
|
393
|
+
PolylineCollection.new(self, opts.merge(tag_name: "polyline"))
|
|
394
|
+
end
|
|
395
|
+
Watir.tag_to_class[:polyline] = Polyline
|
|
396
|
+
|
|
397
|
+
# @return [RadialGradient]
|
|
398
|
+
def radial_gradient(opts = {})
|
|
399
|
+
RadialGradient.new(self, opts.merge(tag_name: "radialGradient"))
|
|
400
|
+
end
|
|
401
|
+
# @return [RadialGradientCollection]
|
|
402
|
+
def radial_gradients(opts = {})
|
|
403
|
+
RadialGradientCollection.new(self, opts.merge(tag_name: "radialGradient"))
|
|
404
|
+
end
|
|
405
|
+
Watir.tag_to_class[:radialGradient] = RadialGradient
|
|
406
|
+
|
|
407
|
+
# @return [Rect]
|
|
408
|
+
def rect(opts = {})
|
|
409
|
+
Rect.new(self, opts.merge(tag_name: "rect"))
|
|
410
|
+
end
|
|
411
|
+
# @return [RectCollection]
|
|
412
|
+
def rects(opts = {})
|
|
413
|
+
RectCollection.new(self, opts.merge(tag_name: "rect"))
|
|
414
|
+
end
|
|
415
|
+
Watir.tag_to_class[:rect] = Rect
|
|
416
|
+
|
|
417
|
+
# @return [Stop]
|
|
418
|
+
def stop(opts = {})
|
|
419
|
+
Stop.new(self, opts.merge(tag_name: "stop"))
|
|
420
|
+
end
|
|
421
|
+
# @return [StopCollection]
|
|
422
|
+
def stops(opts = {})
|
|
423
|
+
StopCollection.new(self, opts.merge(tag_name: "stop"))
|
|
424
|
+
end
|
|
425
|
+
Watir.tag_to_class[:stop] = Stop
|
|
426
|
+
|
|
427
|
+
# @return [SVG]
|
|
428
|
+
def svg(opts = {})
|
|
429
|
+
SVG.new(self, opts.merge(tag_name: "svg"))
|
|
430
|
+
end
|
|
431
|
+
# @return [SVGCollection]
|
|
432
|
+
def svgs(opts = {})
|
|
433
|
+
SVGCollection.new(self, opts.merge(tag_name: "svg"))
|
|
434
|
+
end
|
|
435
|
+
Watir.tag_to_class[:svg] = SVG
|
|
436
|
+
|
|
437
|
+
# @return [Switch]
|
|
438
|
+
def switch(opts = {})
|
|
439
|
+
Switch.new(self, opts.merge(tag_name: "switch"))
|
|
440
|
+
end
|
|
441
|
+
# @return [SwitchCollection]
|
|
442
|
+
def switches(opts = {})
|
|
443
|
+
SwitchCollection.new(self, opts.merge(tag_name: "switch"))
|
|
444
|
+
end
|
|
445
|
+
Watir.tag_to_class[:switch] = Switch
|
|
446
|
+
|
|
447
|
+
# @return [Symbol]
|
|
448
|
+
def symbol(opts = {})
|
|
449
|
+
Symbol.new(self, opts.merge(tag_name: "symbol"))
|
|
450
|
+
end
|
|
451
|
+
# @return [SymbolCollection]
|
|
452
|
+
def symbols(opts = {})
|
|
453
|
+
SymbolCollection.new(self, opts.merge(tag_name: "symbol"))
|
|
454
|
+
end
|
|
455
|
+
Watir.tag_to_class[:symbol] = Symbol
|
|
456
|
+
|
|
457
|
+
# @return [TextPath]
|
|
458
|
+
def text_path(opts = {})
|
|
459
|
+
TextPath.new(self, opts.merge(tag_name: "textPath"))
|
|
460
|
+
end
|
|
461
|
+
# @return [TextPathCollection]
|
|
462
|
+
def text_paths(opts = {})
|
|
463
|
+
TextPathCollection.new(self, opts.merge(tag_name: "textPath"))
|
|
464
|
+
end
|
|
465
|
+
Watir.tag_to_class[:textPath] = TextPath
|
|
466
|
+
|
|
467
|
+
# @return [TSpan]
|
|
468
|
+
def tspan(opts = {})
|
|
469
|
+
TSpan.new(self, opts.merge(tag_name: "tspan"))
|
|
470
|
+
end
|
|
471
|
+
# @return [TSpanCollection]
|
|
472
|
+
def tspans(opts = {})
|
|
473
|
+
TSpanCollection.new(self, opts.merge(tag_name: "tspan"))
|
|
474
|
+
end
|
|
475
|
+
Watir.tag_to_class[:tspan] = TSpan
|
|
476
|
+
|
|
477
|
+
# @return [Use]
|
|
478
|
+
def use(opts = {})
|
|
479
|
+
Use.new(self, opts.merge(tag_name: "use"))
|
|
480
|
+
end
|
|
481
|
+
# @return [UseCollection]
|
|
482
|
+
def uses(opts = {})
|
|
483
|
+
UseCollection.new(self, opts.merge(tag_name: "use"))
|
|
484
|
+
end
|
|
485
|
+
Watir.tag_to_class[:use] = Use
|
|
486
|
+
|
|
487
|
+
# @return [View]
|
|
488
|
+
def view(opts = {})
|
|
489
|
+
View.new(self, opts.merge(tag_name: "view"))
|
|
490
|
+
end
|
|
491
|
+
# @return [ViewCollection]
|
|
492
|
+
def views(opts = {})
|
|
493
|
+
ViewCollection.new(self, opts.merge(tag_name: "view"))
|
|
494
|
+
end
|
|
495
|
+
Watir.tag_to_class[:view] = View
|
|
496
|
+
end # Container
|
|
497
|
+
end # Watir
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Watir
|
|
4
|
+
class Table < HTMLElement
|
|
5
|
+
include RowContainer
|
|
6
|
+
include Enumerable
|
|
7
|
+
|
|
8
|
+
#
|
|
9
|
+
# Yields each TableRow associated with this table.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# table = browser.table
|
|
13
|
+
# table.each do |row|
|
|
14
|
+
# puts row.text
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# @yieldparam [Watir::TableRow] element Iterate through the rows for this table.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
def each(&block)
|
|
21
|
+
rows.each(&block)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Represents table rows as hashes
|
|
26
|
+
#
|
|
27
|
+
# @return [Array<Hash>]
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
def hashes
|
|
31
|
+
all_rows = rows.locate
|
|
32
|
+
header_row = all_rows.first || raise(Error, 'no rows in table')
|
|
33
|
+
|
|
34
|
+
all_rows.entries[1..].map do |row|
|
|
35
|
+
cell_size_check(header_row, row)
|
|
36
|
+
headers(header_row).map(&:text).zip(row.cells.map(&:text)).to_h
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
#
|
|
41
|
+
# Returns first row of Table with proper subtype
|
|
42
|
+
#
|
|
43
|
+
# @return [TableCellCollection]
|
|
44
|
+
#
|
|
45
|
+
|
|
46
|
+
def headers(row = nil)
|
|
47
|
+
row ||= rows.first
|
|
48
|
+
header_type = row.th.exist? ? 'th' : 'td'
|
|
49
|
+
row.send("#{header_type}s")
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
#
|
|
53
|
+
# Returns row of this table with given index.
|
|
54
|
+
#
|
|
55
|
+
# @param [Integer] idx
|
|
56
|
+
# @return Watir::Row
|
|
57
|
+
#
|
|
58
|
+
|
|
59
|
+
def [](idx)
|
|
60
|
+
row(index: idx)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
#
|
|
64
|
+
# @api private
|
|
65
|
+
#
|
|
66
|
+
|
|
67
|
+
def cell_size_check(header_row, cell_row)
|
|
68
|
+
header_size = header_row.cells.size
|
|
69
|
+
row_size = cell_row.cells.size
|
|
70
|
+
return if header_size == row_size
|
|
71
|
+
|
|
72
|
+
index = cell_row.selector[:index]
|
|
73
|
+
row_id = index ? "row at index #{index - 1}" : 'designated row'
|
|
74
|
+
raise Error, "#{row_id} has #{row_size} cells, while header row has #{header_size}"
|
|
75
|
+
end
|
|
76
|
+
end # Table
|
|
77
|
+
end # Watir
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Watir
|
|
4
|
+
class TableCell < HTMLElement
|
|
5
|
+
def column_header
|
|
6
|
+
current_row = parent(tag_name: 'tr')
|
|
7
|
+
header_row(current_row, index: previous_siblings.size).text
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def sibling_from_header(opt)
|
|
11
|
+
current_row = parent(tag_name: 'tr')
|
|
12
|
+
header = header_row(current_row, opt)
|
|
13
|
+
index = header.previous_siblings.size
|
|
14
|
+
|
|
15
|
+
self.class.new(current_row, tag_name: 'td', index: index)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def header_row(current_row, opt)
|
|
21
|
+
table = parent(tag_name: 'table')
|
|
22
|
+
header_row = table.tr
|
|
23
|
+
|
|
24
|
+
table.cell_size_check(header_row, current_row)
|
|
25
|
+
|
|
26
|
+
header_type = table.th.exist? ? 'th' : 'tr'
|
|
27
|
+
opt[:tag_name] = header_type
|
|
28
|
+
|
|
29
|
+
Watir.tag_to_class[header_type.to_sym].new(header_row, opt)
|
|
30
|
+
end
|
|
31
|
+
end # TableCell
|
|
32
|
+
end # Watir
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Watir
|
|
4
|
+
class TableRow < HTMLElement
|
|
5
|
+
include CellContainer
|
|
6
|
+
include Enumerable
|
|
7
|
+
|
|
8
|
+
#
|
|
9
|
+
# Yields each TableCell associated with this row.
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# row = browser.tr
|
|
13
|
+
# row.each do |cell|
|
|
14
|
+
# puts cell.text
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# @yieldparam [Watir::TableCell] element Iterate through the cells for this row.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
def each(&block)
|
|
21
|
+
cells.each(&block)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Get the n'th cell (<th> or <td>) of this row
|
|
26
|
+
#
|
|
27
|
+
# @return Watir::Cell
|
|
28
|
+
#
|
|
29
|
+
|
|
30
|
+
def [](idx)
|
|
31
|
+
cell(index: idx)
|
|
32
|
+
end
|
|
33
|
+
end # TableRow
|
|
34
|
+
end # Watir
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Watir
|
|
4
|
+
class TableSection < HTMLElement
|
|
5
|
+
include RowContainer
|
|
6
|
+
|
|
7
|
+
#
|
|
8
|
+
# Returns table section row with given index.
|
|
9
|
+
#
|
|
10
|
+
# @param [Integer] idx
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
def [](idx)
|
|
14
|
+
row(index: idx)
|
|
15
|
+
end
|
|
16
|
+
end # TableSection
|
|
17
|
+
end # Watir
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Watir
|
|
4
|
+
class TextField < Input
|
|
5
|
+
include UserEditable
|
|
6
|
+
|
|
7
|
+
NON_TEXT_TYPES = %w[file radio checkbox submit reset image button hidden range color date datetime-local].freeze
|
|
8
|
+
|
|
9
|
+
def selector_string
|
|
10
|
+
selector = @selector.dup
|
|
11
|
+
selector[:type] = '(any text type)'
|
|
12
|
+
selector[:tag_name] = 'input'
|
|
13
|
+
|
|
14
|
+
if @query_scope.is_a?(Browser) || @query_scope.is_a?(IFrame)
|
|
15
|
+
super
|
|
16
|
+
else
|
|
17
|
+
"#{@query_scope.selector_string} --> #{selector.inspect}"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end # TextField
|
|
21
|
+
|
|
22
|
+
module Container
|
|
23
|
+
def text_field(opts = {})
|
|
24
|
+
TextField.new(self, opts.merge(tag_name: 'input'))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def text_fields(opts = {})
|
|
28
|
+
TextFieldCollection.new(self, opts.merge(tag_name: 'input'))
|
|
29
|
+
end
|
|
30
|
+
end # Container
|
|
31
|
+
|
|
32
|
+
class TextFieldCollection < InputCollection
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def element_class
|
|
36
|
+
TextField
|
|
37
|
+
end
|
|
38
|
+
end # TextFieldCollection
|
|
39
|
+
end # Watir
|