With Rails 6, I'm struggling getting "good-looking" (with css styles) HTML screenshots when running my specs without JS. Anyone solve this problem?
I run a bunch of specs without JS on because it they run faster but the default setting for webpacker in a test environment is to "inject" the CSS into the HTML. The injection does not happen if you're not running with JS.
You can change webpacker.yml to extract_css: true, and that allows you to generate the css file before running the suite, but I can't figure out why my development environment does not want to serve anything from public/packs-test when I load the html screenshot in a browser: Cannot GET /packs-test/css/application-d7079357.css
With Rails 6, I'm struggling getting "good-looking" (with css styles) HTML screenshots when running my specs without JS. Anyone solve this problem?
I run a bunch of specs without JS on because it they run faster but the default setting for
webpacker
in atest
environment is to "inject" the CSS into the HTML. The injection does not happen if you're not running with JS.You can change webpacker.yml to
extract_css: true
, and that allows you to generate the css file before running the suite, but I can't figure out why my development environment does not want to serve anything frompublic/packs-test
when I load the html screenshot in a browser:Cannot GET /packs-test/css/application-d7079357.css
Anyone else have this use case?