diff options
author | donghyuk.yang <donghyuk.yang@samsung.com> | 2013-10-23 18:20:36 +0900 |
---|---|---|
committer | donghyuk.yang <donghyuk.yang@samsung.com> | 2013-10-23 18:20:36 +0900 |
commit | a510f4166eb3ac465f23e166dd7c032601855cdf (patch) | |
tree | a8cd9cca1fd6e3b17b3acd7d6a62309f42619137 /org.tizen.nativeplatform/test | |
parent | 8db7ed9346271eff21c4330f88cbe1fb672dcf10 (diff) | |
download | nativeplatform-eplugin-a510f4166eb3ac465f23e166dd7c032601855cdf.tar.gz nativeplatform-eplugin-a510f4166eb3ac465f23e166dd7c032601855cdf.tar.bz2 nativeplatform-eplugin-a510f4166eb3ac465f23e166dd7c032601855cdf.zip |
[Title] Added sikuli test
Change-Id: If5a19f18cf9c7b2c9b97061f3eef096547d3a35a
Diffstat (limited to 'org.tizen.nativeplatform/test')
-rwxr-xr-x | org.tizen.nativeplatform/test/sikuli/test-ide.sh | 44 | ||||
-rw-r--r-- | org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png | bin | 0 -> 773 bytes | |||
-rw-r--r-- | org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png | bin | 0 -> 1886 bytes | |||
-rw-r--r-- | org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png | bin | 0 -> 2910 bytes | |||
-rw-r--r-- | org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html | 21 | ||||
-rw-r--r-- | org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py | 18 |
6 files changed, 70 insertions, 13 deletions
diff --git a/org.tizen.nativeplatform/test/sikuli/test-ide.sh b/org.tizen.nativeplatform/test/sikuli/test-ide.sh index d05bc4f5..5970724e 100755 --- a/org.tizen.nativeplatform/test/sikuli/test-ide.sh +++ b/org.tizen.nativeplatform/test/sikuli/test-ide.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# test-ide.sh - tizen ui test automantion supporting script +# test.sh - tizen ui test automantion supporting script from test-ide.sh # # Contact : # Gyeongseok seo <gyeongseok.seo@samsung.com> @@ -216,7 +216,7 @@ function init_variable () #### test result collect path #TEST_RESULT_PATH="${TIZEN_SDK}/test/ide/result" - TEST_RESULT_PATH="${TIZEN_SDK_DATA}/test/ide" + TEST_RESULT_PATH="${TIZEN_SDK_DATA}/test/platform-ide" if [ ! -d "${TEST_RESULT_PATH}" ] ; then mkdir -p ${TEST_RESULT_PATH} fi @@ -468,7 +468,6 @@ function launch_sikuli_script () notify "sikuli script launch..." ${SIKULI_CMD} -r "${TEST_ROOT_PATH}/tizen-ide-ui-test.sikuli" -- "${TIZEN_SDK}/ide" "${TEST_ROOT_PATH}/workspace" "${OS}" >> ${TEMP_LOG} - if [[ "[info] Exit code: 0" == "`cat ${TEMP_LOG} | tail -n 1`" ]] ; then notify "sikuli script launch success..." else @@ -486,7 +485,7 @@ function launch_sikuli_script () ## window's netcat (nc.exe) license GNU, if you want to more information then read the license.txt file function create_result () { - local LOGNAME=IDE-TEST.`echo ${TEST_START_TIME}`.log + local LOGNAME=PLATFORM-TEST.`echo ${TEST_START_TIME}`.log echo "TEST SCRIPT LOG ======================================================" > ${TEST_RESULT_PATH}/`echo ${LOGNAME}` cat ${TEMP_LOG} >> ${TEST_RESULT_PATH}/`echo ${LOGNAME}` @@ -494,7 +493,42 @@ function create_result () echo "IDE LOG ==============================================================" >> ${TEST_RESULT_PATH}/`echo ${LOGNAME}` cat ${TEST_ROOT_PATH}/workspace/.metadata/ide-*.log | grep "PERFORM" >> ${TEST_RESULT_PATH}/`echo ${LOGNAME}` - java -cp ${TIZEN_SDK}/test/ide/lib/org.tizen.common-test.jar org.tizen.common.LogConverter ${TEST_RESULT_PATH}/${LOGNAME} ide.perf + list=`grep "\[PERFORM_E\]" ${TEST_RESULT_PATH}/${LOGNAME} | cut -d- -f2- | sed -e "s/\][^[]*\[/|/g" -e "s/[^ \t]*://g" -e "s/[0-9]\{3\}(ms)\]//g" | tr -d ' ','\t' ` + for i in `echo $list` + do + cat > `echo $i | cut -d'|' -f1`.perf <<END +<testsuite errors="" name="`echo $i | cut -d '|' -f1` performance" skip="" tests="1" time="`echo $i | cut -d'|' -f2`"> + <testcase name="`echo $i | cut -d '|' -f1`" time="`echo $i | cut -d'|' -f2`"/> +</testsuite> +END + done + grep '^\[TEST::>.*\]' ${TEST_RESULT_PATH}/${LOGNAME} | sed -e 's/\[TEST::>[ \t]*\(.*\)[ \t]*\].*$/\1/' -e 's/ */ /g' | tr ' ' '|' > cases + cat > platform-ide.xml <<END +<testsuite errors="`cat cases | grep '|ERROR|' |wc -l`" failures="`cat cases | grep '|FAIL|' |wc -l`" name="platform ide" skip="" tests="`cat cases | wc -l`" time=""> +END + for i in `cat cases` + do + if [ "`echo $i | cut -d '|' -f2`" = "OK" ] ; then + cat >> platform-ide.xml <<END + <testcase classname='`echo $i | cut -d '|' -f1`' name='`echo $i | cut -d '|' -f1`' time=''/> +END + elif [ "`echo $i | cut -d '|' -f2`" = "FAIL" ] ; then + cat >> platform-ide.xml <<END + <testcase classname='`echo $i | cut -d '|' -f1`' name='`echo $i | cut -d '|' -f1`' time=''> + <failure message='`echo $i | cut -d '|' -f3- | tr '|' ' '`' type='fail'/> + </testcase> +END + else + cat >> platform-ide.xml <<END + <testcase classname='`echo $i | cut -d '|' -f1`' name='`echo $i | cut -d '|' -f1`' time=''> + <error message='`echo $i | cut -d '|' -f3- | tr '|' ' '`' type='error'/> + </testcase> +END + fi + done + cat >> platform-ide.xml <<END +</testsuite> +END } diff --git a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png Binary files differnew file mode 100644 index 00000000..6843270c --- /dev/null +++ b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png diff --git a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png Binary files differnew file mode 100644 index 00000000..0d56318a --- /dev/null +++ b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png diff --git a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png Binary files differnew file mode 100644 index 00000000..154efb25 --- /dev/null +++ b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png diff --git a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html index 3bd259f0..075504c4 100644 --- a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html +++ b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html @@ -76,12 +76,22 @@ sdk_path=sys.argv[<span class="dig">1</span>] + <span class="str">"/.."</span> tools_path=sdk_path + <span class="str">"/tools"</span> workspace_path=sys.argv[<span class="dig">2</span>] - +<span class="kw">def</span> setWaitTimeforImage(image): + waitTime=<span class="dig">0</span> + <span class="kw">while</span> <span class="kw">not</span> exists(image): + <span class="kw">if</span> waitTime > <span class="dig">30</span>: + <span class="kw">print</span> <span class="str">"[log] get Image Fail: "</span> + image + exit(<span class="dig">1</span>) + <span class="kw">else</span>: + <span class="skw">wait</span>(<span class="dig">5</span>) + waitTime+=<span class="dig">5</span> ide_launch_cmd=ide_path + <span class="str">"/startup.sh -data "</span> + workspace_path <span class="kw">print</span> <span class="str">"%s%s"</span> % (<span class="str">"start ide path : "</span>,ide_launch_cmd) <span class="kw">print</span> <span class="str">"%s"</span> % (<span class="str">"Tizen IDE launch..."</span>) openApp( ide_launch_cmd ) - +setWaitTimeforImage(<img src="1382405424296.png" />) +<span class="kw">if</span> exists(<img src="1382405562970.png" />): + <span class="skw">click</span>(<img src="1382405606775.png" />) <span class="skw">sleep</span>( <span class="dig">100</span> ) <span class="cmt">## wait ide open</span> <span class="cmt"># create tizen native test project 1 </span><span class="skw">wait</span>( <span class="dig">2</span> ) @@ -143,7 +153,7 @@ build_count = <span class="dig">0</span> <span class="skw">type</span>( Key.ENTER ) <span class="skw">wait</span>(<img src="1375262905514.png" />, <span class="dig">10</span>) <span class="skw">type</span>( Key.ENTER ) - <span class="kw">print</span> <span class="str">"Failed to launch!"</span> + <span class="kw">print</span> <span class="str">"[TEST::> Launch FAIL]"</span> build_count += <span class="dig">1</span> <span class="kw">else</span>: <span class="kw">break</span> @@ -154,7 +164,10 @@ build_count = <span class="dig">0</span> <span class="skw">sleep</span>( <span class="dig">2</span> ) <span class="skw">doubleClick</span>(<img src="1375322657436.png" />) <span class="kw">if</span> exists(<img src="1375264830197.png" />): - <span class="kw">print</span> <span class="str">"Launched!"</span> + f = open(<span class="str">"unittest"</span>,<span class="str">'w'</span>) + f.write(<span class="str">"[TEST::> Launch OK]"</span>) + f.close() + <span class="kw">print</span> <span class="str">"[info] Exit code: 0"</span> </pre> </body> </html> diff --git a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py index 9f1111f5..18661fb1 100644 --- a/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py +++ b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py @@ -4,12 +4,22 @@ ide_path=sys.argv[1] sdk_path=sys.argv[1] + "/.." tools_path=sdk_path + "/tools" workspace_path=sys.argv[2] - +def setWaitTimeforImage(image): + waitTime=0 + while not exists(image): + if waitTime > 30: + print "[log] get Image Fail: " + image + exit(1) + else: + wait(5) + waitTime+=5 ide_launch_cmd=ide_path + "/startup.sh -data " + workspace_path print "%s%s" % ("start ide path : ",ide_launch_cmd) print "%s" % ("Tizen IDE launch...") openApp( ide_launch_cmd ) - +setWaitTimeforImage("1382405424296.png") +if exists("1382405562970.png"): + click("1382405606775.png") sleep( 100 ) ## wait ide open # create tizen native test project 1 wait( 2 ) @@ -71,7 +81,7 @@ while build_count < 3: type( Key.ENTER ) wait("1375262905514.png", 10) type( Key.ENTER ) - print "Failed to launch!" + print "[TEST::> Launch FAIL launch failed!!]" build_count += 1 else: break @@ -82,4 +92,4 @@ click("1375264231809.png") sleep( 2 ) doubleClick("1375322657436.png") if exists("1375264830197.png"): - print "Launched!"
\ No newline at end of file + print "[TEST::> Launch OK]" |