-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try system test to count navbar typeahead results in dropdown #5525
Conversation
|
|
||
fill_in("searchform_input", with: "Canon") | ||
|
||
assert page.evaluate_script("$('.typeahead.dropdown-menu').is(':visible')") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Capybara won't wait unless we ask it to look for a selector. Even then we can increase the max time:
select('Item that is being loaded', wait: 10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example: page.assert_selector('li', text: 'Horse', visible: true)
|
test/system/search_test.rb
Outdated
|
||
fill_in("searchform_input", with: "Canon") | ||
|
||
assert_select 'typeahead.dropdown-menu' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm
FAIL["test_searching_using_navbar_autocomplete", #<Minitest::Reporters::Suite:0x00007f8136b478c8 @name="SearchTest">, 10.584121601999982]
test_searching_using_navbar_autocomplete#SearchTest (10.58s)
expected to find select box "typeahead.dropdown-menu" that is not disabled but there were no matches
test/system/search_test.rb:19:in `block in <class:SearchTest>'
what am I doing wrong here? so close!
|
Hmm. I can't seem to get this to wait for the typeahead dropdown to appear. Capybara is supposed to wait 2 seconds, and i even extended it to 10 seconds. Is it possible I've set this up wrong? I'm trying to detect when the |
OMG wait! This error is different!
Four matches! I can do this! |
Oh bummer!
|
I think we need to match the chrome version with: Line 36 in 94cb7c6
We're using chrome stable: So, i think we need to change the travis.yml line here: Line 34 in 94cb7c6
to chrome 73? |
Chromedriver went to v2.46 in Feb 2019, and then the version numbering changed, perhaps to match Chrome versions? https://chromedriver.storage.googleapis.com/ Or the latest seems to support Chrome 74: https://chromedriver.storage.googleapis.com/74.0.3729.6/notes.txt We were on 73.0.3683.68, but Chrome 74 was released. I'll try upgrading. We may want to peg these version numbers... |
😄 |
…lab#5525) * try system test to count navbar typeahead results in dropdown * Update search_test.rb * add wait * Update search_test.rb * Update search_test.rb * Update search_test.rb * , wait: 10 * search for 4 li elements * chromedriver 74.0.3729.6
…lab#5525) * try system test to count navbar typeahead results in dropdown * Update search_test.rb * add wait * Update search_test.rb * Update search_test.rb * Update search_test.rb * , wait: 10 * search for 4 li elements * chromedriver 74.0.3729.6
Re: #4515