Skip to content

Commit

Permalink
try system test to count navbar typeahead results in dropdown (public…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jywarren authored and digitaldina committed May 12, 2019
1 parent 4247283 commit b272d11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ install:
script:
- docker-compose exec web bash -c "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
- docker-compose exec web bash -c "dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install"
- docker-compose exec web bash -c "wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip" # https://sites.google.com/a/chromium.org/chromedriver/
- docker-compose exec web bash -c "wget https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip" # https://sites.google.com/a/chromium.org/chromedriver/
- docker-compose exec web bash -c "unzip chromedriver_linux64.zip"
- docker-compose exec web bash -c "mv chromedriver /usr/local/bin/chromedriver"
- docker-compose exec web bash -c "chmod +x /usr/local/bin/chromedriver"
Expand Down
11 changes: 11 additions & 0 deletions test/system/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,15 @@ class SearchTest < ApplicationSystemTestCase

assert_selector('h2', text: 'Results for Canon')
end

test 'searching using navbar autocomplete' do
visit '/'

fill_in("searchform_input", with: "Canon")

assert_selector ".typeahead li", text: "Canon A1200 IR conversion at PLOTS Barnraising at LUMCON", wait: 10

assert page.evaluate_script("$('.typeahead.dropdown-menu').is(':visible')")
assert_equal 4, page.evaluate_script("$('.typeahead.dropdown-menu').find('li').length")
end
end

0 comments on commit b272d11

Please sign in to comment.