public class ManualTest
{
private static bool Confirmed = true;
+ private static int _type = 0;
+ private static string _messageFail = "";
public static async Task WaitForConfirm()
{
+
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Wait for confirm result ...");
if (IsWearable())
}
else
{
+ _messageFail = "";
Confirmed = false;
TestPage.GetInstance().UnlockUIButton();
while (true)
{
await Task.Delay(200);
- if (Confirmed)
+ if (Confirmed && _type == 1)
+ {
+ _type = 0;
+ break;
+ }
+ else if (_type == 2)
+ {
+ _type = 0;
+ Assert.Fail(_messageFail);
break;
+ }
}
}
}
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "[Common] Confirm()");
Confirmed = true;
+ _type = 1;
}
}
- public static async Task ConfirmFail(String message)
+ public static void ConfirmFail(String message)
{
if (IsWearable())
{
- await WearableTemplate.ManualTest.ConfirmFail(message);
+ WearableTemplate.ManualTest.ConfirmFail(message);
}
else
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "[Common] ConfirmFail(String message)");
- TestPage.GetInstance().UnlockUIButton();
- await Task.Delay(2000);
- Assert.Fail(message);
+
+ Confirmed = true;
+ _type = 2;
+ _messageFail = message;
}
}
public class ManualTest
{
private static bool Confirmed = true;
+ private static int _type = 0;
+ private static string _messageFail = "";
public static async Task WaitForConfirm()
{
+ _messageFail = "";
Confirmed = false;
TestPage.GetInstance().UnlockUIButton();
while (true)
{
await Task.Delay(200);
- if (Confirmed)
+ if (Confirmed && _type == 1)
+ {
+ _type = 0;
+ break;
+ }
+ else if (_type == 2)
+ {
+ _type = 0;
+ Assert.Fail(_messageFail);
break;
+ }
}
}
public static void Confirm()
{
Confirmed = true;
+ _type = 1;
}
- public static async Task ConfirmFail(String message)
+ public static void ConfirmFail(String message)
{
- TestPage.GetInstance().UnlockUIButton();
- await Task.Delay(2000);
- Assert.Fail(message);
+ Confirmed = true;
+ _type = 2;
+ _messageFail = message;
}
public static void DisplayLabel(String msg)
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = msg + " is not support on this profile. So, you can not test this TC. please mark as PASS",
TextColor = global::Xamarin.Forms.Color.FromHex("#1E90FF"),
- FontSize=4,
+ FontSize = 4,
};
var layout = new StackLayout()
{
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
- Text = msg ,
+ Text = msg,
TextColor = global::Xamarin.Forms.Color.FromHex("#1E90FF"),
FontSize = 4,
};