Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace chromedriver-helper with webdrivers #1038

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

notapatch
Copy link
Contributor

@notapatch notapatch commented Sep 10, 2019

  • Why are we changing?
    Chromedriver is used to automate our browser tests.
    - Chromedriver implements the webdriver standards for
    automated testing of webapps for Chrome.
    https://chromedriver.chromium.org/
    Chromedriver-helper had the task of installing Chromedriver
    for us and making sure the exe was in the Gem path. We could
    have installed it ourselves but this was easier.
    chromedriver-helper is no longer maintained as of 2019-03-31
    - NOTICE: Ending support for this gem flavorjones/chromedriver-helper#83

  • What are we changing to?
    Webdrivers is now responsible for downloading drivers - in our
    case chromedriver.

  • webdrivers has selenium-webdrivers as dependency removing from
    Gemfile and changing Capabyara to require 'webdrivers'

  • What are the differences?
    Webdrivers can do the same as Chromedrivers (superset of
    functionality) - but can also do other drivers and it does it
    automatically - with chromedriver-helper you had to automated
    it by hand - this should help avoid problems with running tests
    with old drivers.

Closes issue #1012

@notapatch
Copy link
Contributor Author

Depends on #1039 - Broke because of a flaky test. When #1039 is merged then this will work too.

@matyikriszta
Copy link
Contributor

@notapatch do you want to give this a rebase now that it's prerequisite PR has been merged in?

@notapatch
Copy link
Contributor Author

notapatch commented Sep 17, 2019

Rebased as requested.

This should be tested on your local system as it changes your development tooling - It would reassure if another developer had run it ok. This changes one way of installing chromedriver with another - there may be a teething issue, I hope not, but after that the tests are still calling Chromedriver which will now be kept up to date - rather than manually updating.

Testing on a local development system without merging

Assuming

  • You are on master and it is in sync with codebar/planner's master
  • You have named the remote connection to codebar/planner as upstream

From the terminal:

   git fetch upstream pull/1038/head:webdrivers
   git checkout webdrivers
   rspec spec       

Any problems?

This is an important commit because the likelihood of the deprecated chromdriver-helper breaking all builds increases with time.

Someone's experience of updating to webdriver

@notapatch notapatch force-pushed the webdrivers branch 4 times, most recently from fbad2f4 to ce4dbab Compare October 1, 2019 18:06
@notapatch notapatch force-pushed the webdrivers branch 2 times, most recently from fae664e to 18e70f7 Compare October 17, 2019 20:06
@notapatch
Copy link
Contributor Author

notapatch commented Oct 17, 2019

@matyikriszta

This one would close two issues and was tested in Docker by biggianteye - I think you were of a mind to close the issue when he agreed it was ok ... which he did
#1061
#1012

The only place it possibly irritate anyone would be non-docker developers - and I don't personally remember a problem.

Meanwhile we've been running a deprecated driver for a few months and we will have a crash at some point if we don't get off it.

@notapatch notapatch force-pushed the webdrivers branch 2 times, most recently from 045fab7 to 9fba4af Compare October 28, 2019 21:34
@notapatch
Copy link
Contributor Author

@matyikriszta - with this commit we know docker is painless. I can put an issue out saying would a native user contact me - and if nobody contacts me we can merge this time next week?

@jhsu802701
Copy link

I applied the changes requested here in my local installation of the master branch. When I run the bin/drake command, I get a webdrivers error about being unable to find the latest point release. I get the following error message:

Failures:

  1) managing workshop attendances an admin can rsvp an invited student to the workshop
     Failure/Error: visit admin_workshop_path(workshop)
     
     Webdrivers::VersionError:
       Unable to find latest point release version for 80.0.3955. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:79:in `rescue in latest_point_release'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:61:in `latest_point_release'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:34:in `block in latest_version'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/common.rb:164:in `with_cache'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:34:in `latest_version'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:90:in `download_url'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/common.rb:98:in `update'
     # /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/chromedriver.rb:119:in `block in <top (required)>'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/service.rb:133:in `binary_path'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/service.rb:94:in `initialize'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/service.rb:41:in `new'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/service.rb:41:in `chrome'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/driver.rb:299:in `service_url'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/chrome/driver.rb:40:in `initialize'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/driver.rb:46:in `new'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver/common/driver.rb:46:in `for'
     # /usr/local/bundle/gems/selenium-webdriver-3.142.6/lib/selenium/webdriver.rb:88:in `for'
     # /usr/local/bundle/gems/capybara-3.29.0/lib/capybara/selenium/driver.rb:49:in `browser'
     # /usr/local/bundle/gems/capybara-3.29.0/lib/capybara/selenium/driver.rb:68:in `visit'
     # /usr/local/bundle/gems/capybara-3.29.0/lib/capybara/session.rb:276:in `visit'
     # /usr/local/bundle/gems/capybara-3.29.0/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
     # ./spec/features/admin/manage_workshop_attendances_spec.rb:47:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:80:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Webdrivers::NetworkError:
     #   Net::HTTPServerException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/LATEST_RELEASE_80.0.3955
     #   /usr/local/bundle/gems/webdrivers-4.1.3/lib/webdrivers/network.rb:17:in `get'

Finished in 2 minutes 15.7 seconds (files took 5.42 seconds to load)
485 examples, 1 failure

Failed examples:

rspec ./spec/features/admin/manage_workshop_attendances_spec.rb:42 # managing workshop attendances an admin can rsvp an invited student to the workshop

@notapatch It would be easier to work with this pull request if it were even with the master branch instead of 23 commits behind.

Everyone else: Is there some reason that I'm not seeing a codebar:webdrivers branch?

@notapatch
Copy link
Contributor Author

notapatch commented Nov 3, 2019

@jhsu802701 - sorry for the misunderstanding. It's up to date. I'm seeing the same issue.


Update:

the issue comes from the Dockerfile installing an "edge" version of the browser (which they call unstable). This version is ahead of the drivers and it errors out. PR to fix this

@matyikriszta
Copy link
Contributor

matyikriszta commented Nov 12, 2019

@notapatch I tested this and it worked correctly for me, did not experience the issue reported by @jhsu802701 (although I do not have Docker running at the moment and never attempted to install the app via Docker). This PR needs a rebase but I'm happy to merge after. I've merged #1149 in already.

  - Why are we changing?
    Chromedriver is used to automate our browser tests.
      - Chromedriver implements the webdriver standards for
        automated testing of webapps for Chrome.
        https://chromedriver.chromium.org/
    Chromedriver-helper had the task of installing Chromedriver
    for us and making sure the exe  was in the Gem path. We could
    have installed it ourselves but this was easier.
    chromedriver-helper is no longer maintained as of 2019-03-31
    we
    - flavorjones/chromedriver-helper#83

  - What are we changing to?
    Webdrivers is now responsible for downloading drivers - in our
    case chromedriver.
  - webdrivers has selenium-webdrivers as dependency removing from
    Gemfile and changing Capabyara to require 'webdrivers'

  - What are the differences?
    Webdrivers can do the same as Chromedrivers (superset of
    functionality) - but can also do other drivers and it does it
    automatically - with chromedriver-helper you had to automated
    it by hand - this should help avoid problems with running
    tests with old drivers.
@notapatch
Copy link
Contributor Author

@matyikriszta - rebased! I did not know you were native/non-docker? Well that's the final test and we can move to the industry standard webdrivers.

Copy link
Contributor

@matyikriszta matyikriszta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@matyikriszta matyikriszta merged commit da3fe8d into codebar:master Nov 12, 2019
@notapatch notapatch deleted the webdrivers branch May 30, 2020 12:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants