As you wrote in the README:
Better looking HTML screenshots
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:
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.
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.