-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbdd_hooks.py
More file actions
30 lines (26 loc) · 968 Bytes
/
bdd_hooks.py
File metadata and controls
30 lines (26 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright (C) 2026 Qt Group.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed.
#
# A common use-case is to use the OnScenarioStart/OnScenarioEnd hooks to
# start and stop an AUT, e.g.
#
# @OnScenarioStart
# def hook(context):
# startApplication("quickaddressbook")
#
# @OnScenarioEnd
# def hook(context):
# currentApplicationContext().detach()
#
# For the complete reference to this and similar available APIs
# (OnFeatureStart/OnFeatureEnd, OnStepStart/OnStepEnd) see the section
# 'Performing Actions During Test Execution Via Hooks' in the Squish manual:
#
# https://doc.qt.io/squish/behavior-driven-testing.html#performing-actions-during-test-execution-via-hooks
# Detach (i.e. potentially terminate) all AUTs at the end of a scenario
@OnScenarioEnd
def hook(context):
for ctx in applicationContextList():
ctx.detach()