When Jenkins runs the tests, the paths in the generated report might be relative or incorrect, causing the browser to fail to load the images. Jenkins reports likely are done from differences in how file paths are resolved or accessed between your local environment and the Jenkins.
make sure the paths in the Jenkins report are absolute paths or URLs accessible from the Jenkins server itself. otherwise, you need to change your code to generate absolute paths. Also, ensure the Reports/screenshots
folder is included in the artifacts.
update your ensure_screenshot_folder
method to print the folder path for debugging, i.e:
print(f"Screenshots folder: {screenshots_folder}")
Run the Jenkins job and check the logs, is it created as expected?