excel2feature/templates/02_function.feature.j2

47 lines
1.4 KiB
Django/Jinja
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# encoding:UTF-8
@{{ project }}
@excel
Feature: {{ sheet_name }}
Background:
Given I active "{{ sheet_name }}"
{#- 以模块为单位一个模块一个Scenario #}
{% for model,table in Scenario_table.items() %}
Scenario: {{ model }}
Then I load the table
| 功能模块 | 子模块 | 用例编号 | 用例名称 | 重要级别 | 操作步骤 | 预期结果 | 更新版本 | 备注 | 测试结果 | 测试人员 | 测试时间 |
{#- 根据子模块,添加注释信息,起到分隔的作用 #}
{%- set sub_model = namespace(value=None) %}
{%- for lines in table %}
{%- if sub_model.value != lines[1] %}
{%- set sub_model.value = lines[1] %}
#{{sub_model.value}}
{%- endif %}
| {{ lines |join(' | ') }} | | | |
{%- endfor %}
{% endfor %}
Scenario: 调整样式
#自动生成用例编号
Then I set case_number on "C"
"""
{{ project | upper }}-ST-
"""
# 指定列自动合并单元格
Then I auto_merge_cells "A" start at "3"
Then I auto_merge_cells "B" start at "3"
# 指定区内自动换行
Then I auto set wrap start at "D3"
"""
{
"horizontal": "left",
"vertical": "center"
}
"""
#使用的范围加上边框
Then I auto set border