db-clean
Cleans specified tables in a database
Overview
e:db-clean
<e:db-clean tables="person, person_fields"/>
Usage
1. Configure a connection to database via DbPlugin.
2. Use e:db-clean tag in specification:
src/test/resources/specs/Specs.html
<e:db-clean tables="person, person_fields"/>
Attributes
| attribute | desc | example |
|---|---|---|
tables |
Tables to clean. Tables will be cleaned up in the order opposite to declaration, hence the "referenced" tables should go first and the "referencing" - last | Required. Default: - |
ds |
Datasource to which dataset will be applied. By default only 1 datasource with name default exists, other may be added by DbPlugin configuration. | Optional. Default: default |
Example
Given
Table has the following records:
| id | name |
|---|---|
| 1 | Adam |
When
Clean:
The following markup:
<e:db-clean tables="ANDROIDS_TABLE"/>will be rendered as:ANDROIDS_TABLE
Then
Table is empty:
| EMPTY |