You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By the default, HTML screenshots will not look very good when opened in a browser. This happens because the browser can't correctly resolve relative paths like <link href="/assets/...." />, which stops CSS, images, etc... from being loaded. To get a nicer looking page, configure Capybara with:
Capybara.asset_host = 'http://localhost:3000'
This will cause Capybara to add <base>http://localhost:3000</base> to the HTML file, which gives the browser enough information to resolve relative paths. Next, start a rails server in development mode, on port 3000, to respond to requests for assets:
rails s -p 3000
Now when you open the page, you should have something that looks much better. You can leave this setup in place and use the default HTML pages when you don't care about the presentation, or start the rails server when you need something better looking.
It's understandable, but not the best solution for each case, especially for CI (like GitHub Actions) with artifacts.
So, my suggestion is to make MHTML screenshots. Chrome supports it (you can try, it's wonderful!), maybe some other drivers (browsers) too.
The text was updated successfully, but these errors were encountered:
Ooh, nice idea! I use .mhtml files all the time when saving web pages from a browser (so that they're self contained and contain all the assets they need).
It does seem like they could potentially help with this problem too...
As you wrote in the README:
It's understandable, but not the best solution for each case, especially for CI (like GitHub Actions) with artifacts.
So, my suggestion is to make MHTML screenshots. Chrome supports it (you can try, it's wonderful!), maybe some other drivers (browsers) too.
The text was updated successfully, but these errors were encountered: