A browser test fails only during continuous integration. Its runner already writes an HTML report. Add an upload step after the test command so someone inspecting the run can download that report. Give the artifact a name that distinguishes it from the build output and, for a test matrix, from reports made by other jobs.
Use the official actions/upload-artifact action at the version your repository supports. Set its path to the directory the test runner actually writes. On the upload step, if: ${{ !cancelled() }} allows it to run after a failed test step while skipping a canceled run. Choose a retention period that fits the time the team usually takes to review failures and stays within the repository limits.
Change one harmless text assertion in a test branch so that the test fails while creating a report. Confirm that the run remains failed and that the named artifact is downloadable. Open it and check for the broken assertion. If the runner never reached report generation, add a distinct diagnostic for the absent file so it is clear why the artifact is missing.
Make a missing report visible
Set if-no-files-found: error on the upload step if the test job is expected to produce a report every time it reaches the runner. For a matrix with multiple browser jobs, put the browser value in the artifact name. Download a failing job’s report and check that its contents match that browser and the run you opened.
Try one failure before the runner starts as well, such as a deliberately wrong test directory in the test branch. The upload step should then flag the missing report. Compare the two runs so the team can recognize a failed assertion with a usable report and a failure that prevented report generation.
