Skip to content

Bucky Test Code Reference

rueyaa332266 edited this page Sep 1, 2019 · 8 revisions

Reference and guidelines

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/

Test Code file structure and examples

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

・desc

Description for this test suite.

Note: In Bucky test code, we crate one file as one test suite.

・device

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.

・service

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.

・priority

The priority for this test suite. Also be used as a filter in run command's option.

Supports Value: "high", "middle", "low"

・test_category

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.

・labels

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

cases configuration reference

There can be multiple cases in one suite. Case level is the smallest level that Bucky can execute.

・case_name

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

・func

The function this case will test.

Example:

func: login

・decs

Description for this case.

Example:

decs: This is the example test for login.

・labels

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

・procs configuration reference

There can be multiple procedures in one case.

・proc

This procedure's name.

Note: It will be shown in the console message when test executing.

・exec configuration reference

There are some execution in this procedure.

・operate
・verfy
・page
・part

setup_each configuration reference

teardown_each configuration reference

Clone this wiki locally