diff options
author | Swoichha Adhikari <swoichhaa@gmail.com> | 2021-05-14 09:30:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 09:30:06 +0300 |
commit | 38ba32c380f750ea9ca7093ec885aaad444a14f0 (patch) | |
tree | 7791befadd1548c7b65a2fa91169dd331ae7a605 /test/gui | |
parent | 948989e834b73736f25a7bcb16148e434f7abaf4 (diff) |
[tests-only]Add init in bdd hooks (#8635)
* [tests-only]Add init in bdd hooks
* add join path
Diffstat (limited to 'test/gui')
-rw-r--r-- | test/gui/shared/scripts/bdd_hooks.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gui/shared/scripts/bdd_hooks.py b/test/gui/shared/scripts/bdd_hooks.py index 0832e66ae..62a4e98a0 100644 --- a/test/gui/shared/scripts/bdd_hooks.py +++ b/test/gui/shared/scripts/bdd_hooks.py @@ -16,6 +16,8 @@ # See the section 'Performing Actions During Test Execution Via Hooks' in the Squish # manual for a complete reference of the available API. import shutil +import urllib.request +import os @OnScenarioStart def hook(context): @@ -49,6 +51,18 @@ def hook(context): if context.userData['clientConfigFile'] == '': context.userData['clientConfigFile']='-' + + req = urllib.request.Request( + os.path.join(context.userData['middlewareUrl'], 'init'), + headers={"Content-Type": "application/json"}, method='POST' + ) + try: + urllib.request.urlopen(req) + except urllib.error.HTTPError as e: + raise Exception( + "Step execution through test middleware failed. Error: " + e.read().decode() + ) + @OnScenarioEnd def hook(context): |