private Label _summaryLabel;
private ListView _listView;
private StackLayout _mainLayout;
+ private List<string> _listNotPass;\r
public static MainPage GetInstance()
public MainPage()
{
_tunitrunner = new TRunner();
- _tunitrunner.LoadTestsuite();
+ _tunitrunner.LoadTestsuite();\r
+ _listNotPass = new List<string>();
_tcIDList = new List<string>();
_listItem = new List<ItemData>();
+ _listNotPass = TSettings.GetInstance().GetNotPassListManual();
+
int count = 0;
- foreach (KeyValuePair<string, ITest> pair in _tunitrunner.GetTestList())
+ foreach (var tc in _listNotPass)
{
count++;
- _listItem.Add(new ItemData { No = count, TCName = pair.Key, Result = StrResult.NOTRUN });
- _tcIDList.Add(pair.Key);
+ _listItem.Add(new ItemData { No = count, TCName = tc, Result = StrResult.NOTRUN });
+ _tcIDList.Add(tc);
}
ResultNumber.Total = ResultNumber.NotRun = _tcIDList.Count;
_tcIDList = testcaseIDList;
_tsettings = TSettings.GetInstance();
_tsettings.IsManual = true;
- _listItem = listItem;
+ _listItem = listItem;\r
MakeTCInfoList();
_summaryLabel = new Label()
{
private void MakeTCInfoList()
{
- foreach (KeyValuePair<string, ITest> pair in _tunitRunner.GetTestList())
- {
- IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();
- List<string> _preconditonsStr = new List<string>(); _preconditonsStr.Add("Preconditions:");
- List<string> _stepsStr = new List<string>(); _stepsStr.Add("Steps:");
- List<string> _postconditionsStr = new List<string>(); _postconditionsStr.Add("Postconditions:\n");
-
- while (customAttributes.MoveNext())
- {
- if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))
- {
- _stepsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
- }
- else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))
- {
- _preconditonsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
- }
- else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))
- {
- _postconditionsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
- }
+ foreach (var testcaseItem in _listItem)
+ {\r
+ foreach (KeyValuePair<string, ITest> pair in _tunitRunner.GetTestList())\r
+ {\r
+ if (testcaseItem.TCName.Equals(pair.Key))\r
+ {\r
+ IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();\r
+ List<string> _preconditonsStr = new List<string>(); _preconditonsStr.Add("Preconditions:");\r
+ List<string> _stepsStr = new List<string>(); _stepsStr.Add("Steps:");\r
+ List<string> _postconditionsStr = new List<string>(); _postconditionsStr.Add("Postconditions:\n");\r
+\r
+ while (customAttributes.MoveNext())\r
+ {\r
+ if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))\r
+ {\r
+ _stepsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))\r
+ {\r
+ _preconditonsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))\r
+ {\r
+ _postconditionsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ }\r
+\r
+ _tcInfoList.Add(new TestcaseInfo\r
+ {\r
+ TestcaseName = pair.Key,\r
+ Preconditions = _preconditonsStr,\r
+ Steps = _stepsStr,\r
+ Postconditions = _postconditionsStr,\r
+ });\r
+ break;\r
+ }\r
}
-
- _tcInfoList.Add(new TestcaseInfo
- {
- TestcaseName = pair.Key,
- Preconditions = _preconditonsStr,
- Steps = _stepsStr,
- Postconditions = _postconditionsStr,
- });
}
}
private Label _summaryLabel1, _summaryLabel2;
private ListView _listView;
private StackLayout _mainLayout;
+ private List<string> _listNotPass;
public static MainPage GetInstance()
{
_tunitrunner = new TRunner();
_tunitrunner.LoadTestsuite();
+ _listNotPass = new List<string>();
_tcIDList = new List<string>();
_listItem = new List<ItemData>();
+ _listNotPass = TSettings.GetInstance().GetNotPassListManual();
+
int count = 0;
- foreach (KeyValuePair<string, ITest> pair in _tunitrunner.GetTestList())
+ foreach (var tc in _listNotPass)
{
count++;
- _listItem.Add(new ItemData { No = count, TCName = pair.Key, Result = StrResult.NOTRUN });
- _tcIDList.Add(pair.Key);
+ _listItem.Add(new ItemData { No = count, TCName = tc, Result = StrResult.NOTRUN });
+ _tcIDList.Add(tc);
}
ResultNumber.Total = ResultNumber.NotRun = _tcIDList.Count;
private void MakeTCInfoList()
{
- foreach (KeyValuePair<string, ITest> pair in _tunitRunner.GetTestList())
+ foreach (var testcaseItem in _listItem)
{
- IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();
- List<string> _preconditonsStr = new List<string>(); _preconditonsStr.Add("Preconditions:");
- List<string> _stepsStr = new List<string>(); _stepsStr.Add("Steps:");
- List<string> _postconditionsStr = new List<string>(); _postconditionsStr.Add("Postconditions:\n");
-
- while (customAttributes.MoveNext())
+ foreach (KeyValuePair<string, ITest> pair in _tunitRunner.GetTestList())
{
- if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))
- {
- _stepsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
- }
- else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))
+ if (testcaseItem.TCName.Equals(pair.Key))
{
- _preconditonsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
- }
- else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))
- {
- _postconditionsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);
+ IEnumerator<CustomAttributeData> customAttributes = pair.Value.Method.MethodInfo.CustomAttributes.GetEnumerator();
+ List<string> _preconditonsStr = new List<string>(); _preconditonsStr.Add("Preconditions:");
+ List<string> _stepsStr = new List<string>(); _stepsStr.Add("Steps:");
+ List<string> _postconditionsStr = new List<string>(); _postconditionsStr.Add("Postconditions:\n");\r
+\r
+ while (customAttributes.MoveNext())\r
+ {\r
+ if (customAttributes.Current.AttributeType.FullName.Equals(STEP_ATTRIBUTE_NAME))\r
+ {\r
+ _stepsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ else if (customAttributes.Current.AttributeType.FullName.Equals(PRECONDITION_ATTRIBUTE_NAME))\r
+ {\r
+ _preconditonsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ else if (customAttributes.Current.AttributeType.FullName.Equals(POSTCONDITION_ATTRIBUTE_NAME))\r
+ {\r
+ _postconditionsStr.Add(customAttributes.Current.ConstructorArguments[0].Value + "." + customAttributes.Current.ConstructorArguments[1].Value);\r
+ }\r
+ }
+
+ _tcInfoList.Add(new TestcaseInfo
+ {
+ TestcaseName = pair.Key,
+ Preconditions = _preconditonsStr,
+ Steps = _stepsStr,
+ Postconditions = _postconditionsStr,
+ });
+ break;
}
}
-
- _tcInfoList.Add(new TestcaseInfo
- {
- TestcaseName = pair.Key,
- Preconditions = _preconditonsStr,
- Steps = _stepsStr,
- Postconditions = _postconditionsStr,
- });
}
}
return true;
else
return false;
- }
+ }\r
+\r
+ public List<string> ManualTestTaskRequest()\r
+ {\r
+ List<string> list = new List<string>();\r
+ string result = RequestGET("manual_cases", _session_id);\r
+ if (result == null)\r
+ return list;\r
+\r
+ result = result.Replace("[", "");\r
+ result = result.Replace("]", "");\r
+ result = result.Replace("\n", "");\r
+ result = result.Replace("{", "");\r
+ result = result.Replace("}", "");\r
+ result = result.Replace(" ", "");\r
+\r
+ string[] arr = result.Split(',');\r
+\r
+ foreach (string item in arr)\r
+ {\r
+ if (!item.Equals("") && item.Contains("case_id"))\r
+ {\r
+ string tmp = item.Replace("\"", "");\r
+ string[] keyValue = tmp.Split(':');\r
+ list.Add(keyValue[1]);\r
+ }\r
+ }\r
+\r
+ return list;\r
+ }\r
public string AutoTestTaskRequest()
{
StreamReader reader = new StreamReader(respPostStream);
result = reader.ReadToEnd();
- Console.WriteLine("[TUnitTest] - " + "RequestPOST Result :" + result);
+ Console.WriteLine("[TUnitTest] - " + "###############Asavin############### RequestPOST Result :" + result);
reader.Dispose();
return result;
}
#if TIZEN
+ public List<string> GetNotPassListManual()
+ {\r
+ List<string> list = new List<string>();
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "############### GetNotPassListManual ###############");
+ if (AskNextStepRequest())
+ {
+ CheckExecutionProgressRequest();
+ list = ManualTestTaskRequest();
+ }
+ return list;
+ }
+
public void NextStepRequest()
{
TLogger.Write("############### NextStepRequest ###############");