watir 7.1.0 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +14 -7
- data/.rubocop_todo.yml +0 -26
- data/CHANGES.md +16 -1
- data/Gemfile +6 -1
- 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 +2 -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 +2 -0
- data/lib/watir/locators/element/selector_builder/regexp_disassembler.rb +2 -0
- 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 -0
- 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 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/capabilities_spec.rb +77 -58
- data/spec/unit/element_locator_spec.rb +2 -0
- data/spec/unit/match_elements/button_spec.rb +2 -0
- data/spec/unit/match_elements/element_spec.rb +10 -8
- data/spec/unit/match_elements/text_field_spec.rb +2 -0
- data/spec/unit/selector_builder/anchor_spec.rb +2 -0
- data/spec/unit/selector_builder/button_spec.rb +31 -28
- data/spec/unit/selector_builder/cell_spec.rb +3 -1
- data/spec/unit/selector_builder/element_spec.rb +61 -60
- data/spec/unit/selector_builder/row_spec.rb +21 -10
- data/spec/unit/selector_builder/text_field_spec.rb +29 -21
- data/spec/unit/selector_builder/textarea_spec.rb +2 -0
- data/spec/unit/unit_helper.rb +2 -0
- data/spec/unit/wait_spec.rb +2 -0
- data/spec/watirspec/adjacent_spec.rb +8 -6
- data/spec/watirspec/after_hooks_spec.rb +19 -21
- data/spec/watirspec/alert_spec.rb +2 -0
- data/spec/watirspec/attributes_spec.rb +2 -0
- data/spec/watirspec/browser_spec.rb +16 -12
- data/spec/watirspec/capabilities_spec.rb +569 -0
- data/spec/watirspec/cookies_spec.rb +4 -2
- data/spec/watirspec/drag_and_drop_spec.rb +2 -0
- data/spec/watirspec/element_hidden_spec.rb +2 -0
- data/spec/watirspec/elements/area_spec.rb +2 -0
- data/spec/watirspec/elements/areas_spec.rb +2 -0
- data/spec/watirspec/elements/button_spec.rb +2 -0
- data/spec/watirspec/elements/buttons_spec.rb +2 -0
- data/spec/watirspec/elements/checkbox_spec.rb +2 -0
- data/spec/watirspec/elements/checkboxes_spec.rb +2 -0
- data/spec/watirspec/elements/collections_spec.rb +5 -3
- data/spec/watirspec/elements/date_field_spec.rb +2 -0
- data/spec/watirspec/elements/date_fields_spec.rb +2 -0
- data/spec/watirspec/elements/date_time_field_spec.rb +2 -0
- data/spec/watirspec/elements/date_time_fields_spec.rb +2 -0
- data/spec/watirspec/elements/dd_spec.rb +2 -0
- data/spec/watirspec/elements/dds_spec.rb +2 -0
- data/spec/watirspec/elements/del_spec.rb +2 -0
- data/spec/watirspec/elements/dels_spec.rb +2 -0
- data/spec/watirspec/elements/div_spec.rb +2 -1
- data/spec/watirspec/elements/divs_spec.rb +2 -0
- data/spec/watirspec/elements/dl_spec.rb +6 -6
- data/spec/watirspec/elements/dls_spec.rb +2 -0
- data/spec/watirspec/elements/dt_spec.rb +2 -0
- data/spec/watirspec/elements/dts_spec.rb +2 -0
- data/spec/watirspec/elements/element_spec.rb +9 -1
- data/spec/watirspec/elements/elements_spec.rb +2 -0
- data/spec/watirspec/elements/em_spec.rb +2 -0
- data/spec/watirspec/elements/ems_spec.rb +2 -0
- data/spec/watirspec/elements/filefield_spec.rb +2 -0
- data/spec/watirspec/elements/filefields_spec.rb +2 -0
- data/spec/watirspec/elements/font_spec.rb +2 -0
- data/spec/watirspec/elements/form_spec.rb +2 -0
- data/spec/watirspec/elements/forms_spec.rb +2 -0
- data/spec/watirspec/elements/frame_spec.rb +2 -0
- data/spec/watirspec/elements/frames_spec.rb +2 -0
- data/spec/watirspec/elements/hidden_spec.rb +2 -0
- data/spec/watirspec/elements/hiddens_spec.rb +2 -0
- data/spec/watirspec/elements/hn_spec.rb +2 -0
- data/spec/watirspec/elements/hns_spec.rb +2 -0
- data/spec/watirspec/elements/iframe_spec.rb +3 -1
- data/spec/watirspec/elements/iframes_spec.rb +2 -0
- data/spec/watirspec/elements/image_spec.rb +2 -0
- data/spec/watirspec/elements/images_spec.rb +2 -0
- data/spec/watirspec/elements/input_spec.rb +2 -0
- data/spec/watirspec/elements/ins_spec.rb +2 -0
- data/spec/watirspec/elements/inses_spec.rb +2 -0
- data/spec/watirspec/elements/label_spec.rb +2 -0
- data/spec/watirspec/elements/labels_spec.rb +2 -0
- data/spec/watirspec/elements/li_spec.rb +2 -0
- data/spec/watirspec/elements/link_spec.rb +4 -4
- data/spec/watirspec/elements/links_spec.rb +2 -0
- data/spec/watirspec/elements/lis_spec.rb +2 -0
- data/spec/watirspec/elements/list_spec.rb +2 -0
- data/spec/watirspec/elements/map_spec.rb +2 -0
- data/spec/watirspec/elements/maps_spec.rb +2 -0
- data/spec/watirspec/elements/meta_spec.rb +2 -0
- data/spec/watirspec/elements/metas_spec.rb +2 -0
- data/spec/watirspec/elements/ol_spec.rb +2 -0
- data/spec/watirspec/elements/ols_spec.rb +2 -0
- data/spec/watirspec/elements/option_spec.rb +2 -0
- data/spec/watirspec/elements/p_spec.rb +2 -0
- data/spec/watirspec/elements/pre_spec.rb +2 -0
- data/spec/watirspec/elements/pres_spec.rb +2 -0
- data/spec/watirspec/elements/ps_spec.rb +2 -0
- data/spec/watirspec/elements/radio_spec.rb +2 -0
- data/spec/watirspec/elements/radios_spec.rb +2 -0
- data/spec/watirspec/elements/select_list_spec.rb +7 -1
- data/spec/watirspec/elements/select_lists_spec.rb +2 -0
- data/spec/watirspec/elements/span_spec.rb +2 -0
- data/spec/watirspec/elements/spans_spec.rb +2 -0
- data/spec/watirspec/elements/strong_spec.rb +2 -0
- data/spec/watirspec/elements/strongs_spec.rb +2 -0
- data/spec/watirspec/elements/table_nesting_spec.rb +2 -0
- data/spec/watirspec/elements/table_spec.rb +2 -0
- data/spec/watirspec/elements/tables_spec.rb +2 -0
- data/spec/watirspec/elements/tbody_spec.rb +2 -0
- data/spec/watirspec/elements/tbodys_spec.rb +2 -0
- data/spec/watirspec/elements/td_spec.rb +2 -0
- data/spec/watirspec/elements/tds_spec.rb +2 -0
- data/spec/watirspec/elements/text_field_spec.rb +2 -0
- data/spec/watirspec/elements/text_fields_spec.rb +2 -0
- data/spec/watirspec/elements/textarea_spec.rb +2 -0
- data/spec/watirspec/elements/textareas_spec.rb +2 -0
- data/spec/watirspec/elements/tfoot_spec.rb +2 -0
- data/spec/watirspec/elements/tfoots_spec.rb +2 -0
- data/spec/watirspec/elements/thead_spec.rb +2 -0
- data/spec/watirspec/elements/theads_spec.rb +2 -0
- data/spec/watirspec/elements/tr_spec.rb +2 -0
- data/spec/watirspec/elements/trs_spec.rb +2 -0
- data/spec/watirspec/elements/ul_spec.rb +2 -0
- data/spec/watirspec/elements/uls_spec.rb +2 -0
- 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 +2 -0
- data/spec/watirspec/screenshot_spec.rb +4 -2
- data/spec/watirspec/scroll_spec.rb +75 -7
- data/spec/watirspec/shadow_root_spec.rb +103 -0
- data/spec/watirspec/special_chars_spec.rb +2 -0
- data/spec/watirspec/support/rspec_matchers.rb +35 -32
- data/spec/watirspec/user_editable_spec.rb +2 -0
- data/spec/watirspec/wait_spec.rb +2 -0
- data/spec/watirspec/window_switching_spec.rb +48 -38
- data/spec/watirspec_helper.rb +24 -18
- data/support/doctest_helper.rb +2 -0
- data/support/version_differ.rb +2 -0
- data/watir.gemspec +11 -8
- metadata +54 -215
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e21571e92209dad62a8048886e0d383b0a2d8c720b2fa42cdb8d23c0f790a28
|
4
|
+
data.tar.gz: 2ebaf5e9faf6aa665986cb333b264e29a1b3400438f8eabecdc91ec42ce640b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b631f01f18c1741b4949188ead10e9f42dd9e7f20853e6a11a4563c1cfeca71efd9cc4dc5d186ab9021f7b8134d73760519d34a765cd21498a4e454361d23ae9
|
7
|
+
data.tar.gz: 433d5075795f765aa516811c956573670f97efe667e2fbadb7a41be9acc96ad3a85df712b21ed23f73dcd8c7f0f70a15ad1db2c4a888f3a92ab2a1380c6f0e8b
|
@@ -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.1 ]
|
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.1 ]
|
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.1 ]
|
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.1 ]
|
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.1 ]
|
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']
|
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,15 +1,16 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
+
require:
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rake
|
6
|
+
|
3
7
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.
|
8
|
+
TargetRubyVersion: 2.7
|
5
9
|
NewCops: enable
|
6
10
|
Exclude:
|
7
11
|
- 'lib/watir/elements/html_elements.rb'
|
8
12
|
- 'lib/watir/elements/svg_elements.rb'
|
9
13
|
|
10
|
-
Layout/LineLength:
|
11
|
-
Max: 120
|
12
|
-
|
13
14
|
Layout/SpaceInsideHashLiteralBraces:
|
14
15
|
EnforcedStyle: no_space
|
15
16
|
|
@@ -17,7 +18,6 @@ Lint/UnifiedInteger:
|
|
17
18
|
Exclude:
|
18
19
|
- 'lib/watir/locators/element/selector_builder.rb'
|
19
20
|
|
20
|
-
# Default: 17
|
21
21
|
Metrics/AbcSize:
|
22
22
|
Max: 22
|
23
23
|
Exclude:
|
@@ -33,6 +33,10 @@ Metrics/BlockLength:
|
|
33
33
|
- 'watir.gemspec'
|
34
34
|
- 'Rakefile'
|
35
35
|
|
36
|
+
Metrics/ModuleLength:
|
37
|
+
Exclude:
|
38
|
+
- 'spec/**/*'
|
39
|
+
|
36
40
|
Metrics/ClassLength:
|
37
41
|
Max: 93
|
38
42
|
Exclude:
|
@@ -47,7 +51,6 @@ Metrics/ClassLength:
|
|
47
51
|
- 'lib/watir/generator/base/spec_extractor.rb'
|
48
52
|
- 'lib/watir/element_collection.rb'
|
49
53
|
|
50
|
-
# Default: 7
|
51
54
|
Metrics/CyclomaticComplexity:
|
52
55
|
Max: 9
|
53
56
|
Exclude:
|
@@ -61,16 +64,19 @@ Metrics/MethodLength:
|
|
61
64
|
- 'lib/watir/locators/element/selector_builder/xpath.rb'
|
62
65
|
- 'lib/watir/locators/element/selector_builder/regexp_disassembler.rb'
|
63
66
|
|
64
|
-
# Default: 8
|
65
67
|
Metrics/PerceivedComplexity:
|
66
68
|
Max: 10
|
67
69
|
|
70
|
+
Performance/CollectionLiteralInLoop:
|
71
|
+
MinSize: 3
|
72
|
+
|
68
73
|
Style/BlockDelimiters:
|
69
74
|
EnforcedStyle: braces_for_chaining
|
70
75
|
|
71
76
|
Style/CommentedKeyword:
|
72
77
|
Enabled: false
|
73
78
|
|
79
|
+
# truthy is not true
|
74
80
|
Style/DoubleNegation:
|
75
81
|
Enabled: false
|
76
82
|
|
@@ -78,6 +84,7 @@ Style/GlobalVars:
|
|
78
84
|
AllowedVariables:
|
79
85
|
- $browser
|
80
86
|
|
87
|
+
# Need to add new keys into hash during iteration
|
81
88
|
Style/HashEachMethods:
|
82
89
|
Enabled: false
|
83
90
|
|
data/.rubocop_todo.yml
CHANGED
@@ -6,31 +6,5 @@
|
|
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: 116
|
10
9
|
Style/Documentation:
|
11
10
|
Enabled: false
|
12
|
-
|
13
|
-
# Offense count: 11
|
14
|
-
# Configuration parameters: EnforcedStyle.
|
15
|
-
# SupportedStyles: annotated, template, unannotated
|
16
|
-
Style/FormatStringToken:
|
17
|
-
Exclude:
|
18
|
-
- 'lib/watir/browser.rb'
|
19
|
-
- 'lib/watir/window.rb'
|
20
|
-
|
21
|
-
# Offense count: 229
|
22
|
-
# Cop supports --auto-correct.
|
23
|
-
# Configuration parameters: EnforcedStyle.
|
24
|
-
# SupportedStyles: always, always_true, never
|
25
|
-
Style/FrozenStringLiteralComment:
|
26
|
-
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,25 @@
|
|
1
|
+
### 7.2.0 (2022-12-22)
|
2
|
+
|
3
|
+
* Implement Shadow DOM support (#953)
|
4
|
+
* Implement existing `Scroll#by` with Selenium Actions Class instead of JavaScript
|
5
|
+
* Implement `Scroll#from` to set origin points
|
6
|
+
* Implement `Scroll#to(:viewport)` for elements using Selenium Actions Class
|
7
|
+
* Fix bug for regex matching on single quotes (#957)
|
8
|
+
* Fix bug for unexpected whitespace in classes (#956)
|
9
|
+
* Fix bug for inferring Edge browser name from Capabilities parameter
|
10
|
+
* Allow starting `Browser` with `Watir::Capabilities`
|
11
|
+
* Allow starting `Browser` with just a `Hash` for generating a `Watir::Capabilities`
|
12
|
+
* Have `Capabilities` use `:options` to generate Selenium `Options` instance
|
13
|
+
* Deprecate allowing `:capabilities` argument in `Browser` constructor
|
14
|
+
* Require Ruby 2.7 and Selenium 4.2
|
15
|
+
|
1
16
|
### 7.1.0 (2021-11-15)
|
2
17
|
|
3
18
|
* Add automatic scroll to `Element#click` with method parameters to ensure element is in viewport
|
4
19
|
* Provide `:scroll_to` parameter for element methods implemented with `Actions` class (thanks osadasami #948, #949)
|
5
20
|
* Allow `:scroll_to` parameter to accept `nil` argument to avoid automatic scrolling
|
6
21
|
* Implement `Element#in_viewport?`
|
7
|
-
* Fix
|
22
|
+
* Fix bug where `Scroll#to` for `Browser` with `:center` argument did not scroll to center of page
|
8
23
|
* Change `Element#obscured?` to only scroll when element out of viewport and then scroll to bottom instead of top
|
9
24
|
|
10
25
|
### 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/README.md
CHANGED
@@ -3,16 +3,19 @@
|
|
3
3
|
Watir Powered By Selenium!
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/watir.svg)](http://badge.fury.io/rb/watir)
|
6
|
-
[![
|
7
|
-
[![
|
8
|
-
[![
|
6
|
+
[![Chrome Tests](https://github.com/watir/watir/actions/workflows/chrome.yml/badge.svg)](https://github.com/watir/watir/actions/workflows/chrome.yml)
|
7
|
+
[![Edge Tests](https://github.com/watir/watir/actions/workflows/edge.yml/badge.svg)](https://github.com/watir/watir/actions/workflows/edge.yml)
|
8
|
+
[![Firefox Tests](https://github.com/watir/watir/actions/workflows/firefox.yml/badge.svg)](https://github.com/watir/watir/actions/workflows/firefox.yml)
|
9
|
+
[![IE Tests](https://github.com/watir/watir/actions/workflows/ie.yml/badge.svg)](https://github.com/watir/watir/actions/workflows/ie.yml)
|
10
|
+
[![Safari Tests](https://github.com/watir/watir/actions/workflows/safari.yml/badge.svg)](https://github.com/watir/watir/actions/workflows/safari.yml)
|
11
|
+
[![Unit Tests](https://github.com/watir/watir/actions/workflows/unit.yml/badge.svg)](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.
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
2
4
|
|
3
5
|
require 'bundler'
|
@@ -16,13 +18,6 @@ RuboCop::RakeTask.new(:rubocop) do |t|
|
|
16
18
|
t.options = ['--display-cop-names']
|
17
19
|
end
|
18
20
|
|
19
|
-
namespace :spec do
|
20
|
-
RSpec::Core::RakeTask.new(:html) do |spec|
|
21
|
-
spec.rspec_opts = "--format html --out #{ENV['SPEC_REPORT'] || 'specs.html'}"
|
22
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
21
|
{
|
27
22
|
html: 'https://www.w3.org/TR/html52/single-page.html',
|
28
23
|
svg: 'https://www.w3.org/TR/2018/CR-SVG2-20180807/single-page.html'
|
@@ -30,6 +25,7 @@ end
|
|
30
25
|
namespace type do
|
31
26
|
spec_path = "support/#{type}.html"
|
32
27
|
|
28
|
+
desc 'require generator'
|
33
29
|
task generator_lib: :lib do
|
34
30
|
require 'watir/generator'
|
35
31
|
end
|
@@ -99,6 +95,7 @@ YARD::Doctest::RakeTask.new do |task|
|
|
99
95
|
end
|
100
96
|
|
101
97
|
namespace :changes do
|
98
|
+
desc 'Show how versions differ'
|
102
99
|
task :differ do
|
103
100
|
require './support/version_differ'
|
104
101
|
end
|
@@ -122,6 +119,11 @@ end
|
|
122
119
|
task default: [:spec, 'yard:doctest']
|
123
120
|
|
124
121
|
namespace :spec do
|
122
|
+
RSpec::Core::RakeTask.new(:html) do |spec|
|
123
|
+
spec.rspec_opts = "--format html --out #{ENV['SPEC_REPORT'] || 'specs.html'}"
|
124
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
125
|
+
end
|
126
|
+
|
125
127
|
require 'selenium-webdriver'
|
126
128
|
|
127
129
|
desc 'Run specs in all browsers'
|
data/lib/watir/adjacent.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Watir
|
2
4
|
module Adjacent
|
3
5
|
#
|
@@ -112,7 +114,7 @@ module Watir
|
|
112
114
|
|
113
115
|
def xpath_adjacent(opt = {})
|
114
116
|
plural = opt.delete(:plural)
|
115
|
-
opt[:index] ||= 0 unless plural || opt.values.any?
|
117
|
+
opt[:index] ||= 0 unless plural || opt.values.any?(Regexp)
|
116
118
|
if !plural
|
117
119
|
el = Watir.element_class_for(opt[:tag_name] || '').new(self, opt)
|
118
120
|
el.is_a?(Input) ? el.to_subtype : el
|
data/lib/watir/after_hooks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Watir
|
2
4
|
#
|
3
5
|
# After hooks are blocks that run after certain browser events.
|
@@ -33,7 +35,7 @@ module Watir
|
|
33
35
|
#
|
34
36
|
|
35
37
|
def add(after_hook = nil, &block)
|
36
|
-
if
|
38
|
+
if block
|
37
39
|
@after_hooks << block
|
38
40
|
elsif after_hook.respond_to? :call
|
39
41
|
@after_hooks << after_hook
|
@@ -99,8 +101,8 @@ module Watir
|
|
99
101
|
# @yieldparam [#call] after_hook Object responding to call
|
100
102
|
#
|
101
103
|
|
102
|
-
def each(&
|
103
|
-
@after_hooks.each
|
104
|
+
def each(&block)
|
105
|
+
@after_hooks.each(&block)
|
104
106
|
end
|
105
107
|
|
106
108
|
#
|