From 83879ca81f701f7b47e019b6920ad9cfec117fca Mon Sep 17 00:00:00 2001 From: agyen Date: Mon, 9 Sep 2024 11:04:11 +0000 Subject: [PATCH] Add exit code --- .../grid-and-chat-display-automated-test.py | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/examples/fdc3-chart-and-grid/fdc3-chart-and-grid.sikuli/grid-and-chat-display-automated-test.py b/examples/fdc3-chart-and-grid/fdc3-chart-and-grid.sikuli/grid-and-chat-display-automated-test.py index 1bd97cd32..2a609b3d2 100644 --- a/examples/fdc3-chart-and-grid/fdc3-chart-and-grid.sikuli/grid-and-chat-display-automated-test.py +++ b/examples/fdc3-chart-and-grid/fdc3-chart-and-grid.sikuli/grid-and-chat-display-automated-test.py @@ -1,13 +1,20 @@ -if exists("./screenshots/modules"): - click(Pattern("./screenshots/datagrid-button.png").similar(0.69)) - chart = wait("./screenshots/open-chart-button.png", 20) - click(chart) - if exists("./screenshots/chart-opened.png"): - click(Pattern("./screenshots/goog-symbol.png").exact()) - wait(10) +try: + if exists("./screenshots/modules"): + click(Pattern("./screenshots/datagrid-button.png").similar(0.69)) + chart = wait("./screenshots/open-chart-button.png", 30) + click(chart) + if exists("./screenshots/chart-opened.png"): + wait(5) + click(Pattern("./screenshots/goog-symbol.png").exact()) + wait(10) + exit(0) + else: + popup("Chart not available to proceed") + exit(1) else: - popup("Chart not available to proceed") - exit() -else: - popup("Module not found, can't continue") - + popup("Module not found, can't continue") + exit(1) +except FindFailed: + popup("test failed") + exit(1) + \ No newline at end of file