-
Notifications
You must be signed in to change notification settings - Fork 11
Bucky Test Code Reference
These topics describe of the Test Code file format.
The test code file is a YAML file defining, description, device, service, priority, test_category, label, cases and procedures. The path for test code file is WORKING_DIRECTORY/services/SERVICE_NAME/DEVICE/scenario/TEST_CATEGORY/
Example Test Code file
desc: suite description
device: pc
service: service_name
priority: high
test_category: e2e
labels: test_label_foo
setup_each:
procs:
- proc: login
exec:
operate: go
url: https://example.com/login
teardown_each:
procs:
- proc: login
exec:
operate: go
url: https://example.com/logout
cases:
- case_name: test_code_1
func: inquire button
desc: case description
labels:
- test_label_bar
- test_label_baz
procs:
- proc: open page
exec:
operate: go
url: http://example.com/
- proc: open page
exec:
verfy: assert_title
expect: The test page title
Description for this test suite.
Note: In Bucky test code, we crate one file as one test suite.
The device type which this test code depends to.
Supports Value: "pc", "sp", "tablet"
Note: Namespace structure for test code. Also be used as a filter in run command's option.
The service name which this test code depends to.
Note: Namespace structure for test code. Also be used as a filter in run command's option.
The priority for this test suite. Also be used as a filter in run command's option.
Supports Value: "high", "middle", "low"
The test category which this test code is.
Supports Value: "e2e", "linkstatus"
Note: Namespace structure for test code. Also be used as a filter in run command's option.
The label for all cases in this suite.
Note: Also be used as a filter in run command's option.
Example:
labels: test_label_foo
labels:
- test_label_foo
- test_label_bar
There can be multiple cases in one suite. Case level is the smallest level that Bucky can execute.
The name of this case. It should be FILE_NAME + "_" + numbers
Note: It will be shown in the console message when test executing.
Example:
case_name: name_of_file_1
The function this case will test.
Example:
func: login
Description for this case.
Example:
desc: This is the example test for login.
The label this cases.
Note: Also be used as a filter in run command's option.
Example:
labels: test_label_foo
labels:
- test_label_foo
- test_label_bar
There can be multiple procedures in one case.
This procedure's name.
Note: It will be shown in the console message when test executing.
The execution in this procedure.
The following structure will depend on which operate or verify you choose in the code.
Note: You can check operations list and usage on this page.
Pattern_1
Using Bucky's defined operator
operate: go
url: https://github.com/lifull-dev/bucky-core/
operate: click
page: top_page
part: top_button
Pattern_2
Using Bucky's defined verification
verify: assert_display
page: top_page
part: top_button
verify: assert_text
page: top_page
part: top_button
text: 'text of button element'
Pattern_3
Using customization operator or verification define by yourself
operate: input_and_login
page: top_page
name: 'foo'
eamil: 'bar'
verify: assert_very_text
page: top_page
name_value: 'foo'
email_value: 'bar'
The procedures executed before every cases.
Note: The structure is same as the procs configuration reference
The procedures executed after every cases.
Note: The structure is same as the procs configuration reference