watir 7.1.0 → 7.2.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.
- checksums.yaml +4 -4
- data/.github/workflows/chrome.yml +29 -16
- data/.github/workflows/edge.yml +19 -11
- data/.github/workflows/firefox.yml +28 -16
- data/.github/workflows/ie.yml +13 -7
- data/.github/workflows/safari.yml +22 -11
- data/.github/workflows/unit.yml +31 -23
- data/.rubocop.yml +33 -13
- data/.rubocop_todo.yml +7 -26
- data/CHANGES.md +21 -1
- data/Gemfile +6 -1
- data/LICENSE +2 -2
- data/README.md +15 -11
- data/Rakefile +9 -7
- data/lib/watir/adjacent.rb +3 -1
- data/lib/watir/after_hooks.rb +5 -3
- data/lib/watir/alert.rb +2 -0
- data/lib/watir/aliases.rb +2 -0
- data/lib/watir/attribute_helper.rb +4 -2
- data/lib/watir/browser.rb +10 -14
- data/lib/watir/capabilities.rb +56 -33
- data/lib/watir/cell_container.rb +2 -0
- data/lib/watir/container.rb +2 -0
- data/lib/watir/cookies.rb +5 -5
- data/lib/watir/element_collection.rb +3 -1
- data/lib/watir/elements/button.rb +2 -0
- data/lib/watir/elements/cell.rb +2 -0
- data/lib/watir/elements/checkbox.rb +2 -0
- data/lib/watir/elements/date_field.rb +2 -0
- data/lib/watir/elements/date_time_field.rb +2 -0
- data/lib/watir/elements/dlist.rb +3 -1
- data/lib/watir/elements/element.rb +29 -105
- data/lib/watir/elements/file_field.rb +2 -0
- data/lib/watir/elements/font.rb +2 -0
- data/lib/watir/elements/form.rb +2 -0
- data/lib/watir/elements/hidden.rb +2 -0
- data/lib/watir/elements/iframe.rb +2 -0
- data/lib/watir/elements/image.rb +2 -0
- data/lib/watir/elements/input.rb +2 -0
- data/lib/watir/elements/link.rb +2 -0
- data/lib/watir/elements/list.rb +2 -0
- data/lib/watir/elements/option.rb +2 -0
- data/lib/watir/elements/radio.rb +2 -0
- data/lib/watir/elements/row.rb +2 -0
- data/lib/watir/elements/select.rb +2 -0
- data/lib/watir/elements/table.rb +3 -1
- data/lib/watir/elements/table_cell.rb +2 -0
- data/lib/watir/elements/table_row.rb +2 -0
- data/lib/watir/elements/table_section.rb +2 -0
- data/lib/watir/elements/text_area.rb +2 -0
- data/lib/watir/elements/text_field.rb +2 -0
- data/lib/watir/exception.rb +2 -0
- data/lib/watir/extensions/nokogiri.rb +2 -0
- data/lib/watir/generator/base/generator.rb +2 -0
- data/lib/watir/generator/base/idl_sorter.rb +3 -1
- data/lib/watir/generator/base/spec_extractor.rb +6 -4
- data/lib/watir/generator/base/util.rb +2 -0
- data/lib/watir/generator/base/visitor.rb +5 -5
- data/lib/watir/generator/base.rb +2 -1
- data/lib/watir/generator/html/generator.rb +2 -0
- data/lib/watir/generator/html/spec_extractor.rb +2 -0
- data/lib/watir/generator/html/visitor.rb +2 -0
- data/lib/watir/generator/html.rb +2 -0
- data/lib/watir/generator/svg/generator.rb +2 -0
- data/lib/watir/generator/svg/spec_extractor.rb +2 -0
- data/lib/watir/generator/svg/visitor.rb +2 -0
- data/lib/watir/generator/svg.rb +2 -0
- data/lib/watir/generator.rb +2 -0
- data/lib/watir/has_window.rb +3 -1
- data/lib/watir/http_client.rb +2 -0
- data/lib/watir/js_execution.rb +2 -0
- data/lib/watir/js_snippets.rb +2 -0
- data/lib/watir/locators/anchor/selector_builder.rb +5 -0
- data/lib/watir/locators/button/matcher.rb +2 -0
- data/lib/watir/locators/button/selector_builder/xpath.rb +15 -19
- data/lib/watir/locators/button/selector_builder.rb +2 -0
- data/lib/watir/locators/cell/selector_builder/xpath.rb +2 -0
- data/lib/watir/locators/cell/selector_builder.rb +2 -0
- data/lib/watir/locators/element/locator.rb +2 -0
- data/lib/watir/locators/element/matcher.rb +4 -1
- data/lib/watir/locators/element/selector_builder/regexp_disassembler.rb +4 -1
- data/lib/watir/locators/element/selector_builder/xpath.rb +16 -15
- data/lib/watir/locators/element/selector_builder/xpath_support.rb +4 -2
- data/lib/watir/locators/element/selector_builder.rb +16 -6
- data/lib/watir/locators/option/matcher.rb +2 -0
- data/lib/watir/locators/option/selector_builder/xpath.rb +2 -0
- data/lib/watir/locators/option/selector_builder.rb +2 -0
- data/lib/watir/locators/row/selector_builder/xpath.rb +2 -0
- data/lib/watir/locators/row/selector_builder.rb +2 -0
- data/lib/watir/locators/text_area/selector_builder/xpath.rb +2 -0
- data/lib/watir/locators/text_area/selector_builder.rb +2 -0
- data/lib/watir/locators/text_field/matcher.rb +2 -4
- data/lib/watir/locators/text_field/selector_builder/xpath.rb +2 -0
- data/lib/watir/locators/text_field/selector_builder.rb +2 -0
- data/lib/watir/locators.rb +2 -0
- data/lib/watir/logger.rb +2 -0
- data/lib/watir/navigation.rb +3 -1
- data/lib/watir/radio_set.rb +2 -0
- data/lib/watir/row_container.rb +2 -0
- data/lib/watir/screenshot.rb +2 -0
- data/lib/watir/scroll.rb +27 -2
- data/lib/watir/search_context.rb +96 -0
- data/lib/watir/shadow_root.rb +60 -0
- data/lib/watir/user_editable.rb +3 -1
- data/lib/watir/version.rb +3 -1
- data/lib/watir/wait/timer.rb +3 -1
- data/lib/watir/wait.rb +5 -5
- data/lib/watir/window.rb +7 -3
- data/lib/watir/window_collection.rb +4 -1
- data/lib/watir.rb +4 -0
- data/lib/watirspec/guards.rb +2 -0
- data/lib/watirspec/implementation.rb +14 -10
- data/lib/watirspec/rake_tasks.rb +4 -4
- data/lib/watirspec/remote_server.rb +5 -3
- data/lib/watirspec/runner.rb +3 -1
- data/lib/watirspec/server/app.rb +2 -0
- data/lib/watirspec/server.rb +2 -0
- data/lib/watirspec.rb +7 -4
- data/spec/locator_spec_helper.rb +2 -8
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/capabilities_spec.rb +561 -550
- data/spec/unit/element_locator_spec.rb +71 -58
- data/spec/unit/match_elements/button_spec.rb +58 -49
- data/spec/unit/match_elements/element_spec.rb +305 -309
- data/spec/unit/match_elements/text_field_spec.rb +78 -73
- data/spec/unit/selector_builder/anchor_spec.rb +41 -33
- data/spec/unit/selector_builder/button_spec.rb +211 -201
- data/spec/unit/selector_builder/cell_spec.rb +50 -42
- data/spec/unit/selector_builder/element_spec.rb +636 -628
- data/spec/unit/selector_builder/row_spec.rb +121 -104
- data/spec/unit/selector_builder/text_field_spec.rb +197 -182
- data/spec/unit/selector_builder/textarea_spec.rb +24 -14
- data/spec/unit/unit_helper.rb +2 -0
- data/spec/unit/wait_spec.rb +77 -71
- data/spec/watirspec/adjacent_spec.rb +251 -247
- data/spec/watirspec/after_hooks_spec.rb +160 -160
- data/spec/watirspec/alert_spec.rb +63 -58
- data/spec/watirspec/browser_spec.rb +411 -407
- data/spec/watirspec/capabilities_spec.rb +559 -0
- data/spec/watirspec/cookies_spec.rb +122 -118
- data/spec/watirspec/drag_and_drop_spec.rb +28 -24
- data/spec/watirspec/element_hidden_spec.rb +68 -60
- data/spec/watirspec/elements/area_spec.rb +51 -47
- data/spec/watirspec/elements/areas_spec.rb +29 -25
- data/spec/watirspec/elements/button_spec.rb +255 -251
- data/spec/watirspec/elements/buttons_spec.rb +38 -34
- data/spec/watirspec/elements/checkbox_spec.rb +50 -36
- data/spec/watirspec/elements/checkboxes_spec.rb +31 -27
- data/spec/watirspec/elements/collections_spec.rb +128 -119
- data/spec/watirspec/elements/date_field_spec.rb +187 -183
- data/spec/watirspec/elements/date_fields_spec.rb +31 -27
- data/spec/watirspec/elements/date_time_field_spec.rb +199 -195
- data/spec/watirspec/elements/date_time_fields_spec.rb +32 -28
- data/spec/watirspec/elements/dd_spec.rb +89 -85
- data/spec/watirspec/elements/dds_spec.rb +29 -25
- data/spec/watirspec/elements/del_spec.rb +108 -104
- data/spec/watirspec/elements/dels_spec.rb +28 -24
- data/spec/watirspec/elements/div_spec.rb +227 -222
- data/spec/watirspec/elements/divs_spec.rb +39 -35
- data/spec/watirspec/elements/dl_spec.rb +112 -110
- data/spec/watirspec/elements/dls_spec.rb +30 -26
- data/spec/watirspec/elements/dt_spec.rb +88 -84
- data/spec/watirspec/elements/dts_spec.rb +29 -25
- data/spec/watirspec/elements/element_spec.rb +798 -771
- data/spec/watirspec/elements/elements_spec.rb +42 -38
- data/spec/watirspec/elements/em_spec.rb +64 -60
- data/spec/watirspec/elements/ems_spec.rb +30 -26
- data/spec/watirspec/elements/filefield_spec.rb +100 -96
- data/spec/watirspec/elements/filefields_spec.rb +30 -26
- data/spec/watirspec/elements/font_spec.rb +22 -18
- data/spec/watirspec/elements/form_spec.rb +53 -49
- data/spec/watirspec/elements/forms_spec.rb +31 -27
- data/spec/watirspec/elements/frame_spec.rb +91 -87
- data/spec/watirspec/elements/frames_spec.rb +29 -25
- data/spec/watirspec/elements/hidden_spec.rb +81 -77
- data/spec/watirspec/elements/hiddens_spec.rb +30 -26
- data/spec/watirspec/elements/hn_spec.rb +61 -57
- data/spec/watirspec/elements/hns_spec.rb +28 -24
- data/spec/watirspec/elements/iframe_spec.rb +197 -191
- data/spec/watirspec/elements/iframes_spec.rb +33 -29
- data/spec/watirspec/elements/image_spec.rb +146 -142
- data/spec/watirspec/elements/images_spec.rb +28 -24
- data/spec/watirspec/elements/input_spec.rb +11 -7
- data/spec/watirspec/elements/ins_spec.rb +108 -104
- data/spec/watirspec/elements/inses_spec.rb +28 -24
- data/spec/watirspec/elements/label_spec.rb +58 -54
- data/spec/watirspec/elements/labels_spec.rb +28 -24
- data/spec/watirspec/elements/li_spec.rb +76 -72
- data/spec/watirspec/elements/link_spec.rb +175 -179
- data/spec/watirspec/elements/links_spec.rb +47 -43
- data/spec/watirspec/elements/lis_spec.rb +29 -25
- data/spec/watirspec/elements/list_spec.rb +46 -42
- data/spec/watirspec/elements/map_spec.rb +59 -55
- data/spec/watirspec/elements/maps_spec.rb +29 -25
- data/spec/watirspec/elements/meta_spec.rb +18 -14
- data/spec/watirspec/elements/metas_spec.rb +28 -24
- data/spec/watirspec/elements/ol_spec.rb +58 -65
- data/spec/watirspec/elements/ols_spec.rb +28 -24
- data/spec/watirspec/elements/option_spec.rb +93 -89
- data/spec/watirspec/elements/p_spec.rb +79 -75
- data/spec/watirspec/elements/pre_spec.rb +77 -73
- data/spec/watirspec/elements/pres_spec.rb +28 -24
- data/spec/watirspec/elements/ps_spec.rb +28 -24
- data/spec/watirspec/elements/radio_spec.rb +253 -249
- data/spec/watirspec/elements/radios_spec.rb +30 -26
- data/spec/watirspec/elements/select_list_spec.rb +539 -522
- data/spec/watirspec/elements/select_lists_spec.rb +34 -30
- data/spec/watirspec/elements/span_spec.rb +114 -110
- data/spec/watirspec/elements/spans_spec.rb +28 -24
- data/spec/watirspec/elements/strong_spec.rb +60 -58
- data/spec/watirspec/elements/strongs_spec.rb +30 -26
- data/spec/watirspec/elements/table_spec.rb +194 -139
- data/spec/watirspec/elements/tables_spec.rb +30 -26
- data/spec/watirspec/elements/tbody_spec.rb +71 -67
- data/spec/watirspec/elements/tbodys_spec.rb +42 -38
- data/spec/watirspec/elements/td_spec.rb +68 -64
- data/spec/watirspec/elements/tds_spec.rb +43 -39
- data/spec/watirspec/elements/text_field_spec.rb +208 -204
- data/spec/watirspec/elements/text_fields_spec.rb +32 -28
- data/spec/watirspec/elements/textarea_spec.rb +22 -18
- data/spec/watirspec/elements/textareas_spec.rb +20 -16
- data/spec/watirspec/elements/tfoot_spec.rb +67 -63
- data/spec/watirspec/elements/tfoots_spec.rb +44 -40
- data/spec/watirspec/elements/thead_spec.rb +67 -63
- data/spec/watirspec/elements/theads_spec.rb +44 -40
- data/spec/watirspec/elements/tr_spec.rb +50 -46
- data/spec/watirspec/elements/trs_spec.rb +44 -40
- data/spec/watirspec/elements/ul_spec.rb +58 -54
- data/spec/watirspec/elements/uls_spec.rb +28 -24
- data/spec/watirspec/html/child_frame.html +29 -0
- data/spec/watirspec/html/class_locator.html +2 -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/radio_set_spec.rb +271 -267
- data/spec/watirspec/screenshot_spec.rb +22 -18
- data/spec/watirspec/scroll_spec.rb +166 -94
- data/spec/watirspec/shadow_root_spec.rb +106 -0
- data/spec/watirspec/support/rspec_matchers.rb +35 -32
- data/spec/watirspec/user_editable_spec.rb +202 -198
- data/spec/watirspec/wait_spec.rb +291 -295
- data/spec/watirspec/window_switching_spec.rb +426 -428
- data/spec/watirspec_helper.rb +25 -41
- data/support/doctest_helper.rb +2 -0
- data/support/version_differ.rb +2 -0
- data/watir.gemspec +14 -10
- metadata +89 -239
- data/.github/actions/enable-safari/action.yml +0 -11
- data/.github/actions/install-chrome/action.yml +0 -12
- data/.github/actions/setup-linux/action.yml +0 -8
- data/lib/watir-webdriver.rb +0 -2
- data/spec/watirspec/attributes_spec.rb +0 -16
- data/spec/watirspec/elements/table_nesting_spec.rb +0 -49
- data/spec/watirspec/special_chars_spec.rb +0 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec69631e8533b0c1f5a428fd9ae4e65ed1b6400d194f8d3ba7608de1e29704de
|
|
4
|
+
data.tar.gz: e45269a6afa488650533d56afd20d12ad542e9557b96b084c16c13db6b746bcf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9dd6b62ab7a055f8dcf5630a387f9023ac3041934c0d14a41eb3812b300f73756ba298e0c81eb7a5cb7b4f2fd289249e945bf6bbe8500eb1097e903b08b3d05
|
|
7
|
+
data.tar.gz: ea9a050b5a5dd631fa6403c48f4cb641987a94f10b72e37d9afa6648f02f0eba2a5cb91fa795fefb5132e6b47fffe39d917216ab34bc29cca9174e1435fbb8dd
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Chrome Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -12,23 +13,35 @@ jobs:
|
|
|
12
13
|
fail-fast: false
|
|
13
14
|
matrix:
|
|
14
15
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
-
ruby: [ 2.
|
|
16
|
+
ruby: [ 2.7, 3.2 ]
|
|
16
17
|
steps:
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
- name: Checkout source tree
|
|
19
|
+
uses: actions/checkout@v2
|
|
20
|
+
- name: Setup Fluxbox
|
|
21
|
+
if: matrix.os == 'ubuntu-latest'
|
|
22
|
+
run: sudo apt-get -y install fluxbox
|
|
23
|
+
- name: Start XVFB
|
|
24
|
+
if: matrix.os == 'ubuntu-latest'
|
|
25
|
+
run: Xvfb :99 -screen 0 1920x1280x24 > /dev/null 2>&1 &
|
|
26
|
+
- name: Start Fluxbox
|
|
27
|
+
if: matrix.os == 'ubuntu-latest'
|
|
28
|
+
run: fluxbox -display :99 &
|
|
29
|
+
- name: Set Windows resolution
|
|
30
|
+
if: matrix.os == 'windows-latest'
|
|
31
|
+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
|
32
|
+
- name: Set Mac resolution
|
|
33
|
+
if: ${{ matrix.os == 'macos-latest' }}
|
|
34
|
+
run: |
|
|
35
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
36
|
+
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 2560 1440
|
|
37
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
38
|
+
- name: Install Ruby
|
|
39
|
+
uses: ruby/setup-ruby@v1
|
|
28
40
|
with:
|
|
29
41
|
ruby-version: ${{ matrix.ruby }}
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
- name: Install gems
|
|
43
|
+
run: bundle install
|
|
44
|
+
- name: Run tests
|
|
45
|
+
run: bundle exec rake spec:chrome
|
|
33
46
|
env:
|
|
34
|
-
DISPLAY: :99
|
|
47
|
+
DISPLAY: :99.0
|
data/.github/workflows/edge.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Edge Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -12,17 +13,24 @@ jobs:
|
|
|
12
13
|
fail-fast: false
|
|
13
14
|
matrix:
|
|
14
15
|
os: [macos-latest, windows-latest]
|
|
15
|
-
ruby: [ 2.
|
|
16
|
+
ruby: [ 2.7, 3.2 ]
|
|
16
17
|
steps:
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if: matrix.os == '
|
|
21
|
-
|
|
18
|
+
- name: Checkout source tree
|
|
19
|
+
uses: actions/checkout@v2
|
|
20
|
+
- name: Set Windows resolution
|
|
21
|
+
if: matrix.os == 'windows-latest'
|
|
22
|
+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
|
23
|
+
- name: Set Mac resolution
|
|
24
|
+
if: ${{ matrix.os == 'macos-latest' }}
|
|
25
|
+
run: |
|
|
26
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
27
|
+
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 2560 1440
|
|
28
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
29
|
+
- name: Install Ruby
|
|
30
|
+
uses: ruby/setup-ruby@v1
|
|
22
31
|
with:
|
|
23
32
|
ruby-version: ${{ matrix.ruby }}
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DISPLAY: :99
|
|
33
|
+
- name: Install gems
|
|
34
|
+
run: bundle install
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: bundle exec rake spec:chrome
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Firefox Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -12,24 +13,35 @@ jobs:
|
|
|
12
13
|
fail-fast: false
|
|
13
14
|
matrix:
|
|
14
15
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
-
ruby: [ 2.
|
|
16
|
+
ruby: [ 2.7, 3.2 ]
|
|
16
17
|
steps:
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
18
|
+
- name: Checkout source tree
|
|
19
|
+
uses: actions/checkout@v2
|
|
20
|
+
- name: Setup Fluxbox
|
|
21
|
+
if: matrix.os == 'ubuntu-latest'
|
|
22
|
+
run: sudo apt-get -y install fluxbox
|
|
23
|
+
- name: Start XVFB
|
|
24
|
+
if: matrix.os == 'ubuntu-latest'
|
|
25
|
+
run: Xvfb :99 -screen 0 1920x1280x24 > /dev/null 2>&1 &
|
|
26
|
+
- name: Start Fluxbox
|
|
27
|
+
if: matrix.os == 'ubuntu-latest'
|
|
28
|
+
run: fluxbox -display :99 &
|
|
29
|
+
- name: Set Windows resolution
|
|
30
|
+
if: matrix.os == 'windows-latest'
|
|
31
|
+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
|
32
|
+
- name: Set Mac resolution
|
|
33
|
+
if: ${{ matrix.os == 'macos-latest' }}
|
|
34
|
+
run: |
|
|
35
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
36
|
+
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 2560 1440
|
|
37
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
38
|
+
- name: Install Ruby
|
|
39
|
+
uses: ruby/setup-ruby@v1
|
|
29
40
|
with:
|
|
30
41
|
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
- name: Install gems
|
|
43
|
+
run: bundle install
|
|
44
|
+
- name: Run tests
|
|
45
|
+
run: bundle exec rake spec:chrome
|
|
34
46
|
env:
|
|
35
47
|
DISPLAY: :99
|
data/.github/workflows/ie.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: IE Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -11,14 +12,19 @@ jobs:
|
|
|
11
12
|
strategy:
|
|
12
13
|
fail-fast: false
|
|
13
14
|
matrix:
|
|
14
|
-
ruby: [ 2.
|
|
15
|
+
ruby: [ 2.7, 3.2 ]
|
|
15
16
|
steps:
|
|
16
|
-
-
|
|
17
|
-
|
|
17
|
+
- name: Checkout source tree
|
|
18
|
+
uses: actions/checkout@v2
|
|
19
|
+
- name: Set Windows resolution
|
|
20
|
+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
|
21
|
+
- name: Install Ruby
|
|
22
|
+
uses: ruby/setup-ruby@v1
|
|
18
23
|
with:
|
|
19
24
|
ruby-version: ${{ matrix.ruby }}
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
- name: Install gems
|
|
26
|
+
run: bundle install
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: bundle exec rake spec:ie
|
|
23
29
|
env:
|
|
24
|
-
|
|
30
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Safari Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -11,17 +12,27 @@ jobs:
|
|
|
11
12
|
strategy:
|
|
12
13
|
fail-fast: false
|
|
13
14
|
matrix:
|
|
14
|
-
ruby: [ 2.
|
|
15
|
+
ruby: [ 2.7, 3.2 ]
|
|
15
16
|
steps:
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
- name: Checkout source tree
|
|
18
|
+
uses: actions/checkout@v2
|
|
19
|
+
- name: Set Mac resolution
|
|
20
|
+
run: |
|
|
21
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
22
|
+
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 2560 1440
|
|
23
|
+
system_profiler SPDisplaysDataType | grep Resolution
|
|
24
|
+
- name: Install Ruby
|
|
25
|
+
uses: ruby/setup-ruby@v1
|
|
21
26
|
with:
|
|
22
27
|
ruby-version: ${{ matrix.ruby }}
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
- name: Install gems
|
|
29
|
+
run: bundle install
|
|
30
|
+
- name: Configure safaridriver
|
|
31
|
+
run: |
|
|
32
|
+
defaults write com.apple.Safari IncludeDevelopMenu YES
|
|
33
|
+
defaults write com.apple.Safari AllowRemoteAutomation 1
|
|
34
|
+
sudo safaridriver --enable
|
|
35
|
+
safaridriver --version
|
|
36
|
+
safaridriver -p 0 &
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: bundle exec rake spec:safari
|
data/.github/workflows/unit.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
name: Unit Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
+
- workflow_dispatch
|
|
4
5
|
- push
|
|
5
6
|
- pull_request
|
|
6
7
|
|
|
@@ -9,16 +10,22 @@ jobs:
|
|
|
9
10
|
name: Yard Doctest
|
|
10
11
|
runs-on: ubuntu-latest
|
|
11
12
|
steps:
|
|
12
|
-
-
|
|
13
|
-
|
|
13
|
+
- name: Checkout source tree
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
- name: Setup Fluxbox
|
|
16
|
+
run: sudo apt-get -y install fluxbox
|
|
17
|
+
- name: Start XVFB
|
|
18
|
+
run: Xvfb :99 -screen 0 1920x1280x24 > /dev/null 2>&1 &
|
|
19
|
+
- name: Start Fluxbox
|
|
20
|
+
run: fluxbox -display :99 &
|
|
21
|
+
- name: Install Ruby
|
|
22
|
+
uses: ruby/setup-ruby@v1
|
|
14
23
|
with:
|
|
15
|
-
ruby-version: 2.
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
bundle exec rake yard:doctest
|
|
21
|
-
|
|
24
|
+
ruby-version: 2.7
|
|
25
|
+
- name: Install gems
|
|
26
|
+
run: bundle install
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: bundle exec rake yard:doctest
|
|
22
29
|
|
|
23
30
|
unit-test:
|
|
24
31
|
name: Unit Tests
|
|
@@ -26,27 +33,28 @@ jobs:
|
|
|
26
33
|
strategy:
|
|
27
34
|
fail-fast: false
|
|
28
35
|
matrix:
|
|
29
|
-
ruby: ['2.
|
|
36
|
+
ruby: ['2.7', '3.0', '3.1', '3.2', 'jruby-9.4.0.0', 'truffleruby-22.3.0']
|
|
30
37
|
steps:
|
|
31
|
-
-
|
|
32
|
-
|
|
38
|
+
- name: Checkout source tree
|
|
39
|
+
uses: actions/checkout@v2
|
|
40
|
+
- name: Install Ruby
|
|
41
|
+
uses: ruby/setup-ruby@v1
|
|
33
42
|
with:
|
|
34
43
|
ruby-version: ${{ matrix.ruby }}
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
- run: |
|
|
39
|
-
bundle exec rake spec:unit
|
|
40
|
-
env:
|
|
41
|
-
DISPLAY: :99
|
|
44
|
+
- name: Install gems
|
|
45
|
+
run: bundle install
|
|
46
|
+
- run: bundle exec rake spec:unit
|
|
42
47
|
|
|
43
48
|
linter-test:
|
|
44
49
|
name: Rubocop Tests
|
|
45
50
|
runs-on: ubuntu-latest
|
|
46
51
|
steps:
|
|
47
|
-
-
|
|
48
|
-
|
|
52
|
+
- name: Checkout source tree
|
|
53
|
+
uses: actions/checkout@v2
|
|
54
|
+
- name: Install Ruby
|
|
55
|
+
uses: ruby/setup-ruby@v1
|
|
49
56
|
with:
|
|
50
|
-
ruby-version: 2.
|
|
51
|
-
-
|
|
57
|
+
ruby-version: 2.7
|
|
58
|
+
- name: Install gems
|
|
59
|
+
run: bundle install
|
|
52
60
|
- run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
|
2
2
|
|
|
3
|
+
require:
|
|
4
|
+
- rubocop-performance
|
|
5
|
+
- rubocop-rake
|
|
6
|
+
- rubocop-rspec
|
|
7
|
+
|
|
3
8
|
AllCops:
|
|
4
|
-
TargetRubyVersion: 2.
|
|
9
|
+
TargetRubyVersion: 2.7
|
|
5
10
|
NewCops: enable
|
|
6
11
|
Exclude:
|
|
7
12
|
- 'lib/watir/elements/html_elements.rb'
|
|
8
13
|
- 'lib/watir/elements/svg_elements.rb'
|
|
9
14
|
|
|
10
|
-
Layout/LineLength:
|
|
11
|
-
Max: 120
|
|
12
|
-
|
|
13
15
|
Layout/SpaceInsideHashLiteralBraces:
|
|
14
16
|
EnforcedStyle: no_space
|
|
15
17
|
|
|
16
|
-
Lint/UnifiedInteger:
|
|
17
|
-
Exclude:
|
|
18
|
-
- 'lib/watir/locators/element/selector_builder.rb'
|
|
19
|
-
|
|
20
|
-
# Default: 17
|
|
21
18
|
Metrics/AbcSize:
|
|
22
19
|
Max: 22
|
|
23
20
|
Exclude:
|
|
@@ -28,7 +25,6 @@ Metrics/AbcSize:
|
|
|
28
25
|
|
|
29
26
|
Metrics/BlockLength:
|
|
30
27
|
Exclude:
|
|
31
|
-
- 'spec/**/*'
|
|
32
28
|
- 'support/doctest_helper.rb'
|
|
33
29
|
- 'watir.gemspec'
|
|
34
30
|
- 'Rakefile'
|
|
@@ -46,8 +42,8 @@ Metrics/ClassLength:
|
|
|
46
42
|
- 'lib/watir/elements/select.rb'
|
|
47
43
|
- 'lib/watir/generator/base/spec_extractor.rb'
|
|
48
44
|
- 'lib/watir/element_collection.rb'
|
|
45
|
+
- 'spec/**/*_spec.rb'
|
|
49
46
|
|
|
50
|
-
# Default: 7
|
|
51
47
|
Metrics/CyclomaticComplexity:
|
|
52
48
|
Max: 9
|
|
53
49
|
Exclude:
|
|
@@ -58,19 +54,42 @@ Metrics/MethodLength:
|
|
|
58
54
|
Max: 18
|
|
59
55
|
Exclude:
|
|
60
56
|
- 'lib/watir/locators/element/selector_builder.rb'
|
|
61
|
-
- 'lib/watir/locators/element/selector_builder/xpath.rb'
|
|
62
57
|
- 'lib/watir/locators/element/selector_builder/regexp_disassembler.rb'
|
|
63
58
|
|
|
64
|
-
|
|
59
|
+
Metrics/ModuleLength:
|
|
60
|
+
Exclude:
|
|
61
|
+
- 'spec/**/*'
|
|
62
|
+
|
|
65
63
|
Metrics/PerceivedComplexity:
|
|
66
64
|
Max: 10
|
|
67
65
|
|
|
66
|
+
RSpec/AnyInstance:
|
|
67
|
+
Enabled: false
|
|
68
|
+
|
|
69
|
+
RSpec/BeforeAfterAll:
|
|
70
|
+
Enabled: false
|
|
71
|
+
|
|
72
|
+
RSpec/ExampleLength:
|
|
73
|
+
Enabled: false
|
|
74
|
+
|
|
75
|
+
RSpec/MultipleExpectations:
|
|
76
|
+
Enabled: false
|
|
77
|
+
|
|
78
|
+
RSpec/MultipleMemoizedHelpers:
|
|
79
|
+
Exclude:
|
|
80
|
+
- 'spec/watirspec/capabilities_spec.rb'
|
|
81
|
+
|
|
82
|
+
RSpec/NoExpectationExample:
|
|
83
|
+
Exclude:
|
|
84
|
+
- 'spec/watirspec/cookies_spec.rb'
|
|
85
|
+
|
|
68
86
|
Style/BlockDelimiters:
|
|
69
87
|
EnforcedStyle: braces_for_chaining
|
|
70
88
|
|
|
71
89
|
Style/CommentedKeyword:
|
|
72
90
|
Enabled: false
|
|
73
91
|
|
|
92
|
+
# truthy is not true
|
|
74
93
|
Style/DoubleNegation:
|
|
75
94
|
Enabled: false
|
|
76
95
|
|
|
@@ -78,6 +97,7 @@ Style/GlobalVars:
|
|
|
78
97
|
AllowedVariables:
|
|
79
98
|
- $browser
|
|
80
99
|
|
|
100
|
+
# Need to add new keys into hash during iteration
|
|
81
101
|
Style/HashEachMethods:
|
|
82
102
|
Enabled: false
|
|
83
103
|
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2022-12-31 19:29:43 UTC using RuboCop version 1.40.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
10
|
-
|
|
11
|
-
Enabled: false
|
|
12
|
-
|
|
13
|
-
# Offense count: 11
|
|
14
|
-
# Configuration parameters: EnforcedStyle.
|
|
15
|
-
# SupportedStyles: annotated, template, unannotated
|
|
16
|
-
Style/FormatStringToken:
|
|
9
|
+
# Offense count: 1
|
|
10
|
+
RSpec/PendingWithoutReason:
|
|
17
11
|
Exclude:
|
|
18
|
-
- '
|
|
19
|
-
- 'lib/watir/window.rb'
|
|
12
|
+
- 'spec/watirspec/browser_spec.rb'
|
|
20
13
|
|
|
21
|
-
# Offense count:
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
# SupportedStyles: always, always_true, never
|
|
25
|
-
Style/FrozenStringLiteralComment:
|
|
14
|
+
# Offense count: 114
|
|
15
|
+
# Configuration parameters: AllowedConstants.
|
|
16
|
+
Style/Documentation:
|
|
26
17
|
Enabled: false
|
|
27
|
-
|
|
28
|
-
# Remove for Watir 7
|
|
29
|
-
Naming/FileName:
|
|
30
|
-
Exclude:
|
|
31
|
-
- 'lib/watir-webdriver.rb'
|
|
32
|
-
|
|
33
|
-
# Fix in Watir 7
|
|
34
|
-
Metrics/ParameterLists:
|
|
35
|
-
Exclude:
|
|
36
|
-
- 'lib/watir/wait.rb'
|
data/CHANGES.md
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
|
+
### 7.2.1 (2023-01-02)
|
|
2
|
+
|
|
3
|
+
* Fix bug for building locators with JRuby
|
|
4
|
+
* Fix bug for inferring internet explorer browser name from options
|
|
5
|
+
|
|
6
|
+
### 7.2.0 (2022-12-24)
|
|
7
|
+
|
|
8
|
+
* Implement Shadow DOM support (#953)
|
|
9
|
+
* Implement existing `Scroll#by` with Selenium Actions Class instead of JavaScript
|
|
10
|
+
* Implement `Scroll#from` to set origin points
|
|
11
|
+
* Implement `Scroll#to(:viewport)` for elements using Selenium Actions Class
|
|
12
|
+
* Fix bug for regex matching on single quotes (#957)
|
|
13
|
+
* Fix bug for unexpected whitespace in classes (#956)
|
|
14
|
+
* Fix bug for inferring Edge browser name from Capabilities parameter
|
|
15
|
+
* Allow starting `Browser` with `Watir::Capabilities`
|
|
16
|
+
* Allow starting `Browser` with just a `Hash` for generating a `Watir::Capabilities`
|
|
17
|
+
* Have `Capabilities` use `:options` to generate Selenium `Options` instance
|
|
18
|
+
* Deprecate allowing `:capabilities` argument in `Browser` constructor
|
|
19
|
+
* Require Ruby 2.7 and Selenium 4.2
|
|
20
|
+
|
|
1
21
|
### 7.1.0 (2021-11-15)
|
|
2
22
|
|
|
3
23
|
* Add automatic scroll to `Element#click` with method parameters to ensure element is in viewport
|
|
4
24
|
* Provide `:scroll_to` parameter for element methods implemented with `Actions` class (thanks osadasami #948, #949)
|
|
5
25
|
* Allow `:scroll_to` parameter to accept `nil` argument to avoid automatic scrolling
|
|
6
26
|
* Implement `Element#in_viewport?`
|
|
7
|
-
* Fix
|
|
27
|
+
* Fix bug where `Scroll#to` for `Browser` with `:center` argument did not scroll to center of page
|
|
8
28
|
* Change `Element#obscured?` to only scroll when element out of viewport and then scroll to bottom instead of top
|
|
9
29
|
|
|
10
30
|
### 7.0.0 (2021-10-18)
|
data/Gemfile
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
5
|
gem 'webidl', path: File.expand_path('../webidl') if ENV['LOCAL_WEBIDL']
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
if ENV['LOCAL_SELENIUM']
|
|
8
|
+
ENV['RUBYOPT'] = '-I../selenium/bazel-bin/rb'
|
|
9
|
+
gem 'selenium-webdriver', path: File.expand_path('../selenium/rb')
|
|
10
|
+
end
|
|
6
11
|
|
|
7
12
|
gem 'ffi' if Gem.win_platform? # For selenium-webdriver on Windows
|
|
8
13
|
|
data/LICENSE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(the MIT License)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2009-2015 Jari Bakken
|
|
4
|
-
Copyright (c) 2015-
|
|
5
|
-
Copyright (c) 2018-
|
|
4
|
+
Copyright (c) 2015-2023 Alex Rodionov, Titus Fortner
|
|
5
|
+
Copyright (c) 2018-2023 Justin Ko
|
|
6
6
|
|
|
7
7
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
8
8
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
Watir Powered By Selenium!
|
|
4
4
|
|
|
5
5
|
[](http://badge.fury.io/rb/watir)
|
|
6
|
-
[](https://github.com/watir/watir/actions/workflows/chrome.yml)
|
|
7
|
+
[](https://github.com/watir/watir/actions/workflows/edge.yml)
|
|
8
|
+
[](https://github.com/watir/watir/actions/workflows/firefox.yml)
|
|
9
|
+
[](https://github.com/watir/watir/actions/workflows/ie.yml)
|
|
10
|
+
[](https://github.com/watir/watir/actions/workflows/safari.yml)
|
|
11
|
+
[](https://github.com/watir/watir/actions/workflows/unit.yml)
|
|
9
12
|
|
|
10
13
|
## Using Watir
|
|
11
14
|
|
|
12
15
|
This README is for people interested in writing code for Watir or gems in the Watir ecosystem
|
|
13
16
|
that leverage private-api Watir code.
|
|
14
17
|
|
|
15
|
-
For our users, everything you'll need is on the [Watir website](http://watir.com):
|
|
18
|
+
For our users, everything you'll need is on the [Watir website](http://watir.com):
|
|
16
19
|
examples, news, guides, additional resources, support information and more.
|
|
17
20
|
|
|
18
21
|
## Procedure for Patches/Pull Requests
|
|
@@ -30,7 +33,7 @@ examples, news, guides, additional resources, support information and more.
|
|
|
30
33
|
|
|
31
34
|
## Developing Extensions
|
|
32
35
|
|
|
33
|
-
When developing a gem intended to be used with Watir, you can run your code with WatirSpec
|
|
36
|
+
When developing a gem intended to be used with Watir, you can run your code with WatirSpec
|
|
34
37
|
to make sure that requiring your code does not break something else in Watir.
|
|
35
38
|
|
|
36
39
|
First, add WatirSpec Rake tasks to your gem:
|
|
@@ -52,7 +55,7 @@ This command will walk you through how to customize your code.
|
|
|
52
55
|
## Automatic Element Generation
|
|
53
56
|
|
|
54
57
|
The majority of element methods Watir provides is autogenerated from specifications.
|
|
55
|
-
This is done by extracting the IDL parts from the spec and processing them with the
|
|
58
|
+
This is done by extracting the IDL parts from the spec and processing them with the
|
|
56
59
|
[WebIDL gem](https://github.com/jarib/webidl).
|
|
57
60
|
|
|
58
61
|
Generated elements are currently based on the following specifications:
|
|
@@ -61,6 +64,7 @@ Generated elements are currently based on the following specifications:
|
|
|
61
64
|
* [SVG](https://www.w3.org/TR/2018/CR-SVG2-20180807/) (`lib/watir/elements/svg_elements.rb`)
|
|
62
65
|
|
|
63
66
|
To run:
|
|
67
|
+
|
|
64
68
|
```bash
|
|
65
69
|
$ bundle exec rake html:update
|
|
66
70
|
$ bundle exec rake svg:update
|
|
@@ -70,7 +74,7 @@ $ bundle exec rake svg:update
|
|
|
70
74
|
|
|
71
75
|
#### Github Actions
|
|
72
76
|
|
|
73
|
-
Watir specs are run with [Github Actions](https://github.com/watir/watir/workflows).
|
|
77
|
+
Watir specs are run with [Github Actions](https://github.com/watir/watir/tree/main/.github/workflows).
|
|
74
78
|
|
|
75
79
|
Watir code is tested on Linux with latest versions of supported browsers and all active Ruby versions.
|
|
76
80
|
|
|
@@ -92,14 +96,14 @@ to ensure all paths in their code have tests associated with them.
|
|
|
92
96
|
|
|
93
97
|
#### Rubocop
|
|
94
98
|
|
|
95
|
-
Watir is using [Rubocop](https://github.com/rubocop
|
|
96
|
-
code base. It is run with our minimum supported Ruby version (2.3)
|
|
97
|
-
We have some
|
|
99
|
+
Watir is using [Rubocop](https://github.com/rubocop/rubocop) to ensure a consistent style across the
|
|
100
|
+
code base. It is run with our minimum supported Ruby version (2.3)
|
|
101
|
+
We have some established exceptions at `.rubocop.yml`
|
|
98
102
|
that might need to be tweaked for new code submissions. This can be addressed in the PR as necessary.
|
|
99
103
|
|
|
100
104
|
#### Statistics
|
|
101
105
|
|
|
102
|
-
Element specs are run with
|
|
106
|
+
Element specs are run with
|
|
103
107
|
[Selenium Statistics gem](https://github.com/titusfortner/selenium_statistics)
|
|
104
108
|
to verify that changes to the code do not dramatically decrease the performance based
|
|
105
109
|
on wire calls.
|