Closed brandoncc closed 5 years ago
Hi I have same issue.
Using: capybara-screenshot 1.0.22 Cucumber 3.1.2 capybara 3.11.1
I get error in my local as well
@brandoncc what driver where you using?
@ekinciq did you ever work around the issue?
Can someone provide a stack trace at least and some more description of what the test is doing and what driver is being used etc. so it can be reproduced. If you have a sample project that can reproduce this, then it will easy to roll out a fix.
@mattheworiordan i had a work around. I changed the order in my hook file so it stopped calling reset_browsers before taking thw screenshot.
I don't remember anymore but I got it working. I also don't remember how I did that :-/
I had to change both capybara-screenshot and rspec-rails to get it working in Rails 6. See:
@mattheworiordan FWIW, I'm seeing this issue while using headless_chrome.
I'm opening a page, filling in some form fields and clicking a button, at which point the spec fails and this message appears.
@mattheworiordan FWIW, I'm seeing this issue while using headless_chrome.
I'm opening a page, filling in some form fields and clicking a button, at which point the spec fails and this message appears.
Yes, i'm getting "WARN: Screenshot could not be saved. page.current_path
is empty." with headless_chrome too. i can create screenshots manually with screenshot_and_save_page.
@mattheworiordan FWIW, I'm seeing this issue while using headless_chrome.
I'm opening a page, filling in some form fields and clicking a button, at which point the spec fails and this message appears.
I also have a similar problem while using headless_chrome, the reason was:
config.after(:each, js: true) do
Capybara.reset!
end
I have replaced it with:
config.retry_callback = proc do |ex|
Capybara.reset! if ex.metadata[:js]
end
And now everything works as expected :tada:
Thanks for sharing a working solution, @GalenkoEugene!
@GalenkoEugene Can you please specify the file name where you made these changes?
@GalenkoEugene Can you please specify the file name where you made these changes?
../spec/support/capybara.rb
inside configuration block...
RSpec.configure do |config|
config.retry_callback = proc do |ex|
Capybara.reset! if ex.metadata[:js]
end
end
Generally, you could put it into any config file. Don't forget to require it in spec_helper.rb
I'm running the test using bundle exec rspec
which gives me the error of:
WARN: Screenshot could not be saved.
page.current_pathis empty.
also this:
Failure/Error: expect(page).to have_selector(".name", text: "Take Notes")
.
I used all above-mentioned solutions, but nothing worked. Can anyone help me with this?
I have this issue in the following public repo git clone git@bitbucket.org:marcdonovan/se.git
$ rails --version Rails 6.1.4.1
git checkout screenshot to see the problem.
Should be able to reproduce from this.
Closed but continued here: #277
Using:
capybara-screenshot 1.0.21 Rails 4.2.0 capybara 2.14.3
I get:
on CircleCI, but it seems to work fine locally. Is this a known problem?