<a class="pb-1 border-bottom border-light relevance-label-control" id="55-relevant-label-control" data-remote="true" rel="nofollow" data-method="patch" href="/relevance_labels/55?filter=1&project=1&relevance=true&user=1"><i aria-hidden="true" class="fa-lg fa-thumbs-up grey-text far" data-html="true" data-toggle="tooltip" id="55-relevant-label-icon" title="" data-original-title="Label this article as <strong>relevant</strong> to this stream"></i></a>
data-remote
and patch
and definitely uses ajax in the regular browser. it just doesn't seem like capybara is using the selenium driver
@elasticsearch @javascript
Scenario Outline: Labeling articles
When a specific stream is viewed
And the label <new_label> is applied to an article whose label is <current_label>
Then only the label <new_label> is indicated
And a message about <new_label> is displayed
Examples:
| current_label | new_label |
| unlabeled | relevant |
@elasticsearch
part definitely works
@javacript
/ @selenium
are being ignored
ok, getting further. here's my turnip_helper.rb
now:
require 'rails_helper'
require 'turnip/capybara' # to use Capybara DSL methods in steps
require 'capybara'
require 'webdrivers'
Dir.glob("spec/steps/**/*steps.rb") { |f| load f, true }
Capybara.current_driver = :selenium
Capybara.javascript_driver = :selenium
But now when I run the feature, I get the following error:
Failure/Error: visit(project_path(@labeling_project.slug, f: @labeling_stream.slug, q: @labeling_stream.query))
Selenium::WebDriver::Error::UnknownError:
invalid argument: can't kill an exited process
ok, now I am having an issue with the "Wrong" javascript driver being run...
require 'rails_helper'
require 'turnip/capybara' # to use Capybara DSL methods in steps
require 'capybara'
require 'webdrivers'
Dir.glob("spec/steps/**/*steps.rb") { |f| load f, true }
Capybara.register_driver :firefox_headless do |app|
options = ::Selenium::WebDriver::Firefox::Options.new
options.args << '--headless'
Capybara::Selenium::Driver.new(app, browser: :firefox, options: options)
end
Capybara.javascript_driver = :firefox_headless
Capybara.current_driver = :firefox_headless
When I get down into a test and use a binding.pry
, I get the following:
[1] pry(#<RSpec::ExampleGroups::UsersCanManageRelevanceLabelsOnArticles::LabelingArticles>)> Capybara.current_driver
=> :rack_test
[2] pry(#<RSpec::ExampleGroups::UsersCanManageRelevanceLabelsOnArticles::LabelingArticles>)> Capybara.javascript_driver
=> :firefox_headless
:rack_test
and I don't know why