title: Rspec capybara webkit cant find button tag
body: <p>I have the following test </p>
  
  <pre><code>require "rails_helper"
  
  RSpec.feature "Menu", :type =&gt; :feature do
  
   let!(:articles) { create_list(:article, 10) }
   let!(:quotes) { create_list(:quote, 2) }
  
   before { visit "/" }
  
   scenario "should not have Javascript errors" do
     Capybara.current_driver = :webkit
  
     page.find("#menu-button").click
  
     expect(page).not_to have_errors
   end
  
  end
  </code></pre>
  
  <p>and it fails with the message</p>
  
  <p><em>Capybara::ElementNotFound:
         Unable to find css "#menu-button"</em></p>
  
  <p>I also tried </p>
  
  <pre><code>click_on "Open Menu"
  
  click_button "Open Menu"
  
  click_link "Open Menu"
  
  page.find_button(id: 'menu-button').click
  
  find("#menu-button").click
  </code></pre>
  
  <p>I am trying to test the off canvas feature that foundation 6 has.</p>
  
  <p>application.html.erb file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  
  &lt;title&gt;&lt;%= content_for?(:title) ? yield(:title) : "Stargazers.news" %&gt;&lt;/title&gt;
  
  &lt;%= stylesheet_link_tag    "application" %&gt;
  &lt;%= javascript_include_tag "application", 'data-turbolinks-track' =&gt; true %&gt;
  &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="off-canvas-wrapper"&gt;
  
    &lt;div class="off-canvas position-left" id="offCanvas" data-off-canvas&gt;
      &lt;button class="close-button" arial-label="Close menu" type="button" data-close&gt;&lt;/button&gt;
  
      &lt;div id="search"&gt;
        &lt;%= form_tag({controller: "/pages", action:"search"}, method: "get") do %&gt;
          &lt;%= label_tag(:search, "Search for:") %&gt;
          &lt;%= text_field_tag(:search) %&gt;
          &lt;%= submit_tag("Search") %&gt;
        &lt;% end %&gt;
      &lt;/div&gt;    
    &lt;/div&gt;
  
    &lt;div class="off-canvas-content" data-off-canvas-content&gt;
      &lt;div class="top-bar"&gt;
        &lt;div class="top-bar-right"&gt;
          &lt;button id="menu-button" type="button" class="button" data-toggle="offCanvas"&gt;Open Menu&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;p class="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
      &lt;p class="alert"&gt;&lt;%= alert %&gt;&lt;/p&gt;
  
      &lt;%= yield %&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>the index.html.erb file</p>
  
  <pre><code>&lt;div id="quote"&gt;
    &lt;%= @quote.body %&gt;
  &lt;/div&gt;
  
  &lt;% @articles.each do |article| %&gt;
    &lt;article&gt;
      &lt;header&gt; &lt;%= article.title%&gt; &lt;/header&gt;
      &lt;div class="content-summary"&gt; &lt;%= article.body %&gt; &lt;/div&gt;
    &lt;/article&gt;
    &lt;hr/&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>rails_helper.rb file</p>
  
  <pre><code>ENV['RAILS_ENV'] ||= 'test'
  require File.expand_path('../../config/environment', __FILE__)
  
  abort("The Rails environment is running in production mode!") if Rails.env.production?
  require 'spec_helper'
  require 'rspec/rails'
  require 'capybara/rspec'
  require 'simple_bdd/rspec'
  
  ActiveRecord::Migration.maintain_test_schema!
  
  RSpec.configure do |config|
    Capybara.javascript_driver = :webkit
    config.include FactoryGirl::Syntax::Methods
  
    config.include RSpecHtmlMatchers
  
    config.include Devise::Test::IntegrationHelpers, type: :feature
  
    config.use_transactional_fixtures = true
  
    config.before(:suite) do 
      DatabaseCleaner.strategy = :truncation
      DatabaseCleaner.clean_with(:truncation)
    end
  
    config.before(:each) do
      DatabaseCleaner.start 
    end
  
    config.after(:each) do
      DatabaseCleaner.clean
    end 
  
    config.infer_spec_type_from_file_location!
    config.filter_rails_from_backtrace!
  end
  
  Shoulda::Matchers.configure do |config|
    config.integrate do |with|
      with.test_framework :rspec
      with.library :rails
    end
  end
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  git_source(:github) do |repo_name|
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
    "https://github.com/#{repo_name}.git"
  end
  
  gem 'rails', '~&gt; 5.0.1'
  gem 'pg', '~&gt; 0.18'
  gem 'puma', '~&gt; 3.0'
  gem 'sass-rails', '~&gt; 5.0'
  gem 'foundation-rails'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'coffee-rails', '~&gt; 4.2'
  gem 'jquery-rails'
  gem 'turbolinks', '~&gt; 5'
  gem 'jbuilder', '~&gt; 2.5'
  gem "paperclip", "~&gt; 5.0.0"
  gem 'devise'
  
  group :development, :test do
    gem 'byebug', platform: :mri
    gem 'factory_girl_rails'
    gem 'rspec-rails', '~&gt; 3.5'
    gem 'rspec-html-matchers'
    gem 'ffaker'
    gem 'simple_bdd'
  end
  
  group :development do
    gem 'web-console', '&gt;= 3.3.0'
    gem 'listen', '~&gt; 3.0.5'
    gem 'spring'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
    gem "better_errors"
  end
  
  group :test do
    gem 'capybara-webkit'
    gem 'database_cleaner'
    gem 'shoulda-matchers', '~&gt; 3.1'
  end
  
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>my qt version is 5.5.1
  and I am on Ubuntu 16.04</p>