Givens
When writing a test step like click on the login button
it is necessary to explain how to find the login button. It is recommended that this explanation is presented in a Given
statement. This keeps the test statements themselves clear.
The same applies for properties and attributes. For example, for the test step The "password" field should be invalid
it is necessary to explain what "invalid" means. Again, these should be written as givens.
File structure
Givens can either be global or local to individual tests. The are identified by the markdown title # Given:
. Note that the title depth depends on its scope and should be one more than the enclosing scope. In other words, global givens will be identified by ## Given:
since the test file will have an overall # Test file title
. Test givens will appear below a ## Test: title
and identified as ### Given:
.
When a test has givens, the actual test steps should be identified with ### Test
.
For example:
# User Registration
## Given:
- A field is invalid if it has the class 'input-error'
- A field is valid if it does not have the class 'input-error'
## Test: Create a valid user
### Given:
- The "Get started" link has the ID "link-get-started"
### Test
- Go to http://demo.testabulous.com/
This test file has an overall title "User Registration" with 2 global givens describing how to test if a field is valid or not. There is one test defined, called "Create a valid user" which has one local given.
Targets
Testabulous understands the following targets:
- CSS classes
- CSS styles
- HTML attribute
- HTML element text