Closed joscha closed 3 years ago
Hi @joscha,
There's a few subtle differences in your examples:
describe 'w/o JS', js: false do
# ...
end
^ this will disable JavaScript when running a test in your test suite.
Percy::Capybara.snapshot(page, name: 'w/o JS', enable_javascript: false)
^ this simple tells Percy to disable JavaScript when Percy loads up your page in Percy's rendering infrastructure. This is where we take the snapshot.
^ this is simply percy-capybara
's built-in test suite setting (sorry that's kinda meta!) but it has no impact on your tests and codebase.
If you are running Percy::Capybara.snapshot(page, name: 'w/o JS', enable_javascript: false)
and JavaScript still appears to be running in the snapshot you see in Percy, let's chat more on customer support because that should indeed disable JavaScript.
Cheers, David.
Hi David,
Thanks for the clarification, that makes sense! Sorry for the confusion about the spec helper, I thought it was the base class for the capybara run - it seems like option 2 is what I wanted, however
If you are running Percy::Capybara.snapshot(page, name: 'w/o JS', enable_javascript: false) and JavaScript still appears to be running in the snapshot you see in Percy, let's chat more on customer support because that should indeed disable JavaScript.
I sent you a message there because this seems as if indeed the page is snapshot with JS. Maybe the fallback to JS on for omission of enable_javascript
isn't trumped by the explicit false
?
Hi,
I am trying to take a percy snapshot of a page and want to load it w/o Javascript.
I tried:
without success.
I also tried:
which didn't work either. Then I had a look at https://github.com/percy/percy-capybara/blob/e1c80b350530f591324541646a0650adbc3c6653/spec/spec_helper.rb#L36 which led me to https://github.com/teampoltergeist/poltergeist/issues/489
I am running out of ideas on how to make this work - any hints?