jessezach / RobotEyes

Image comparison for Robot Framework
MIT License
75 stars 24 forks source link

Report fails to generate when some test don't use RobotEyes feature #64

Closed kumy closed 4 years ago

kumy commented 4 years ago

Describe the bug Only few of my tests use RobotEyes. The reportgen fails to generate the report with error:

13 tests total, 13 passed, 0 failed
==============================================================================
Debug:   /home/kumy/GIT/geokrety-website_new-theme/tests-qa/docs/local/debugfile.log
Output:  /home/kumy/GIT/geokrety-website_new-theme/tests-qa/docs/local/output.xml
XUnit:   /home/kumy/GIT/geokrety-website_new-theme/tests-qa/docs/local/xUnit.xml
Log:     /home/kumy/GIT/geokrety-website_new-theme/tests-qa/docs/local/log.html
Report:  /home/kumy/GIT/geokrety-website_new-theme/tests-qa/docs/local/report.html
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kumy/GIT/geokrety-website-qa/venv/lib/python3.8/site-packages/RobotEyes/report_generator.py", line 60, in generate_report
    for filename in os.listdir(baseline_folder + os.path.sep + folder_name):
FileNotFoundError: [Errno 2] No such file or directory: 'visual_images/Seed'

To Reproduce Steps to reproduce the behavior:

  1. Have Test Cases with and without RobotEyes ex:
    
    Library         SeleniumLibrary  timeout=10  implicit_wait=0
    Library         RobotEyes

Test Cases

Seed Seed 1 users

Statpic generated on user create Seed 1 users Go To User 1 url Check Image

Statpic updated on geokrety create Seed 1 users Seed 1 geokrety owned by 1 Go To User 1 url Check Image

Keywords Check Image Open Eyes SeleniumLibrary 5 Wait Until Element Is Visible ${USER_PROFILE_STATPIC_IMAGE} Capture Element ${USER_PROFILE_STATPIC_IMAGE} Compare Images

2. Start `Robot Framework`
3. See error when report is generated

**Expected behavior**
No error should happen when some tests don't use `Open Eyes` keyword

**Screenshots**
N/A

**Desktop (please complete the following information):**
```bash
$ python --version
Python 3.8.2

$ pip freeze|grep eye
robotframework-eyes==1.4.1
kumy commented 4 years ago

Please find PR #65

jessezach commented 4 years ago

Merged the fix. Will go out in release 1.5.0