There are a few approaches you could take for testing rendering output.
First, you could create a test mock version of your renderer, that instead of plotting things on the screen, would instead perhaps store some kind of representation of the rendering output, such as lists of renderer elements that you could assert against. This sort of approach is often used in webdev testing, where the output of components is tested using DOM elements instead of directly checking the output.
Your tests could then look something like this:
Alternatively, you could first manually visually verify a rendered output that looks good, and implement code for storing screenshots of the output. Then, your automated testing procedure could launch the game, perform the rendering, capture the framebuffer contents, and compare those to the previously verified output images. This could be beneficial to find regression bugs for an example. I believe the term for this is "snapshot testing".