[Non-ACR][MediaPlayer][add precondition for Tizen.MediaPlayer.Tests ] 95/180895/8
authornguyen.vtan <nguyen.vtan@samsung.com>
Tue, 5 Jun 2018 08:28:31 +0000 (15:28 +0700)
committerLee Sanghoon <shooney.lee@samsung.com>
Fri, 8 Jun 2018 02:13:06 +0000 (02:13 +0000)
http://suprem.sec.samsung.net/jira/browse/DPTTIZEN-3073

Change-Id: Ifcdd55be4cc0735ca305ae08039147ea5322986a
Signed-off-by: nguyen.vtan <nguyen.vtan@samsung.com>
release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip
release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/preconfigure.json
release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tct-testconfig.ini
release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig/tests.xml
tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs [new file with mode: 0644]
tool/script/tct-testconfig/preconfigure.json
tool/script/tct-testconfig/tct-testconfig-3.0.zip
tool/script/tct-testconfig/tct-testconfig.ini
tool/script/tct-testconfig/tests.xml

index 59ec304..fe25108 100755 (executable)
Binary files a/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip and b/release/csharp-tct_5.0_dotnet/csharp-tct_5.0_dotnet/resource/tct-testconfig-3.0.zip differ
index 59ce6aa..cc345d0 100755 (executable)
@@ -32,5 +32,6 @@
     "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)",
     "WPS_PBC_AP":"Set name of available AP with WPS PBC function",
     "WPS_PIN_AP":"Set name of available AP with WPS PIN function",
-    "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533."
+    "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.",
+    "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4"
 }]
index 93c3889..fbb67d2 100755 (executable)
@@ -51,3 +51,6 @@ HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin
 [Tizen.XamarinFormsMaps.Manual.Tests]
 HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)
 
+# MediaPlayer test key settings
+[Tizen.MediaPlayer.Tests]
+STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4
\ No newline at end of file
index 24d2834..f65a029 100755 (executable)
@@ -387,5 +387,18 @@ The tct-bt-helper is included in the tct-bluetooth-tizen-tests package. Install
         </description>
       </testcase>
     </set>
+
+   <set name="Tizen.MediaPlayer.Tests">
+      <testcase component="WebAPI/Tizen/configuration" execution_type="manual" id="MediaPlayerconfiguration" purpose="Tizen.MediaPlayer.Tests configuration">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc> Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4.</step_desc>
+            </step>
+          </steps>
+          <test_script_entry test_script_expected_result="0" timeout="90"/>
+        </description>
+      </testcase>
+    </set>
   </suite>
 </test_definition>
diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs
new file mode 100644 (file)
index 0000000..a3d8fd1
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using NUnit.Framework.TUnit;
+using System;
+using System.IO;
+
+namespace PreconditionUtils
+{
+    public class PreconditionUtils
+    {
+        public static string STREAMING_URI = null;
+
+        public static void SetPrecondition()
+        {
+            string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
+            int index = 0;
+            string[] resultArray = StringParser(result);
+            foreach (string item in resultArray)
+            {
+                switch (item)
+                {
+                    case "STREAMING_URI":
+                        // Remove backslash
+                        resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
+                        STREAMING_URI = resultArray[index + 1];
+                        break;
+                    default:
+                        break;
+                }
+                index++;
+            }
+        }
+
+        private static string ReadFile(string path)
+        {
+            string result = null;
+            string url = path;
+
+            try
+            {
+                StreamReader reader = File.OpenText(path);
+                result = reader.ReadToEnd();
+            }
+            catch (Exception e)
+            {
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
+            }
+
+            return result;
+        }
+        private static string[] StringParser(string TCID)
+        {
+            string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" };
+            string[] stringPieces = null;
+
+            try
+            {
+                stringPieces = TCID.Split(delimiter, StringSplitOptions.None);
+            }
+            catch (Exception e)
+            {
+                LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message);
+            }
+
+            return stringPieces;
+        }
+    }
+}
index 59ce6aa..cc345d0 100755 (executable)
@@ -32,5 +32,6 @@
     "HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)",
     "WPS_PBC_AP":"Set name of available AP with WPS PBC function",
     "WPS_PIN_AP":"Set name of available AP with WPS PIN function",
-    "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533."
+    "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.",
+    "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4"
 }]
index 59ec304..fe25108 100755 (executable)
Binary files a/tool/script/tct-testconfig/tct-testconfig-3.0.zip and b/tool/script/tct-testconfig/tct-testconfig-3.0.zip differ
index 93c3889..fbb67d2 100755 (executable)
@@ -51,3 +51,6 @@ HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin
 [Tizen.XamarinFormsMaps.Manual.Tests]
 HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN = Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)
 
+# MediaPlayer test key settings
+[Tizen.MediaPlayer.Tests]
+STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4
\ No newline at end of file
index 24d2834..f65a029 100755 (executable)
@@ -387,5 +387,18 @@ The tct-bt-helper is included in the tct-bluetooth-tizen-tests package. Install
         </description>
       </testcase>
     </set>
+
+   <set name="Tizen.MediaPlayer.Tests">
+      <testcase component="WebAPI/Tizen/configuration" execution_type="manual" id="MediaPlayerconfiguration" purpose="Tizen.MediaPlayer.Tests configuration">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc> Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4.</step_desc>
+            </step>
+          </steps>
+          <test_script_entry test_script_expected_result="0" timeout="90"/>
+        </description>
+      </testcase>
+    </set>
   </suite>
 </test_definition>