Skip to content
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

Test_Helpers are deprecated #600

Open
limsammy opened this issue Apr 27, 2018 · 0 comments
Open

Test_Helpers are deprecated #600

limsammy opened this issue Apr 27, 2018 · 0 comments

Comments

@limsammy
Copy link

So as other users have mentioned the bip_select, bip_area, etc. methods from the TestHelpers module are broken. I figured out it's a CapybaraDriver error. I rebuilt the test_helpers module included in best_in_place manually and get the following error (Stack trace included):

1) Admin can edit task inline admin visits task manager (tasks#index) admin can edit fields in place
     Failure/Error:
           execute_script <<-JS
             $("##{id} input[name='#{attr}']").val('#{escape_javascript new_value.to_s}');
             $("##{id} form").submit();
           JS

     Capybara::NotSupportedByDriverError:
       Capybara::Driver::Base#execute_script
     # /Users/sam/.rvm/gems/ruby-2.4.1/gems/capybara-2.18.0/lib/capybara/driver/base.rb:38:in `execute_script'
     # /Users/sam/.rvm/gems/ruby-2.4.1/gems/capybara-2.18.0/lib/capybara/session.rb:616:in `execute_script'
     # /Users/sam/.rvm/gems/ruby-2.4.1/gems/capybara-2.18.0/lib/capybara/dsl.rb:50:in `block (2 levels) in <module:DSL>'
     # ./app/helpers/js_spec_helper.rb:8:in `bip_text'
     # ./spec/features/admin/admin_can_edit_a_task_inline_spec.rb:27:in `block (3 levels) in <top (required)>

I then attempted a solution I found on SO and added :js => true to my it block in RSpec: it "user can edit fields in place", :js => true do....

And that triggers Selenium, opens Firefox, navigates to the right page, but isn't able to edit any fields.

If anyone has fixed this, please let me know! I believe it to be an issue with the current JS being executed by the test_helper. You can find the source for that here: https://github.com/bernat/best_in_place/blob/e262821006d9f295e9992340114ff4f3895add51/lib/best_in_place/test_helpers.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant