Closed dschiller closed 5 years ago
Steps are printed in yellow when it's currently running and are being rewritten in either red for a failed Step or green for a passed Step.
Radish only overwrites so many lines as it's written itself. If your Step prints anything during it's execution this rewriting is messed up. Can you add a --no-line-jump
to the radish run and see what's printed?
Thank's a lot! Now it shows an Error. I rather should throw an Exception. But anyway the Image is still there - wonder how that could happen. In any Case, now I can continue working.
1. Feature: Saved Items # features/oGG/E1161.feature
Saved Items are not changeable
1. Scenario: Create saved Item "test"
1. And Change Column "ID" Position 200 Pixel to "Right"
ERROR: Image not found on Screen - 'images/app_column_id.png'
1. And Change Column "ID" Position 200 Pixel to "Right"
1 features (1 passed)
1 scenarios (1 passed)
1 steps (1 passed)
Run App Features finished within a moment
Thank's for fast Response Timo!
I changed my Code behind and changed a simple print
to an Exception raise
:
# >> Decorators for pyautogui
def handleError(func):
def wrapper(*args, **kwargs):
try:
func(*args, **kwargs)
return True
except TypeError as e:
if 'object is not subscriptable' in str(e):
raise Exception('ERROR: Image not found on Screen - \'%s\'' % args[0])
else:
print(func.__name__ + '():', e)
return wrapper
Now the Output is much better and I don't need the --no-line-jump
Parameter:
1. Feature: Saved Items # features/Ogg/E1161.feature
Saved Items are not changeable
1. Scenario: Create saved Item "test"
1. And Change Column "ID" Position 200 Pixel to "Right"
Exception: ERROR: Image not found on Screen - 'images/app_column_id.png'
1 features (0 passed, 1 failed)
1 scenarios (0 passed, 1 failed)
1 steps (0 passed, 1 failed)
Run App Features finished within a moment
Awesome! Yeah, you have to raise an Exception for radish to know that the Step failed.
I sometimes use prints to debug something and that's where I make the use of --no-line-jump
, but never in production.
I have the following Feature Step:
And Change Column "ID" Position 200 Pixel to "Right"
And the following corresponding
step.py
:And on Executing I get this Yellow and Green Line twice and the Code doesn't execute. What does that mean ?