Comments (9)
A "require 'capybara'" at the top of page.rb should fix the issue.
Maybe this could be included in future versions?
from site_prism.
Did it work when you added require 'capybara'
?
from site_prism.
Yes.
from site_prism.
Hi @Fryie, since this works fine when you require 'capybara'
, as stated in the README.md, I'm going to close this.
from site_prism.
I think this has been a misunderstanding.
I added "require 'capybara'" to page.rb, which worked.
Adding capybara to spec_helper.rb doesn't help at all. No matter whether it's declared at the top or inside either of the Spork blocks.
from site_prism.
Are you requiring your spec_helper.rb
in your .rspec
file?
from site_prism.
Doesn't change anything.
Spork preloads the entire Rails environment. At that point, RSpec or Cucumber files haven't been loaded yet.
It may be Spork's fault not to provide a custom initializer (or maybe I'm just too stupid to find it), but still I think that a gem should manage its own dependencies. What would be the harm in requiring capybara explicitly from site_prism?
As an aside, the same problem happens - for whatever reason - when committing the codebase to travis CI. See: https://travis-ci.org/Fryie/stuts-orga/jobs/10685216
from site_prism.
I've never used spork before, but having quickly scanned the documentation it looks like require 'capybara
' should go in a...
Spork.prefork do
#...
end
...block. Dunno, just a guess...
from site_prism.
Spork is just a test server against which rspec or cucumber run. It preloads the Rails environment and does not read the spec_helper.rb (or env.rb) files - that happens later, when rspec or cucumber connects to it. At least that's the way I understand it.
Travis CI seems to do a similar thing, just preloading the Rails environment before running any tests.
When preloading the environment, capybara has not been required yet, hence (I guess) the error.
from site_prism.
Related Issues (20)
- Improve Feature Coverage - Loadables HOT 5
- How to reduce number of deprecation warnings? HOT 5
- Can you release a new beta to allow capybara > 3.6? HOT 1
- Filling inputs by label HOT 4
- Ability to check expected elements for section or page recursively HOT 10
- wait_for_<section> not working in 3.x HOT 3
- iFrames - XPath compatibility issue in internal locator creation. HOT 1
- iFrames - Full scoping capabilities not confirmed to be working when defining iFrames in Sections HOT 1
- newbie question about elements HOT 3
- Add not_expected_elements function for a page/section class HOT 12
- Bundle install requires ruby 2.3 HOT 1
- When I click on link, site prism get the link URL and concatenate with set_url "/en" and this broken HOT 7
- Can't reuse SitePrism::Page objects across multiple Capybara::Sessions HOT 6
- Can not use rspec expect inside page object method HOT 9
- Add a CHANGELOG.md file HOT 6
- Ability to skip load validation HOT 6
- Siteprism hangs when used with timecop HOT 3
- individual Section in sections do not exec block HOT 14
- Add Deprecator/Soft Deprecator Messages HOT 1
- Input Blocks are not validated / errored for some DSL methods (element/elements) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from site_prism.