watir 7.0.0.beta1 → 7.0.0.beta5
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/tests.yml +7 -3
- data/.rubocop.yml +2 -7
- data/CHANGES.md +32 -0
- data/lib/watir/browser.rb +21 -7
- data/lib/watir/capabilities.rb +52 -7
- data/lib/watir/elements/date_field.rb +4 -1
- data/lib/watir/elements/date_time_field.rb +4 -1
- data/lib/watir/elements/element.rb +32 -3
- data/lib/watir/elements/font.rb +1 -0
- data/lib/watir/elements/iframe.rb +0 -1
- data/lib/watir/elements/radio.rb +2 -2
- data/lib/watir/elements/select.rb +63 -40
- data/lib/watir/has_window.rb +2 -0
- data/lib/watir/locators.rb +4 -0
- data/lib/watir/locators/element/matcher.rb +1 -1
- data/lib/watir/locators/element/selector_builder.rb +0 -3
- data/lib/watir/locators/element/selector_builder/xpath.rb +2 -1
- data/lib/watir/locators/option/matcher.rb +24 -0
- data/lib/watir/locators/option/selector_builder.rb +8 -0
- data/lib/watir/locators/option/selector_builder/xpath.rb +37 -0
- data/lib/watir/logger.rb +3 -74
- data/lib/watir/radio_set.rb +1 -0
- data/lib/watir/screenshot.rb +2 -8
- data/lib/watir/user_editable.rb +10 -3
- data/lib/watir/version.rb +1 -1
- data/lib/watir/window.rb +15 -4
- data/lib/watir/window_collection.rb +9 -0
- data/lib/watirspec.rb +4 -2
- data/lib/watirspec/guards.rb +1 -1
- data/lib/watirspec/remote_server.rb +2 -6
- data/lib/watirspec/server.rb +1 -1
- data/spec/spec_helper.rb +0 -10
- data/spec/unit/capabilities_spec.rb +198 -48
- data/spec/unit/match_elements/element_spec.rb +11 -0
- data/spec/watirspec/after_hooks_spec.rb +22 -45
- data/spec/watirspec/browser_spec.rb +185 -206
- data/spec/watirspec/cookies_spec.rb +47 -52
- data/spec/watirspec/drag_and_drop_spec.rb +5 -7
- data/spec/watirspec/elements/area_spec.rb +1 -5
- data/spec/watirspec/elements/button_spec.rb +4 -8
- data/spec/watirspec/elements/checkbox_spec.rb +2 -4
- data/spec/watirspec/elements/date_field_spec.rb +13 -16
- data/spec/watirspec/elements/date_time_field_spec.rb +14 -13
- data/spec/watirspec/elements/dd_spec.rb +3 -4
- data/spec/watirspec/elements/del_spec.rb +10 -12
- data/spec/watirspec/elements/div_spec.rb +41 -50
- data/spec/watirspec/elements/dl_spec.rb +4 -12
- data/spec/watirspec/elements/element_spec.rb +155 -89
- data/spec/watirspec/elements/elements_spec.rb +8 -9
- data/spec/watirspec/elements/filefield_spec.rb +5 -7
- data/spec/watirspec/elements/form_spec.rb +1 -1
- data/spec/watirspec/elements/forms_spec.rb +3 -5
- data/spec/watirspec/elements/frame_spec.rb +17 -22
- data/spec/watirspec/elements/iframe_spec.rb +21 -27
- data/spec/watirspec/elements/ins_spec.rb +10 -12
- data/spec/watirspec/elements/link_spec.rb +24 -26
- data/spec/watirspec/elements/links_spec.rb +8 -9
- data/spec/watirspec/elements/radio_spec.rb +11 -14
- data/spec/watirspec/elements/select_list_spec.rb +248 -117
- data/spec/watirspec/elements/span_spec.rb +10 -12
- data/spec/watirspec/elements/table_nesting_spec.rb +31 -34
- data/spec/watirspec/elements/table_spec.rb +11 -13
- data/spec/watirspec/elements/tbody_spec.rb +10 -12
- data/spec/watirspec/elements/td_spec.rb +4 -6
- data/spec/watirspec/elements/text_field_spec.rb +10 -12
- data/spec/watirspec/elements/tr_spec.rb +5 -7
- data/spec/watirspec/support/rspec_matchers.rb +1 -1
- data/spec/watirspec/user_editable_spec.rb +26 -28
- data/spec/watirspec/wait_spec.rb +255 -258
- data/spec/watirspec/window_switching_spec.rb +199 -200
- data/spec/watirspec_helper.rb +34 -31
- data/watir.gemspec +1 -1
- metadata +7 -8
- data/spec/implementation_spec.rb +0 -24
- data/spec/unit/logger_spec.rb +0 -81
@@ -55,10 +55,9 @@ describe 'Dl' do
|
|
55
55
|
expect(browser.dl(id: 'experience-list').text).to include('11 years')
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
58
|
+
it 'returns an empty string if the element exists but contains no text',
|
59
|
+
except: {browser: :safari, reason: 'Safari does not strip text'} do
|
60
|
+
expect(browser.dl(id: 'noop').text).to eq ''
|
62
61
|
end
|
63
62
|
|
64
63
|
it 'raises UnknownObjectException if the element does not exist' do
|
@@ -98,14 +97,7 @@ describe 'Dl' do
|
|
98
97
|
describe '#html' do
|
99
98
|
it 'returns the HTML of the element' do
|
100
99
|
html = browser.dl(id: 'experience-list').html.downcase
|
101
|
-
|
102
|
-
expect(html).to include('<dt class="current-industry">')
|
103
|
-
end
|
104
|
-
|
105
|
-
deviates_on :internet_explorer do
|
106
|
-
expect(html).to include('<dt class=current-industry>')
|
107
|
-
end
|
108
|
-
|
100
|
+
expect(html).to match(/<dt class=?"current-industry?">/)
|
109
101
|
expect(html).to_not include('</body>')
|
110
102
|
end
|
111
103
|
end
|
@@ -2,6 +2,7 @@ require 'watirspec_helper'
|
|
2
2
|
|
3
3
|
describe 'Element' do
|
4
4
|
before :each do
|
5
|
+
@c = Selenium::WebDriver::Platform.mac? ? :command : :control
|
5
6
|
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
6
7
|
end
|
7
8
|
|
@@ -101,14 +102,13 @@ describe 'Element' do
|
|
101
102
|
expect(browser.element(visible_text: /Link 2/, class: 'external')).to exist
|
102
103
|
end
|
103
104
|
|
104
|
-
|
105
|
-
|
106
|
-
|
105
|
+
it 'finds elements by visible text in spite of hidden text',
|
106
|
+
except: {browser: :safari, reason: 'Safari is not filtering out hidden text'} do
|
107
|
+
browser.goto WatirSpec.url_for('non_control_elements.html')
|
107
108
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
109
|
+
expect(browser.element(visible_text: 'some visible')).to exist
|
110
|
+
expect(browser.element(visible_text: 'none visible')).not_to exist
|
111
|
+
expect(browser.element(visible_text: /none visible/)).not_to exist
|
112
112
|
end
|
113
113
|
|
114
114
|
it 'raises exception unless value is a String or a RegExp' do
|
@@ -202,14 +202,13 @@ describe 'Element' do
|
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
end
|
205
|
+
describe '#focused?',
|
206
|
+
except: {browser: :firefox,
|
207
|
+
remote: true,
|
208
|
+
reason: 'https://github.com/SeleniumHQ/selenium/issues/2555'} do
|
209
|
+
it 'knows if the element is focused' do
|
210
|
+
expect(browser.element(id: 'new_user_first_name')).to be_focused
|
211
|
+
expect(browser.element(id: 'new_user_last_name')).to_not be_focused
|
213
212
|
end
|
214
213
|
end
|
215
214
|
|
@@ -249,7 +248,8 @@ describe 'Element' do
|
|
249
248
|
browser.goto WatirSpec.url_for('removed_element.html')
|
250
249
|
end
|
251
250
|
|
252
|
-
it 'element from a collection is re-looked up after it becomes stale'
|
251
|
+
it 'element from a collection is re-looked up after it becomes stale',
|
252
|
+
except: {browser: :ie, reason: 'throwing NoSuchElement instead'} do
|
253
253
|
element = browser.divs(id: 'text').first.locate
|
254
254
|
|
255
255
|
browser.refresh
|
@@ -258,7 +258,8 @@ describe 'Element' do
|
|
258
258
|
expect(element).to exist
|
259
259
|
end
|
260
260
|
|
261
|
-
it 'element from a selenium element throws an exception when relocated'
|
261
|
+
it 'element from a selenium element throws an exception when relocated',
|
262
|
+
except: {browser: :ie, reason: 'throwing NoSuchElement instead'} do
|
262
263
|
div = browser.div.locate
|
263
264
|
element = browser.element(element: div.wd)
|
264
265
|
|
@@ -338,7 +339,8 @@ describe 'Element' do
|
|
338
339
|
expect(element).to be_stale
|
339
340
|
end
|
340
341
|
|
341
|
-
it 'returns true the second time if the element is stale'
|
342
|
+
it 'returns true the second time if the element is stale',
|
343
|
+
except: {browser: :ie, reason: 'throwing NoSuchElement instead'} do
|
342
344
|
element = browser.div.locate
|
343
345
|
|
344
346
|
browser.refresh
|
@@ -462,7 +464,6 @@ describe 'Element' do
|
|
462
464
|
|
463
465
|
describe '#send_keys' do
|
464
466
|
before(:each) do
|
465
|
-
@c = Selenium::WebDriver::Platform.mac? ? :command : :control
|
466
467
|
browser.goto(WatirSpec.url_for('keylogger.html'))
|
467
468
|
end
|
468
469
|
|
@@ -481,43 +482,122 @@ describe 'Element' do
|
|
481
482
|
expect(events).to eq 10
|
482
483
|
end
|
483
484
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
485
|
+
context 'with key combinations',
|
486
|
+
except: [{browser: :firefox, reason: 'https://github.com/mozilla/geckodriver/issues/245'},
|
487
|
+
{browser: :safari}] do
|
488
|
+
it 'performs from array' do
|
489
|
+
receiver.send_keys 'foo'
|
490
|
+
receiver.send_keys [@c, 'a']
|
491
|
+
receiver.send_keys :backspace
|
492
|
+
expect(receiver.value).to be_empty
|
493
|
+
expect(events).to eq 6
|
494
|
+
end
|
493
495
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
496
|
+
it 'performs from multiple arrays' do
|
497
|
+
receiver.send_keys 'foo'
|
498
|
+
receiver.send_keys [@c, 'a'], [@c, 'x']
|
499
|
+
expect(receiver.value).to be_empty
|
500
|
+
expect(events).to eq 7
|
501
|
+
end
|
500
502
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
end
|
503
|
+
it 'supports combination of strings and arrays' do
|
504
|
+
receiver.send_keys 'foo', [@c, 'a'], :backspace
|
505
|
+
expect(receiver.value).to be_empty
|
506
|
+
expect(events).to eq 6
|
506
507
|
end
|
507
508
|
end
|
508
509
|
end
|
509
510
|
|
510
511
|
describe '#click' do
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
512
|
+
it 'accepts modifiers', except: {browser: :ie} do
|
513
|
+
browser.a.click(@c)
|
514
|
+
expect { browser.windows.wait_until(size: 2) }.to_not raise_exception
|
515
|
+
ensure
|
516
|
+
browser.windows.restore!
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
520
|
+
describe '#set' do
|
521
|
+
it 'clicks an element by default that does not define #set' do
|
522
|
+
browser.goto(WatirSpec.url_for('non_control_elements.html'))
|
523
|
+
browser.element(id: 'best_language').set
|
524
|
+
expect(browser.div(id: 'best_language').text).to eq 'Ruby!'
|
525
|
+
end
|
526
|
+
|
527
|
+
it 'clicks an element that does not define #set with provided modifiers', except: {browser: :ie} do
|
528
|
+
browser.a.set(@c)
|
529
|
+
browser.wait_until { |b| b.windows.size > 1 }
|
530
|
+
expect(browser.windows.size).to eq 2
|
531
|
+
ensure
|
532
|
+
browser.windows.restore!
|
533
|
+
end
|
534
|
+
|
535
|
+
it 'does not click an element that does not define #set when passed false' do
|
536
|
+
browser.goto(WatirSpec.url_for('non_control_elements.html'))
|
537
|
+
browser.element(id: 'best_language').set(false)
|
538
|
+
expect(browser.div(id: 'best_language').text).not_to eq 'Ruby!'
|
539
|
+
end
|
540
|
+
|
541
|
+
it 'clicks a Button' do
|
542
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
543
|
+
browser.button(id: 'delete_user_submit').set
|
544
|
+
browser.wait_until { |b| !b.url.include? 'forms_with_input_elements.html' }
|
545
|
+
expect(browser.text).to include('Semantic table')
|
546
|
+
end
|
547
|
+
|
548
|
+
it 'sends keys to text element' do
|
549
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
550
|
+
browser.element(id: 'new_user_email').set('Bye Cruel World')
|
551
|
+
expect(browser.text_field(id: 'new_user_email').value).to eq 'Bye Cruel World'
|
552
|
+
end
|
553
|
+
|
554
|
+
it 'sends keys to text area' do
|
555
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
556
|
+
browser.element(id: 'delete_user_comment').set('Hello Cruel World')
|
557
|
+
expect(browser.textarea(id: 'delete_user_comment').value).to eq 'Hello Cruel World'
|
558
|
+
end
|
559
|
+
|
560
|
+
it 'checks a checkbox' do
|
561
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
562
|
+
browser.element(id: 'new_user_interests_cars').set
|
563
|
+
expect(browser.checkbox(id: 'new_user_interests_cars')).to be_set
|
564
|
+
end
|
565
|
+
|
566
|
+
it 'unchecks a checkbox' do
|
567
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
568
|
+
browser.element(id: 'new_user_interests_books').set(false)
|
569
|
+
expect(browser.checkbox(id: 'new_user_interests_books')).to_not be_set
|
570
|
+
end
|
571
|
+
|
572
|
+
it 'clicks a Radio' do
|
573
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
574
|
+
browser.radio(id: 'new_user_newsletter_no').set
|
575
|
+
expect(browser.radio(id: 'new_user_newsletter_no')).to be_set
|
576
|
+
expect(messages.size).to eq 1
|
577
|
+
end
|
578
|
+
|
579
|
+
it 'does not click a Radio when false or already clicked' do
|
580
|
+
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
581
|
+
browser.element(id: 'new_user_newsletter_no').set(false)
|
582
|
+
browser.element(id: 'new_user_newsletter_yes').set(true)
|
583
|
+
expect(messages.size).to eq 0
|
584
|
+
end
|
585
|
+
|
586
|
+
it 'uploads a file' do
|
587
|
+
browser.element(name: 'new_user_portrait').set __FILE__
|
588
|
+
|
589
|
+
expect(browser.file_field(name: 'new_user_portrait').value).to include(File.basename(__FILE__))
|
590
|
+
end
|
591
|
+
|
592
|
+
it 'selects an option' do
|
593
|
+
browser.select_list(name: 'new_user_languages').clear
|
594
|
+
browser.element(name: 'new_user_languages').set('2')
|
595
|
+
expect(browser.select_list(name: 'new_user_languages').selected_options.map(&:text)).to eq %w[EN]
|
596
|
+
end
|
597
|
+
|
598
|
+
it 'sends keys to content editable element' do
|
599
|
+
browser.element(id: 'contenteditable').set('Bar')
|
600
|
+
expect(browser.div(id: 'contenteditable').text).to eq 'Bar'
|
521
601
|
end
|
522
602
|
end
|
523
603
|
|
@@ -543,17 +623,15 @@ describe 'Element' do
|
|
543
623
|
end
|
544
624
|
|
545
625
|
describe '#hover' do
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
expect(link.style('font-size')).to eq '20px'
|
556
|
-
end
|
626
|
+
it 'should hover over the element', except: {browser: :ie} do
|
627
|
+
browser.goto WatirSpec.url_for('hover.html')
|
628
|
+
link = browser.a
|
629
|
+
|
630
|
+
expect(link.style('font-size')).to eq '10px'
|
631
|
+
link.scroll.to
|
632
|
+
link.hover
|
633
|
+
link.wait_until { |l| l.style('font-size') == '20px' }
|
634
|
+
expect(link.style('font-size')).to eq '20px'
|
557
635
|
end
|
558
636
|
end
|
559
637
|
|
@@ -616,7 +694,8 @@ describe 'Element' do
|
|
616
694
|
end
|
617
695
|
|
618
696
|
describe '#inner_text' do
|
619
|
-
it 'returns inner HTML code of element'
|
697
|
+
it 'returns inner HTML code of element',
|
698
|
+
except: {browser: :ie, reason: 'also returning explicitly hidden results'} do
|
620
699
|
browser.goto WatirSpec.url_for('non_control_elements.html')
|
621
700
|
div = browser.div(id: 'shown')
|
622
701
|
expect(div.inner_text).to eq('Not hidden')
|
@@ -642,7 +721,8 @@ describe 'Element' do
|
|
642
721
|
end
|
643
722
|
|
644
723
|
describe '#select_text and #selected_text' do
|
645
|
-
it 'selects text and returns selected text'
|
724
|
+
it 'selects text and returns selected text',
|
725
|
+
except: {browser: :ie, reason: 'Select Text atom appears broken in IE 11'} do
|
646
726
|
browser.goto WatirSpec.url_for('non_control_elements.html')
|
647
727
|
element = browser.element(visible_text: 'all visible')
|
648
728
|
element.select_text('all visible')
|
@@ -779,28 +859,22 @@ describe 'Element' do
|
|
779
859
|
end
|
780
860
|
end
|
781
861
|
|
782
|
-
describe '
|
783
|
-
it 'returns Float value
|
862
|
+
describe 'Numeric Attribute' do
|
863
|
+
it 'returns Float value',
|
864
|
+
except: {browser: :ie, reason: 'not recognizing the value of the element'} do
|
784
865
|
element = browser.text_field(id: 'number')
|
785
866
|
expect(element.valueasnumber).to be_a Float
|
786
867
|
end
|
787
868
|
|
788
|
-
it 'returns nil
|
869
|
+
it 'returns nil for unspecified value' do
|
789
870
|
element = browser.input
|
790
871
|
expect(element.valueasnumber).to be_nil
|
791
872
|
end
|
792
|
-
end
|
793
873
|
|
794
|
-
|
795
|
-
it 'returns Float value of applicable element' do
|
874
|
+
it 'returns Integer value' do
|
796
875
|
element = browser.form
|
797
876
|
expect(element.length).to be_a Integer
|
798
877
|
end
|
799
|
-
|
800
|
-
it 'returns -1 for an inapplicable Element' do
|
801
|
-
element = browser.input
|
802
|
-
expect(element.maxlength).to eq(-1)
|
803
|
-
end
|
804
878
|
end
|
805
879
|
|
806
880
|
describe '#class_name' do
|
@@ -850,18 +924,12 @@ describe 'Element' do
|
|
850
924
|
expect { btn.click }.not_to raise_exception
|
851
925
|
end
|
852
926
|
|
853
|
-
it 'returns true if element center is covered by a non-descendant'
|
927
|
+
it 'returns true if element center is covered by a non-descendant',
|
928
|
+
except: {browser: :safari, reason: 'not getting element click intercepted'} do
|
854
929
|
btn = browser.button(id: 'obscured')
|
855
930
|
expect(btn).to be_obscured
|
856
|
-
|
857
|
-
|
858
|
-
end
|
859
|
-
compliant_on :chrome do
|
860
|
-
expect { btn.click }.to raise_exception(Selenium::WebDriver::Error::ElementClickInterceptedError)
|
861
|
-
end
|
862
|
-
compliant_on :safari do
|
863
|
-
expect { btn.click }.to raise_exception(Selenium::WebDriver::Error::WebDriverError)
|
864
|
-
end
|
931
|
+
|
932
|
+
expect { btn.click }.to raise_exception(Selenium::WebDriver::Error::ElementClickInterceptedError)
|
865
933
|
end
|
866
934
|
|
867
935
|
it 'returns false if element center is surrounded by non-descendants' do
|
@@ -882,12 +950,10 @@ describe 'Element' do
|
|
882
950
|
expect { div.click }.not_to raise_exception
|
883
951
|
end
|
884
952
|
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
expect { btn.click }.to raise_unknown_object_exception
|
890
|
-
end
|
953
|
+
it 'returns true if element cannot be scrolled into view' do
|
954
|
+
btn = browser.button(id: 'off_screen')
|
955
|
+
expect(btn).to be_obscured
|
956
|
+
expect { btn.click }.to raise_unknown_object_exception
|
891
957
|
end
|
892
958
|
|
893
959
|
it 'returns true if element is hidden' do
|
@@ -43,15 +43,14 @@ describe 'Elements' do
|
|
43
43
|
expect(container.elements(visible_text: /some visible/).count).to eq(1)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
46
|
+
it 'finds elements in spite of hidden text',
|
47
|
+
except: {browser: :safari, reason: 'Safari is not filtering out hidden text'} do
|
48
|
+
browser.goto WatirSpec.url_for('non_control_elements.html')
|
49
|
+
container = browser.div(id: 'visible_text')
|
50
|
+
|
51
|
+
expect(container.elements(visible_text: 'some visible').count).to eq(1)
|
52
|
+
expect(container.elements(visible_text: 'none visible').count).to eq(0)
|
53
|
+
expect(container.elements(visible_text: /none visible/).count).to eq(0)
|
55
54
|
end
|
56
55
|
end
|
57
56
|
end
|
@@ -111,7 +111,7 @@ describe 'FileField' do
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
-
describe '#value=' do
|
114
|
+
describe '#value=', exclude: {browser: :ie} do
|
115
115
|
it 'is able to set a file path in the field and click the upload button and fire the onchange event' do
|
116
116
|
browser.goto WatirSpec.url_for('forms_with_input_elements.html')
|
117
117
|
|
@@ -122,12 +122,10 @@ describe 'FileField' do
|
|
122
122
|
expect(element.value).to include(File.basename(path)) # only some browser will return the full path
|
123
123
|
end
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
expect(value).to match(/\.rubocop\.yml$/)
|
130
|
-
end
|
125
|
+
it 'does not alter its argument' do
|
126
|
+
value = File.expand_path '.rubocop.yml'
|
127
|
+
browser.file_field.value = value
|
128
|
+
expect(value).to match(/\.rubocop\.yml$/)
|
131
129
|
end
|
132
130
|
end
|
133
131
|
end
|
@@ -47,7 +47,7 @@ describe 'Form' do
|
|
47
47
|
describe '#submit' do
|
48
48
|
it 'submits the form' do
|
49
49
|
browser.form(id: 'delete_user').submit
|
50
|
-
|
50
|
+
browser.wait_while(url: /forms_with_input_elements\.html$/)
|
51
51
|
expect(browser.text).to include('Semantic table')
|
52
52
|
end
|
53
53
|
|
@@ -5,11 +5,9 @@ describe 'Forms' do
|
|
5
5
|
browser.goto(WatirSpec.url_for('forms_with_input_elements.html'))
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
expect(browser.forms(method: 'post').to_a).to eq [browser.form(method: 'post')]
|
12
|
-
end
|
8
|
+
describe 'with selectors' do
|
9
|
+
it 'returns the matching elements' do
|
10
|
+
expect(browser.forms(method: 'post').to_a).to eq [browser.form(method: 'post')]
|
13
11
|
end
|
14
12
|
end
|
15
13
|
|