Skip to content

Commit 85141be

Browse files
committed
docs: better web driver events section
1 parent 5fb779d commit 85141be

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

docs/README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,8 +1476,42 @@ Check the `drivers.events` node in the
14761476
[configuration.default.yaml]({{ site.repository_url }}/spectrum/src/main/resources/yaml/configuration.default.yaml){:target="_blank"}
14771477
to see the defaults.
14781478

1479+
## Event Level
1480+
1481+
The available values for the `level` property are: `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. Let's check the default value of the click events:
1482+
1483+
{% include copyCode.html %}
1484+
1485+
```yaml
1486+
drivers:
1487+
events:
1488+
beforeClick:
1489+
level: INFO
1490+
message: Clicking on <code>%1$s</code>
1491+
afterClick:
1492+
message: Clicked on <code>%1$s</code>
1493+
```
1494+
1495+
The configuration snippet above means that the `beforeClick` event is logged at `INFO` by default, while `afterClick` isn't logged at all.
1496+
If you want to completely turn off the `beforeClick` event, you need to explicitly set it to null, which in yaml is done by not specifying any value:
1497+
1498+
{% include copyCode.html %}
1499+
1500+
```yaml
1501+
drivers:
1502+
events:
1503+
beforeClick:
1504+
level:
1505+
message: Clicking on <code>%1$s</code>
1506+
```
1507+
1508+
## Event message
1509+
14791510
The `message` property specifies what to add to logs and reports upon receiving the related event,
1480-
and is affected by the `level` property (check the sections below).
1511+
and is affected by the `level` property. Check the [Automatically Generated Reports](#automatically-generated-reports) section below.
1512+
1513+
## Event wait
1514+
14811515
On the other hand, `wait` is a standalone property, meaning it will be considered even if the related event won't be logged,
14821516
and specifies how many milliseconds to wait before actually processing the related event.
14831517

0 commit comments

Comments
 (0)