public class PolygonTests
{
private TestPage _testPage = TestPage.GetInstance();
+ private Background _bg;
private Polygon _polygon;
private Window _window = MainWindow.GetInstance();
public void Destroy()
{
LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
+ if (_bg != null)
+ {
+ _bg.Unrealize();
+ _bg = null;
+ }
+ var naviPage = _testPage.getNavigationPage();
+ if (naviPage != null)
+ naviPage.Popped -= TSPolygon_Popped;
+ }
+
+ private void TSPolygon_Popped(object sender, NaviframeEventArgs e)
+ {
if (_polygon != null)
{
_polygon.Unrealize();
private void CreatePolygon()
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreatePolygon");
+ _bg = new Background(_window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ BackgroundColor = Color.Black
+ };
+ _bg.Show();
_polygon = new Polygon(_window);
_polygon.Show();
- _testPage.ExecuteTCByPage(_polygon);
+ _testPage.ExecuteTCByPage(_bg);
+
+ var naviPage = _testPage.getNavigationPage();
+ if (naviPage != null)
+ {
+ naviPage.Popped += TSPolygon_Popped;
+ }
}
[Test]
[Postcondition(1, "NA")]
public async Task AddPoint_INT_LOOK()
{
- Color color = Color.FromRgb(255, 128, 128);
+ Color color = Color.Pink;
- if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile))
- {
- _polygon.AddPoint(100, 100);
- _polygon.AddPoint(100, 250);
- _polygon.AddPoint(250, 250);
- }
- else
- {
- _polygon.AddPoint(100, 100);
- _polygon.AddPoint(100, 500);
- _polygon.AddPoint(500, 500);
- }
+ Size size = _window.ScreenSize;
+
+ _polygon.AddPoint(110, size.Height - 250);
+ _polygon.AddPoint(110, size.Height - 110);
+ _polygon.AddPoint(250, size.Height - 110);
_polygon.Color = color;
[Postcondition(1, "NA")]
public async Task AddPoint_POINT_LOOK()
{
- Color color = Color.FromRgb(255, 200, 0);
+ Color color = Color.Yellow;
- if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile))
- {
- _polygon.AddPoint(new Point { X = 100, Y = 150 });
- _polygon.AddPoint(new Point { X = 250, Y = 150 });
- _polygon.AddPoint(new Point { X = 250, Y = 250 });
- }
- else
- {
- _polygon.AddPoint(new Point { X = 200, Y = 300 });
- _polygon.AddPoint(new Point { X = 500, Y = 300 });
- _polygon.AddPoint(new Point { X = 500, Y = 600 });
- }
+ Size size = _window.ScreenSize;
+
+ _polygon.AddPoint(new Point { X = 110, Y = size.Height - 250 });
+ _polygon.AddPoint(new Point { X = 250, Y = size.Height - 250 });
+ _polygon.AddPoint(new Point { X = 250, Y = size.Height - 110 });
_polygon.Color = color;
[Postcondition(1, "NA")]
public async Task ClearPoints_LOOK()
{
- Color color = Color.FromRgb(255, 128, 128);
+ Color color = Color.Pink;
+
+ Size size = _window.ScreenSize;
_polygon.AddPoint(new Point { X = 200, Y = 300 });
_polygon.AddPoint(new Point { X = 500, Y = 300 });
_polygon.ClearPoints();
- if (ElmSharpProfile.GetProfile().Equals(ElmSharpProfile.WearableProfile))
- {
- _polygon.AddPoint(new Point { X = 260, Y = 50 });
- _polygon.AddPoint(new Point { X = 350, Y = 130 });
- _polygon.AddPoint(new Point { X = 310, Y = 230 });
- _polygon.AddPoint(new Point { X = 210, Y = 230 });
- _polygon.AddPoint(new Point { X = 160, Y = 130 });
- }
- else
- {
- _polygon.AddPoint(new Point { X = 260, Y = 50 });
- _polygon.AddPoint(new Point { X = 360, Y = 130 });
- _polygon.AddPoint(new Point { X = 310, Y = 230 });
- _polygon.AddPoint(new Point { X = 210, Y = 230 });
- _polygon.AddPoint(new Point { X = 160, Y = 130 });
- }
+ _polygon.AddPoint(new Point { X = 180, Y = size.Height - 270 });
+ _polygon.AddPoint(new Point { X = 270, Y = size.Height - 190 });
+ _polygon.AddPoint(new Point { X = 230, Y = size.Height - 90 });
+ _polygon.AddPoint(new Point { X = 130, Y = size.Height - 90 });
+ _polygon.AddPoint(new Point { X = 90, Y = size.Height - 190 });
_polygon.Show();
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- [Precondition(1, "NA")]
+ [Precondition(1, "This test will be automatically passed on TV. (Due to limitation on TV profile)")]
[Step(1, "Click run TC")]
[Step(2, "Scroll it")]
[Step(3, "Testcase result will be shown automatically")]
[Postcondition(1, "NA")]
public async Task DragStart_CB()
{
- CreateScroller("Scroll it !! Test: Handle event DragStart");
- _scroller.SetPageSize(1, 1);
+ if (ElmSharpProfile.GetProfile().CompareTo(ElmSharpProfile.TvProfile) == 0)
+ {
+ _testPage.UnlockUIButton();
+ Assert.Pass("Not Supported");
+ }
+ else
+ {
+ CreateScroller("Scroll it !! Test: Handle event DragStart");
+ _scroller.SetPageSize(1, 1);
- _testPage.ExecuteTCByPage(_scroller);
+ _testPage.ExecuteTCByPage(_scroller);
- _scroller.DragStart += _Confirm;
+ _scroller.DragStart += _Confirm;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
- var niviframe = _testPage.getNavigationPage();
- if (niviframe != null)
- niviframe.Pop();
+ var niviframe = _testPage.getNavigationPage();
+ if (niviframe != null)
+ niviframe.Pop();
- _scroller.DragStart -= _Confirm;
+ _scroller.DragStart -= _Confirm;
+ }
}
[Test]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- [Precondition(1, "NA")]
+ [Precondition(1, "This test will be automatically passed on TV. (Due to limitation on TV profile)")]
[Step(1, "Click run TC")]
[Step(2, "Drag the page to scroll")]
[Step(3, "Testcase result will be shown automatically")]
[Postcondition(1, "NA")]
public async Task DragStop_CB()
{
- CreateScroller("Scroll it !! Test: Handle event DragStop");
- _scroller.SetPageSize(1, 1);
+ if (ElmSharpProfile.GetProfile().CompareTo(ElmSharpProfile.TvProfile) == 0)
+ {
+ _testPage.UnlockUIButton();
+ Assert.Pass("Not Supported");
+ }
+ else
+ {
+ CreateScroller("Scroll it !! Test: Handle event DragStop");
+ _scroller.SetPageSize(1, 1);
- _testPage.ExecuteTCByPage(_scroller);
+ _testPage.ExecuteTCByPage(_scroller);
- _scroller.DragStop += _Confirm;
+ _scroller.DragStop += _Confirm;
- // Waits for user confirmation.
- await ManualTest.WaitForConfirm();
+ // Waits for user confirmation.
+ await ManualTest.WaitForConfirm();
- var niviframe = _testPage.getNavigationPage();
- if (niviframe != null)
- niviframe.Pop();
+ var niviframe = _testPage.getNavigationPage();
+ if (niviframe != null)
+ niviframe.Pop();
- _scroller.DragStop -= _Confirm;
+ _scroller.DragStop -= _Confirm;
+ }
}
[Test]