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

bip Test Helpers with MiniTest #596

Open
zivkovicj opened this issue Jan 28, 2018 · 1 comment
Open

bip Test Helpers with MiniTest #596

zivkovicj opened this issue Jan 28, 2018 · 1 comment

Comments

@zivkovicj
Copy link

I'm trying to use this line in a minitest test that uses capybara, poltergeist, and phantomjs:

bip_select(@gs, :goal_id, Goal.first.name)
I've read a few questions on StackOverflow where other developers who are using RSpec have added this line to their spec_helper.rb file:

config.include BestInPlace::TestHelpers

I've tried adding this line to my test_helper.rb file and I've tried adding it to the test in question. But I'm still getting the error

NoMethodError: undefined methodbip_select' for #GoalStudentsPoltergeistEditTest:0x00000006d85148`

Thank you in advance for any insight.

@limsammy
Copy link

Would like to add to this and mention 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!


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

2 participants