mega-max-rb 0.0.1

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.
Files changed (319) hide show
  1. checksums.yaml +7 -0
  2. data/capybara-3.40.0/History.md +2043 -0
  3. data/capybara-3.40.0/License.txt +22 -0
  4. data/capybara-3.40.0/README.md +1264 -0
  5. data/capybara-3.40.0/lib/capybara/config.rb +104 -0
  6. data/capybara-3.40.0/lib/capybara/cucumber.rb +27 -0
  7. data/capybara-3.40.0/lib/capybara/driver/base.rb +178 -0
  8. data/capybara-3.40.0/lib/capybara/driver/node.rb +143 -0
  9. data/capybara-3.40.0/lib/capybara/dsl.rb +59 -0
  10. data/capybara-3.40.0/lib/capybara/helpers.rb +127 -0
  11. data/capybara-3.40.0/lib/capybara/minitest/spec.rb +279 -0
  12. data/capybara-3.40.0/lib/capybara/minitest.rb +398 -0
  13. data/capybara-3.40.0/lib/capybara/node/actions.rb +420 -0
  14. data/capybara-3.40.0/lib/capybara/node/base.rb +144 -0
  15. data/capybara-3.40.0/lib/capybara/node/document.rb +48 -0
  16. data/capybara-3.40.0/lib/capybara/node/document_matchers.rb +67 -0
  17. data/capybara-3.40.0/lib/capybara/node/element.rb +613 -0
  18. data/capybara-3.40.0/lib/capybara/node/finders.rb +335 -0
  19. data/capybara-3.40.0/lib/capybara/node/matchers.rb +908 -0
  20. data/capybara-3.40.0/lib/capybara/node/simple.rb +216 -0
  21. data/capybara-3.40.0/lib/capybara/node/whitespace_normalizer.rb +81 -0
  22. data/capybara-3.40.0/lib/capybara/queries/active_element_query.rb +18 -0
  23. data/capybara-3.40.0/lib/capybara/queries/ancestor_query.rb +28 -0
  24. data/capybara-3.40.0/lib/capybara/queries/base_query.rb +106 -0
  25. data/capybara-3.40.0/lib/capybara/queries/current_path_query.rb +61 -0
  26. data/capybara-3.40.0/lib/capybara/queries/match_query.rb +26 -0
  27. data/capybara-3.40.0/lib/capybara/queries/selector_query.rb +761 -0
  28. data/capybara-3.40.0/lib/capybara/queries/sibling_query.rb +27 -0
  29. data/capybara-3.40.0/lib/capybara/queries/style_query.rb +45 -0
  30. data/capybara-3.40.0/lib/capybara/queries/text_query.rb +116 -0
  31. data/capybara-3.40.0/lib/capybara/queries/title_query.rb +39 -0
  32. data/capybara-3.40.0/lib/capybara/rack_test/browser.rb +200 -0
  33. data/capybara-3.40.0/lib/capybara/rack_test/css_handlers.rb +13 -0
  34. data/capybara-3.40.0/lib/capybara/rack_test/driver.rb +110 -0
  35. data/capybara-3.40.0/lib/capybara/rack_test/errors.rb +6 -0
  36. data/capybara-3.40.0/lib/capybara/rack_test/form.rb +149 -0
  37. data/capybara-3.40.0/lib/capybara/rack_test/node.rb +324 -0
  38. data/capybara-3.40.0/lib/capybara/rails.rb +16 -0
  39. data/capybara-3.40.0/lib/capybara/registration_container.rb +41 -0
  40. data/capybara-3.40.0/lib/capybara/registrations/drivers.rb +42 -0
  41. data/capybara-3.40.0/lib/capybara/registrations/patches/puma_ssl.rb +29 -0
  42. data/capybara-3.40.0/lib/capybara/registrations/servers.rb +66 -0
  43. data/capybara-3.40.0/lib/capybara/result.rb +186 -0
  44. data/capybara-3.40.0/lib/capybara/rspec/features.rb +23 -0
  45. data/capybara-3.40.0/lib/capybara/rspec/matcher_proxies.rb +82 -0
  46. data/capybara-3.40.0/lib/capybara/rspec/matchers/base.rb +113 -0
  47. data/capybara-3.40.0/lib/capybara/rspec/matchers/become_closed.rb +33 -0
  48. data/capybara-3.40.0/lib/capybara/rspec/matchers/compound.rb +88 -0
  49. data/capybara-3.40.0/lib/capybara/rspec/matchers/count_sugar.rb +37 -0
  50. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_ancestor.rb +28 -0
  51. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_current_path.rb +29 -0
  52. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_selector.rb +69 -0
  53. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_sibling.rb +27 -0
  54. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_text.rb +33 -0
  55. data/capybara-3.40.0/lib/capybara/rspec/matchers/have_title.rb +29 -0
  56. data/capybara-3.40.0/lib/capybara/rspec/matchers/match_selector.rb +27 -0
  57. data/capybara-3.40.0/lib/capybara/rspec/matchers/match_style.rb +43 -0
  58. data/capybara-3.40.0/lib/capybara/rspec/matchers/spatial_sugar.rb +39 -0
  59. data/capybara-3.40.0/lib/capybara/rspec/matchers.rb +207 -0
  60. data/capybara-3.40.0/lib/capybara/rspec.rb +31 -0
  61. data/capybara-3.40.0/lib/capybara/selector/builders/css_builder.rb +84 -0
  62. data/capybara-3.40.0/lib/capybara/selector/builders/xpath_builder.rb +71 -0
  63. data/capybara-3.40.0/lib/capybara/selector/css.rb +102 -0
  64. data/capybara-3.40.0/lib/capybara/selector/definition/button.rb +68 -0
  65. data/capybara-3.40.0/lib/capybara/selector/definition/checkbox.rb +26 -0
  66. data/capybara-3.40.0/lib/capybara/selector/definition/css.rb +10 -0
  67. data/capybara-3.40.0/lib/capybara/selector/definition/datalist_input.rb +35 -0
  68. data/capybara-3.40.0/lib/capybara/selector/definition/datalist_option.rb +25 -0
  69. data/capybara-3.40.0/lib/capybara/selector/definition/element.rb +28 -0
  70. data/capybara-3.40.0/lib/capybara/selector/definition/field.rb +40 -0
  71. data/capybara-3.40.0/lib/capybara/selector/definition/fieldset.rb +14 -0
  72. data/capybara-3.40.0/lib/capybara/selector/definition/file_field.rb +13 -0
  73. data/capybara-3.40.0/lib/capybara/selector/definition/fillable_field.rb +33 -0
  74. data/capybara-3.40.0/lib/capybara/selector/definition/frame.rb +17 -0
  75. data/capybara-3.40.0/lib/capybara/selector/definition/id.rb +6 -0
  76. data/capybara-3.40.0/lib/capybara/selector/definition/label.rb +62 -0
  77. data/capybara-3.40.0/lib/capybara/selector/definition/link.rb +55 -0
  78. data/capybara-3.40.0/lib/capybara/selector/definition/link_or_button.rb +16 -0
  79. data/capybara-3.40.0/lib/capybara/selector/definition/option.rb +27 -0
  80. data/capybara-3.40.0/lib/capybara/selector/definition/radio_button.rb +27 -0
  81. data/capybara-3.40.0/lib/capybara/selector/definition/select.rb +81 -0
  82. data/capybara-3.40.0/lib/capybara/selector/definition/table.rb +109 -0
  83. data/capybara-3.40.0/lib/capybara/selector/definition/table_row.rb +21 -0
  84. data/capybara-3.40.0/lib/capybara/selector/definition/xpath.rb +5 -0
  85. data/capybara-3.40.0/lib/capybara/selector/definition.rb +280 -0
  86. data/capybara-3.40.0/lib/capybara/selector/filter.rb +5 -0
  87. data/capybara-3.40.0/lib/capybara/selector/filter_set.rb +121 -0
  88. data/capybara-3.40.0/lib/capybara/selector/filters/base.rb +77 -0
  89. data/capybara-3.40.0/lib/capybara/selector/filters/expression_filter.rb +22 -0
  90. data/capybara-3.40.0/lib/capybara/selector/filters/locator_filter.rb +29 -0
  91. data/capybara-3.40.0/lib/capybara/selector/filters/node_filter.rb +31 -0
  92. data/capybara-3.40.0/lib/capybara/selector/regexp_disassembler.rb +211 -0
  93. data/capybara-3.40.0/lib/capybara/selector/selector.rb +159 -0
  94. data/capybara-3.40.0/lib/capybara/selector/xpath_extensions.rb +17 -0
  95. data/capybara-3.40.0/lib/capybara/selector.rb +494 -0
  96. data/capybara-3.40.0/lib/capybara/selenium/atoms/getAttribute.min.js +1 -0
  97. data/capybara-3.40.0/lib/capybara/selenium/atoms/isDisplayed.min.js +1 -0
  98. data/capybara-3.40.0/lib/capybara/selenium/atoms/src/getAttribute.js +161 -0
  99. data/capybara-3.40.0/lib/capybara/selenium/atoms/src/isDisplayed.js +454 -0
  100. data/capybara-3.40.0/lib/capybara/selenium/driver.rb +517 -0
  101. data/capybara-3.40.0/lib/capybara/selenium/driver_specializations/chrome_driver.rb +117 -0
  102. data/capybara-3.40.0/lib/capybara/selenium/driver_specializations/edge_driver.rb +128 -0
  103. data/capybara-3.40.0/lib/capybara/selenium/driver_specializations/firefox_driver.rb +84 -0
  104. data/capybara-3.40.0/lib/capybara/selenium/driver_specializations/internet_explorer_driver.rb +26 -0
  105. data/capybara-3.40.0/lib/capybara/selenium/driver_specializations/safari_driver.rb +24 -0
  106. data/capybara-3.40.0/lib/capybara/selenium/extensions/file_input_click_emulation.rb +34 -0
  107. data/capybara-3.40.0/lib/capybara/selenium/extensions/find.rb +110 -0
  108. data/capybara-3.40.0/lib/capybara/selenium/extensions/html5_drag.rb +229 -0
  109. data/capybara-3.40.0/lib/capybara/selenium/extensions/modifier_keys_stack.rb +28 -0
  110. data/capybara-3.40.0/lib/capybara/selenium/extensions/scroll.rb +76 -0
  111. data/capybara-3.40.0/lib/capybara/selenium/node.rb +636 -0
  112. data/capybara-3.40.0/lib/capybara/selenium/nodes/chrome_node.rb +125 -0
  113. data/capybara-3.40.0/lib/capybara/selenium/nodes/edge_node.rb +110 -0
  114. data/capybara-3.40.0/lib/capybara/selenium/nodes/firefox_node.rb +136 -0
  115. data/capybara-3.40.0/lib/capybara/selenium/nodes/ie_node.rb +22 -0
  116. data/capybara-3.40.0/lib/capybara/selenium/nodes/safari_node.rb +118 -0
  117. data/capybara-3.40.0/lib/capybara/selenium/patches/atoms.rb +18 -0
  118. data/capybara-3.40.0/lib/capybara/selenium/patches/is_displayed.rb +16 -0
  119. data/capybara-3.40.0/lib/capybara/selenium/patches/logs.rb +45 -0
  120. data/capybara-3.40.0/lib/capybara/selenium/patches/pause_duration_fix.rb +9 -0
  121. data/capybara-3.40.0/lib/capybara/selenium/patches/persistent_client.rb +20 -0
  122. data/capybara-3.40.0/lib/capybara/server/animation_disabler.rb +80 -0
  123. data/capybara-3.40.0/lib/capybara/server/checker.rb +44 -0
  124. data/capybara-3.40.0/lib/capybara/server/middleware.rb +71 -0
  125. data/capybara-3.40.0/lib/capybara/server.rb +126 -0
  126. data/capybara-3.40.0/lib/capybara/session/config.rb +128 -0
  127. data/capybara-3.40.0/lib/capybara/session/matchers.rb +87 -0
  128. data/capybara-3.40.0/lib/capybara/session.rb +951 -0
  129. data/capybara-3.40.0/lib/capybara/spec/fixtures/another_test_file.txt +1 -0
  130. data/capybara-3.40.0/lib/capybara/spec/fixtures/capybara.jpg +3 -0
  131. data/capybara-3.40.0/lib/capybara/spec/fixtures/no_extension +1 -0
  132. data/capybara-3.40.0/lib/capybara/spec/fixtures/test_file.txt +1 -0
  133. data/capybara-3.40.0/lib/capybara/spec/public/jquery-ui.js +13 -0
  134. data/capybara-3.40.0/lib/capybara/spec/public/jquery.js +5 -0
  135. data/capybara-3.40.0/lib/capybara/spec/public/offset.js +6 -0
  136. data/capybara-3.40.0/lib/capybara/spec/public/test.js +284 -0
  137. data/capybara-3.40.0/lib/capybara/spec/session/accept_alert_spec.rb +81 -0
  138. data/capybara-3.40.0/lib/capybara/spec/session/accept_confirm_spec.rb +32 -0
  139. data/capybara-3.40.0/lib/capybara/spec/session/accept_prompt_spec.rb +78 -0
  140. data/capybara-3.40.0/lib/capybara/spec/session/active_element_spec.rb +31 -0
  141. data/capybara-3.40.0/lib/capybara/spec/session/all_spec.rb +274 -0
  142. data/capybara-3.40.0/lib/capybara/spec/session/ancestor_spec.rb +88 -0
  143. data/capybara-3.40.0/lib/capybara/spec/session/assert_all_of_selectors_spec.rb +140 -0
  144. data/capybara-3.40.0/lib/capybara/spec/session/assert_current_path_spec.rb +75 -0
  145. data/capybara-3.40.0/lib/capybara/spec/session/assert_selector_spec.rb +143 -0
  146. data/capybara-3.40.0/lib/capybara/spec/session/assert_style_spec.rb +26 -0
  147. data/capybara-3.40.0/lib/capybara/spec/session/assert_text_spec.rb +258 -0
  148. data/capybara-3.40.0/lib/capybara/spec/session/assert_title_spec.rb +93 -0
  149. data/capybara-3.40.0/lib/capybara/spec/session/attach_file_spec.rb +222 -0
  150. data/capybara-3.40.0/lib/capybara/spec/session/body_spec.rb +23 -0
  151. data/capybara-3.40.0/lib/capybara/spec/session/check_spec.rb +251 -0
  152. data/capybara-3.40.0/lib/capybara/spec/session/choose_spec.rb +127 -0
  153. data/capybara-3.40.0/lib/capybara/spec/session/click_button_spec.rb +517 -0
  154. data/capybara-3.40.0/lib/capybara/spec/session/click_link_or_button_spec.rb +138 -0
  155. data/capybara-3.40.0/lib/capybara/spec/session/click_link_spec.rb +240 -0
  156. data/capybara-3.40.0/lib/capybara/spec/session/current_scope_spec.rb +31 -0
  157. data/capybara-3.40.0/lib/capybara/spec/session/current_url_spec.rb +125 -0
  158. data/capybara-3.40.0/lib/capybara/spec/session/dismiss_confirm_spec.rb +36 -0
  159. data/capybara-3.40.0/lib/capybara/spec/session/dismiss_prompt_spec.rb +21 -0
  160. data/capybara-3.40.0/lib/capybara/spec/session/element/assert_match_selector_spec.rb +38 -0
  161. data/capybara-3.40.0/lib/capybara/spec/session/element/match_css_spec.rb +31 -0
  162. data/capybara-3.40.0/lib/capybara/spec/session/element/match_xpath_spec.rb +25 -0
  163. data/capybara-3.40.0/lib/capybara/spec/session/element/matches_selector_spec.rb +120 -0
  164. data/capybara-3.40.0/lib/capybara/spec/session/evaluate_async_script_spec.rb +23 -0
  165. data/capybara-3.40.0/lib/capybara/spec/session/evaluate_script_spec.rb +49 -0
  166. data/capybara-3.40.0/lib/capybara/spec/session/execute_script_spec.rb +28 -0
  167. data/capybara-3.40.0/lib/capybara/spec/session/fill_in_spec.rb +292 -0
  168. data/capybara-3.40.0/lib/capybara/spec/session/find_button_spec.rb +74 -0
  169. data/capybara-3.40.0/lib/capybara/spec/session/find_by_id_spec.rb +33 -0
  170. data/capybara-3.40.0/lib/capybara/spec/session/find_field_spec.rb +113 -0
  171. data/capybara-3.40.0/lib/capybara/spec/session/find_link_spec.rb +80 -0
  172. data/capybara-3.40.0/lib/capybara/spec/session/find_spec.rb +545 -0
  173. data/capybara-3.40.0/lib/capybara/spec/session/first_spec.rb +156 -0
  174. data/capybara-3.40.0/lib/capybara/spec/session/frame/frame_title_spec.rb +23 -0
  175. data/capybara-3.40.0/lib/capybara/spec/session/frame/frame_url_spec.rb +23 -0
  176. data/capybara-3.40.0/lib/capybara/spec/session/frame/switch_to_frame_spec.rb +116 -0
  177. data/capybara-3.40.0/lib/capybara/spec/session/frame/within_frame_spec.rb +114 -0
  178. data/capybara-3.40.0/lib/capybara/spec/session/go_back_spec.rb +12 -0
  179. data/capybara-3.40.0/lib/capybara/spec/session/go_forward_spec.rb +14 -0
  180. data/capybara-3.40.0/lib/capybara/spec/session/has_all_selectors_spec.rb +69 -0
  181. data/capybara-3.40.0/lib/capybara/spec/session/has_ancestor_spec.rb +46 -0
  182. data/capybara-3.40.0/lib/capybara/spec/session/has_any_selectors_spec.rb +29 -0
  183. data/capybara-3.40.0/lib/capybara/spec/session/has_button_spec.rb +150 -0
  184. data/capybara-3.40.0/lib/capybara/spec/session/has_css_spec.rb +375 -0
  185. data/capybara-3.40.0/lib/capybara/spec/session/has_current_path_spec.rb +151 -0
  186. data/capybara-3.40.0/lib/capybara/spec/session/has_element_spec.rb +47 -0
  187. data/capybara-3.40.0/lib/capybara/spec/session/has_field_spec.rb +389 -0
  188. data/capybara-3.40.0/lib/capybara/spec/session/has_link_spec.rb +79 -0
  189. data/capybara-3.40.0/lib/capybara/spec/session/has_none_selectors_spec.rb +78 -0
  190. data/capybara-3.40.0/lib/capybara/spec/session/has_select_spec.rb +316 -0
  191. data/capybara-3.40.0/lib/capybara/spec/session/has_selector_spec.rb +217 -0
  192. data/capybara-3.40.0/lib/capybara/spec/session/has_sibling_spec.rb +50 -0
  193. data/capybara-3.40.0/lib/capybara/spec/session/has_table_spec.rb +209 -0
  194. data/capybara-3.40.0/lib/capybara/spec/session/has_text_spec.rb +375 -0
  195. data/capybara-3.40.0/lib/capybara/spec/session/has_title_spec.rb +71 -0
  196. data/capybara-3.40.0/lib/capybara/spec/session/has_xpath_spec.rb +149 -0
  197. data/capybara-3.40.0/lib/capybara/spec/session/headers_spec.rb +8 -0
  198. data/capybara-3.40.0/lib/capybara/spec/session/html_spec.rb +47 -0
  199. data/capybara-3.40.0/lib/capybara/spec/session/matches_style_spec.rb +37 -0
  200. data/capybara-3.40.0/lib/capybara/spec/session/node_spec.rb +1399 -0
  201. data/capybara-3.40.0/lib/capybara/spec/session/node_wrapper_spec.rb +39 -0
  202. data/capybara-3.40.0/lib/capybara/spec/session/refresh_spec.rb +34 -0
  203. data/capybara-3.40.0/lib/capybara/spec/session/reset_session_spec.rb +161 -0
  204. data/capybara-3.40.0/lib/capybara/spec/session/response_code_spec.rb +8 -0
  205. data/capybara-3.40.0/lib/capybara/spec/session/save_and_open_page_spec.rb +21 -0
  206. data/capybara-3.40.0/lib/capybara/spec/session/save_and_open_screenshot_spec.rb +43 -0
  207. data/capybara-3.40.0/lib/capybara/spec/session/save_page_spec.rb +110 -0
  208. data/capybara-3.40.0/lib/capybara/spec/session/save_screenshot_spec.rb +55 -0
  209. data/capybara-3.40.0/lib/capybara/spec/session/screenshot_spec.rb +18 -0
  210. data/capybara-3.40.0/lib/capybara/spec/session/scroll_spec.rb +119 -0
  211. data/capybara-3.40.0/lib/capybara/spec/session/select_spec.rb +229 -0
  212. data/capybara-3.40.0/lib/capybara/spec/session/selectors_spec.rb +98 -0
  213. data/capybara-3.40.0/lib/capybara/spec/session/sibling_spec.rb +52 -0
  214. data/capybara-3.40.0/lib/capybara/spec/session/text_spec.rb +74 -0
  215. data/capybara-3.40.0/lib/capybara/spec/session/title_spec.rb +29 -0
  216. data/capybara-3.40.0/lib/capybara/spec/session/uncheck_spec.rb +100 -0
  217. data/capybara-3.40.0/lib/capybara/spec/session/unselect_spec.rb +116 -0
  218. data/capybara-3.40.0/lib/capybara/spec/session/visit_spec.rb +224 -0
  219. data/capybara-3.40.0/lib/capybara/spec/session/window/become_closed_spec.rb +89 -0
  220. data/capybara-3.40.0/lib/capybara/spec/session/window/current_window_spec.rb +28 -0
  221. data/capybara-3.40.0/lib/capybara/spec/session/window/open_new_window_spec.rb +31 -0
  222. data/capybara-3.40.0/lib/capybara/spec/session/window/switch_to_window_spec.rb +132 -0
  223. data/capybara-3.40.0/lib/capybara/spec/session/window/window_opened_by_spec.rb +99 -0
  224. data/capybara-3.40.0/lib/capybara/spec/session/window/window_spec.rb +203 -0
  225. data/capybara-3.40.0/lib/capybara/spec/session/window/windows_spec.rb +34 -0
  226. data/capybara-3.40.0/lib/capybara/spec/session/window/within_window_spec.rb +157 -0
  227. data/capybara-3.40.0/lib/capybara/spec/session/within_spec.rb +212 -0
  228. data/capybara-3.40.0/lib/capybara/spec/spec_helper.rb +141 -0
  229. data/capybara-3.40.0/lib/capybara/spec/test_app.rb +305 -0
  230. data/capybara-3.40.0/lib/capybara/spec/views/animated.erb +49 -0
  231. data/capybara-3.40.0/lib/capybara/spec/views/buttons.erb +5 -0
  232. data/capybara-3.40.0/lib/capybara/spec/views/fieldsets.erb +30 -0
  233. data/capybara-3.40.0/lib/capybara/spec/views/form.erb +738 -0
  234. data/capybara-3.40.0/lib/capybara/spec/views/frame_child.erb +18 -0
  235. data/capybara-3.40.0/lib/capybara/spec/views/frame_one.erb +10 -0
  236. data/capybara-3.40.0/lib/capybara/spec/views/frame_parent.erb +9 -0
  237. data/capybara-3.40.0/lib/capybara/spec/views/frame_two.erb +9 -0
  238. data/capybara-3.40.0/lib/capybara/spec/views/header_links.erb +8 -0
  239. data/capybara-3.40.0/lib/capybara/spec/views/host_links.erb +13 -0
  240. data/capybara-3.40.0/lib/capybara/spec/views/initial_alert.erb +11 -0
  241. data/capybara-3.40.0/lib/capybara/spec/views/layout.erb +10 -0
  242. data/capybara-3.40.0/lib/capybara/spec/views/obscured.erb +47 -0
  243. data/capybara-3.40.0/lib/capybara/spec/views/offset.erb +33 -0
  244. data/capybara-3.40.0/lib/capybara/spec/views/path.erb +13 -0
  245. data/capybara-3.40.0/lib/capybara/spec/views/popup_one.erb +9 -0
  246. data/capybara-3.40.0/lib/capybara/spec/views/popup_two.erb +9 -0
  247. data/capybara-3.40.0/lib/capybara/spec/views/postback.erb +14 -0
  248. data/capybara-3.40.0/lib/capybara/spec/views/react.erb +45 -0
  249. data/capybara-3.40.0/lib/capybara/spec/views/scroll.erb +21 -0
  250. data/capybara-3.40.0/lib/capybara/spec/views/spatial.erb +31 -0
  251. data/capybara-3.40.0/lib/capybara/spec/views/tables.erb +130 -0
  252. data/capybara-3.40.0/lib/capybara/spec/views/with_animation.erb +81 -0
  253. data/capybara-3.40.0/lib/capybara/spec/views/with_base_tag.erb +11 -0
  254. data/capybara-3.40.0/lib/capybara/spec/views/with_count.erb +8 -0
  255. data/capybara-3.40.0/lib/capybara/spec/views/with_dragula.erb +24 -0
  256. data/capybara-3.40.0/lib/capybara/spec/views/with_fixed_header_footer.erb +18 -0
  257. data/capybara-3.40.0/lib/capybara/spec/views/with_hover.erb +24 -0
  258. data/capybara-3.40.0/lib/capybara/spec/views/with_hover1.erb +10 -0
  259. data/capybara-3.40.0/lib/capybara/spec/views/with_html.erb +210 -0
  260. data/capybara-3.40.0/lib/capybara/spec/views/with_html5_svg.erb +20 -0
  261. data/capybara-3.40.0/lib/capybara/spec/views/with_html_entities.erb +2 -0
  262. data/capybara-3.40.0/lib/capybara/spec/views/with_jquery_animation.erb +24 -0
  263. data/capybara-3.40.0/lib/capybara/spec/views/with_js.erb +162 -0
  264. data/capybara-3.40.0/lib/capybara/spec/views/with_jstree.erb +26 -0
  265. data/capybara-3.40.0/lib/capybara/spec/views/with_namespace.erb +21 -0
  266. data/capybara-3.40.0/lib/capybara/spec/views/with_scope.erb +42 -0
  267. data/capybara-3.40.0/lib/capybara/spec/views/with_scope_other.erb +6 -0
  268. data/capybara-3.40.0/lib/capybara/spec/views/with_shadow.erb +31 -0
  269. data/capybara-3.40.0/lib/capybara/spec/views/with_simple_html.erb +2 -0
  270. data/capybara-3.40.0/lib/capybara/spec/views/with_slow_unload.erb +18 -0
  271. data/capybara-3.40.0/lib/capybara/spec/views/with_sortable_js.erb +21 -0
  272. data/capybara-3.40.0/lib/capybara/spec/views/with_unload_alert.erb +15 -0
  273. data/capybara-3.40.0/lib/capybara/spec/views/with_windows.erb +54 -0
  274. data/capybara-3.40.0/lib/capybara/spec/views/within_frames.erb +15 -0
  275. data/capybara-3.40.0/lib/capybara/version.rb +5 -0
  276. data/capybara-3.40.0/lib/capybara/window.rb +142 -0
  277. data/capybara-3.40.0/lib/capybara.rb +521 -0
  278. data/capybara-3.40.0/spec/basic_node_spec.rb +168 -0
  279. data/capybara-3.40.0/spec/capybara_spec.rb +124 -0
  280. data/capybara-3.40.0/spec/counter_spec.rb +35 -0
  281. data/capybara-3.40.0/spec/css_builder_spec.rb +101 -0
  282. data/capybara-3.40.0/spec/css_splitter_spec.rb +38 -0
  283. data/capybara-3.40.0/spec/dsl_spec.rb +291 -0
  284. data/capybara-3.40.0/spec/filter_set_spec.rb +46 -0
  285. data/capybara-3.40.0/spec/fixtures/capybara.csv +1 -0
  286. data/capybara-3.40.0/spec/fixtures/certificate.pem +25 -0
  287. data/capybara-3.40.0/spec/fixtures/key.pem +27 -0
  288. data/capybara-3.40.0/spec/fixtures/selenium_driver_rspec_failure.rb +13 -0
  289. data/capybara-3.40.0/spec/fixtures/selenium_driver_rspec_success.rb +13 -0
  290. data/capybara-3.40.0/spec/minitest_spec.rb +175 -0
  291. data/capybara-3.40.0/spec/minitest_spec_spec.rb +166 -0
  292. data/capybara-3.40.0/spec/per_session_config_spec.rb +68 -0
  293. data/capybara-3.40.0/spec/rack_test_spec.rb +297 -0
  294. data/capybara-3.40.0/spec/regexp_dissassembler_spec.rb +250 -0
  295. data/capybara-3.40.0/spec/result_spec.rb +202 -0
  296. data/capybara-3.40.0/spec/rspec/features_spec.rb +101 -0
  297. data/capybara-3.40.0/spec/rspec/scenarios_spec.rb +23 -0
  298. data/capybara-3.40.0/spec/rspec/shared_spec_matchers.rb +983 -0
  299. data/capybara-3.40.0/spec/rspec/views_spec.rb +14 -0
  300. data/capybara-3.40.0/spec/rspec_matchers_spec.rb +87 -0
  301. data/capybara-3.40.0/spec/rspec_spec.rb +149 -0
  302. data/capybara-3.40.0/spec/sauce_spec_chrome.rb +43 -0
  303. data/capybara-3.40.0/spec/selector_spec.rb +528 -0
  304. data/capybara-3.40.0/spec/selenium_spec_chrome.rb +209 -0
  305. data/capybara-3.40.0/spec/selenium_spec_chrome_remote.rb +96 -0
  306. data/capybara-3.40.0/spec/selenium_spec_edge.rb +60 -0
  307. data/capybara-3.40.0/spec/selenium_spec_firefox.rb +228 -0
  308. data/capybara-3.40.0/spec/selenium_spec_firefox_remote.rb +94 -0
  309. data/capybara-3.40.0/spec/selenium_spec_ie.rb +149 -0
  310. data/capybara-3.40.0/spec/selenium_spec_safari.rb +162 -0
  311. data/capybara-3.40.0/spec/server_spec.rb +315 -0
  312. data/capybara-3.40.0/spec/session_spec.rb +91 -0
  313. data/capybara-3.40.0/spec/shared_selenium_node.rb +79 -0
  314. data/capybara-3.40.0/spec/shared_selenium_session.rb +566 -0
  315. data/capybara-3.40.0/spec/spec_helper.rb +133 -0
  316. data/capybara-3.40.0/spec/whitespace_normalizer_spec.rb +54 -0
  317. data/capybara-3.40.0/spec/xpath_builder_spec.rb +93 -0
  318. data/mega-max-rb.gemspec +12 -0
  319. metadata +358 -0
@@ -0,0 +1,494 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'capybara/selector/xpath_extensions'
4
+ require 'capybara/selector/selector'
5
+ require 'capybara/selector/definition'
6
+
7
+ #
8
+ # All Selectors below support the listed selector specific filters in addition to the following system-wide filters
9
+ # * :id (String, Regexp, XPath::Expression) - Matches the id attribute
10
+ # * :class (String, Array<String | Regexp>, Regexp, XPath::Expression) - Matches the class(es) provided
11
+ # * :style (String, Regexp, Hash<String, String>) - Match on elements style
12
+ # * :above (Element) - Match elements above the passed element on the page
13
+ # * :below (Element) - Match elements below the passed element on the page
14
+ # * :left_of (Element) - Match elements left of the passed element on the page
15
+ # * :right_of (Element) - Match elements right of the passed element on the page
16
+ # * :near (Element) - Match elements near (within 50px) the passed element on the page
17
+ # * :focused (Boolean) - Match elements with focus (requires driver support)
18
+ #
19
+ # ### Built-in Selectors
20
+ #
21
+ # * **:xpath** - Select elements by XPath expression
22
+ # * Locator: An XPath expression
23
+ #
24
+ # ```ruby
25
+ # page.html # => '<input>'
26
+ #
27
+ # page.find :xpath, './/input'
28
+ # ```
29
+ #
30
+ # * **:css** - Select elements by CSS selector
31
+ # * Locator: A CSS selector
32
+ #
33
+ # ```ruby
34
+ # page.html # => '<input>'
35
+ #
36
+ # page.find :css, 'input'
37
+ # ```
38
+ #
39
+ # * **:id** - Select element by id
40
+ # * Locator: (String, Regexp, XPath::Expression) The id of the element to match
41
+ #
42
+ # ```ruby
43
+ # page.html # => '<input id="field">'
44
+ #
45
+ # page.find :id, 'content'
46
+ # ```
47
+ #
48
+ # * **:field** - Select field elements (input [not of type submit, image, or hidden], textarea, select)
49
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, placeholder, or
50
+ # associated label text
51
+ # * Filters:
52
+ # * :name (String, Regexp) - Matches the name attribute
53
+ # * :placeholder (String, Regexp) - Matches the placeholder attribute
54
+ # * :type (String) - Matches the type attribute of the field or element type for 'textarea' and 'select'
55
+ # * :readonly (Boolean) - Match on the element being readonly
56
+ # * :with (String, Regexp) - Matches the current value of the field
57
+ # * :checked (Boolean) - Match checked fields?
58
+ # * :unchecked (Boolean) - Match unchecked fields?
59
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
60
+ # * :multiple (Boolean) - Match fields that accept multiple values
61
+ # * :valid (Boolean) - Match fields that are valid/invalid according to HTML5 form validation
62
+ # * :validation_message (String, Regexp) - Matches the elements current validationMessage
63
+ #
64
+ # ```ruby
65
+ # page.html # => '<label for="article_title">Title</label>
66
+ # <input id="article_title" name="article[title]" value="Hello world">'
67
+ #
68
+ # page.find :field, 'article_title'
69
+ # page.find :field, 'article[title]'
70
+ # page.find :field, 'Title'
71
+ # page.find :field, 'Title', type: 'text', with: 'Hello world'
72
+ # ```
73
+ #
74
+ # * **:fieldset** - Select fieldset elements
75
+ # * Locator: Matches id, {Capybara.configure test_id}, or contents of wrapped legend
76
+ # * Filters:
77
+ # * :legend (String) - Matches contents of wrapped legend
78
+ # * :disabled (Boolean) - Match disabled fieldset?
79
+ #
80
+ # ```ruby
81
+ # page.html # => '<fieldset disabled>
82
+ # <legend>Fields (disabled)</legend>
83
+ # </fieldset>'
84
+ #
85
+ # page.find :fieldset, 'Fields (disabled)', disabled: true
86
+ # ```
87
+ #
88
+ # * **:link** - Find links (`<a>` elements with an href attribute)
89
+ # * Locator: Matches the id, {Capybara.configure test_id}, or title attributes, or the string content of the link,
90
+ # or the alt attribute of a contained img element. By default this selector requires a link to have an href attribute.
91
+ # * Filters:
92
+ # * :title (String) - Matches the title attribute
93
+ # * :alt (String) - Matches the alt attribute of a contained img element
94
+ # * :href (String, Regexp, nil, false) - Matches the normalized href of the link, if nil will find `<a>` elements with no href attribute, if false ignores href presence
95
+ #
96
+ # ```ruby
97
+ # page.html # => '<a href="/">Home</a>'
98
+ #
99
+ # page.find :link, 'Home', href: '/'
100
+ #
101
+ # page.html # => '<a href="/"><img src="/logo.png" alt="The logo"></a>'
102
+ #
103
+ # page.find :link, 'The logo', href: '/'
104
+ # page.find :link, alt: 'The logo', href: '/'
105
+ # ```
106
+ #
107
+ # * **:button** - Find buttons ( input [of type submit, reset, image, button] or button elements )
108
+ # * Locator: Matches the id, {Capybara.configure test_id} attribute, name, value, or title attributes, string content of a button, or the alt attribute of an image type button or of a descendant image of a button
109
+ # * Filters:
110
+ # * :name (String, Regexp) - Matches the name attribute
111
+ # * :title (String) - Matches the title attribute
112
+ # * :value (String) - Matches the value of an input button
113
+ # * :type (String) - Matches the type attribute
114
+ # * :disabled (Boolean, :all) - Match disabled buttons (Default: false)
115
+ #
116
+ # ```ruby
117
+ # page.html # => '<button>Submit</button>'
118
+ #
119
+ # page.find :button, 'Submit'
120
+ #
121
+ # page.html # => '<button name="article[state]" value="draft">Save as draft</button>'
122
+ #
123
+ # page.find :button, 'Save as draft', name: 'article[state]', value: 'draft'
124
+ # ```
125
+ #
126
+ # * **:link_or_button** - Find links or buttons
127
+ # * Locator: See :link and :button selectors
128
+ # * Filters:
129
+ # * :disabled (Boolean, :all) - Match disabled buttons? (Default: false)
130
+ #
131
+ # ```ruby
132
+ # page.html # => '<a href="/">Home</a>'
133
+ #
134
+ # page.find :link_or_button, 'Home'
135
+ #
136
+ # page.html # => '<button>Submit</button>'
137
+ #
138
+ # page.find :link_or_button, 'Submit'
139
+ # ```
140
+ #
141
+ # * **:fillable_field** - Find text fillable fields ( textarea, input [not of type submit, image, radio, checkbox, hidden, file] )
142
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, placeholder, or associated label text
143
+ # * Filters:
144
+ # * :name (String, Regexp) - Matches the name attribute
145
+ # * :placeholder (String, Regexp) - Matches the placeholder attribute
146
+ # * :with (String, Regexp) - Matches the current value of the field
147
+ # * :type (String) - Matches the type attribute of the field or element type for 'textarea'
148
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
149
+ # * :multiple (Boolean) - Match fields that accept multiple values
150
+ # * :valid (Boolean) - Match fields that are valid/invalid according to HTML5 form validation
151
+ # * :validation_message (String, Regexp) - Matches the elements current validationMessage
152
+ #
153
+ # ```ruby
154
+ # page.html # => '<label for="article_body">Body</label>
155
+ # <textarea id="article_body" name="article[body]"></textarea>'
156
+ #
157
+ # page.find :fillable_field, 'article_body'
158
+ # page.find :fillable_field, 'article[body]'
159
+ # page.find :fillable_field, 'Body'
160
+ # page.find :field, 'Body', type: 'textarea'
161
+ # ```
162
+ #
163
+ # * **:radio_button** - Find radio buttons
164
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
165
+ # * Filters:
166
+ # * :name (String, Regexp) - Matches the name attribute
167
+ # * :checked (Boolean) - Match checked fields?
168
+ # * :unchecked (Boolean) - Match unchecked fields?
169
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
170
+ # * :option (String, Regexp) - Match the current value
171
+ # * :with - Alias of :option
172
+ #
173
+ # ```ruby
174
+ # page.html # => '<input type="radio" id="article_state_published" name="article[state]" value="published" checked>
175
+ # <label for="article_state_published">Published</label>
176
+ # <input type="radio" id="article_state_draft" name="article[state]" value="draft">
177
+ # <label for="article_state_draft">Draft</label>'
178
+ #
179
+ # page.find :radio_button, 'article_state_published'
180
+ # page.find :radio_button, 'article[state]', option: 'published'
181
+ # page.find :radio_button, 'Published', checked: true
182
+ # page.find :radio_button, 'Draft', unchecked: true
183
+ # ```
184
+ #
185
+ # * **:checkbox** - Find checkboxes
186
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
187
+ # * Filters:
188
+ # * :name (String, Regexp) - Matches the name attribute
189
+ # * :checked (Boolean) - Match checked fields?
190
+ # * :unchecked (Boolean) - Match unchecked fields?
191
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
192
+ # * :with (String, Regexp) - Match the current value
193
+ # * :option - Alias of :with
194
+ #
195
+ # ```ruby
196
+ # page.html # => '<input type="checkbox" id="registration_terms" name="registration[terms]" value="true">
197
+ # <label for="registration_terms">I agree to terms and conditions</label>'
198
+ #
199
+ # page.find :checkbox, 'registration_terms'
200
+ # page.find :checkbox, 'registration[terms]'
201
+ # page.find :checkbox, 'I agree to terms and conditions', unchecked: true
202
+ # ```
203
+ #
204
+ # * **:select** - Find select elements
205
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, placeholder, or associated label text
206
+ # * Filters:
207
+ # * :name (String, Regexp) - Matches the name attribute
208
+ # * :placeholder (String, Placeholder) - Matches the placeholder attribute
209
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
210
+ # * :multiple (Boolean) - Match fields that accept multiple values
211
+ # * :options (Array<String>) - Exact match options
212
+ # * :enabled_options (Array<String>) - Exact match enabled options
213
+ # * :disabled_options (Array<String>) - Exact match disabled options
214
+ # * :with_options (Array<String>) - Partial match options
215
+ # * :selected (String, Array<String>) - Match the selection(s)
216
+ # * :with_selected (String, Array<String>) - Partial match the selection(s)
217
+ #
218
+ # ```ruby
219
+ # page.html # => '<label for="article_category">Category</label>
220
+ # <select id="article_category" name="article[category]">
221
+ # <option value="General" checked></option>
222
+ # <option value="Other"></option>
223
+ # </select>'
224
+ #
225
+ # page.find :select, 'article_category'
226
+ # page.find :select, 'article[category]'
227
+ # page.find :select, 'Category'
228
+ # page.find :select, 'Category', selected: 'General'
229
+ # page.find :select, with_options: ['General']
230
+ # page.find :select, with_options: ['Other']
231
+ # page.find :select, options: ['General', 'Other']
232
+ # page.find :select, options: ['General'] # => raises Capybara::ElementNotFound
233
+ # ```
234
+ #
235
+ # * **:option** - Find option elements
236
+ # * Locator: Match text of option
237
+ # * Filters:
238
+ # * :disabled (Boolean) - Match disabled option
239
+ # * :selected (Boolean) - Match selected option
240
+ #
241
+ # ```ruby
242
+ # page.html # => '<option value="General" checked></option>
243
+ # <option value="Disabled" disabled></option>
244
+ # <option value="Other"></option>'
245
+ #
246
+ # page.find :option, 'General'
247
+ # page.find :option, 'General', selected: true
248
+ # page.find :option, 'Disabled', disabled: true
249
+ # page.find :option, 'Other', selected: false
250
+ # ```
251
+ #
252
+ # * **:datalist_input** - Find input field with datalist completion
253
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name,
254
+ # placeholder, or associated label text
255
+ # * Filters:
256
+ # * :name (String, Regexp) - Matches the name attribute
257
+ # * :placeholder (String, Regexp) - Matches the placeholder attribute
258
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
259
+ # * :options (Array<String>) - Exact match options
260
+ # * :with_options (Array<String>) - Partial match options
261
+ #
262
+ # ```ruby
263
+ # page.html # => '<label for="ice_cream_flavor">Flavor</label>
264
+ # <input list="ice_cream_flavors" id="ice_cream_flavor" name="ice_cream[flavor]">
265
+ # <datalist id="ice_cream_flavors">
266
+ # <option value="Chocolate"></option>
267
+ # <option value="Strawberry"></option>
268
+ # <option value="Vanilla"></option>
269
+ # </datalist>'
270
+ #
271
+ # page.find :datalist_input, 'ice_cream_flavor'
272
+ # page.find :datalist_input, 'ice_cream[flavor]'
273
+ # page.find :datalist_input, 'Flavor'
274
+ # page.find :datalist_input, with_options: ['Chocolate', 'Strawberry']
275
+ # page.find :datalist_input, options: ['Chocolate', 'Strawberry', 'Vanilla']
276
+ # page.find :datalist_input, options: ['Chocolate'] # => raises Capybara::ElementNotFound
277
+ # ```
278
+ #
279
+ # * **:datalist_option** - Find datalist option
280
+ # * Locator: Match text or value of option
281
+ # * Filters:
282
+ # * :disabled (Boolean) - Match disabled option
283
+ #
284
+ # ```ruby
285
+ # page.html # => '<datalist>
286
+ # <option value="Chocolate"></option>
287
+ # <option value="Strawberry"></option>
288
+ # <option value="Vanilla"></option>
289
+ # <option value="Forbidden" disabled></option>
290
+ # </datalist>'
291
+ #
292
+ # page.find :datalist_option, 'Chocolate'
293
+ # page.find :datalist_option, 'Strawberry'
294
+ # page.find :datalist_option, 'Vanilla'
295
+ # page.find :datalist_option, 'Forbidden', disabled: true
296
+ # ```
297
+ #
298
+ # * **:file_field** - Find file input elements
299
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
300
+ # * Filters:
301
+ # * :name (String, Regexp) - Matches the name attribute
302
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
303
+ # * :multiple (Boolean) - Match field that accepts multiple values
304
+ #
305
+ # ```ruby
306
+ # page.html # => '<label for="article_banner_image">Banner Image</label>
307
+ # <input type="file" id="article_banner_image" name="article[banner_image]">'
308
+ #
309
+ # page.find :file_field, 'article_banner_image'
310
+ # page.find :file_field, 'article[banner_image]'
311
+ # page.find :file_field, 'Banner Image'
312
+ # page.find :file_field, 'Banner Image', name: 'article[banner_image]'
313
+ # page.find :field, 'Banner Image', type: 'file'
314
+ # ```
315
+ #
316
+ # * **:label** - Find label elements
317
+ # * Locator: Match id, {Capybara.configure test_id}, or text contents
318
+ # * Filters:
319
+ # * :for (Element, String, Regexp) - The element or id of the element associated with the label
320
+ #
321
+ # ```ruby
322
+ # page.html # => '<label for="article_title">Title</label>
323
+ # <input id="article_title" name="article[title]">'
324
+ #
325
+ # page.find :label, 'Title'
326
+ # page.find :label, 'Title', for: 'article_title'
327
+ # page.find :label, 'Title', for: page.find('article[title]')
328
+ # ```
329
+ #
330
+ # * **:table** - Find table elements
331
+ # * Locator: id, {Capybara.configure test_id}, or caption text of table
332
+ # * Filters:
333
+ # * :caption (String) - Match text of associated caption
334
+ # * :with_rows (Array<Array<String>>, Array<Hash<String, String>>) - Partial match `<td>` data - visibility of `<td>` elements is not considered
335
+ # * :rows (Array<Array<String>>) - Match all `<td>`s - visibility of `<td>` elements is not considered
336
+ # * :with_cols (Array<Array<String>>, Array<Hash<String, String>>) - Partial match `<td>` data - visibility of `<td>` elements is not considered
337
+ # * :cols (Array<Array<String>>) - Match all `<td>`s - visibility of `<td>` elements is not considered
338
+ #
339
+ # ```ruby
340
+ # page.html # => '<table>
341
+ # <caption>A table</caption>
342
+ # <tr>
343
+ # <th>A</th>
344
+ # <th>B</th>
345
+ # </tr>
346
+ # <tr>
347
+ # <td>1</td>
348
+ # <td>2</td>
349
+ # </tr>
350
+ # <tr>
351
+ # <td>3</td>
352
+ # <td>4</td>
353
+ # </tr>
354
+ # </table>'
355
+ #
356
+ # page.find :table, 'A table'
357
+ # page.find :table, with_rows: [
358
+ # { 'A' => '1', 'B' => '2' },
359
+ # { 'A' => '3', 'B' => '4' },
360
+ # ]
361
+ # page.find :table, with_rows: [
362
+ # ['1', '2'],
363
+ # ['3', '4'],
364
+ # ]
365
+ # page.find :table, rows: [
366
+ # { 'A' => '1', 'B' => '2' },
367
+ # { 'A' => '3', 'B' => '4' },
368
+ # ]
369
+ # page.find :table, rows: [
370
+ # ['1', '2'],
371
+ # ['3', '4'],
372
+ # ]
373
+ # page.find :table, rows: [ ['1', '2'] ] # => raises Capybara::ElementNotFound
374
+ # ```
375
+ #
376
+ # * **:table_row** - Find table row
377
+ # * Locator: Array<String>, Hash<String, String> table row `<td>` contents - visibility of `<td>` elements is not considered
378
+ #
379
+ # ```ruby
380
+ # page.html # => '<table>
381
+ # <tr>
382
+ # <th>A</th>
383
+ # <th>B</th>
384
+ # </tr>
385
+ # <tr>
386
+ # <td>1</td>
387
+ # <td>2</td>
388
+ # </tr>
389
+ # <tr>
390
+ # <td>3</td>
391
+ # <td>4</td>
392
+ # </tr>
393
+ # </table>'
394
+ #
395
+ # page.find :table_row, 'A' => '1', 'B' => '2'
396
+ # page.find :table_row, 'A' => '3', 'B' => '4'
397
+ # ```
398
+ #
399
+ # * **:frame** - Find frame/iframe elements
400
+ # * Locator: Match id, {Capybara.configure test_id} attribute, or name
401
+ # * Filters:
402
+ # * :name (String) - Match name attribute
403
+ #
404
+ # ```ruby
405
+ # page.html # => '<iframe id="embed_frame" name="embed" src="https://example.com/embed"></iframe>'
406
+ #
407
+ # page.find :frame, 'embed_frame'
408
+ # page.find :frame, 'embed'
409
+ # page.find :frame, name: 'embed'
410
+ # ```
411
+ #
412
+ # * **:element**
413
+ # * Locator: Type of element ('div', 'a', etc) - if not specified defaults to '*'
414
+ # * Filters:
415
+ # * :\<any> (String, Regexp) - Match on any specified element attribute
416
+ #
417
+ # ```ruby
418
+ # page.html # => '<button type="button" role="menuitemcheckbox" aria-checked="true">Check me</button>
419
+ #
420
+ # page.find :element, 'button'
421
+ # page.find :element, type: 'button', text: 'Check me'
422
+ # page.find :element, role: 'menuitemcheckbox'
423
+ # page.find :element, role: /checkbox/, 'aria-checked': 'true'
424
+ # ```
425
+ #
426
+ class Capybara::Selector; end # rubocop:disable Lint/EmptyClass
427
+
428
+ Capybara::Selector::FilterSet.add(:_field) do
429
+ node_filter(:checked, :boolean) { |node, value| !(value ^ node.checked?) }
430
+ node_filter(:unchecked, :boolean) { |node, value| (value ^ node.checked?) }
431
+ node_filter(:disabled, :boolean, default: false, skip_if: :all) { |node, value| !(value ^ node.disabled?) }
432
+ node_filter(:valid, :boolean) { |node, value| node.evaluate_script('this.validity.valid') == value }
433
+ node_filter(:name) { |node, value| !value.is_a?(Regexp) || value.match?(node[:name]) }
434
+ node_filter(:placeholder) { |node, value| !value.is_a?(Regexp) || value.match?(node[:placeholder]) }
435
+ node_filter(:validation_message) do |node, msg|
436
+ vm = node[:validationMessage]
437
+ (msg.is_a?(Regexp) ? msg.match?(vm) : vm == msg.to_s).tap do |res|
438
+ add_error("Expected validation message to be #{msg.inspect} but was #{vm}") unless res
439
+ end
440
+ end
441
+
442
+ expression_filter(:name) do |xpath, val|
443
+ builder(xpath).add_attribute_conditions(name: val)
444
+ end
445
+ expression_filter(:placeholder) do |xpath, val|
446
+ builder(xpath).add_attribute_conditions(placeholder: val)
447
+ end
448
+ expression_filter(:disabled) { |xpath, val| val ? xpath : xpath[~XPath.attr(:disabled)] }
449
+ expression_filter(:multiple) { |xpath, val| xpath[val ? XPath.attr(:multiple) : ~XPath.attr(:multiple)] }
450
+
451
+ describe(:expression_filters) do |name: nil, placeholder: nil, disabled: nil, multiple: nil, **|
452
+ desc = +''
453
+ desc << ' that is not disabled' if disabled == false
454
+ desc << " with name #{name}" if name
455
+ desc << " with placeholder #{placeholder}" if placeholder
456
+ desc << ' with the multiple attribute' if multiple == true
457
+ desc << ' without the multiple attribute' if multiple == false
458
+ desc
459
+ end
460
+
461
+ describe(:node_filters) do |checked: nil, unchecked: nil, disabled: nil, valid: nil, validation_message: nil, **|
462
+ desc, states = +'', []
463
+ states << 'checked' if checked || (unchecked == false)
464
+ states << 'not checked' if unchecked || (checked == false)
465
+ states << 'disabled' if disabled == true
466
+ desc << " that is #{states.join(' and ')}" unless states.empty?
467
+ desc << ' that is valid' if valid == true
468
+ desc << ' that is invalid' if valid == false
469
+ desc << " with validation message #{validation_message.to_s.inspect}" if validation_message
470
+ desc
471
+ end
472
+ end
473
+
474
+ require 'capybara/selector/definition/xpath'
475
+ require 'capybara/selector/definition/css'
476
+ require 'capybara/selector/definition/id'
477
+ require 'capybara/selector/definition/field'
478
+ require 'capybara/selector/definition/fieldset'
479
+ require 'capybara/selector/definition/link'
480
+ require 'capybara/selector/definition/button'
481
+ require 'capybara/selector/definition/link_or_button'
482
+ require 'capybara/selector/definition/fillable_field'
483
+ require 'capybara/selector/definition/radio_button'
484
+ require 'capybara/selector/definition/checkbox'
485
+ require 'capybara/selector/definition/select'
486
+ require 'capybara/selector/definition/datalist_input'
487
+ require 'capybara/selector/definition/option'
488
+ require 'capybara/selector/definition/datalist_option'
489
+ require 'capybara/selector/definition/file_field'
490
+ require 'capybara/selector/definition/label'
491
+ require 'capybara/selector/definition/table'
492
+ require 'capybara/selector/definition/table_row'
493
+ require 'capybara/selector/definition/frame'
494
+ require 'capybara/selector/definition/element'
@@ -0,0 +1 @@
1
+ (function(){function u(e){var t=e.tagName.toUpperCase();if("OPTION"==t)return!0;if("INPUT"!=t)return!1;var r=e.type.toLowerCase();return"checkbox"==r||"radio"==r}function s(e){var t="selected",r=e.type&&e.type.toLowerCase();return"checkbox"!=r&&"radio"!=r||(t="checked"),!!e[t]}function c(e,t){var r=e.getAttributeNode(t);return r&&r.specified?r.value:null}var i=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","compact","complete","controls","declare","default","defaultchecked","defaultselected","defer","disabled","ended","formnovalidate","hidden","indeterminate","iscontenteditable","ismap","itemscope","loop","multiple","muted","nohref","nomodule","noresize","noshade","novalidate","nowrap","open","paused","playsinline","pubdate","readonly","required","reversed","scoped","seamless","seeking","selected","truespeed","typemustmatch","willvalidate"],d={"class":"className",readonly:"readOnly"};return function f(e,t){var r=null,a=t.toLowerCase();if("style"==a)return(r=e.style)&&"string"!=typeof r&&(r=r.cssText),r;if(("selected"==a||"checked"==a)&&u(e))return s(e)?"true":null;if(tagName=e.tagName.toUpperCase(),"IMG"==tagName&&"src"==a||"A"==tagName&&"href"==a)return(r=c(e,a))&&(r=e[a]),r;if("spellcheck"==a){if(null!==(r=c(e,a))){if("false"==r.toLowerCase())return"false";if("true"==r.toLowerCase())return"true"}return e[a]+""}var l,n=d[t]||t;if(i.some(function(e){e==a}))return(r=!(null===(r=c(e,a)))||e[n])?"true":null;try{l=e[n]}catch(o){}return null!=(r=null==l||"object"==typeof l||"function"==typeof l?c(e,t):l)?r.toString():null}})()
@@ -0,0 +1 @@
1
+ (function(){function d(t,e,n){function r(t){var e=x(t);if(0<e.height&&0<e.width)return!0;if("PATH"==t.tagName.toUpperCase()&&(0<e.height||0<e.width)){var n=window.getComputedStyle(t)["stroke-width"];return!!n&&0<parseInt(n,10)}return"hidden"!=window.getComputedStyle(t).overflow&&Array.prototype.slice.call(t.childNodes).some(function(t){return t.nodeType==Node.TEXT_NODE||t.nodeType==Node.ELEMENT_NODE&&r(t)})}function i(t){return C(t)==T.HIDDEN&&Array.prototype.slice.call(t.childNodes).every(function(t){return t.nodeType!=Node.ELEMENT_NODE||i(t)||!r(t)})}var o=t.tagName.toUpperCase();if("BODY"==o)return!0;if("OPTION"==o||"OPTGROUP"==o){var a=c(t,function(t){return"SELECT"==t.tagName.toUpperCase()});return!!a&&d(a,!0,n)}var u=s(t);if(u)return!!u.image&&0<u.rect.width&&0<u.rect.height&&d(u.image,e,n);if("INPUT"==o&&"hidden"==t.type.toLowerCase())return!1;if("NOSCRIPT"==o)return!1;var l=window.getComputedStyle(t).visibility;return"collapse"!=l&&"hidden"!=l&&(!!n(t)&&(!(!e&&0==f(t))&&(!!r(t)&&!i(t))))}function E(t){var e=x(t);return{left:e.left,right:e.left+e.width,top:e.top,bottom:e.top+e.height}}function D(t){return t.parentElement}function C(t){function e(t){function e(t){if(t==u)return!0;var e=window.getComputedStyle(t),n=e.display;return 0!=n.indexOf("inline")&&"contents"!=n&&("absolute"!=r||"static"!=e.position)}var r=window.getComputedStyle(t).position;if("fixed"==r)return i=!0,t==u?null:u;for(var n=D(t);n&&!e(n);)n=D(n);return n}function n(t){var e=t;if("visible"==d)if(t==u&&l)e=l;else if(t==l)return{x:"visible",y:"visible"};var n=window.getComputedStyle(e),r={x:n["overflow-x"],y:n["overflow-y"]};return t==u&&(r.x="visible"==r.x?"auto":r.x,r.y="visible"==r.y?"auto":r.y),r}function r(t){return t==u?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop}}for(var i,o=E(t),a=t.ownerDocument,u=a.documentElement,l=a.body,d=window.getComputedStyle(u).overflow,f=e(t);f;f=e(f)){var h=n(f);if("visible"!=h.x||"visible"!=h.y){var s=x(f);if(0==s.width||0==s.height)return T.HIDDEN;var p=o.right<s.left,c=o.bottom<s.top;if(p&&"hidden"==h.x||c&&"hidden"==h.y)return T.HIDDEN;if(p&&"visible"!=h.x||c&&"visible"!=h.y){var v=r(f),g=o.right<s.left-v.x,w=o.bottom<s.top-v.y;return g&&"visible"!=h.x||w&&"visible"!=h.x?T.HIDDEN:C(f)==T.HIDDEN?T.HIDDEN:T.SCROLL}var N=o.left>=s.left+s.width,m=o.top>=s.top+s.height;if(N&&"hidden"==h.x||m&&"hidden"==h.y)return T.HIDDEN;if(N&&"visible"!=h.x||m&&"visible"!=h.y){if(i){var y=r(f);if(o.left>=u.scrollWidth-y.x||o.right>=u.scrollHeight-y.y)return T.HIDDEN}return C(f)==T.HIDDEN?T.HIDDEN:T.SCROLL}}}return T.NONE}function o(t){var e=t.document.documentElement;return{width:e.clientWidth,height:e.clientHeight}}function p(t,e,n,r){return{left:t,top:e,width:n,height:r}}function x(t){var e,n=s(t);if(n)return n.rect;if("HTML"==t.tagName.toUpperCase()){t.ownerDocument;var r=o(window);return p(0,0,r.width,r.height)}try{e=t.getBoundingClientRect()}catch(i){return p(0,0,0,0)}return p(e.left,e.top,e.right-e.left,e.bottom-e.top)}function f(t){var e=1,n=window.getComputedStyle(t).opacity;n&&(e=Number(n));var r=D(t);return r&&r.nodeType==Node.ELEMENT_NODE&&(e*=f(r)),e}function h(t){var e=t.shape.toLowerCase(),n=t.coords.split(",");if("rect"==e&&4==n.length){var r=n[0],i=n[1];return p(r,i,n[2]-r,n[3]-i)}if("circle"==e&&3==n.length){var o=n[0],a=n[1],u=n[2];return p(o-u,a-u,2*u,2*u)}if("poly"==e&&2<n.length){for(var l=n[0],d=n[1],f=l,h=d,s=2;s+1<n.length;s+=2)l=Math.min(l,n[s]),f=Math.max(f,n[s]),d=Math.min(d,n[s+1]),h=Math.max(h,n[s+1]);return p(l,d,f-l,h-d)}return p(0,0,0,0)}function s(t){var e=t.tagName.toUpperCase(),n="MAP"==e;if(!n&&"AREA"!=e)return null;var r=n?t:"MAP"==D(t).tagName.toUpperCase()?D(t):null,i=null,o=null;if(r&&r.name&&((i=r.ownerDocument.querySelector("*[usemap='#"+r.name+"']"))&&(o=x(i),!n&&"default"!=t.shape.toLowerCase()))){var a=h(t),u=Math.min(Math.max(a.left,0),o.width),l=Math.min(Math.max(a.top,0),o.height),d=Math.min(a.width,o.width-u),f=Math.min(a.height,o.height-l);o=p(u+o.left,l+o.top,d,f)}return{image:i,rect:o||p(0,0,0,0)}}function c(t,e){for(t&&(t=D(t));t;){if(e(t))return t;t=D(t)}return null}function r(t){var e=t.parentNode;if(e&&e.shadowRoot&&t.assignedSlot!==undefined)return t.assignedSlot?t.assignedSlot.parentNode:null;if(t.getDestinationInsertionPoints){var n=t.getDestinationInsertionPoints();if(0<n.length)return n[n.length-1]}return e}var T={NONE:"none",HIDDEN:"hidden",SCROLL:"scroll"};return function i(t,e){function n(t){if("none"==window.getComputedStyle(t).display)return!1;var e=r(t);if("function"==typeof ShadowRoot&&e instanceof ShadowRoot){if(e.host.shadowRoot!==e)return!1;e=e.host}return!(!e||e.nodeType!=Node.DOCUMENT_NODE&&e.nodeType!=Node.DOCUMENT_FRAGMENT_NODE)||!(e&&e.tagName&&"DETAILS"==e.tagName.toUpperCase()&&!e.open&&"SUMMARY"!=t.tagName)&&(e&&n(e))}return d(t,!!e,n)}})()
@@ -0,0 +1,161 @@
1
+ (function(){
2
+ var BOOLEAN_PROPERTIES = [
3
+ "allowfullscreen",
4
+ "allowpaymentrequest",
5
+ "allowusermedia",
6
+ "async",
7
+ "autofocus",
8
+ "autoplay",
9
+ "checked",
10
+ "compact",
11
+ "complete",
12
+ "controls",
13
+ "declare",
14
+ "default",
15
+ "defaultchecked",
16
+ "defaultselected",
17
+ "defer",
18
+ "disabled",
19
+ "ended",
20
+ "formnovalidate",
21
+ "hidden",
22
+ "indeterminate",
23
+ "iscontenteditable",
24
+ "ismap",
25
+ "itemscope",
26
+ "loop",
27
+ "multiple",
28
+ "muted",
29
+ "nohref",
30
+ "nomodule",
31
+ "noresize",
32
+ "noshade",
33
+ "novalidate",
34
+ "nowrap",
35
+ "open",
36
+ "paused",
37
+ "playsinline",
38
+ "pubdate",
39
+ "readonly",
40
+ "required",
41
+ "reversed",
42
+ "scoped",
43
+ "seamless",
44
+ "seeking",
45
+ "selected",
46
+ "truespeed",
47
+ "typemustmatch",
48
+ "willvalidate"
49
+ ];
50
+
51
+ var PROPERTY_ALIASES = {
52
+ "class": "className",
53
+ "readonly": "readOnly"
54
+ };
55
+
56
+ function isSelectable(element){
57
+ var tagName = element.tagName.toUpperCase();
58
+
59
+ if (tagName == "OPTION"){
60
+ return true;
61
+ }
62
+
63
+ if (tagName == "INPUT") {
64
+ var type = element.type.toLowerCase();
65
+ return type == "checkbox" || type == "radio";
66
+ }
67
+
68
+ return false;
69
+ }
70
+
71
+ function isSelected(element){
72
+ var propertyName = "selected";
73
+ var type = element.type && element.type.toLowerCase();
74
+ if ("checkbox" == type || "radio" == type) {
75
+ propertyName = "checked";
76
+ }
77
+
78
+ return !!element[propertyName];
79
+ }
80
+
81
+ function getAttributeValue(element, name){
82
+ var attr = element.getAttributeNode(name);
83
+ return (attr && attr.specified) ? attr.value : null;
84
+ }
85
+
86
+ return function get(element, attribute){
87
+ var value = null;
88
+ var name = attribute.toLowerCase();
89
+
90
+ if ("style" == name) {
91
+ value = element.style;
92
+
93
+ if (value && (typeof value != "string")) {
94
+ value = value.cssText;
95
+ }
96
+
97
+ return value;
98
+ }
99
+
100
+ if (("selected" == name || "checked" == name) &&
101
+ isSelectable(element)) {
102
+ return isSelected(element) ? "true" : null;
103
+ }
104
+
105
+ tagName = element.tagName.toUpperCase();
106
+
107
+ // The property is consistent. Return that in preference to the attribute for links and images.
108
+ if (((tagName == "IMG") && name == "src") ||
109
+ ((tagName == "A") && name == "href")) {
110
+ value = getAttributeValue(element, name);
111
+ if (value) {
112
+ // We want the full URL if present
113
+ value = element[name];
114
+ }
115
+ return value;
116
+ }
117
+
118
+ if ("spellcheck" == name) {
119
+ value = getAttributeValue(element, name);
120
+ if (!(value === null)) {
121
+ if (value.toLowerCase() == "false") {
122
+ return "false";
123
+ } else if (value.toLowerCase() == "true") {
124
+ return "true";
125
+ }
126
+ }
127
+ // coerce the property value to a string
128
+ return element[name] + "";
129
+ }
130
+ var propName = PROPERTY_ALIASES[attribute] || attribute;
131
+ if (BOOLEAN_PROPERTIES.some(function(prop){ prop == name })) {
132
+ value = getAttributeValue(element, name);
133
+ value = !(value === null) || element[propName];
134
+ return value ? "true" : null;
135
+ }
136
+ var property;
137
+ try {
138
+ property = element[propName]
139
+ } catch (e) {
140
+ // Leaves property undefined or null
141
+ }
142
+ // 1- Call getAttribute if getProperty fails,
143
+ // i.e. property is null or undefined.
144
+ // This happens for event handlers in Firefox.
145
+ // For example, calling getProperty for 'onclick' would
146
+ // fail while getAttribute for 'onclick' will succeed and
147
+ // return the JS code of the handler.
148
+ //
149
+ // 2- When property is an object we fall back to the
150
+ // actual attribute instead.
151
+ // See issue http://code.google.com/p/selenium/issues/detail?id=966
152
+ if ((property == null) || (typeof property == "object") || (typeof property == "function")) {
153
+ value = getAttributeValue(element, attribute);
154
+ } else {
155
+ value = property;
156
+ };
157
+
158
+ // The empty string is a valid return value.
159
+ return value != null ? value.toString() : null;
160
+ };
161
+ })()