theforeman / foreman_puppet

https://theforeman.org/plugins/foreman_puppet/
GNU General Public License v3.0
7 stars 24 forks source link

Adapt foreman_puppet tests to run with remote_webdriver #382

Closed dosas closed 4 months ago

dosas commented 7 months ago

When executing foreman_puppet integration tests with the remote webdriver

I get the following error:

test_0005_edit page(Minitest::Result) [/builds/Engineering/orcharhino/dependencies/foreman_puppet/foreman/vendor/ruby/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/bridge.rb:411]:
Selenium::WebDriver::Error::WebDriverError: You are trying to work with something that isn't a file.
foreman_puppet/test/integration/foreman_puppet/smartclass_parameter_js_test.rb:77:in `block in <class:SmartclassParameterJSTest>'

In this file

fill_in 'puppetclass_lookup_key_description', with: 'test'

Is looking for a file called test

AFAIK there are to possibilities to fix this:

  1. Disable the file detector for this test

    page.driver.browser.file_detector = nil if page.driver.browser.respond_to?(:file_detector=)
  2. Change fill_in to something that isn't a file

    fill_in 'puppetclass_lookup_key_description', with: 'asdf'

Let me know which one you prefer then I can open a PR

nadjaheitmann commented 7 months ago

@stejskalleos Any idea what is a good solution for this?

dosas commented 5 months ago

https://github.com/theforeman/foreman_puppet/pull/392