znt/module/testcase/test/zen/processstepsformindmap.php

33 lines
1.7 KiB
PHP
Executable file
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.

#!/usr/bin/env php
<?php
/**
title=测试 testcaseZen::processStepsForMindMap();
timeout=0
cid=19107
- 步骤1正常用例处理脑图步骤第mindMapSteps条的id属性 @case_1
- 步骤2空步骤数组处理第mindMapSteps条的id属性 @case_2
- 步骤3多层级步骤处理第mindMapSteps条的text属性 @测试用例3
- 步骤4包含分组步骤处理第mindMapSteps条的id属性 @case_4
- 步骤5期望值为空的步骤处理第mindMapSteps条的type属性 @root
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/testcasezen.unittest.class.php';
// 2. 用户登录(选择合适角色)
su('admin');
// 3. 创建测试实例(变量名与模块名一致)
$testcaseTest = new testcaseZenTest();
// 4. 🔴 强制要求必须包含至少5个测试步骤
r($testcaseTest->processStepsForMindMapTest($testcaseTest->getCaseWithSteps(1))) && p('mindMapSteps:id') && e('case_1'); // 步骤1正常用例处理脑图步骤
r($testcaseTest->processStepsForMindMapTest($testcaseTest->getCaseWithSteps(2, array()))) && p('mindMapSteps:id') && e('case_2'); // 步骤2空步骤数组处理
r($testcaseTest->processStepsForMindMapTest($testcaseTest->getCaseWithSteps(3))) && p('mindMapSteps:text') && e('测试用例3'); // 步骤3多层级步骤处理
r($testcaseTest->processStepsForMindMapTest($testcaseTest->getCaseWithSteps(4))) && p('mindMapSteps:id') && e('case_4'); // 步骤4包含分组步骤处理
r($testcaseTest->processStepsForMindMapTest($testcaseTest->getCaseWithSteps(5))) && p('mindMapSteps:type') && e('root'); // 步骤5期望值为空的步骤处理