znt/module/testtask/test/zen/setmenu.php

40 lines
1.5 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=测试 testtaskZen::setMenu();
timeout=0
cid=19242
- 步骤1qa tab默认情况返回productID @1
- 步骤2project tab情况返回projectID @1
- 步骤3execution tab情况返回executionID @1
- 步骤4qa tab多分支产品情况 @1
- 步骤5其他tab情况测试 @1
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/testtaskzen.unittest.class.php';
// 2. zendata数据准备根据需要配置
$table = zenData('product');
$table->id->range('1-5');
$table->name->range('产品1,产品2,产品3,产品4,产品5');
$table->type->range('normal{3},branch{2}');
$table->gen(5);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$testtaskTest = new testtaskZenTest();
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($testtaskTest->setMenuTest(1, 0, 0, 0, 'qa')) && p() && e('1'); // 步骤1qa tab默认情况返回productID
r($testtaskTest->setMenuTest(1, 'all', 1, 0, 'project')) && p() && e('1'); // 步骤2project tab情况返回projectID
r($testtaskTest->setMenuTest(1, 0, 0, 1, 'execution')) && p() && e('1'); // 步骤3execution tab情况返回executionID
r($testtaskTest->setMenuTest(2, 'main', 0, 0, 'qa')) && p() && e('1'); // 步骤4qa tab多分支产品情况
r($testtaskTest->setMenuTest(1, '', 0, 0, 'other')) && p() && e('1'); // 步骤5其他tab情况测试