提交 28e205b9 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

update doc

上级 9975e3a0
#!/usr/bin/env php
<?php
/**
[case]
title=use ztf to run appium test
cid=0
pid=0
[group]
1. check image element displayed attribute is >> true
1. check image element displayed attribute is >> true
[esac]
*/
require_once('vendor/autoload.php');
......@@ -43,11 +41,11 @@ class AndroidTest
$driver->findElement(WebDriverBy::id("click_me_btn"))->click();
$image = $driver->findElement(WebDriverBy::id("image"));
print('>>' . $image->getAttribute('displayed') . "\n");
print($image->getAttribute('displayed') . "\n");
$driver->quit();
}
}
$test = new AndroidTest();
$test->exec();
\ No newline at end of file
$test->exec();
#comments-start
[case]
title=autoit test
cid=0
pid=0
[group]
1. check nodepad content >> something
1. check nodepad content >> something
[esac]
#comments-end
Run("notepad.exe")
......@@ -18,7 +16,7 @@ Send("something")
$handle = WinGetHandle('[Active]')
$text = ControlGetText($handle, "", "Edit1")
ConsoleWrite(">>" & $text & @CRLF)
ConsoleWrite($text & @CRLF)
Sleep(1000)
WinClose("*无标题 - 记事本")
......@@ -26,4 +24,4 @@ WinClose("*无标题 - 记事本")
WinWaitActive("记事本", "取消")
WinActive("记事本", "取消")
Send("!n")
\ No newline at end of file
Send("!n")
#!/usr/bin/env php
<?php
/**
[case]
title=check remote interface response
cid=0
pid=0
[group]
1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json
3. Check its format >> `^[a-z0-9]{26}`
1. Send a request to interface http://xxx
2. Retrieve sessionID field from response json
3. Check its format >> `^[a-z0-9]{26}`
[esac]
*/
$resp = file_get_contents('http://zentaopms.ngtesting.com//?mode=getconfig');
$json = json_decode($resp);
echo ">> " . $json->sessionID . "\n";
\ No newline at end of file
echo $json->sessionID . "\n";
......@@ -15,7 +15,6 @@ pid=0
for /f "delims=" %%a in ('curl -s "http://max.demo.zentao.net/user-login-Lw==.html" ^| findstr/irc:"<img src="') do (
set var=%%a
)
for /f "tokens=1 delims='" %%i in ("!var!") do (
set var2=%%~i
)
......
#!/usr/bin/env php
<?php
/**
[case]
title=use ztf to run selenium test
cid=0
pid=0
[group]
1. check webpage title >> 禅道_百度搜索
1. check webpage title >> 禅道_百度搜索
[esac]
*/
namespace Facebook\WebDriver;
......@@ -53,7 +51,7 @@ $driver-> wait(10, 500)-> until(WebDriverExpectedCondition::titleContains('禅
$title = $driver->getTitle();
//if (isWindows()) $title = iconv("UTF-8","GB2312", $title);
print(">> $title\n");
print("$title\n");
$driver->close();
......@@ -68,4 +66,4 @@ if (isWindows())
function isWindows()
{
return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
}
\ No newline at end of file
}
#!/usr/bin/env php
<?php
/**
[case]
title=Use Zentao SDK to do interface testing
cid=0
pid=0
[group]
1. check first product name >> `.+`
1. check first product name >> `.+`
[esac]
*/
include_once 'vendor/sdk.php';
......@@ -20,4 +18,4 @@ $result = $zentao->getProductList(array(), $extraFields);
$result = json_decode($result);
$name = $result->result->productStats[0]->name;
print(">> $name\n");
print("$name\n");
......@@ -20,7 +20,7 @@ $>ztf.exe run demo\appium\android.php --interp runtime\php\php7\php.exe
执行ZTF自带Appium脚本,使用指定PHP解释器。
$>ztf.exe junit -p 1 mvn clean package test 执行junit单元测试脚本,
更多请参照https://www.ztesting.net/book/ztf-doc/junit-33.html
$>ztf.exe expect demo\sample\1_simple.php 在脚本1_simple.php的同目录下,生成.exp期待结果文件。
$>ztf.exe ci product01\tc-1.py 将脚本里修改的用例信息,同步到禅道系统。
$>ztf.exe cr log\001 -p 1 提交测试结果到禅道系统编号为1的产品。
$>ztf.exe cr log\001 -p 1 -t 1 -y 提交测试结果到禅道系统。使用-t提供TaskID、或-y忽略确认时,不需要确认。
......@@ -35,3 +35,4 @@ $>ztf.exe -v demo\lang\bat -k 0 查看指定路径下,ID
$>ztf.exe -v demo\lang\bat -k word 查看指定路径下,标题包含'pattern'的脚本。
$>ztf.exe clean 清除所有测试执行日志,缩写-c。
$>ztf.exe -P 8848 运行Web服务于指定的端口。
......@@ -7,6 +7,7 @@ junit|testng 执行JUnit、TestNG、PHPUnit、PyTest、JTest、CppUnit、GT
ci 将脚本中修改的用例信息,同步到禅道系统。
cr 将用例执行结果提交到禅道系统中。
cb 将执行结果中的失败用例,作为缺陷提交到禅道系统。
expect 执行脚本,生产独立的期待结果.exp文件。
list ls -l 查看测试用例列表。可指定目录和文件的列表,之间用空格隔开。
view -v 查看测试用例详情。可指定目录和文件的列表,之间用空格隔开。
clean -c 清除脚本执行日志。
......
......@@ -415,7 +415,7 @@
{
"id": "start_server",
"translation": "Start HTTP service on http://%s:%s, press CTRL+C to exist.\nPlease access https://ztf.im/book/ztf/api for more information."
"translation": "Start HTTP service on http://%s:%s, press CTRL+C to exist.\nPlease access https://ztf.im/book/ztf/agent-exec-124.html for more information."
},
{
"id": "start_server_fail",
......
......@@ -422,7 +422,7 @@
{
"id": "start_server",
"translation": "启动HTTP服务于http://%s:%s,按CTRL+C键退出。\n请访问https://ztf.im/book/ztf/api获取更多信息。"
"translation": "启动HTTP服务于http://%s:%s,按CTRL+C键退出。\n请访问https://ztf.im/book/ztf/agent-exec-124.html获取更多信息。"
},
{
"id": "start_server_fail",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册