[Title] Added sikuli test 64/11264/1
authordonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 23 Oct 2013 09:20:36 +0000 (18:20 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 23 Oct 2013 09:20:36 +0000 (18:20 +0900)
Change-Id: If5a19f18cf9c7b2c9b97061f3eef096547d3a35a

org.tizen.nativeplatform/test/sikuli/test-ide.sh
org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png [new file with mode: 0644]
org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png [new file with mode: 0644]
org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png [new file with mode: 0644]
org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.html
org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/tizen-ide-ui-test.py

index d05bc4f..5970724 100755 (executable)
@@ -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
new file mode 100644 (file)
index 0000000..6843270
Binary files /dev/null and b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405424296.png differ
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
new file mode 100644 (file)
index 0000000..0d56318
Binary files /dev/null and b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405562970.png differ
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
new file mode 100644 (file)
index 0000000..154efb2
Binary files /dev/null and b/org.tizen.nativeplatform/test/sikuli/tizen-ide-ui-test.sikuli/1382405606775.png differ
index 3bd259f..075504c 100644 (file)
 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 &gt; <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::&gt; 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::&gt; Launch OK]"</span>)
+    f.close()
+    <span class="kw">print</span> <span class="str">"[info] Exit code: 0"</span>
 </pre>
 </body>
 </html>
index 9f1111f..18661fb 100644 (file)
@@ -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]"