Salomanuel
Salomanuel

Reputation: 955

cannot run anymore single SitePrism feature specs

something happened, old tests that used to run fine on master are not running anymore

If I run the whole spec suite (with $ rspec), everything is in the green.
I have several feature specs that use SitePrism, I use to call them separately to write new ones, but none of them run anymore if called specifically from the terminal:

$ rspec spec/support/pages/user_log_in_page.rb

An error occurred while loading ./spec/support/pages/user_log_in_page.rb.
Failure/Error:
  class UserLoginPage < SitePrism::Page
    set_url "/"

    def user_clicks_on_login_button
      find(:xpath, "//a[@class='vr-link-footer'][text()='Login']").click
    end

    def user_enters_email(email)
      find(:xpath, "//*[@id='user_email']").set(email)
    end

NameError:
  uninitialized constant SitePrism
# ./spec/support/pages/user_log_in_page.rb:3:in `<top (required)>'
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
No examples found.

Randomized with seed 4425


Finished in 0.00037 seconds (files took 0.54282 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

this is one of the failing support pages:

# frozen_string_literal: true

class UserLoginPage < SitePrism::Page
  set_url "/"

  def user_clicks_on_login_button
    find(:xpath, "//a[@class='vr-link-footer'][text()='Login']").click
  end

  def user_enters_email(email)
    find(:xpath, "//*[@id='user_email']").set(email)
  end

  def user_enters_password(password)
    find(:xpath, "//*[@id='user_password']").set(password)
  end

  def user_clicks_on_submit_button
    find(:xpath, "//*[@id='vr-managed-form']/div[6]/div/input").click
  end
end

my spec/rails-helper.rb has everything it needs and then more:

require "spec_helper"
require "rspec/rails"
require "dry/monads/result"
require "dry/monads/maybe"
require "task_helper"
require "pundit/rspec"
require "capybara"
require "capybara/rspec"
require "selenium-webdriver"
require "site_prism"
require "database_cleaner"
require "webmock/rspec"
require "paper_trail/frameworks/rspec"

what could it be?

Upvotes: 0

Views: 175

Answers (1)

Salomanuel
Salomanuel

Reputation: 955

never mind,
$ rspec spec/support/pages/user_log_in_page.rb
will never run because that's a page supposed to be called from other specs, like
$ rspec spec/features/user_log_in_spec.rb
(that does indeed work)

nothing to see here

Upvotes: 1

Related Questions