In this episode, we focus on how to capture and make use of artifacts (like screenshots and console logs) during our tests, especially when things go wrong. First, we talk about how handy screenshots and console output can be for troubleshooting issues locally, giving us more context when a test fails.
Then, we take this a step further and show how to automatically store these artifacts when running tests on GitHub Actions. All it takes is a small update to your dusk.yaml
file—just a few lines that tell GitHub Actions to upload your screenshot and console log folders as artifacts whenever there is a test failure.
To demonstrate, we create a quick dummy test to generate a screenshot, then force a test to fail so we can see the whole flow in action. After pushing the changes, we refresh the GitHub Actions page and check out the new "Artifacts" section. There, we can download and inspect the screenshots from our failed test runs—super handy if you're debugging remotely!
By the end of this video, you'll know exactly how to set up artifact uploading for your project, allowing you to visually track down bugs even when your tests run in the cloud.