From: nguyen.vtan Date: Fri, 15 Feb 2019 10:34:44 +0000 (+0700) Subject: [Non-ACR] Remove Xamarin & Xamarin Map X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F199908%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR] Remove Xamarin & Xamarin Map Change-Id: Idff59e833baf63363d5aad159f7e178a236a2b3e --- diff --git a/tct-suite-vs/CSharpTCT.sln b/tct-suite-vs/CSharpTCT.sln index b22e0de1b..4d3a4d658 100755 --- a/tct-suite-vs/CSharpTCT.sln +++ b/tct-suite-vs/CSharpTCT.sln @@ -96,8 +96,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Wifidirect.Tests", "T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.MediaController.Tests", "Tizen.MediaController.Tests\Tizen.MediaController.Tests.csproj", "{C03750D8-7A7B-4126-9555-BEC39FB26D58}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms.Manual.Tests", "Tizen.XamarinForms.Manual.Tests\Tizen.XamarinForms.Manual.Tests.csproj", "{4E36D272-9642-46EA-8D8A-BF5B7330FD97}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tts.Tests", "Tizen.Tts.Tests\Tizen.Tts.Tests.csproj", "{35BE8024-E369-41B0-BE2B-6C20385563FD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tts.Manual.Tests", "Tizen.Tts.Manual.Tests\Tizen.Tts.Manual.Tests.csproj", "{D852B2C9-0D40-40B2-9D70-552BDAC83E97}" @@ -124,12 +122,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.MediaKey.Manual.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Inputmethodmanager.Tests", "Tizen.Inputmethodmanager.Tests\Tizen.Inputmethodmanager.Tests.csproj", "{0FCFB092-54E6-4A21-9595-1B6BAD69ED58}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinFormsMaps.Tests", "Tizen.XamarinFormsMaps.Tests\Tizen.XamarinFormsMaps.Tests.csproj", "{53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.DataControl.Tests", "Tizen.DataControl.Tests\Tizen.DataControl.Tests.csproj", "{10FE62D3-50D1-458E-ABB4-9C13E946A935}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinFormsMaps.Manual.Tests", "Tizen.XamarinFormsMaps.Manual.Tests\Tizen.XamarinFormsMaps.Manual.Tests.csproj", "{4EBF4294-2FD8-451C-B7DD-37D837E9E271}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Tests", "Tizen.NUI.Tests\Tizen.NUI.Tests.csproj", "{FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Alarm.Tests", "Tizen.Alarm.Tests\Tizen.Alarm.Tests.csproj", "{8BCA1FEB-7175-461F-A1A8-7FE324F1E034}" @@ -198,16 +192,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Badge.Manual.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.AttachPanel.Manual.Tests", "Tizen.AttachPanel.Manual.Tests\Tizen.AttachPanel.Manual.Tests.csproj", "{3372CC3A-51F4-42EB-8D9A-1657C1A9131B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms1.Tests", "Tizen.XamarinForms1.Tests\Tizen.XamarinForms1.Tests.csproj", "{922CC89D-1881-4536-AD0F-89B28F46B4B3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms2.Tests", "Tizen.XamarinForms2.Tests\Tizen.XamarinForms2.Tests.csproj", "{1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms3.Tests", "Tizen.XamarinForms3.Tests\Tizen.XamarinForms3.Tests.csproj", "{FD233943-681C-4583-87C1-3AE8D213A6AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms4.Tests", "Tizen.XamarinForms4.Tests\Tizen.XamarinForms4.Tests.csproj", "{9CE23374-4BBE-4F07-B293-994485809AE6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms5.Tests", "Tizen.XamarinForms5.Tests\Tizen.XamarinForms5.Tests.csproj", "{1464181A-4AFF-48F5-9C21-6302E1582A15}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.ElmSharpWearable.Manual.Tests", "Tizen.ElmSharpWearable.Manual.Tests\Tizen.ElmSharpWearable.Manual.Tests.csproj", "{57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.ElmSharpWearable.Tests", "Tizen.ElmSharpWearable.Tests\Tizen.ElmSharpWearable.Tests.csproj", "{B0284A28-42EE-4A08-B493-6547E5C38862}" @@ -518,12 +502,6 @@ Global {C03750D8-7A7B-4126-9555-BEC39FB26D58}.NUI|Any CPU.ActiveCfg = Release|Any CPU {C03750D8-7A7B-4126-9555-BEC39FB26D58}.Release|Any CPU.ActiveCfg = Release|Any CPU {C03750D8-7A7B-4126-9555-BEC39FB26D58}.Release|Any CPU.Build.0 = Release|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.NUI|Any CPU.ActiveCfg = Release|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.NUI|Any CPU.Build.0 = Release|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E36D272-9642-46EA-8D8A-BF5B7330FD97}.Release|Any CPU.Build.0 = Release|Any CPU {35BE8024-E369-41B0-BE2B-6C20385563FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35BE8024-E369-41B0-BE2B-6C20385563FD}.Debug|Any CPU.Build.0 = Debug|Any CPU {35BE8024-E369-41B0-BE2B-6C20385563FD}.NUI|Any CPU.ActiveCfg = Release|Any CPU @@ -589,22 +567,11 @@ Global {0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.NUI|Any CPU.ActiveCfg = Release|Any CPU {0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.Release|Any CPU.ActiveCfg = Release|Any CPU {0FCFB092-54E6-4A21-9595-1B6BAD69ED58}.Release|Any CPU.Build.0 = Release|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.NUI|Any CPU.ActiveCfg = Release|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.NUI|Any CPU.Build.0 = Release|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53ACEB7B-41DD-4A7D-8C0D-B48C2283878B}.Release|Any CPU.Build.0 = Release|Any CPU {10FE62D3-50D1-458E-ABB4-9C13E946A935}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10FE62D3-50D1-458E-ABB4-9C13E946A935}.Debug|Any CPU.Build.0 = Debug|Any CPU {10FE62D3-50D1-458E-ABB4-9C13E946A935}.NUI|Any CPU.ActiveCfg = Release|Any CPU {10FE62D3-50D1-458E-ABB4-9C13E946A935}.Release|Any CPU.ActiveCfg = Release|Any CPU {10FE62D3-50D1-458E-ABB4-9C13E946A935}.Release|Any CPU.Build.0 = Release|Any CPU - {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.NUI|Any CPU.ActiveCfg = Release|Any CPU - {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4EBF4294-2FD8-451C-B7DD-37D837E9E271}.Release|Any CPU.Build.0 = Release|Any CPU {FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {FC4BDD19-5A2E-4FB7-B058-6EC7663723DF}.NUI|Any CPU.ActiveCfg = Release|Any CPU @@ -809,36 +776,6 @@ Global {3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.NUI|Any CPU.Build.0 = Debug|Any CPU {3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.Release|Any CPU.ActiveCfg = Release|Any CPU {3372CC3A-51F4-42EB-8D9A-1657C1A9131B}.Release|Any CPU.Build.0 = Release|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.NUI|Any CPU.Build.0 = Debug|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {922CC89D-1881-4536-AD0F-89B28F46B4B3}.Release|Any CPU.Build.0 = Release|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.NUI|Any CPU.Build.0 = Debug|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B6A1265-DDD9-4791-8A5C-5EDD2D2B76AF}.Release|Any CPU.Build.0 = Release|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.NUI|Any CPU.Build.0 = Debug|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD233943-681C-4583-87C1-3AE8D213A6AF}.Release|Any CPU.Build.0 = Release|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.NUI|Any CPU.Build.0 = Debug|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9CE23374-4BBE-4F07-B293-994485809AE6}.Release|Any CPU.Build.0 = Release|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.NUI|Any CPU.Build.0 = Debug|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1464181A-4AFF-48F5-9C21-6302E1582A15}.Release|Any CPU.Build.0 = Release|Any CPU {57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.Debug|Any CPU.Build.0 = Debug|Any CPU {57B0DF9F-3B6F-4327-A2FF-4C6265AB395F}.NUI|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Program.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Program.cs deleted file mode 100755 index ffdd4f521..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Program.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using Xamarin.Forms; - -namespace XamarinApplication.Tizen -{ - class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication - { - private static Application _app; - protected override void OnCreate() - { - Console.WriteLine("TCT : OnCreate()"); - base.OnCreate(); - if (ManualTest.IsWearable()) - { - _app = new WearableTemplate.MainPage(); - } - else - { - _app = new ManualTemplate.MainPage(); - } - LoadApplication(_app); - } - - public static Application GetApp() - { - return _app; - } - - static void Main(string[] args) - { - Console.WriteLine("TCT : Main()"); - var app = new Program(); - global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); - app.Run(args); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.csproj b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.csproj deleted file mode 100644 index a171ef771..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Exe - tizen60 - - - - - true - - - - portable - - - None - - - - - - - - - - - Runtime - - - - - - - - - - diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.sln b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.sln deleted file mode 100755 index 13c2b732c..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/Tizen.XamarinForms.Manual.Tests.sln +++ /dev/null @@ -1,80 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms.Manual.Tests", "Tizen.XamarinForms.Manual.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplate", "..\Template\ManualTemplate\ManualTemplate.csproj", "{269F89A7-E648-4811-8421-844E00ACF5F0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplateForWearable", "..\Template\ManualTemplateForWearable\ManualTemplateForWearable.csproj", "{D36CED01-29BD-4EB3-8903-62E0BF2A822D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.NUI|Any CPU.Build.0 = Debug|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.Build.0 = Release|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.NUI|Any CPU.Build.0 = Debug|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/app_icn_ted.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/app_icn_ted.png deleted file mode 100755 index ab726c817..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/app_icn_ted.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/a.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/a.jpg deleted file mode 100755 index ff184399c..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/a.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/b.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/b.jpg deleted file mode 100755 index e34e60b53..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/b.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/c.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/c.jpg deleted file mode 100755 index ae2a56c11..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/c.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/d.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/d.jpg deleted file mode 100755 index bb7d72a94..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/d.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/e.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/e.jpg deleted file mode 100755 index d35a60dd6..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/e.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/f.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/f.jpg deleted file mode 100755 index 238d72222..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/f.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/g.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/g.jpg deleted file mode 100755 index 873c9f3fa..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/large/g.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/a.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/a.jpg deleted file mode 100755 index 4d1659444..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/a.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/b.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/b.jpg deleted file mode 100755 index f3dc3dd0d..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/b.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/c.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/c.jpg deleted file mode 100755 index a0a4c1a3b..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/c.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/d.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/d.jpg deleted file mode 100755 index 4dfda7cea..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/d.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/e.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/e.jpg deleted file mode 100755 index 0d4ded3d1..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/e.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/f.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/f.jpg deleted file mode 100755 index a3fc74442..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/f.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/g.jpg b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/g.jpg deleted file mode 100755 index 33c46c166..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/TED/thumbnail/g.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_SIM_card_manager.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_SIM_card_manager.png deleted file mode 100755 index 653ee88f8..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_SIM_card_manager.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_about_pdevice.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_about_pdevice.png deleted file mode 100755 index 2720aa721..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_about_pdevice.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_account.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_account.png deleted file mode 100755 index f99519afb..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_account.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_bluetooth.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_bluetooth.png deleted file mode 100755 index 011801e54..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_bluetooth.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_color_theme.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_color_theme.png deleted file mode 100755 index 36cb7a68d..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_color_theme.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_date_and_time.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_date_and_time.png deleted file mode 100755 index 423fb2a7f..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_date_and_time.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_display.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_display.png deleted file mode 100755 index c67032d43..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_display.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_language_and_input.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_language_and_input.png deleted file mode 100755 index 123a64eb5..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_language_and_input.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_network.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_network.png deleted file mode 100755 index c068a93b2..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_network.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_privacy.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_privacy.png deleted file mode 100755 index 6c58dea0d..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_privacy.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_restart.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_restart.png deleted file mode 100755 index c8162c955..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_restart.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_safetyassistance.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_safetyassistance.png deleted file mode 100755 index 82f6127e6..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_safetyassistance.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_security.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_security.png deleted file mode 100755 index c5cd5314b..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_security.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_sound.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_sound.png deleted file mode 100755 index 03728f7f4..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_sound.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_storage.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_storage.png deleted file mode 100755 index 5ff084faf..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_storage.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wallpaper.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wallpaper.png deleted file mode 100755 index 996a33c66..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wallpaper.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wifi.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wifi.png deleted file mode 100755 index 34e649f8d..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icon/settings_wifi.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icons/settings_bluetooth.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icons/settings_bluetooth.png deleted file mode 100755 index 011801e54..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/icons/settings_bluetooth.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/picture.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/picture.png deleted file mode 100755 index 7522362aa..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/picture.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/testimage.gif b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/testimage.gif deleted file mode 100755 index 9a68f8e61..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/res/testimage.gif and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.Image.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.Image.png deleted file mode 100755 index 0f1360196..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.Image.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.XamarinForms.Manual.Tests.png b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.XamarinForms.Manual.Tests.png deleted file mode 100755 index 9765b1bda..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/shared/res/Tizen.XamarinForms.Manual.Tests.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSAbsoluteLayout.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSAbsoluteLayout.cs deleted file mode 100755 index 599632d46..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSAbsoluteLayout.cs +++ /dev/null @@ -1,1306 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class AbsoluteLayoutTests - { - private AbsoluteLayout _mAbsoluteLayout; - private static TestPage _testPage = TestPage.GetInstance(); - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Setup---------------------------------"); - _mAbsoluteLayout = new AbsoluteLayout(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Teardown---------------------------------"); - _mAbsoluteLayout = null; - } - - [Test] - [Category("P1")] - [Description("check whether AbsoluteLayout's able to auto size or not")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AutoSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Default button or AutoSize button")] - [Step(3, "Observe change of square")] - [Step(4, "Testcase PASS if square size changed otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task AutoSize_PROPERTY_GET() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.FillAndExpand - }; - - var mBoxviewcenter = new BoxView - { - Color = Color.Red - }; - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.PositionProportional); - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 10, 10)); - - simpleLayout.Children.Add(mBoxviewcenter); - - var mBtnDefalut = new Button - { - HorizontalOptions = LayoutOptions.Fill, - Text = "Default", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var BtnAutoResize = new Button - { - HorizontalOptions = LayoutOptions.Fill, - Text = "AutoSize", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnDefalut, - BtnAutoResize - }, - }, - Title = "Test: AutoSize", - }; - - BtnAutoResize.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); - }; - - mBtnDefalut.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 10, 10)); - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - BtnAutoResize.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); - }; - - mBtnDefalut.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 500, 500)); - }; - } - - [Test] - [Category("P1")] - [Description("Check whether SetLayoutBounds able to sets the layout bounds")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutBounds M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of square")] - [Step(4, "Testcase PASS if click Change button -> square changed,otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task SetLayoutBounds_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.FillAndExpand - }; - - var mBoxviewcenter = new BoxView - { - Color = Color.Red, - HeightRequest = 200, - WidthRequest = 200 - }; - - simpleLayout.Children.Add(mBoxviewcenter); - - var mBtnChangeBound = new Button - { - HorizontalOptions = LayoutOptions.Fill, - Text = "Change", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnChangeBound, - }, - }, - Title = "SetLayoutBounds Test", - }; - - mBtnChangeBound.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 500, 500)); - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnChangeBound.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 500, 500)); - }; - } - - [Test] - [Category("P1")] - [Description("check whether SetLayoutFlags able to sets the layout flags")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutFlags M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click all buttons")] - [Step(3, "Observe change of square")] - [Step(4, "Testcase PASS if square apparence has been changed after clicked each button otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task SetLayoutFlags_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.FillAndExpand, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - - var mBoxviewcenter = new BoxView - { - Color = Color.Red - }; - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.PositionProportional); - AbsoluteLayout.SetLayoutBounds(mBoxviewcenter, - new Rectangle(0.5f, - 0.5f, 200, 200)); - - simpleLayout.Children.Add(mBoxviewcenter); - - var mBtnAll = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "All", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHeightProportional = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "HeightProportional", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - var mBtnNone = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "None", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnSizeProportional = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "SizeProportional", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnWidthProportional = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "WidthProportional", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnXProportional = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "XProportional", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnYProportional = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "YProportional", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var layout = new StackLayout - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - simpleLayout, - mBtnAll, - mBtnHeightProportional, - mBtnNone, - mBtnSizeProportional, - mBtnWidthProportional, - mBtnXProportional, - mBtnYProportional - }, - }; - - var view = new ScrollView - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Content = layout - }; - - ContentPage page = new ContentPage - { - Content = view, - Title = "SetLayoutFlags Test", - }; - - mBtnAll.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.All); - }; - - mBtnHeightProportional.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.HeightProportional); - }; - - mBtnNone.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.None); - }; - - mBtnSizeProportional.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.SizeProportional); - }; - - mBtnWidthProportional.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.WidthProportional); - }; - - mBtnXProportional.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.XProportional); - }; - - mBtnYProportional.Clicked += (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.YProportional); - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnAll.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.All); - }; - - mBtnHeightProportional.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.HeightProportional); - }; - - mBtnNone.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.None); - }; - - mBtnSizeProportional.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.SizeProportional); - }; - - mBtnWidthProportional.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.WidthProportional); - }; - - mBtnXProportional.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.XProportional); - }; - - mBtnYProportional.Clicked -= (e, o) => - { - AbsoluteLayout.SetLayoutFlags(mBoxviewcenter, - AbsoluteLayoutFlags.YProportional); - }; - } - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.IsVisible P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of the layout")] - [Step(4, "Testcase PASS if click Visible button -> Show the layout and click Hide button-> Hide the layout, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_IsVisible_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - simpleLayout.IsVisible = true; - }; - - mBtnHide.Clicked += (e, o) => - { - simpleLayout.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - simpleLayout.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - simpleLayout.IsVisible = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the BackgroundColor property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.BackgroundColor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of layout is changed")] - [Step(3, "Testcase PASS If BackgroundColor of Layout changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_BackgroundColor_Change_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var mBtnRed = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Red, - Text = "Red", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnRed, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnRed.Clicked += (e, o) => - { - simpleLayout.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked += (e, o) => - { - simpleLayout.BackgroundColor = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnRed.Clicked -= (e, o) => - { - simpleLayout.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked -= (e, o) => - { - simpleLayout.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the HeightRequest & WidthRequest property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of the layout changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_WidthAndHeight_CHANGE_SIZE_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - sliderHorizontal, - sliderVertical - }, - }, - Title = "Size Layout Test", - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - simpleLayout.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - simpleLayout.HeightRequest = sliderVertical.Value; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - sliderHorizontal.ValueChanged -= (o, e) => - { - simpleLayout.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged -= (o, e) => - { - simpleLayout.HeightRequest = sliderVertical.Value; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of layout changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_Opacity_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - simpleLayout.BindingContext = sliderOpacity; - simpleLayout.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - if (ManualTest.IsWearable()) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If Margin of layout changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_Margin_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.Fill, - HorizontalOptions = LayoutOptions.Fill, - HeightRequest = 100, - WidthRequest = 200 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Margin = new Thickness(0, 100, 0, 0); - } - else - { - simpleLayout.Margin = new Thickness(0, 150, 0, 0); - } - }; - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of layout changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_Rotation_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Rotation = 50; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Rotation = 90; - } - else - { - simpleLayout.Rotation = 180; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of layout changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_Scale_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Scale = 1.0; - } - else - { - simpleLayout.Scale = 2.0; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the IsEnabled property")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Click me button can not be clicked after select the Disable from Listview, otherwaise False")] - [Postcondition(1, "Click Back button.")] - public async Task AbsoluteLayout_IsEnabled_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - AbsoluteLayout simpleLayout = new AbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200, - Children = - { - new StackLayout - { - HorizontalOptions=LayoutOptions.FillAndExpand, - VerticalOptions=LayoutOptions.FillAndExpand, - Children = - { - new Button - { - Text="Click me", - HorizontalOptions=LayoutOptions.CenterAndExpand, - VerticalOptions=LayoutOptions.Center - } - } - } - } - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.IsEnabled = false; - } - else - { - simpleLayout.IsEnabled = true; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSActivityIndicator.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSActivityIndicator.cs deleted file mode 100755 index 63dfcad5d..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSActivityIndicator.cs +++ /dev/null @@ -1,758 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.ActivityIndicator ManualTests")] - public class ActivityIndicatorTest - { - private ActivityIndicator _mActivityIndicator; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ActivityIndicator CLASS: Setup---------------------------------"); - _mActivityIndicator = new ActivityIndicator(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ActivityIndicator CLASS: Teardown---------------------------------"); - _mActivityIndicator = null; - } - - [Test] - [Category("P1")] - [Description("Check whether ActivityIndicator IsRunning can be changed")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunning A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click start button")] - [Step(3, "Observe ActivityIndicator is running")] - [Step(4, "Testcase PASS if the ActivityIndicator is running,otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task IsRunning_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - WidthRequest = 100, - HeightRequest = 100 - }; - _mActivityIndicator.Color = Color.Yellow; - _mActivityIndicator.IsVisible = true; - _mActivityIndicator.IsRunning = true; - - var btnStop = new Button - { - Text = "Stop" - }; - - var btnRun = new Button - { - Text = "Run" - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - btnRun, - btnStop - } - }, - Title = "ActivityIndicator IsRunning test", - }; - - btnRun.Clicked += (e, o) => - { - _mActivityIndicator.IsRunning = true; - }; - - btnStop.Clicked += (e, o) => - { - _mActivityIndicator.IsRunning = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - btnRun.Clicked += (e, o) => - { - _mActivityIndicator.IsRunning = true; - }; - - btnStop.Clicked += (e, o) => - { - _mActivityIndicator.IsRunning = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsVisible P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of the layout")] - [Step(4, "Testcase PASS if click Visible button -> Show the ActivityIndicator and click Hide button-> Hide the ActivityIndicator, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_IsVisible_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mainUi = new StackLayout - { - Children = - { - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - _mActivityIndicator.IsVisible = true; - _mActivityIndicator.IsRunning = true; - }; - - mBtnHide.Clicked += (e, o) => - { - _mActivityIndicator.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - _mActivityIndicator.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - _mActivityIndicator.IsVisible = false; - }; - } - - //[Test] - [Category("P1")] - [Description("Check the Color property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.BackgroundColor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "Can not test on TV and TV Emulator. Please mark NA on TV.(Due to Limitation on TV)")] - [Step(2, "Select a Color after observe BackgroundColor of ActivityIndicator is changed")] - [Step(3, "Testcase PASS If BackgroundColor of ActivityIndicator changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_Color_Change_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - var mBtnYellow = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Yellow, - Text = "Yellow", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - mBtnYellow, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnYellow.Clicked += (e, o) => - { - _mActivityIndicator.Color = Color.Yellow; - }; - - mBtnGreen.Clicked += (e, o) => - { - _mActivityIndicator.Color = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnYellow.Clicked -= (e, o) => - { - _mActivityIndicator.BackgroundColor = Color.Yellow; - }; - - mBtnGreen.Clicked -= (e, o) => - { - _mActivityIndicator.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of ActivityIndicator changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_Opacity_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _mActivityIndicator.BindingContext = sliderOpacity; - _mActivityIndicator.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - if (ManualTest.IsWearable()) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If Margin of ActivityIndicator changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_Margin_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mActivityIndicator.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mActivityIndicator.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _mActivityIndicator.Margin = new Thickness(0, 150, 0, 0); - } - }; - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - _listview, - }, - BackgroundColor = Color.Blue.WithLuminosity(0.9), - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "This test will be passed on Wearable")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of ActivityIndicator changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_Rotation_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mActivityIndicator.Rotation = 50; - _mActivityIndicator.IsRunning = true; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mActivityIndicator.Rotation = 90; - _mActivityIndicator.IsRunning = true; - } - else - { - _mActivityIndicator.Rotation = 180; - _mActivityIndicator.IsRunning = true; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - _listview, - }, - BackgroundColor = Color.Blue.WithLuminosity(0.9), - }, - Title = title, - }; - - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of ActivityIndicator changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task ActivityIndicator_Scale_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mActivityIndicator = new ActivityIndicator() - { - IsRunning = true, - IsVisible = true, - WidthRequest = 100, - HeightRequest = 100 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mActivityIndicator.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mActivityIndicator.Scale = 1.0; - _mActivityIndicator.IsRunning = true; - } - else - { - _mActivityIndicator.Scale = 2.0; - _mActivityIndicator.IsRunning = true; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mActivityIndicator, - _listview, - }, - BackgroundColor = Color.Blue.WithLuminosity(0.9), - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSApplication.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSApplication.cs deleted file mode 100755 index 7c1e1b72a..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSApplication.cs +++ /dev/null @@ -1,472 +0,0 @@ -using System.Threading.Tasks; -using System.Diagnostics; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.Applications; - -namespace Xamarin.Forms.Core.UnitTests { - - [TestFixture] - [Description("Application init test")] - public class ApplicationTests { - - private static TestPage _testPage = TestPage.GetInstance(); - - public static void AppLaunchReq() - { - AppControl myAppControl = new AppControl(); - myAppControl.Operation = AppControlOperations.Default; - myAppControl.ApplicationId = "ApplicationTests.Tizen"; - AppControl.SendLaunchRequest(myAppControl); - } - - [SetUp] - public void Init() { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST"); - - - } - - [TearDown] - public void Destroy() { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST"); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : OnResume() should be called after launch app")] - [Property("SPEC", "Xamarin.Forms.Application.OnResume M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")] - [Precondition(2, "Open terminal to view logs.")] - [Precondition(3, "Enter command \"sdb dlog -c \"")] - [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")] - [Step(1, "Click run TC")] - [Step(2, "Check if log show \"[TestCase][OnResume][Application] Pass\".")] - [Postcondition(1, "Close the terminal")] - public async Task OnResume_MANUAL_TEST() - { - /* TEST CODE */ - ApplicationTests.AppLaunchReq(); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : OnStart() should be called after launch app")] - [Property("SPEC", "Xamarin.Forms.Application.OnStart M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")] - [Precondition(2, "Open terminal to view logs.")] - [Precondition(3, "Enter command \"sdb dlog -c\"")] - [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")] - [Step(1, "Click run TC")] - [Step(2, "Check if log show \"[TestCase][OnStart][Application] Pass\".")] - [Postcondition(1, "Close the terminal")] - public async Task OnStart_MANUAL_TEST() - { - /* TEST CODE */ - ApplicationTests.AppLaunchReq(); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : OnSleep() should be called after launch app")] - [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")] - [Precondition(2, "Open terminal to view logs.")] - [Precondition(3, "Enter command \"sdb dlog -c \"")] - [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")] - [Step(1, "Click run TC")] - [Step(2, "Check if log show \"[TestCase][OnSleep][Application] Pass\".")] - [Postcondition(1, "Close the terminal")] - public async Task OnSleep_MANUAL_TEST() - { - /* TEST CODE */ - ApplicationTests.AppLaunchReq(); - await ManualTest.WaitForConfirm(); - } - - //[Test] - [Category("P1")] - [Description("MANUAL TEST : OnSleep() should be called after launch app")] - [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Precondition(1, "If ApplicationTests.Tizen is launched, please kill this application.")] - [Precondition(2, "Open terminal to view logs.")] - [Precondition(3, "Enter command \"sdb dlog -c \"")] - [Precondition(4, "Enter command \"sdb dlog | grep TestCase\" to terminal")] - [Step(1, "Click run TC")] - [Step(2, "Check if log show \"[TestCase][OnSleep][Application] Pass\".")] - [Postcondition(1, "Close the terminal")] - public async Task OnAppLinkRequestReceived_MANUAL_TEST() - { - /* TEST CODE */ - ApplicationTests.AppLaunchReq(); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : ModalPopped event is raised after a view has been popped modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPopped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "N/A")] - [Step(1, "Click run TC")] - [Step(2, "Click the button click me.")] - [Step(3, "Check new page with button 'Click for Popped' appears.")] - [Step(4, "Click the button for Popped.")] - [Step(5, "Check the lebel below clicked button is 'ModalPopped Event raised'.")] - [Step(6, "TC will Pass automatically if ModalPopped event raised otherwise Fail")] - [Postcondition(1, "N/A")] - public async Task ModalPopped_EVENT_CHECK_MANUAL_TEST() - { - /* TEST CODE */ - var _button1 = new Button - { - Text = "Click me", - }; - - Label poppedText = new Label - { - Text = "Not Popped." - }; - - var _buttonPopped = new Button - { - Text = "Click for Popped", - }; - - ContentPage page1 = new ContentPage - { - Title = "Hello World", - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _buttonPopped - } - } - - }; - - ContentPage contentpage = new ContentPage() - { - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button1, - poppedText - } - } - - }; - - _button1.Clicked += (sender, e) => - { - _button1.Text = "Clicked"; - contentpage.Navigation.PushModalAsync(page1); - }; - - _buttonPopped.Clicked += (sender, e) => - { - _button1.Text = "Clicked"; - contentpage.Navigation.PopModalAsync(); - }; - - Application.Current.ModalPopped += (sender, e) => { - _buttonPopped.Text = "popped"; - poppedText.Text = "ModalPopped Evenet Raised."; - Assert.IsTrue(true, "Unknown exception occured."); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(contentpage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : ModalPopping event is raised when a view is modally popped.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPopping E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "N/A")] - [Step(1, "Click run TC")] - [Step(2, "Click the button click me.")] - [Step(3, "Check new page with button 'click for popping' appears.")] - [Step(4, "Click the button for popping.")] - [Step(5, "Check the lebel below click me button is 'ModalPopping Event raised'.")] - [Step(6, "TC will Pass automatically if ModalPopping event raised otherwise Fail")] - [Postcondition(1, "N/A")] - public async Task ModalPopping_EVENT_CHECK_MANUAL_TEST() - { - /* TEST CODE */ - var _button1 = new Button - { - Text = "Click me", - }; - - var _buttonPopping = new Button - { - Text = "Click for Popping", - }; - - Label poppingText = new Label - { - Text = "Not Popped." - }; - - ContentPage page1 = new ContentPage - { - Title = "Hello World", - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _buttonPopping, - - } - } - - }; - - ContentPage contentpage = new ContentPage() - { - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button1, - poppingText - } - } - - }; - - _button1.Clicked += (sender, e) => - { - _button1.Text = "Clicked"; - contentpage.Navigation.PushModalAsync(page1); - }; - - _buttonPopping.Clicked += (sender, e) => - { - contentpage.Navigation.PopModalAsync(); - }; - - Application.Current.ModalPopping += (sender, e) => { - _buttonPopping.Text = "popping"; - poppingText.Text = "ModalPopping Event raised."; - Assert.IsTrue(true, "Unknown exception occured."); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(contentpage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : ModalPushed event is raised after a view has been pushed modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPushed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "N/A")] - [Step(1, "Click run TC")] - [Step(2, "Click the button click me.")] - [Step(3, "Check new page with button 'Pushed' appears.")] - [Step(4, "Click the button for Pushed.")] - [Step(5, "Check the lebel below click me button is 'ModalPushed Event raised'.")] - [Step(6, "TC will Pass automatically if ModalPushed event raised otherwise Fail")] - [Postcondition(1, "N/A")] - public async Task ModalPushed_EVENT_CHECK_MANUAL_TEST() - { - /* TEST CODE */ - var _button1 = new Button - { - Text = "Click me", - }; - - var _buttonPushed = new Button - { - Text = "Pushed" - }; - - Label pushedText = new Label - { - Text = "Not Pushed." - }; - - ContentPage page1 = new ContentPage - { - Title = "Hello World", - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _buttonPushed - - } - } - - }; - - ContentPage contentpage = new ContentPage() - { - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button1, - pushedText - } - } - - }; - - _button1.Clicked += (sender, e) => - { - _button1.Text = "Clicked"; - contentpage.Navigation.PushModalAsync(page1); - }; - - _buttonPushed.Clicked += (sender, e) => - { - contentpage.Navigation.PopModalAsync(); - }; - - Application.Current.ModalPushed += (sender, e) => { - _buttonPushed.Text = "Pushed"; - pushedText.Text = "ModalPushed Event raised."; - Assert.IsTrue(true, "Unknown exception occured."); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(contentpage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("MANUAL TEST : ModalPushing event is raised when a view is modally pushed.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPushing E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "N/A")] - [Step(1, "Click run TC")] - [Step(2, "Click the button click me.")] - [Step(3, "Check new page with button 'Pushing' appears.")] - [Step(4, "Click the button for Pushing.")] - [Step(5, "Check the lebel below click me button is 'ModalPushing Event raised'.")] - [Step(6, "TC will Pass automatically if ModalPushing event raised otherwise Fail")] - [Postcondition(1, "N/A")] - public async Task ModalPushing_EVENT_CHECK_MANUAL_TEST() - { - /* TEST CODE */ - var _button1 = new Button - { - Text = "Click me", - }; - - var _buttonPushing = new Button - { - Text = "Pushing" - }; - - Label pushingText = new Label - { - Text = "Not Pushed." - }; - - ContentPage page1 = new ContentPage - { - Title = "Hello World", - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _buttonPushing - - } - } - - }; - - ContentPage contentpage = new ContentPage() - { - Content = new StackLayout - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button1, - pushingText - } - } - - }; - - _button1.Clicked += (sender, e) => - { - _button1.Text = "Clicked"; - contentpage.Navigation.PushModalAsync(page1); - }; - - _buttonPushing.Clicked += (sender, e) => - { - contentpage.Navigation.PopModalAsync(); - }; - - Application.Current.ModalPushing += (sender, e) => { - _buttonPushing.Text = "Pushing"; - pushingText.Text = "ModalPushing Event raised."; - Assert.IsTrue(true, "Unknown exception occured."); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(contentpage); - await ManualTest.WaitForConfirm(); - } - - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSBoxView.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSBoxView.cs deleted file mode 100755 index 153d394b4..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSBoxView.cs +++ /dev/null @@ -1,794 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; -using Xamarin.Forms; -using XamarinApplication.Tizen; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.BoxView ManualTests")] - class BoxViewTest - { - private BoxView _mBoxView; - private static TestPage _testPage = TestPage.GetInstance(); - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "BoxView CLASS: Setup---------------------------------"); - _mBoxView = new BoxView(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "BoxView CLASS: Teardown---------------------------------"); - _mBoxView = null; - } - - //support function - - [Test] - [Category("P1")] - [Description("BoxView look")] - [Property("SPEC", "Xamarin.Forms.BoxView A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(4, "Testcase PASS if the BoxView is shown,otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView - } - }, - Title = "BoxView UILK Test", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.BoxView.IsVisible P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of the BoxView")] - [Step(4, "Testcase PASS if click Visible button -> Show the BoxView and click Hide button-> Hide the BoxView, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_IsVisible_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200, - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - _mBoxView.IsVisible = true; - }; - - mBtnHide.Clicked += (e, o) => - { - _mBoxView.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - _mBoxView.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - _mBoxView.IsVisible = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the BackgroundColor property")] - [Property("SPEC", "Xamarin.Forms.BoxView.BackgroundColor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of BoxView is changed")] - [Step(3, "Testcase PASS If BackgroundColor of BoxView changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_BackgroundColor_Change_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var mBtnRed = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Red, - Text = "Red", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - mBtnRed, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnRed.Clicked += (e, o) => - { - _mBoxView.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked += (e, o) => - { - _mBoxView.BackgroundColor = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnRed.Clicked -= (e, o) => - { - _mBoxView.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked -= (e, o) => - { - _mBoxView.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the HeightRequest & WidthRequest property")] - [Property("SPEC", "Xamarin.Forms.BoxView P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of the BoxView changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_WidthAndHeight_CHANGE_SIZE_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - sliderHorizontal, - sliderVertical - }, - }, - Title = "Size Layout Test", - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _mBoxView.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - _mBoxView.HeightRequest = sliderVertical.Value; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - sliderHorizontal.ValueChanged -= (o, e) => - { - _mBoxView.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged -= (o, e) => - { - _mBoxView.HeightRequest = sliderVertical.Value; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.BoxView P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of BoxView changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_Opacity_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _mBoxView.BindingContext = sliderOpacity; - _mBoxView.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.BoxView P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If Margin of BoxView changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_Margin_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mBoxView.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mBoxView.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _mBoxView.Margin = new Thickness(0, 150, 0, 0); - } - }; - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.BoxView P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of BoxView changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_Rotation_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mBoxView.Rotation = 50; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mBoxView.Rotation = 90; - } - else - { - _mBoxView.Rotation = 180; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.BoxView P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of BoxView changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task BoxView_Scale_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _mBoxView = new BoxView - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 200, - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _mBoxView.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _mBoxView.Scale = 1.0; - } - else - { - _mBoxView.Scale = 2.0; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _mBoxView, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSButton.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSButton.cs deleted file mode 100755 index 1611ee2c0..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSButton.cs +++ /dev/null @@ -1,1521 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ButtonTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private Button _button; - private static ListView _listview; - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Setup---------------------------------"); - _button = new Button(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Button CLASS: Teardown---------------------------------"); - _button = null; - } - - //support function - public void CreatePageTestToButton(String txtDisplay, String title, String[] dataTest) - { - _button = new Button - { - Text = "This is button test", - HorizontalOptions = LayoutOptions.Center, - Font = Font.SystemFontOfSize(NamedSize.Medium), - WidthRequest = 200, - HeightRequest = 100, - IsEnabled = true, - }; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - //--------------BHLK Testing-------------- - [Test] - [Category("P1")] - [Description("Test: Button look")] - [Property("SPEC", "Tizen.UI.Button.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click and Observe all button's behaviours/looks")] - [Step(3, "Pass If buttons show clearly, they don't overlap otherwise fail")] - [Postcondition(1, "NA")] - public async Task Button_BHLK_FULL() - { - //Stack1 - var mButton1 = new Button() - { - Text = "Default", - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - WidthRequest = 320, - HeightRequest = 80 - }; - var mStack1 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - Orientation = StackOrientation.Horizontal, - HeightRequest = 120, - Children = - { - mButton1 - }, - Padding = new Thickness() - { - Top = 0, - }, - }; - - mButton1.Clicked += (sender, e) => - { - mButton1.Text = "Clicked"; - }; - //Stack2 - var mButton21 = new Button() - { - Text = "Default", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - }; - var mButton22 = new Button() - { - Text = "Disabled", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - IsEnabled = false - }; - var mStack2 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - Orientation = StackOrientation.Horizontal, - HeightRequest = 120, - Children = - { - mButton21, - mButton22, - }, - Spacing = 0 - }; - //Stack3 - var mButton31 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 80, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_restart.png" - } - }; - var mButton32 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 80, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_date_and_time.png" - }, - }; - var mButton33 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 80, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_network.png" - }, - IsEnabled = false - }; - var mStack3 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - Orientation = StackOrientation.Horizontal, - HeightRequest = 200, - Spacing = 10, - Children = - { - mButton31, - mButton32, - mButton33 - }, - }; - //Stack4 - var mButton41 = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_sound.png", - }, - WidthRequest = 82, - HeightRequest = 82, - }; - var mStackChild1 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - mButton41, - new Label() - { - HorizontalTextAlignment = TextAlignment.Center, - Text = "Speakers", - Font = Font.SystemFontOfSize(NamedSize.Medium), - } - }, - Spacing = 20, - Padding = new Thickness() - { - Top = 70 - } - }; - var mButton42 = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_restart.png", - }, - WidthRequest = 82, - HeightRequest = 82, - }; - var mStackChild2 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - mButton42 - }, - Padding = new Thickness() - { - Top = 90 - } - }; - var mButton43 = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_network.png", - // IsSmooth = true, - }, - WidthRequest = 82, - HeightRequest = 82, - IsEnabled = false - }; - var mStackChild3 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - mButton43, - new Label() - { - HorizontalTextAlignment = TextAlignment.Center, - Text = "Network", - Font = Font.SystemFontOfSize(NamedSize.Medium), - } - }, - Spacing = 20, - Padding = new Thickness() - { - Top = 70 - } - }; - var mStack4 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - Orientation = StackOrientation.Horizontal, - HeightRequest = 350, - Children = - { - mStackChild1, - mStackChild2, - mStackChild3 - } - }; - //Stack5 - var mButton51 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 80, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_restart.png" - }, - Text = "Restart" - }; - var mButton52 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 80, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_date_and_time.png" - }, - Text = "Calendar" - }; - var mStack5 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Orientation = StackOrientation.Horizontal, - Children = - { - mButton51, - mButton52 - }, - Padding = new Thickness() - { - Left = 25, - Right = 25 - }, - Spacing = 10 - }; - //Stack6 - var mButton61 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 100, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_restart.png" - }, - TextColor = new Color(255, 255, 255) - }; - var mButton62 = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 100, - WidthRequest = 110, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_account.png" - }, - TextColor = new Color(255, 255, 255) - }; - var mButton63 = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - HeightRequest = 100, - Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_network.png" - }, - IsEnabled = false, - TextColor = new Color(255, 255, 255) - }; - var mStack6 = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Orientation = StackOrientation.Horizontal, - Children = - { - mButton61, - mButton62, - mButton63 - }, - Spacing = 60, - }; - //Main stack - var mainStack = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - mStack1, - mStack2, - mStack3, - mStack4, - mStack5, - mStack6, - }, - BackgroundColor = Color.White - }; - - var view = new ScrollView - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Content = mainStack - }; - - var contentPage = new ContentPage() - { - Content = view - }; - /*add*/ - contentPage.Title = "Button Test"; - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Button look")] - [Property("SPEC", "Tizen.UI.Button.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "When you test on TV, you should click button after changing background color.")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of button is changed")] - [Step(3, "Pass If BackgroundColor of Button changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_COLOR_CHANGE() - { - _button = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 320, - BorderColor = Color.Pink, - BorderWidth = 10, - BorderRadius = 5, - Text = "BackgroundColor", - Font = Font.SystemFontOfSize(NamedSize.Medium), - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _button.BackgroundColor = Color.Red; - _button.Text = "RED"; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _button.BackgroundColor = Color.Green; - _button.Text = "GREEN"; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += (s, e) => - { - _button.BackgroundColor = Color.Gray; - _button.Text = "GRAY"; - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - - Children = - { - _button, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Button look")] - [Property("SPEC", "Tizen.UI.Button")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of Button changed otherwise false")] - [Postcondition(1, "NA")] - public async Task WidthAndHeight_CHANGE_SIZE() - { - _button = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - BorderColor = Color.Pink, - BorderWidth = 10, - BorderRadius = 5, - Text = "Size", - Font = Font.SystemFontOfSize(NamedSize.Small), - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _button.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - _button.HeightRequest = sliderVertical.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _button, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Width: ", - }, - sliderHorizontal - } - }, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Height: ", - }, - sliderVertical - } - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Button Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Button look")] - [Property("SPEC", "Tizen.UI.Button")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of Button changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_LOOK() - { - _button = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 220, - BorderColor = Color.Pink, - BorderWidth = 10, - BorderRadius = 5, - Text = "OpacityTest", - Font = Font.SystemFontOfSize(NamedSize.Medium), - }; - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 0.5 - }; - - _button.BindingContext = sliderOpacity; - _button.SetBinding(Button.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _button, - sliderOpacity - //new StackLayout() { - // Orientation = StackOrientation.Horizontal, - // HorizontalOptions = LayoutOptions.FillAndExpand, - // Padding = new Thickness() { - // Left = 20, - // Right = 20, - // }, - // Children = - // { - // //new Label() - // //{ - // // Text = "Opacity: ", - // // Font = Font.SystemFontOfSize(NamedSize.Large) - // //}, - // } - //}, - } - }; - - if (ManualTest.IsWearable()) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Button Test" - }); - await ManualTest.WaitForConfirm(); - } - } - - [Test] - [Category("P1")] - [Description("Test: Button look")] - [Property("SPEC", "Tizen.UI.Button")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "When you test on TV, you should click button after changing background color.")] - [Step(1, "Click run TC")] - [Step(2, "Select a icon after observe icon of button is changed")] - [Step(3, "Pass If icon of Button changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Image_ICON_CHANGE() - { - _button = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 320, - BorderColor = Color.Pink, - BorderWidth = 10, - BorderRadius = 5, - Font = Font.SystemFontOfSize(NamedSize.Medium), - }; - - var image1 = new Image() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Source = _appResourcePath + "icon/settings_sound.png", - BackgroundColor = Color.Gray - }; - - var image2 = new Image() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Source = _appResourcePath + "icon/settings_storage.png", - BackgroundColor = Color.Gray - }; - - var image3 = new Image() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Source = _appResourcePath + "icon/settings_SIM_card_manager.png", - BackgroundColor = Color.Gray - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _button.Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_sound.png", - }; - await Task.Delay(2000); - }; - image1.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _button.Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_storage.png", - }; - await Task.Delay(2000); - }; - image2.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += (s, e) => - { - _button.Image = new FileImageSource() - { - File = _appResourcePath + "icon/settings_SIM_card_manager.png", - }; - }; - image3.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _button, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - image1, - image2, - image3 - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Image Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: FontSize BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.FontSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If FontSize of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task FontSize_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "15.2"; - dataTest[1] = "25.3"; - dataTest[2] = "45.5"; - var text = "Select a FontSize test"; - var title = "FontSize Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.FontSize = 15.2; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.FontSize = 25.3; - } - else - { - _button.FontSize = 35.4; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: TextColor BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If TextColor of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task TextColor_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Red"; - dataTest[1] = "Green"; - dataTest[2] = "Yellow"; - var text = "Select a TextColor test"; - var title = "TextColor Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.TextColor = Color.Red; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.TextColor = Color.Green; - } - else - { - _button.TextColor = Color.Yellow; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Text BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Text of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Text_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Text 1"; - dataTest[1] = "This is 2 text"; - dataTest[2] = "Text 3 test"; - var text = "Select a Text test"; - var title = "Text Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.Text = dataTest[0]; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.Text = dataTest[1]; - } - else - { - _button.Text = dataTest[2]; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Image BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Image A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Image of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Image_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Image 01"; - dataTest[1] = "Image 02"; - dataTest[2] = "Image 03"; - var text = "Select a Image test"; - var title = "Image Test"; - var file1 = _appResourcePath + "TED/thumbnail/a.jpg"; - var file2 = _appResourcePath + "TED/thumbnail/b.jpg"; - var file3 = _appResourcePath + "TED/thumbnail/c.jpg"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - var fileImageSource1 = new FileImageSource() - { - File = file1, - }; - _button.Image = fileImageSource1; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - var fileImageSource2 = new FileImageSource() - { - File = file2, - }; - _button.Image = fileImageSource2; - } - else - { - var fileImageSource3 = new FileImageSource() - { - File = file3, - }; - _button.Image = fileImageSource3; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: FontAttributes BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.FontAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If FontAttributes of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task FontAttributes_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "None"; - dataTest[1] = "Bold"; - dataTest[2] = "Italic"; - var text = "Select a FontAttributes test"; - var title = "FontAttributes Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals("None")) - { - _button.FontAttributes = FontAttributes.None; - } - else if (controlTest.Name.Equals("Bold")) - { - _button.FontAttributes = FontAttributes.Bold; - } - else - { - _button.FontAttributes = FontAttributes.Italic; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Font BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Font A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Font of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Font_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Font: Small"; - dataTest[1] = "Font: Medium"; - dataTest[2] = "Font: Large"; - var text = "Select a Font test"; - var title = "Font Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.Font = Font.SystemFontOfSize(NamedSize.Small); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.Font = Font.SystemFontOfSize(NamedSize.Medium); - } - else - { - _button.Font = Font.SystemFontOfSize(NamedSize.Large); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Margin of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _button.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Rotation of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.Rotation = 90; - } - else - { - _button.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Scale of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _button.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _button.Scale = 1.0; - } - else - { - _button.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsEnabled of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _button.IsEnabled = false; - } - else - { - _button.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible BHBH")] - [Property("SPEC", "Xamarin.Forms.Button.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "BHBH")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsVisible of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_Button_BHBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToButton(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _button.IsVisible = false; - } - else - { - _button.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - private static Button _button1; - - private static void CreateButton(string buttonText) - { - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - _button1 = new Button() - { - Text = buttonText, - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - layout.Children.Add(_button1); - _testPage.ExecuteTC(layout); - } - - private static void OnClicked(object sender, EventArgs e) - { - // If your test is fail, you should set Assert.True(false , "msg"); - Assert.True(true); - // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code. - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Clicked event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.Button.Clicked E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click the Button")] - [Step(2, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Clicked_EVENT() - { - CreateButton("Click Me!!!!!!!!!!!!!."); - _button1.Clicked += OnClicked; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button1.Clicked -= OnClicked; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSCell.cs deleted file mode 100755 index c4284af5b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSCell.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 System; -using Xamarin.Forms; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Cell Tests")] - public class CellTests - { - - private static TestPage _testPage = TestPage.GetInstance(); - private Cell _cell; - [SetUp] - public void SetUp() - { - Console.WriteLine("BoundsTypeConverterTests --------------- Setup()"); - _cell = new EntryCell - { - IsEnabled = true - }; - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BoundsTypeConverterTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check whether occurs when the Cell is Tapped.")] - [Property("SPEC", "Xamarin.Forms.Cell.Tapped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Tap to an entry cell: row will receive focus when select")] - [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "NA")] - public async Task Tapped_EVENT() - { - TextCell _cell = new TextCell - { - Text = "TextCell:", - }; - - TextCell _cell2 = new TextCell - { - Text = "TextCell2 :", - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _cell, - _cell - } - } - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5), - Title = "Test: Tapped", - }; - - _cell.Tapped += onCellTapped; - _cell2.Tapped += onCellTapped; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _cell.Tapped -= onCellTapped; - _cell2.Tapped -= onCellTapped; - } - - private void onCellTapped(object sender, EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSContentPage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSContentPage.cs deleted file mode 100755 index c0f43ca8c..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSContentPage.cs +++ /dev/null @@ -1,367 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ContentPageTest - { - private static ContentPage _contentPage = null; - private static TestPage _testPage = TestPage.GetInstance(); - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - public class CustomContentPage : ContentPage - { - public bool _flagOnBackButtonPressed; - - protected override bool OnBackButtonPressed() - { - _flagOnBackButtonPressed = true; - return base.OnBackButtonPressed(); - } - } - - [SetUp] - public void SetUp() - { - Console.WriteLine("ContentPageTest --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("ContentPageTest --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check Content of a ContentPage can be displayed")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Content A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe")] - [Step(3, "Click Pass if \"Content has been set\" text dispalyed, vice versa")] - [Postcondition(1, "Click back button")] - public async Task Content_UIBH() - { - /* TEST CODE */ - _contentPage = new CustomContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new Label - { - Text = "Content has been set" - } - } - } - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check BackgroundColor can be set with content page.")] - [Property("SPEC", "Xamarin.Forms.ContentPage.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe Background")] - [Step(3, "Click Pass if background color is red, vice versa")] - [Postcondition(1, "Click back button")] - public async Task BackgroundColor_UILK() - { - /* TEST CODE */ - _contentPage = new CustomContentPage(); - - _contentPage.BackgroundColor = Color.Red; - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check BackgroundImage can be set with content page.")] - [Property("SPEC", "Xamarin.Forms.ContentPage.BackgroundImage A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe Background")] - [Step(3, "Click Pass if background image shown, vice versa")] - [Postcondition(1, "Click back button")] - public async Task BackgroundImage_UILK() - { - /* TEST CODE */ - _contentPage = new CustomContentPage(); - - _contentPage.BackgroundImage = _appResourcePath + "icon/settings_date_and_time.png"; - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - //[Test] - [Category("P1")] - [Description("Check Icon can be set with content page.")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Icon A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe")] - [Step(3, "Click Pass if icon shown, vice versa")] - [Postcondition(1, "Click back button")] - public async Task Icon_UILK() - { - /* TEST CODE */ - _contentPage = new CustomContentPage(); - _contentPage.Icon = _appResourcePath + "icon/settings_date_and_time.png"; - _contentPage.Title = "Title"; - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check Padding can be set")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Padding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change padding button")] - [Step(3, "Click Pass if padding change, vice versa")] - [Postcondition(1, "Click back button")] - public async Task Padding_UILK() - { - /* TEST CODE */ - var btnPadding = new Button - { - Text = "Change padding", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand, - BackgroundColor = Color.Maroon - }; - - _contentPage = new CustomContentPage - { - Content = new StackLayout - { - Children = - { - btnPadding - } - } - }; - - btnPadding.Clicked += (sender, e) => - { - _contentPage.Padding = new Thickness(20.5); - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check Title can be set")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Title A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change Title button")] - [Step(3, "Click Pass if Title is shown, vice versa")] - [Postcondition(1, "Click back button")] - public async Task Title_UILK() - { - /* TEST CODE */ - var btnPadding = new Button - { - Text = "Change Title", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand - }; - - _contentPage = new CustomContentPage - { - Title = "Title", - Content = new StackLayout - { - Children = - { - btnPadding - } - } - }; - - btnPadding.Clicked += (sender, e) => - { - _contentPage.Title = "Title test"; - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check ToolbarItems can be set")] - [Property("SPEC", "Xamarin.Forms.ContentPage.ToolbarItems A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click Change Title button")] - [Step(3, "Click Pass if ToolbarItems shown, vice versa")] - [Postcondition(1, "Click back button")] - public async Task ToolbarItems_UIBH() - { - /* TEST CODE */ - if (Device.Idiom == TargetIdiom.Phone) - { - var btnPadding = new Button - { - Text = "Add ToolBarItems", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand - }; - - _contentPage = new CustomContentPage - { - Content = new StackLayout - { - Children = - { - btnPadding - } - } - }; - - btnPadding.Clicked += (sender, e) => - { - _contentPage.ToolbarItems.Add(new ToolbarItem - { - Icon = _appResourcePath + "icon/settings_restart.png", - Name = "Restart", - Command = new Command(() => { }), - Order = ToolbarItemOrder.Primary - } - ); - - _contentPage.ToolbarItems.Add(new ToolbarItem - { - Icon = _appResourcePath + "icon/settings_date_and_time.png", - Name = "Settings", - Command = new Command(() => { }), - Order = ToolbarItemOrder.Secondary - } - ); - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Check ToolbarItems can be set")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Appearing M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click back button")] - [Step(3, "If Appearing event fire the TC will pass autometically, fail otherwaise")] - [Postcondition(1, "N/A")] - public async Task Appearing_UIBH() - { - /* TEST CODE */ - - _contentPage = new CustomContentPage(); - _contentPage.Title = "Appearing Test"; - - _contentPage.Appearing += (sender, e) => - { - Assert.IsTrue(true); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check ToolbarItems can be set")] - [Property("SPEC", "Xamarin.Forms.ContentPage.Disappearing M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click back button")] - [Step(3, "If Disappearing event fire the TC will pass autometically, fail otherwaise")] - [Postcondition(1, "N/A")] - public async Task Disappearing_UIBH() - { - /* TEST CODE */ - - _contentPage = new CustomContentPage(); - _contentPage.Title = "Disappearing Test"; - - _contentPage.Disappearing += (sender, e) => - { - Assert.IsTrue(true); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(_contentPage); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDatePicker.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDatePicker.cs deleted file mode 100755 index 0003722a2..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDatePicker.cs +++ /dev/null @@ -1,265 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class DatePickerTest - { - private static TestPage _testPage = TestPage.GetInstance(); - private static DatePicker _datePicker = null; - - [SetUp] - public void SetUp() - { - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - Console.WriteLine("DatePickerTest --------------- SetUp()"); - } - else - { - Console.WriteLine("Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("DatePickerTest --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check DatePicker look")] - [Property("SPEC", "Xamarin.Forms.DatePicker.Format")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe")] - [Step(3, "Click Pass if date has been shown as \"Tuesday, March 10, 2020\", vice versa")] - [Postcondition(1, "Click back button")] - public async Task Date_UILK() - { - /* TEST CODE */ - var contentPage = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new DatePicker - { - Format="D", - Date = new DateTime(2020,03,10), - VerticalOptions = LayoutOptions.CenterAndExpand - } - } - } - }; - - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check DatePicker look")] - [Property("SPEC", "Xamarin.Forms.DatePicker.DatePicker ")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe a date is showing as formate ")] - [Step(3, "Click on the date")] - [Step(4, "Observe a Choose Date popup shown.")] - [Step(5, "Change date and press Set button.")] - [Step(6, "Observe the date has been changed")] - [Step(7, "Click back button")] - [Step(8, "Click Pass if date has been changed after press the Set button , vice versa")] - [Postcondition(1, "Click back button")] - public async Task DatePicker_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - /* TEST CODE */ - var contentPage = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new DatePicker - { - Format="D", - VerticalOptions = LayoutOptions.CenterAndExpand - } - } - } - }; - - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check DatePicker look")] - [Property("SPEC", "Xamarin.Forms.DatePicker.MaximumDate")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe a date is showing as formate ")] - [Step(3, "Click on the date")] - [Step(4, "Observe a Choose Date popup shown.")] - [Step(5, "Try to change date more than 10-Mar-2018.")] - [Step(3, "Click Pass if date can not set more than 10-Mar-2018, vice versa")] - [Postcondition(1, "Click back button")] - public async Task MaximumDate_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /* TEST CODE */ - var contentPage = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new DatePicker - { - Format="D", - MaximumDate = new DateTime(2018,03,10), - VerticalOptions = LayoutOptions.CenterAndExpand - } - } - } - }; - - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check DatePicker look")] - [Property("SPEC", "Xamarin.Forms.DatePicker.MinimumDate")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe a date is showing as formate ")] - [Step(3, "Click on the date")] - [Step(4, "Observe a Choose Date popup shown.")] - [Step(5, "Try to change date less than 10-Mar-2016.")] - [Step(6, "Click Pass if date can not set less than 10-Mar-2016, vice versa")] - [Postcondition(1, "Click back button")] - public async Task MinimumDate_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /* TEST CODE */ - var contentPage = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new DatePicker - { - Format="D", - MinimumDate = new DateTime(2016,03,10), - VerticalOptions = LayoutOptions.CenterAndExpand - } - } - } - }; - - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check DatePicker look")] - [Property("SPEC", "Xamarin.Forms.DatePicker.TextColor")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe a date is showing as formate ")] - [Step(3, "Click Pass if text color of date is red, vice versa")] - [Postcondition(1, "Click back button")] - public async Task TextColor_UILK() - { - /* TEST CODE */ - var contentPage = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Children = - { - new DatePicker - { - Format="D", - TextColor=Color.Red, - VerticalOptions = LayoutOptions.CenterAndExpand - } - } - } - }; - - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.Styles.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.Styles.cs deleted file mode 100755 index 5b45f0c75..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.Styles.cs +++ /dev/null @@ -1,293 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Device.Styles Tests")] - public class DeviceStylesTests - { - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - if (ManualTest.IsWearable()) - { - Console.Write("Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - Console.WriteLine("DeviceStylesTests --------------- Setup()"); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("DeviceStylesTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check whether BodyStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.BodyStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"body styles\" text style is different than Subtitle style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task BodyStyle_UILK() - { - /* TEST CODE */ - Label bodyStyle = new Label - { - Text = "Body Style", - Style = Device.Styles.BodyStyle, - TextColor = Color.Green - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle }, - new Label { Text = "Subtitle style",TextColor =Color.Red, Style = Device.Styles.SubtitleStyle }, - bodyStyle - } - }, - Title = "Test: BodyStyles", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether CaptionStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.CaptionStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"Caption styles\" text style is different than Body style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task CaptionStyle_UILK() - { - /* TEST CODE */ - Label captionStyle = new Label - { - Text = "Caption Style", - Style = Device.Styles.CaptionStyle, - TextColor = Color.Blue - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle }, - captionStyle, - new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle } - } - }, - Title = "Test: CaptionStyle", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether SubtitleStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.SubtitleStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"subtitle styles\" text style is different than Body style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task SubtitleStyle_UILK() - { - /* TEST CODE */ - Label subtitleStyle = new Label - { - Text = "Subtitle Style", - Style = Device.Styles.SubtitleStyle, - TextColor = Color.Red - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label { Text = "Title style",TextColor =Color.Black, Style = Device.Styles.TitleStyle }, - subtitleStyle, - new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle } - } - }, - Title = "Test: CaptionStyle", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether TitleStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.TitleStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"Title Style\" text style is different than Body style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task TitleStyle_UILK() - { - /* TEST CODE */ - Label titleStyle = new Label - { - Text = "Title Style", - Style = Device.Styles.TitleStyle, - TextColor = Color.Green - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - titleStyle, - new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle } - } - }, - Title = "Test: TitleStyle", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListItemDetailTextStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemDetailTextStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"ListItemDetailTextStyle\" text style is different than Body style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task ListItemDetailTextStyle_UILK() - { - /* TEST CODE */ - Label listItemDetailTextStyle = new Label - { - Text = "ListItemDetailTextStyle", - Style = Device.Styles.ListItemDetailTextStyle, - TextColor = Color.Blue - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - listItemDetailTextStyle, - new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle } - } - }, - Title = "Test: ListItemDetailTextStyle", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListItemTextStyle is working properly.")] - [Property("SPEC", "Xamarin.Forms.Device.Styles.ListItemTextStyle A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run the TC")] - [Step(2, "Check if \"ListItemTextStyle\" text style is different than Body style text.")] - [Step(3, "Press back button and confirm Pass/Fail.")] - [Postcondition(1, "NA")] - public async Task ListItemTextStyle_UILK() - { - /* TEST CODE */ - Label listItemTextStyle = new Label - { - Text = "ListItemTextStyle", - Style = Device.Styles.ListItemTextStyle, - TextColor = Color.Blue - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - listItemTextStyle, - new Label { Text = "Body style",TextColor =Color.Red, Style = Device.Styles.BodyStyle } - } - }, - Title = "Test: ListItemTextStyle", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.cs deleted file mode 100755 index 6b312b97e..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSDevice.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Device Tests")] - public class DeviceTests - { - private static TestPage _testPage = TestPage.GetInstance(); - [SetUp] - public void SetUp() - { - Console.WriteLine("DeviceTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("DeviceTests --------------- TearDown()"); - } - - //[Test] - [Category("P1")] - [Description("Checking a Uri to open.")] - [Property("SPEC", "Xamarin.Forms.Device.OpenUri M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan , nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Observe a uri, which is opened")] - [Postcondition(1, "NA")] - public async Task OpenUri_Uri() - { - /* TEST CODE */ - var uri = "mailto:info@johankarlsson.net?subject=subject&body=body"; - Device.OpenUri(new Uri(uri)); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEditor.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEditor.cs deleted file mode 100755 index 12ddde896..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEditor.cs +++ /dev/null @@ -1,1588 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class EditorTests - { - Editor _editor; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - private void onEditorCompleted(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - - private void onEditorTextChanged(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Setup---------------------------------"); - _editor = new Editor(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Editor CLASS: Teardown---------------------------------"); - _editor = null; - } - - [Test] - [Category("P1")] - [Description("Check whether Completed events can be invoked or not when the Editor object created complete.")] - [Property("SPEC", "Xamarin.Forms.Editor.Completed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click cusor text line and edit")] - [Step(3, "Typing some characters")] - [Step(4, "Tap outside screen")] - [Step(5, "Click BACK button: Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "NA")] - public async Task Completed_CHECK_EVENT() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - ///*TEST CODE*/ - _editor.Text = "TestEditor"; - _editor.HorizontalOptions = LayoutOptions.FillAndExpand; - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _editor - } - }, - Title = "Test: Completed", - }; - _editor.Completed += onEditorCompleted; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _editor.Completed -= onEditorCompleted; - } - - [Test] - [Category("P1")] - [Description("Check whether TextChanged events can be invoked or not when the Text has been changed in Editor.")] - [Property("SPEC", "Xamarin.Forms.Editor.TextChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click cusor text line and edit")] - [Step(3, "Typing some characters")] - [Step(4, "Tap outside screen")] - [Step(5, "Click BACK button: Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "NA")] - public async Task TextChanged_CHECK_EVENT() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - ///*TEST CODE*/ - _editor = new Editor(); - _editor.Text = "TestEditor"; - _editor.HorizontalOptions = LayoutOptions.FillAndExpand; - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _editor - } - }, - Title = "Test: TextChanged", - }; - _editor.TextChanged += onEditorTextChanged; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _editor.TextChanged -= onEditorTextChanged; - } - - [Test] - [Category("P1")] - [Description("Test: FontAttributes UIBH")] - [Property("SPEC", "Xamarin.Forms.Editor.FontAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UiBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If FontAttributes of Editor changed otherwise False")] - [Postcondition(1, "NA")] - public async Task FontAttributes_Editor_UIBH() - { - /*TEST CODE*/ - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - Text = "Xamarin Forms" - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "None"; - dataTest[1] = "Bold"; - dataTest[2] = "Italic"; - var text = "Select a FontAttributes test"; - var title = "FontAttributes Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals("None")) - { - _editor.FontAttributes = FontAttributes.None; - } - else if (ctlTest.Name.Equals("Bold")) - { - _editor.FontAttributes = FontAttributes.Bold; - } - else - { - _editor.FontAttributes = FontAttributes.Italic; - } - }; - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: FontFamily UIBH")] - [Property("SPEC", "Xamarin.Forms.Editor.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "Several fonts are not supported on TV product")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If FontFamily of Editor changed otherwise False")] - [Postcondition(1, "NA")] - public async Task FontFamily_Editor_UIBH() - { - if (Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Unsupported) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300, - Text = "Xamarin Forms" - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Times New Roman"; - dataTest[1] = "Sans"; - dataTest[2] = "Sans Bold"; - var text = "Select a FontFamily test"; - var title = "FontFamily Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.FontFamily = "Times New Roman:style=Regular"; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.FontFamily = "Sans:style=Regular"; - } - else - { - _editor.FontFamily = "Sans:style=Bold"; - } - }; - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: FontFamily UIBH")] - [Property("SPEC", "Xamarin.Forms.Editor.FontSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If FontSize of Editor changed otherwise False")] - [Postcondition(1, "NA")] - public async Task FontSize_Editor_UIBH() - { - /*TEST CODE*/ - - var size = 10; - - if (Device.Idiom == TargetIdiom.TV) - { - size = size * 3; - } - - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = 200, - Text = "Xamarin Forms" - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = size.ToString(); - dataTest[1] = (size * 2).ToString(); - dataTest[2] = (size * 3).ToString(); - var text = "Select a FontSize test"; - var title = "FontSize Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.FontSize = size; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.FontSize = size * 2; - } - else - { - _editor.FontSize = size * 3; - } - }; - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: FontFamily UIBH")] - [Property("SPEC", "Xamarin.Forms.Editor.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click The button Set Text")] - [Step(3, "Pass If Editor 1 text is displaying in Editor 2 then Pass, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task Text_Editor_UIBH() - { - /*TEST CODE*/ - var text = "Select a FontSize test"; - var title = "FontSize Test"; - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = 200, - WidthRequest = 300, - Text = "Xamarin Forms" - }; - - var editor2 = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = 200, - WidthRequest = 300, - }; - - var labl1 = new Label - { - Text = "Editor 1", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - var labl2 = new Label - { - Text = "Editor 2", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - var btnSettEXT = new Button - { - Text = "Set Text", - VerticalOptions = LayoutOptions.EndAndExpand, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - btnSettEXT.Clicked += (s, e) => - { - editor2.Text = _editor.Text; - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - labl1, - _editor, - labl2, - editor2, - btnSettEXT - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - btnSettEXT.Clicked -= (s, e) => - { - editor2.Text = _editor.Text; - }; - } - - [Test] - [Category("P1")] - [Description("Test: FontFamily UIBH")] - [Property("SPEC", "Xamarin.Forms.Editor.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If TextColor of Editor changed otherwise False")] - [Postcondition(1, "NA")] - public async Task TextColor_Editor_UIBH() - { - /*TEST CODE*/ - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - Text = "Xamarin Forms" - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Red"; - dataTest[1] = "Green"; - dataTest[2] = "Blue"; - var text = "Select a TextColor test"; - var title = "TextColor Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.TextColor = Color.Red; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.TextColor = Color.Green; - } - else - { - _editor.TextColor = Color.Blue; - } - }; - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - //================================================================================================ - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.Editor.IsVisible P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of the Editor")] - [Step(4, "Testcase PASS if click Visible button -> Show the Editor and click Hide button-> Hide the Editor, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task IsVisible_Editor_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300, - Text = "Editor" - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - _editor.IsVisible = true; - }; - - mBtnHide.Clicked += (e, o) => - { - _editor.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - _editor.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - _editor.IsVisible = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the BackgroundColor property")] - [Property("SPEC", "Xamarin.Forms.Editor.BackgroundColor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Editor is changed")] - [Step(3, "Testcase PASS If BackgroundColor of Editor changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task BackgroundColor_Editor_Change_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300 - }; - - var mBtnRed = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Red, - Text = "Red", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - mBtnRed, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnRed.Clicked += (e, o) => - { - _editor.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked += (e, o) => - { - _editor.BackgroundColor = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnRed.Clicked -= (e, o) => - { - _editor.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked -= (e, o) => - { - _editor.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the HeightRequest & WidthRequest property")] - [Property("SPEC", "Xamarin.Forms.Editor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of the Editor changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task WidthAndHeight_Editor_CHANGE_SIZE_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - if (Device.Idiom == TargetIdiom.Unsupported) - { - sliderVertical.Maximum = 200; - sliderVertical.Minimum = 0; - } - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - sliderHorizontal, - sliderVertical - }, - }, - Title = "Size Layout Test", - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _editor.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - _editor.HeightRequest = sliderVertical.Value; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - sliderHorizontal.ValueChanged -= (o, e) => - { - _editor.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged -= (o, e) => - { - _editor.HeightRequest = sliderVertical.Value; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.Editor.Opacity P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of Editor changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task Opacity_Editor_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300 - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _editor.BindingContext = sliderOpacity; - _editor.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.Editor.Margin P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If Margin of Editor changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Margin_Editor_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _editor.Margin = new Thickness(0, 150, 0, 0); - } - }; - //await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.Editor.Rotation P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of Editor changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Rotation_Editor_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.Rotation = 50; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.Rotation = 90; - } - else - { - _editor.Rotation = 180; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.Editor.Scale P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of Editor changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Scale_Editor_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300, - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _editor.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.Scale = 1.0; - } - else - { - _editor.Scale = 2.0; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the IsEnabled property")] - [Property("SPEC", "Xamarin.Forms.Editor.IsEnabled P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If text can not be entered in Editor after select the Disable from Listview, otherwaise False")] - [Postcondition(1, "Click Back button.")] - public async Task IsEnabled_Editor_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - _editor = new Editor - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 200, - WidthRequest = 300, - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[1])) - { - _editor.IsEnabled = false; - } - else - { - _editor.IsEnabled = true; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _editor, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEntryCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEntryCell.cs deleted file mode 100755 index 7e0c76b21..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSEntryCell.cs +++ /dev/null @@ -1,650 +0,0 @@ -/* - * 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; -using System; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class EntryCellTests - { - private EntryCell _entryCell, _entryCell2; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - Console.WriteLine("EntryCellTests --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("EntryCellTests --------------- TearDown()"); - } - - //[Test] - [Category("P1")] - [Description("Check whether Completed event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.EntryCell.Completed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "click a entry cell")] - [Step(2, "Edit some character")] - [Step(3, "Touch 'done' btn on keyboard.")] - [Step(4, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Completed_EVENT() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - Label header = new Label - { - Text = "EntryCell", - FontSize = Device.GetNamedSize(NamedSize.Large, typeof(EntryCell)), - HorizontalOptions = LayoutOptions.Center - }; - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - _entryCell2 = new EntryCell - { - Label = "EntryCell2:", - Placeholder = "Type Text Here2" - }; - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - TableView tableView1 = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell2 - } - } - }; - - _entryCell.Completed += (o, e) => - { - Assert.True(true); - ManualTest.Confirm(); - }; - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - header, - tableView, - tableView1 - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _entryCell.Completed -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether HorizontalTextAlignment align Placeholder text Start,Center & End")] - [Property("SPEC", "Xamarin.Forms.EntryCell. HorizontalTextAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Aign Start Button")] - [Step(3, "Click Aign Center Button")] - [Step(4, "Click Aign End Button")] - [Step(5, "Click Pass if alignment of text has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task HorizontalTextAlignment_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnStart = new Button - { - Text = "Align Start", - Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.Start; }) - }; - - var btnCenter = new Button - { - Text = "Align Center", - Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.Center; }) - }; - - var btnEnd = new Button - { - Text = "Align End", - Command = new Command(() => { _entryCell.HorizontalTextAlignment = TextAlignment.End; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnStart, - btnCenter, - btnEnd - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label gets or sets the fixed text presented next to the Entry in the EntryCell")] - [Property("SPEC", "Xamarin.Forms.EntryCell.Label A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Change lable text button")] - [Step(3, "Observe")] - [Step(4, "Click Back Button")] - [Step(5, "Click Pass if Label text has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task Label_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnChangeLabel = new Button - { - Text = "Change lable text", - Command = new Command(() => { _entryCell.Label = "Label text changed"; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnChangeLabel, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label color can be changed.")] - [Property("SPEC", "Xamarin.Forms.EntryCell.LabelColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Change lable color button")] - [Step(3, "Observe")] - [Step(4, "Click Back Button")] - [Step(5, "Click Pass if Label color has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task LabelColor_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnChangeLabelColor = new Button - { - Text = "Change label color", - Command = new Command(() => { _entryCell.LabelColor = Color.Red; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnChangeLabelColor, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label color can be changed.")] - [Property("SPEC", "Xamarin.Forms.EntryCell.Placeholder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Change placeholder text button")] - [Step(3, "Observe")] - [Step(4, "Click Pass if Placeholder text has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task Placeholder_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnChangePlaceholder = new Button - { - Text = "Change placeholder text", - Command = new Command(() => { _entryCell.Placeholder = " Text has been changed"; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnChangePlaceholder, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Text of the Entry of the EntryCell can be changed.")] - [Property("SPEC", "Xamarin.Forms.EntryCell.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Change text button")] - [Step(3, "Observe")] - [Step(4, "Click Back Button")] - [Step(5, "Click Pass if Text of the Entry of the EntryCell has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task Text_UIBH() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnChangeText = new Button - { - Text = "Change Text", - Command = new Command(() => { _entryCell.Text = " Text has been changed"; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnChangeText, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether XAlign align Text property to Start,Center & End")] - [Property("SPEC", "Xamarin.Forms.EntryCell.XAlign A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Aign Start Button")] - [Step(3, "Click Aign Center Button")] - [Step(4, "Click Aign End Button")] - [Step(5, "Click Pass if alignment of text has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task XAlign_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnStart = new Button - { - Text = "Align Start", - Command = new Command(() => { _entryCell.XAlign = TextAlignment.Start; }) - }; - - var btnCenter = new Button - { - Text = "Align Center", - Command = new Command(() => { _entryCell.XAlign = TextAlignment.Center; }) - }; - - var btnEnd = new Button - { - Text = "Align End", - Command = new Command(() => { _entryCell.XAlign = TextAlignment.End; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnStart, - btnCenter, - btnEnd - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - // Currently, Xamarin Forms Limitation - //[Test] - [Category("P1")] - [Description("Check whether Height of the entry cell can be changed")] - [Property("SPEC", "Xamarin.Forms.EntryCell.Height A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Buttons")] - [Step(4, "Click Back Button")] - [Step(4, "Click Pass if Height of EentryCell has been changed, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task Height_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnHeight100 = new Button - { - Text = "Change Height to 100", - Command = new Command(() => { _entryCell.Height = 100; }) - }; - - var btnHeight50 = new Button - { - Text = "Change Height to 50", - Command = new Command(() => { _entryCell.Height = 50; }) - }; - - var btnHeight150 = new Button - { - Text = "Change Height to 150", - Command = new Command(() => { _entryCell.Height = 150; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnHeight100, - btnHeight50, - btnHeight150 - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether entry cell can be enable and disable")] - [Property("SPEC", "Xamarin.Forms.EntryCell.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Buttons")] - [Step(4, "Click Back Button")] - [Step(4, "Click Pass if EntryCell disabled after pressing Disable button and enabled after pressing Enable button, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task IsEnabled_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - _entryCell = new EntryCell - { - Label = "EntryCell:", - Placeholder = "Type Text Here" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _entryCell - } - } - }; - - var btnDisable = new Button - { - Text = "Disable", - Command = new Command(() => { _entryCell.IsEnabled = false; }) - }; - - var btnEnable = new Button - { - Text = "Enable", - Command = new Command(() => { _entryCell.IsEnabled = true; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - btnDisable, - btnEnable, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSFrame.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSFrame.cs deleted file mode 100755 index 76d9d0208..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSFrame.cs +++ /dev/null @@ -1,987 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class FrameTest - { - private Frame _frame; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - Console.WriteLine("Frame --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("Frame --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check whether OutlineColor of a Frame can be change")] - [Property("SPEC", "Xamarin.Forms.Frame.OutlineColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Buttons")] - [Step(4, "Click Back Button")] - [Step(4, "Click Pass if Fram OutlineColor after pressing Silver & Orange button, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task OutlineColor_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - Label header = new Label - { - Text = "Frame OutlineColor", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - }; - - var btnSilver = new Button - { - Text = "Silver", - Command = new Command(() => { _frame.OutlineColor = Color.Silver; }) - }; - - var btnOrange = new Button - { - Text = "Orange", - Command = new Command(() => { _frame.OutlineColor = Color.Orange; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - Children = - { - _frame, - btnSilver, - btnOrange, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether HasShadow of a Frame can be change")] - [Property("SPEC", "Xamarin.Forms.Frame.HasShadow A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Run TC")] - [Step(2, "Click Buttons")] - [Step(4, "Click Back Button")] - [Step(4, "Click Pass if Fram HasShadow after pressing buttons, Fail otherwaise")] - [Postcondition(1, "NA")] - public async Task HasShadow_UILK() - { - // This event will come when touch 'done' btn on keyboard. - /* TEST CODE */ - Label header = new Label - { - Text = "Frame HasShadow", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center - }; - - var btnHasShadow = new Button - { - Text = "Has shadow", - Command = new Command(() => { _frame.HasShadow = true; }) - }; - - var btnHasNoShadow = new Button - { - Text = "Has no shadow", - Command = new Command(() => { _frame.HasShadow = false; }) - }; - - var page = new ContentPage() - { - Content = new StackLayout - { - BackgroundColor = Color.White, - Children = - { - _frame, - btnHasShadow, - btnHasNoShadow, - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - //=============================================================== - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.Frame.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change button")] - [Step(3, "Observe change of the Editor")] - [Step(4, "Testcase PASS if click Visible button -> Show the Frame and click Hide button-> Hide the Frame, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task IsVisible_Frame_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - - Label header = new Label - { - Text = "Frame IsVisible", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - _frame.IsVisible = true; - }; - - mBtnHide.Clicked += (e, o) => - { - _frame.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - _frame.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - _frame.IsVisible = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the BackgroundColor property")] - [Property("SPEC", "Xamarin.Forms.Frame.BackgroundColor P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Frame is changed")] - [Step(3, "Testcase PASS If BackgroundColor of Frame changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task BackgroundColor_Frame_Change_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - Label header = new Label - { - Text = "Frame BackgroundColor", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - //BackgroundColor = Color.White - }; - - var mBtnRed = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Red, - Text = "Red", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - mBtnRed, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnRed.Clicked += (e, o) => - { - _frame.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked += (e, o) => - { - _frame.BackgroundColor = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnRed.Clicked -= (e, o) => - { - _frame.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked -= (e, o) => - { - _frame.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the HeightRequest & WidthRequest property")] - [Property("SPEC", "Xamarin.Forms.Frame P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of the Frame changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task WidthAndHeight_Frame_CHANGE_SIZE_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - var header = new Label - { - Text = "Frame Width and Height Request", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - sliderHorizontal, - sliderVertical - }, - }, - Title = "Size Layout Test", - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _frame.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - _frame.HeightRequest = sliderVertical.Value; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - sliderHorizontal.ValueChanged -= (o, e) => - { - _frame.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged -= (o, e) => - { - _frame.HeightRequest = sliderVertical.Value; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.Frame.Opacity P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of Frame changed otherwise false")] - [Postcondition(1, "Click Back button.")] - public async Task Opacity_Frame_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - Label header = new Label - { - Text = "Frame Opacity", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _frame.BindingContext = sliderOpacity; - _frame.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.Frame.Margin P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If Margin of Frame changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Margin_Frame_UILK() - { - Label header = new Label - { - Text = "Frame Margin", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - BackgroundColor = Color.White - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var title = "Margin Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Pink, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _frame.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _frame.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _frame.Margin = new Thickness(0, 150, 0, 0); - } - }; - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.Frame.Rotation P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of Frame changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Rotation_Frame_UILK() - { - /*PRE CONDITION - * - */ - //TEST CODE - Label header = new Label - { - Text = "Frame Rotation", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - BackgroundColor = Color.White - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _frame.Rotation = 50; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _frame.Rotation = 90; - } - else - { - _frame.Rotation = 180; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.Frame.Scale P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of Frame changed otherwise False")] - [Postcondition(1, "Click Back button.")] - public async Task Scale_Frame_UILK() - { - Label header = new Label - { - Text = "Frame Scale", - TextColor = Color.Blue, - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - BackgroundColor = Color.White, - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var title = "Select a Scale"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - BackgroundColor = Color.Black, - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Blue, - HorizontalOptions = LayoutOptions.Center, - HorizontalTextAlignment = TextAlignment.Center - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - _frame.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - _frame.Scale = 1.0; - } - else - { - _frame.Scale = 2.0; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the IsEnabled property")] - [Property("SPEC", "Xamarin.Forms.Frame.IsEnabled P")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Frame IsEnabled button can not be clicked after select the Disable from Listview, otherwaise False")] - [Postcondition(1, "Click Back button.")] - public async Task IsEnabled_Frame_UIBH() - { - var header = new Button - { - Text = "Frame", - }; - _frame = new Frame - { - Content = header, - OutlineColor = Color.Blue, - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.Center, - BackgroundColor = Color.White - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var title = "IsEnabled Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Pink, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[1])) - { - _frame.IsEnabled = false; - } - else - { - _frame.IsEnabled = true; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - _frame, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSGrid.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSGrid.cs deleted file mode 100755 index cdf72a2d6..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSGrid.cs +++ /dev/null @@ -1,2230 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class GridTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static Grid _grid1, _grid2, _grid3, _grid4, _grid5, _grid6; - private static ListView _listview; - private static Button _button1; - private static Boolean isSizeChanged; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - class CustomGrid : Grid - { - protected override void OnAdded(View view) - { - Assert.True(true); - ManualTest.Confirm(); - base.OnAdded(view); - } - - protected override void OnBindingContextChanged() - { - Assert.True(true); - ManualTest.Confirm(); - base.OnBindingContextChanged(); - } - - protected override void OnRemoved(View view) - { - Assert.True(true); - ManualTest.Confirm(); - base.OnRemoved(view); - } - - protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint) - { - if (isSizeChanged) - { - Assert.True(true); - ManualTest.Confirm(); - } - return base.OnSizeRequest(widthConstraint, heightConstraint); - } - } - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Grid CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Grid CLASS: Teardown---------------------------------"); - } - - private static void HandleClick(object sender, EventArgs e) - { - _grid2.ColumnSpacing = 200; - _button1.Text = "Clicked" + _grid2.ColumnSpacing.ToString(); - _grid2.ForceLayout(); - } - - //support function - public void CreatePageTestToGrid(String txtDisplay, String title, String[] dataTest) - { - _grid5 = new Grid - { - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Gray, - HeightRequest = 100, - WidthRequest = 300, - Margin = 20 - }; - _grid5.Children.Add(new Label - { - Text = "This is A Grid.", - TextColor = Color.White - }); - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid5, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Check if Grid object is created.")] - [Property("SPEC", "Xamarin.Forms.Grid.Grid C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if Grid is visible.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Grid_INIT() - { - /* TEST CODE */ - _grid1 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = GridLength.Auto }, - new RowDefinition { Height = GridLength.Auto }, - new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, - new RowDefinition { Height = new GridLength(100, GridUnitType.Absolute) } - }, - ColumnDefinitions = - { - new ColumnDefinition { Width = GridLength.Auto }, - new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, - new ColumnDefinition { Width = new GridLength(100, GridUnitType.Absolute) } - } - }; - - _grid1.Children.Add(new Label - { - Text = "Grid", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - _grid1.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - _grid1.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - _grid1.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - _grid1.Children.Add(new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 0, 2, 3, 4); - - _grid1.Children.Add(new Label - { - Text = "Fixed 100x100", - TextColor = Color.Aqua, - BackgroundColor = Color.Red, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid1 - }, - BackgroundColor = Color.White, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if column spacing is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.ColumnSpacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if column spacing in Grid is changing with slider move.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task ColumnSpacing_UIBH() - { - /* TEST CODE */ - _grid2 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - ColumnSpacing = 50.00 - }; - - _grid2.Children.Add(new Label - { - Text = "Grid", - HorizontalOptions = LayoutOptions.Center - }); - - _grid2.Children.Add(new Label - { - Text = "Cell 1", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - _grid2.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - _grid2.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - _grid2.Children.Add(new BoxView - { - Color = Color.BlueViolet, - }, 1, 2); - - var sliderColumnSpacing = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 300.00, - Minimum = 10.00, - Value = 10.00 - }; - - _grid2.BindingContext = sliderColumnSpacing; - _grid2.SetBinding(Grid.ColumnSpacingProperty, "Value"); - - sliderColumnSpacing.ValueChanged += (sender, e) => - { - _grid2.ForceLayout(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid2, - new Label() - { - Text = "Column Spacing: ", - }, - sliderColumnSpacing - }, - BackgroundColor = Color.White, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if RowDefinitions property of Grid working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.RowDefinitions A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if clicking the button changes RowDefinitions.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task RowDefinitions_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "GridUnitType.Absolute" - }; - - _grid1 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Absolute) }, - } - }; - - _grid1.Children.Add(new Label - { - Text = "Test: RowDefinitions", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - _grid1.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - _grid1.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - _grid1.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - _grid1.Children.Add(new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 0, 2, 3, 4); - - _grid1.Children.Add(new Label - { - Text = "Fixed 100x100", - TextColor = Color.Aqua, - BackgroundColor = Color.Red, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid1, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - if (_button1.Text == "GridUnitType.Absolute") - { - _button1.Text = "GridUnitType.Auto"; - _grid1.RowDefinitions = new RowDefinitionCollection - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - }; - _grid1.ForceLayout(); - } - else - { - _button1.Text = "GridUnitType.Absolute"; - _grid1.RowDefinitions = new RowDefinitionCollection - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Absolute) }, - }; - _grid1.ForceLayout(); - } - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the amount of space left between rows in the Grid. This is a bindable property.")] - [Property("SPEC", "Xamarin.Forms.Grid.RowSpacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if Row Spacing in Grid is changing with slider move.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task RowSpacing_UIBH() - { - /* TEST CODE */ - _grid2 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowSpacing = 50.00 - }; - - _grid2.Children.Add(new Label - { - Text = "Grid", - HorizontalOptions = LayoutOptions.Center - }); - - _grid2.Children.Add(new Label - { - Text = "Cell 1", - TextColor = Color.Pink, - BackgroundColor = Color.Blue - }, 0, 1); - - _grid2.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - _grid2.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - _grid2.Children.Add(new BoxView - { - Color = Color.BlueViolet, - }, 1, 2); - - var sliderRowSpacing = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 300.00, - Minimum = 10.00, - Value = 1.00 - }; - - if (Device.Idiom == TargetIdiom.Unsupported) - { - sliderRowSpacing.Minimum = 0; - sliderRowSpacing.Maximum = 20; - } - - _grid2.BindingContext = sliderRowSpacing; - _grid2.SetBinding(Grid.RowSpacingProperty, "Value"); - - sliderRowSpacing.ValueChanged += (sender, e) => - { - _grid2.ForceLayout(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid2, - new Label() - { - Text = "Row Spacing: ", - TextColor = Color.Pink - }, - sliderRowSpacing - }, - BackgroundColor = Color.White, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets the collection of child elements of the Grid.")] - [Property("SPEC", "Xamarin.Forms.Grid.Children A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click the button Click for Children.")] - [Step(3, "Check if clicking the button add child in the grid and children count is visible.")] - [Step(4, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Children_UILK() - { - /* TEST CODE */ - Label childCount = new Label - { - Text = "No Of Children in Grid", - Margin = 10 - }; - _grid2 = new Grid - { - RowSpacing = 5.00, - BackgroundColor = Color.Gold - }; - _grid2.Children.Add(childCount, 0, 1); - - _grid2.Children.Add(new Label - { - Text = "Grid", - HorizontalOptions = LayoutOptions.Center - }); - - _button1 = new Button() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 500, - BorderWidth = 10, - BorderRadius = 5, - Text = "Click for Childern.", - TextColor = Color.Black, - }; - - int i, j; - i = 0; - j = 2; - _button1.Clicked += (sender, e) => - { - childCount.Text = "No Of Children in Grid : " + (_grid2.Children.Count - 1).ToString(); - _grid2.Children.Add(new Label - { - Text = "Child No : " + (_grid2.Children.Count - 1).ToString(), - TextColor = Color.White, - BackgroundColor = Color.Blue, - HeightRequest = 10 - }, i, j); - j++; - _grid2.ForceLayout(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid2,_button1 - }, - BackgroundColor = Color.White, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if ColumnDefinitions property of Grid working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.ColumnDefinitions A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if clicking the button changes ColumnDefinitions.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task ColumnDefinitions_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "GridUnitType.Absolute" - }; - - _grid1 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - ColumnDefinitions = - { - new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, - } - }; - - _grid1.Children.Add(new Label - { - Text = "Test: ColumnDefinitions", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - _grid1.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - _grid1.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - _grid1.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - _grid1.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - _grid1.Children.Add(new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 0, 2, 3, 4); - - _grid1.Children.Add(new Label - { - Text = "Fixed 100x100", - TextColor = Color.Aqua, - BackgroundColor = Color.Red, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _grid1, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - if (_button1.Text == "GridUnitType.Absolute") - { - _button1.Text = "GridUnitType.Auto"; - _grid1.ColumnDefinitions = new ColumnDefinitionCollection - { - new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) }, - }; - _grid1.ForceLayout(); - } - else - { - _button1.Text = "GridUnitType.Absolute"; - _grid1.ColumnDefinitions = new ColumnDefinitionCollection - { - new ColumnDefinition { Width = new GridLength(1, GridUnitType.Absolute) }, - }; - _grid1.ForceLayout(); - } - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if opacity is changing properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of Grid changed owtherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_UIBH() - { - _grid3 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - HeightRequest = 200, - WidthRequest = 500 - }; - - _grid3.Children.Add(new Label - { - Text = "This is A Grid.", - TextColor = Color.White - }); - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _grid3.BindingContext = sliderOpacity; - _grid3.SetBinding(Grid.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _grid3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Opacity: ", - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if background color is changing properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Grid is changed")] - [Step(3, "Pass If BackgroundColor of Grid changed owtherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_UILK() - { - _grid4 = new Grid - { - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - HeightRequest = 100, - WidthRequest = 300 - }; - - _grid4.Children.Add(new Label - { - Text = "This is A Grid.", - TextColor = Color.White - }); - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _grid4.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _grid4.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _grid4.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _grid4, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if IsVisible is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsVisible of Grid changed otherwise Fail")] - [Postcondition(1, "NA")] - public async Task IsVisible_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToGrid(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _grid5.IsVisible = false; - } - else - { - _grid5.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check if IsEnabled is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of Grid changed owtherwise Fail")] - [Postcondition(1, "NA")] - public async Task IsEnabled_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - - CreatePageTestToGrid(text, title, dataTest); - _grid5.HeightRequest = 200; - _grid5.WidthRequest = 300; - _grid5.Children.Add(new Button - { - Text = "This is a button.", - TextColor = Color.White, - WidthRequest = 20, - HeightRequest = 10 - }, 0, 1); - - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _grid5.IsEnabled = false; - } - else - { - _grid5.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check if Scale is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of Grid changed owtherwise Fail")] - [Postcondition(1, "NA")] - public async Task Scale_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToGrid(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _grid5.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _grid5.Scale = 1.0; - } - else - { - _grid5.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check if rotation is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of Grid changed owtherwise Fail")] - [Postcondition(1, "NA")] - public async Task Rotation_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToGrid(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _grid5.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _grid5.Rotation = 90; - } - else - { - _grid5.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check if margin is changing properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Margin of Grid changed owtherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToGrid(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _grid5.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _grid5.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _grid5.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Change grid width and height with WidthRequest and HeightRequest respectively.")] - [Property("SPEC", "Xamarin.Forms.Grid.Width A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of Button changed owtherwise Fail")] - [Postcondition(1, "NA")] - public async Task WidthAndHeight_CHANGE_SIZE() - { - _grid6 = new Grid - { - HorizontalOptions = LayoutOptions.Center, - BackgroundColor = Color.Blue, - //HeightRequest = 100, - //WidthRequest = 200, - //Margin = 10 - }; - _grid6.Children.Add(new Label - { - Text = "This is A Grid.", - TextColor = Color.Pink, - HorizontalTextAlignment = TextAlignment.Center - }); - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 100 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - if (Device.Idiom == TargetIdiom.Unsupported) - { - sliderVertical.Maximum = 200; - sliderVertical.Minimum = 20; - } - - sliderHorizontal.ValueChanged += (o, e) => - { - _grid6.WidthRequest = sliderHorizontal.Value; - _grid6.ForceLayout(); - }; - - sliderVertical.ValueChanged += (o, e) => - { - _grid6.HeightRequest = sliderVertical.Value; - _grid6.ForceLayout(); - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _grid6, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Width: ", - TextColor = Color.Pink - }, - sliderHorizontal - } - }, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Height: ", - TextColor = Color.Pink - }, - sliderVertical - } - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Button Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if SetColumn is working properly")] - [Property("SPEC", "Xamarin.Forms.Grid.SetColumn M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click Change Column button and check if last item column is changed.")] - [Step(3, "Click BACK button: Mark Pass if column is changed or mark Fail.")] - [Postcondition(1, "NA")] - public async Task SetColumn_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Change Column" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: SetColumn", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - Label label = new Label - { - Text = "Last Item", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - grid.Children.Add(label, 0, 2); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - Grid.SetColumn(label, 2); - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if SetColumnSpan can set properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.SetColumnSpan M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click button and check if column span is changed accordingly.")] - [Step(3, "Click BACK button: Mark Pass if span is changed accordingly or mark Fail.")] - [Postcondition(1, "NA")] - public async Task SetColumnSpan_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Span 2" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: SetColumnSpan", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - Label label = new Label - { - Text = "Column Span 2", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - grid.Children.Add(label, 0, 2, 3, 4); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - if (_button1.Text == "Span 2") - { - label.Text = "Column span 1"; - _button1.Text = "Span 1"; - Grid.SetColumnSpan(label, 1); - } - else - { - label.Text = "Column span 2"; - _button1.Text = "Span 2"; - Grid.SetColumnSpan(label, 2); - } - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if SetRow is working properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.SetRow M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click Change Column button and check if last item row is changed.")] - [Step(3, "Click BACK button: Mark Pass if row is changed or mark Fail.")] - [Postcondition(1, "NA")] - public async Task SetRow_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Change Column" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: SetRow", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - Label label = new Label - { - Text = "Last Item", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - grid.Children.Add(label, 0, 2, 3, 4); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - Grid.SetRow(label, 1); - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if row span can set properly.")] - [Property("SPEC", "Xamarin.Forms.Grid.SetRowSpan M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click button and check if row span is changed accordingly.")] - [Step(3, "Click BACK button: Mark Pass if span is changed accordingly or mark Fail.")] - [Postcondition(1, "NA")] - public async Task SetRowSpan_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Span 1" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: SetColumnSpan", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - Label label = new Label - { - Text = "Row span 1", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }; - grid.Children.Add(label, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - if (_button1.Text == "Span 2") - { - label.Text = "Row span 1"; - _button1.Text = "Span 1"; - Grid.SetRowSpan(label, 1); - } - else - { - label.Text = "Row span 2"; - _button1.Text = "Span 2"; - Grid.SetRowSpan(label, 2); - } - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if OnAdded is called when children is added.")] - [Property("SPEC", "Xamarin.Forms.Grid.OnAdded M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click Add Children button and check if a children is added.")] - [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnAdded_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Add Children" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: OnAdded", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - grid.Children.Add(new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 0, 2, 3, 4); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - grid.Children.Add(new Label - { - Text = "Fixed 100x100", - TextColor = Color.Aqua, - BackgroundColor = Color.Red, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3); - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if OnBindingContextChanged is called when binding context is changed.")] - [Property("SPEC", "Xamarin.Forms.Grid.OnBindingContextChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click Change Binding Context button.")] - [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnBindingContextChanged_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Change Binding Context" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - CustomGrid gridNew = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: OnBindingContextChanged", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - Label leftover = new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }; - grid.Children.Add(leftover, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - Label label = new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - gridNew.Children.Add(label, 0, 1, 3, 4); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - gridNew, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - gridNew.BindingContext = grid; - gridNew.SetBinding(Grid.ColumnSpanProperty, "ColumnSpan"); - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if OnRemoved is called when children is removed.")] - [Property("SPEC", "Xamarin.Forms.Grid.OnRemoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click Remove Children button and check if a children is removed.")] - [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnRemoved_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Remove Children" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: OnRemoved", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - grid.Children.Add(new Label - { - Text = "Span 2 columns", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 0, 2, 3, 4); - - var label = new Label - { - Text = "Fixed 100x100", - TextColor = Color.Aqua, - BackgroundColor = Color.Red, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - - grid.Children.Add(label, 2, 3); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - - _button1.Clicked += (sender, e) => - { - grid.Children.Remove(label); - }; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check if OnSizeRequest is called when an attempt is made to resize this Grid element.")] - [Property("SPEC", "Xamarin.Forms.Grid.OnSizeRequest M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click button to change row span.")] - [Step(3, "Click BACK button: TC will Pass automatically or mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnSizeRequest_UIBH() - { - /* TEST CODE */ - _button1 = new Button - { - Text = "Span 2" - }; - - CustomGrid grid = new CustomGrid - { - VerticalOptions = LayoutOptions.FillAndExpand, - RowDefinitions = - { - new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }, - } - }; - - grid.Children.Add(new Label - { - Text = "Test: SetColumnSpan", - HorizontalOptions = LayoutOptions.Center - }, 0, 3, 0, 1); - - grid.Children.Add(new Label - { - Text = "Autosized cell", - TextColor = Color.White, - BackgroundColor = Color.Blue - }, 0, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Silver, - HeightRequest = 0 - }, 1, 1); - - grid.Children.Add(new BoxView - { - Color = Color.Teal - }, 0, 2); - - grid.Children.Add(new Label - { - Text = "Leftover space", - TextColor = Color.Purple, - BackgroundColor = Color.Aqua, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - }, 1, 2); - - grid.Children.Add(new Label - { - Text = "Span two rows (or more if you want)", - TextColor = Color.Yellow, - BackgroundColor = Color.Navy, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }, 2, 3, 1, 3); - - Label label = new Label - { - Text = "Column Span 2", - TextColor = Color.Blue, - BackgroundColor = Color.Yellow, - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - }; - grid.Children.Add(label, 0, 2, 3, 4); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - grid, - _button1 - }, - BackgroundColor = Color.White, - }, - }); - isSizeChanged = true; - - _button1.Clicked += (sender, e) => - { - if (_button1.Text == "Span 2") - { - label.Text = "Column span 1"; - _button1.Text = "Span 1"; - Grid.SetColumnSpan(label, 1); - } - else - { - label.Text = "Column span 2"; - _button1.Text = "Span 2"; - Grid.SetColumnSpan(label, 2); - } - }; - - await ManualTest.WaitForConfirm(); - isSizeChanged = false; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImage.cs deleted file mode 100755 index 23ae8ce4f..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImage.cs +++ /dev/null @@ -1,629 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ImageTests - { - private static Image _imageOne, _imageTwo, _imageThree; - private static Label _labelOne, _labelTwo, _labelThree; - private static Button _button; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Image CLASS: Setup---------------------------------"); - _imageOne = new Image(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Image CLASS: Teardown---------------------------------"); - _imageOne = null; - } - - [Test] - [Category("P1")] - [Description("Check whether Image BanckgroundColor is displayed property.")] - [Property("SPEC", "Xamarin.Forms.Image.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the button to change BanckgroundColor accordingly.")] - [Step(3, "Click BACK button: Click Pass if image BanckgroundColor is changed accordingly.")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_UILK() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Red"; - _labelOne = new Label - { - Text = "Click button to change Background Color." - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.HeightRequest = 100; - _imageOne.WidthRequest = 100; - _imageOne.Aspect = Aspect.AspectFit; - _imageOne.BackgroundColor = Color.Green; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _imageOne, - _button - } - }, - Title = "Test: BackgroundColor", - BackgroundColor = Color.White - }; - - _button.Clicked += onRedOrGreen; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onRedOrGreen; - } - - private void onRedOrGreen(object sender, System.EventArgs e) - { - if (_button.Text == "Red") - { - _imageOne.BackgroundColor = Color.Red; - _button.Text = "Green"; - } - else - { - _imageOne.BackgroundColor = Color.Green; - _button.Text = "Red"; - } - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper WidthRequest property.")] - [Property("SPEC", "Xamarin.Forms.Image.WidthRequest A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if Image is diplayed with proper WidthRequest property.")] - [Step(3, "Click BACK button: Click Pass if WidthRequest property is working properly.")] - [Postcondition(1, "NA")] - public async Task WidthRequest_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Width of below image is 50." - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.WidthRequest = 50; - _imageOne.Aspect = Aspect.AspectFit; - - _labelTwo = new Label - { - Text = "Width of below image is 200." - }; - - _imageTwo = new Image - { - Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png", - WidthRequest = 200, - Aspect = Aspect.AspectFit - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _imageOne, - _labelTwo, - _imageTwo - } - }, - Title = "Test: WidthRequest", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper HeightRequest property.")] - [Property("SPEC", "Xamarin.Forms.Image.HeightRequest A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Image height is changing..")] - [Step(3, "Click BACK button: Click Pass if Height changes accordingly.")] - [Postcondition(1, "NA")] - public async Task HeightRequest_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to change height." - }; - - var sliderHeight = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 300, - Minimum = 100, - Value = 10 - }; - - _imageOne.WidthRequest = 100; - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.BindingContext = sliderHeight; - _imageOne.SetBinding(Image.HeightRequestProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _imageOne, - sliderHeight - } - }, - Title = "Test: HeightRequest", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper Opacity property.")] - [Property("SPEC", "Xamarin.Forms.Image.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Image Opacity is changing..")] - [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Opacity_UIBH() - { - /*TEST CODE*/ - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.BindingContext = sliderOpacity; - _imageOne.SetBinding(Image.OpacityProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - sliderOpacity - } - }, - Title = "Test: Opacity", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper Margin property.")] - [Property("SPEC", "Xamarin.Forms.Image.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Image Margin is changing..")] - [Step(3, "Click BACK button: Click Pass if Margin changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Margin_UIBH() - { - /*TEST CODE*/ - - var sliderMargin = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 100, - Minimum = 10, - Value = 5 - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.BindingContext = sliderMargin; - _imageOne.SetBinding(Image.MarginProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - sliderMargin - } - }, - Title = "Test: Margin", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image visibility is changed properly.")] - [Property("SPEC", "Xamarin.Forms.Image.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the Button to change visibility.")] - [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")] - [Postcondition(1, "NA")] - public async Task IsVisible_UIBH() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Hide"; - _labelOne = new Label - { - Text = "Click the button to change visibility." - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.HeightRequest = 100; - _imageOne.WidthRequest = 100; - _imageOne.Aspect = Aspect.AspectFit; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - _button - } - }, - Title = "Test: IsVisible", - BackgroundColor = Color.White - }; - - _button.Clicked += onShowOrHide; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onShowOrHide; - } - - private void onShowOrHide(object sender, System.EventArgs e) - { - if (_button.Text == "Hide") - { - _imageOne.IsVisible = false; - _button.Text = "Show"; - } - else - { - _imageOne.IsVisible = true; - _button.Text = "Hide"; - } - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper Scale property.")] - [Property("SPEC", "Xamarin.Forms.Image.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move slider to change the scaling value.")] - [Step(3, "Click BACK button: Click Pass if scaling is working.")] - [Postcondition(1, "NA")] - public async Task Scale_UIBH() - { - /*TEST CODE*/ - - var sliderScale = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0.5, - Value = 1 - }; - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.BindingContext = sliderScale; - _imageOne.SetBinding(Image.ScaleProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - sliderScale - } - }, - Title = "Test: Scale", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper Rotation property.")] - [Property("SPEC", "Xamarin.Forms.Image.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to apply rotation.")] - [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")] - [Postcondition(1, "NA")] - public async Task Rotation_UIBH() - { - /*TEST CODE*/ - - var sliderRotation = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 360, - Minimum = 0, - Value = 5 - }; - - _imageOne.Source = "../shared/res/Tizen.Image.png"; - _imageOne.BindingContext = sliderRotation; - _imageOne.SetBinding(Image.RotationProperty, "Value"); - _imageOne.Margin = 50; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - sliderRotation - } - }, - Title = "Test: Rotation", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper Aspect property.")] - [Property("SPEC", "Xamarin.Forms.Image.Aspect A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if Image is diplayed with proper Aspect property.")] - [Step(3, "Click BACK button: Click Pass if Aspect property is working properly.")] - [Postcondition(1, "NA")] - public async Task Aspect_UIBH() - { - /*TEST CODE*/ - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.HeightRequest = 100; - _imageOne.WidthRequest = 100; - _imageOne.Aspect = Aspect.AspectFill; - - _imageTwo = new Image - { - Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png", - HeightRequest = 100, - WidthRequest = 100, - Aspect = Aspect.AspectFit - }; - - _imageThree = new Image - { - Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png", - HeightRequest = 100, - WidthRequest = 100, - Aspect = Aspect.Fill - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - _imageTwo, - _imageThree - } - }, - Title = "Test: Aspect", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed with proper IsOpaque property.")] - [Property("SPEC", "Xamarin.Forms.Image.IsOpaque A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if Image is diplayed with proper IsOpaque property.")] - [Step(3, "Click BACK button: Click Pass if IsOpaque property is working properly.")] - [Postcondition(1, "NA")] - public async Task IsOpaque_UIBH() - { - /*TEST CODE*/ - - _imageOne.Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - _imageOne.HeightRequest = 100; - _imageOne.WidthRequest = 100; - _imageOne.IsOpaque = false; - - _imageTwo = new Image - { - Source = "../shared/res/Tizen.XamarinForms.Manual.Tests.png", - HeightRequest = 100, - WidthRequest = 100, - IsOpaque = true - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne, - _imageTwo - } - }, - Title = "Test: IsOpaque", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Image is displayed using Source property.")] - [Property("SPEC", "Xamarin.Forms.Image.Source A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if an Image is diplayed.")] - [Step(3, "Click BACK button: Click Pass if an Image is visible.")] - [Postcondition(1, "NA")] - public async Task Source_UIBH() - { - /*TEST CODE*/ - - _imageOne.Source = ImageSource.FromFile("../shared/res/Tizen.XamarinForms.Manual.Tests.png"); - _imageOne.HeightRequest = 100; - _imageOne.WidthRequest = 100; - _imageOne.IsOpaque = false; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _imageOne - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImageCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImageCell.cs deleted file mode 100755 index bb8cb9342..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSImageCell.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ImageCellTests - { - private static ImageCell _imageCellOne, _imageCellTwo; - private static Label _labelOne, _labelTwo; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ImageCell CLASS: Setup---------------------------------"); - _imageCellOne = new ImageCell(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ImageCell CLASS: Teardown---------------------------------"); - _imageCellOne = null; - } - - [Test] - [Category("P1")] - [Description("Check if imagesource displays Image.")] - [Property("SPEC", "Xamarin.Forms.ImageCell.ImageSource A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if an Image is diplayed.")] - [Step(3, "Click BACK button: Click Pass if an Image is visible.")] - [Postcondition(1, "NA")] - public async Task ImageSource_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "An image should be displayed below." - }; - _imageCellOne.ImageSource = ImageSource.FromFile("../shared/res/Tizen.XamarinForms.Manual.Tests.png"); - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _imageCellOne - } - } - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - tableView - } - }, - Title = "Test: ImageSource", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSLabel.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSLabel.cs deleted file mode 100755 index 501a73fa0..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSLabel.cs +++ /dev/null @@ -1,867 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class LabelTests - { - private static Label _labelOne, _labelTwo; - private static Button _button; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Label CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Label CLASS: Teardown---------------------------------"); - } - - [Test] - [Category("P1")] - [Description("Check whether Label BanckgroundColor is displayed property.")] - [Property("SPEC", "Xamarin.Forms.Label.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if Label BanckgroundColor is Purple.")] - [Step(3, "Click BACK button: Click Pass if Label BanckgroundColor is Purple.")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Background Color of this text should be purple.", - BackgroundColor = Color.Purple - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne - } - }, - Title = "Test: BackgroundColor" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper WidthRequest property.")] - [Property("SPEC", "Xamarin.Forms.Label.WidthRequest A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move slider position to check if width is working properly.")] - [Step(3, "Click BACK button: Click Pass if Height is minimum when Width is maximum.")] - [Postcondition(1, "NA")] - public async Task WidthRequest_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - HorizontalOptions = LayoutOptions.Start, - VerticalOptions = LayoutOptions.Start, - Text = "Move the cursor position to change width.", - BackgroundColor = Color.Purple - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 300, - Minimum = 0, - Value = 200 - }; - - _labelOne.BindingContext = sliderOpacity; - _labelOne.SetBinding(Label.WidthRequestProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderOpacity - } - }, - Title = "Test: WidthRequest" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper HeightRequest property.")] - [Property("SPEC", "Xamarin.Forms.Label.HeightRequest A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Label height is changing.")] - [Step(3, "Click BACK button: Click Pass if Height changes accordingly.")] - [Postcondition(1, "NA")] - public async Task HeightRequest_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to change height.", - BackgroundColor = Color.Purple - }; - - var sliderHeight = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 300, - Minimum = 100, - Value = 10 - }; - - _labelOne.BindingContext = sliderHeight; - _labelOne.SetBinding(Label.HeightRequestProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderHeight - } - }, - Title = "Test: HeightRequest" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper Opacity property.")] - [Property("SPEC", "Xamarin.Forms.Label.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Label Opacity is changing..")] - [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Opacity_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the silder position to change Opacity.", - BackgroundColor = Color.Purple - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _labelOne.BindingContext = sliderOpacity; - _labelOne.SetBinding(Label.OpacityProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderOpacity - } - }, - Title = "Test: Opacity" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper Margin property.")] - [Property("SPEC", "Xamarin.Forms.Label.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if Label Margin is changing..")] - [Step(3, "Click BACK button: Click Pass if Margin changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Margin_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the silder position to change Margin.", - BackgroundColor = Color.Purple - }; - - var sliderMargin = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 100, - Minimum = 10, - Value = 5 - }; - - _labelOne.BindingContext = sliderMargin; - _labelOne.SetBinding(Label.MarginProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderMargin - } - }, - Title = "Test: Margin" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label visibility is changed properly.")] - [Property("SPEC", "Xamarin.Forms.Label.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the Button to change visibility.")] - [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")] - [Postcondition(1, "NA")] - public async Task IsVisible_UIBH() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Hide"; - _labelOne = new Label - { - Text = "Click the button to change visibility.", - BackgroundColor = Color.Purple - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _button - } - }, - Title = "Test: IsVisible" - }; - - _button.Clicked += onShowOrHide; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onShowOrHide; - } - - private void onShowOrHide(object sender, System.EventArgs e) - { - if (_button.Text == "Hide") - { - _labelOne.IsVisible = false; - _button.Text = "Show"; - } - else - { - _labelOne.IsVisible = true; - _button.Text = "Hide"; - } - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper Scale property.")] - [Property("SPEC", "Xamarin.Forms.Label.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move slider to change the scaling value.")] - [Step(3, "Click BACK button: Click Pass if scaling is working.")] - [Postcondition(1, "NA")] - public async Task Scale_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to change the scaling value.", - BackgroundColor = Color.Purple - }; - - var sliderScale = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 2, - Minimum = 0.5, - Value = 0.3 - }; - - _labelOne.BindingContext = sliderScale; - _labelOne.SetBinding(Label.ScaleProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderScale - } - }, - Title = "Test: Scale" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper Rotation property.")] - [Property("SPEC", "Xamarin.Forms.Label.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to apply rotation.")] - [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")] - [Postcondition(1, "NA")] - public async Task Rotation_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to apply rotation", - BackgroundColor = Color.Purple - }; - - var sliderRotation = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 360, - Minimum = 0, - Value = 5 - }; - - _labelOne.BindingContext = sliderRotation; - _labelOne.SetBinding(Label.RotationProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - sliderRotation - } - }, - Title = "Test: Rotation" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper FontAttributes property.")] - [Property("SPEC", "Xamarin.Forms.Label.FontAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different FontAttributes.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper FontAttributes.")] - [Postcondition(1, "NA")] - public async Task FontAttributes_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "This line should be Bold.", - FontAttributes = FontAttributes.Bold - }; - - _labelTwo = new Label - { - Text = "This line should be Italic.", - FontAttributes = FontAttributes.Italic - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: FontAttributes", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper FontFamily property.")] - [Property("SPEC", "Xamarin.Forms.Label.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different FontFamily.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing different FontFamily.")] - [Postcondition(1, "NA")] - public async Task FontFamily_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "This line is in Times New Roman.", - FontFamily = "Times New Roman" - }; - - _labelTwo = new Label - { - Text = "This line should is in Sans:style=Bold.", - FontFamily = "Sans:style=Bold" - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: FontFamily" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper FontSize property.")] - [Property("SPEC", "Xamarin.Forms.Label.FontSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different FontSize.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper FontSize.")] - [Postcondition(1, "NA")] - public async Task FontSize_UIBH() - { - var size = 10; - - if ((Device.Idiom == TargetIdiom.Phone) || (Device.Idiom == TargetIdiom.TV)) - { - size = size * 2; - } - - /*TEST CODE*/ - _labelOne = new Label - { - Text = "FontSize " + size, - FontAttributes = FontAttributes.Bold, - FontSize = size - }; - - _labelTwo = new Label - { - Text = "FontSize " + (size * 2), - FontAttributes = FontAttributes.Bold, - FontSize = (size * 2) - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: FontSize" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper FormattedText property.")] - [Property("SPEC", "Xamarin.Forms.Label.FormattedText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if 3 texts are matched with looks.")] - [Step(3, "Click BACK button: Click Pass if FormattedText is matched.")] - [Postcondition(1, "NA")] - public async Task FormattedText_UILK() - { - /*TEST CODE*/ - - var fstring = new FormattedString(); - fstring.Spans.Add(new Span { Text = "Red bold ", ForegroundColor = Color.Red, FontAttributes = FontAttributes.Bold }); - fstring.Spans.Add(new Span { Text = "Default " }); - fstring.Spans.Add(new Span { Text = "italic small", FontAttributes = FontAttributes.Italic, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) }); - - _labelTwo = new Label - { - FormattedText = fstring - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelTwo - } - }, - Title = "Test: FormattedText" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper HorizontalTextAlignment property.")] - [Property("SPEC", "Xamarin.Forms.Label.HorizontalTextAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different HorizontalTextAlignment.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper HorizontalTextAlignment.")] - [Postcondition(1, "NA")] - public async Task HorizontalTextAlignment_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Text Alignment of this line should be from Start.", - HorizontalTextAlignment = TextAlignment.Start - }; - - _labelTwo = new Label - { - Text = "Text Alignment of this line should be from End.", - HorizontalTextAlignment = TextAlignment.End - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: HorizontalTextAlignment" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper LineBreakMode property.")] - [Property("SPEC", "Xamarin.Forms.Label.LineBreakMode A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different LineBreakMode.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper LineBreakMode.")] - [Postcondition(1, "NA")] - public async Task LineBreakMode_UILK() - { - string text1 = "LineBreakMode test with CharacterWrap"; - string text2 = "LineBreakMode test with WordWrap"; - if ((Device.Idiom == TargetIdiom.Phone) || (Device.Idiom == TargetIdiom.TV)) - { - text1 = "LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap. LineBreakMode of this line should is CharacterWrap.LineBreakMode of this line should is CharacterWrap."; - text2 = "LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap. LineBreakMode of this line should is WordWrap.LineBreakMode of this line should is WordWrap."; - } - - /*TEST CODE*/ - _labelOne = new Label - { - Text = text1, - LineBreakMode = LineBreakMode.CharacterWrap - }; - - _labelTwo = new Label - { - Text = text2, - LineBreakMode = LineBreakMode.WordWrap - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: LineBreakMode" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper Text property.")] - [Property("SPEC", "Xamarin.Forms.Label.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if a label is displayed with Text.")] - [Step(3, "Click BACK button: Click Pass if Label is are showing properly.")] - [Postcondition(1, "NA")] - public async Task Text_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "This text should be visible.", - LineBreakMode = LineBreakMode.CharacterWrap - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne - } - }, - Title = "Test: Text" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper TextColor property.")] - [Property("SPEC", "Xamarin.Forms.Label.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different TextColor.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper TextColor.")] - [Postcondition(1, "NA")] - public async Task TextColor_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Text color of this line should be Green.", - TextColor = Color.Green - }; - - _labelTwo = new Label - { - Text = "Text color of this line should be Red", - TextColor = Color.Red - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: TextColor" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - // Currently, Xamarin Forms Limitations - //[Test] - [Category("P1")] - [Description("Check whether Label is displayed with proper VerticalTextAlignment property.")] - [Property("SPEC", "Xamarin.Forms.Label.VerticalTextAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if two labels are displayed with different VerticalTextAlignment.")] - [Step(3, "Click BACK button: Click Pass if Labels are showing proper VerticalTextAlignment.")] - [Postcondition(1, "NA")] - public async Task VerticalTextAlignment_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Alignment of this text is Start.", - VerticalTextAlignment = TextAlignment.Start - }; - - _labelTwo = new Label - { - Text = "Alignment of this text is Center.", - VerticalTextAlignment = TextAlignment.Center - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _labelTwo - } - }, - Title = "Test: VerticalTextAlignment" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSListView.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSListView.cs deleted file mode 100755 index b0b1c9c22..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSListView.cs +++ /dev/null @@ -1,1295 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ListViewTests - { - private static ListView _listView; - private static Button _button; - private static Label _labelOne; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ListView CLASS: Setup---------------------------------"); - _listView = new ListView(); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "ListView CLASS: Teardown---------------------------------"); - _listView = null; - } - - class Person - { - public string FullName - { - get; - set; - } - - public string Address - { - get; - set; - } - } - - class Group : ObservableCollection - { - public Group(string firstInitial) - { - FirstInitial = firstInitial; - } - - public string FirstInitial - { - get; - private set; - } - } - - Group[] mygroup; - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Opacity property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if ListView Opacity is changing.")] - [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Opacity_UIBH() - { - /*TEST CODE*/ - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - HeightRequest = 500, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.HeightRequest = 200; - _listView.BindingContext = sliderOpacity; - _listView.SetBinding(ListView.OpacityProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView, - sliderOpacity - } - }, - Title = "Test: Opacity", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Margin property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if ListView Margin is changing.")] - [Step(3, "Click BACK button: Click Pass if ListView changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Margin_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the silder position to change Margin." - }; - - var sliderMargin = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 100, - Minimum = 10, - Value = 5 - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.BindingContext = sliderMargin; - _listView.SetBinding(ListView.MarginProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - sliderMargin, - _listView, - _labelOne, - } - }, - Title = "Test: Margin", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView visibility is changed properly.")] - [Property("SPEC", "Xamarin.Forms.ListView.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the Button to change visibility.")] - [Step(3, "Click BACK button: Click Pass if visibility is changed accordingliy.")] - [Postcondition(1, "NA")] - public async Task IsVisible_UIBH() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Hide"; - _labelOne = new Label - { - Text = "Click the button to change visibility." - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView, - _button - } - }, - Title = "Test: IsVisible", - BackgroundColor = Color.White - }; - - _button.Clicked += onShowOrHide; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onShowOrHide; - } - - private void onShowOrHide(object sender, System.EventArgs e) - { - if (_button.Text == "Hide") - { - _listView.IsVisible = false; - _button.Text = "Show"; - } - else - { - _listView.IsVisible = true; - _button.Text = "Hide"; - } - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Scale property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move slider to change the scaling value.")] - [Step(3, "Click BACK button: Click Pass if scaling is working.")] - [Postcondition(1, "NA")] - public async Task Scale_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to change the scaling value." - }; - - var sliderScale = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 2, - Minimum = 0.5, - Value = 0.3 - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.BindingContext = sliderScale; - _listView.SetBinding(ListView.ScaleProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - sliderScale, - _listView, - _labelOne, - } - }, - Title = "Test: Scale", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Rotation property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to apply rotation.")] - [Step(3, "Click BACK button: Click Pass if rotation is working propertly.")] - [Postcondition(1, "NA")] - public async Task Rotation_UIBH() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Move the slider position to apply rotation" - }; - - var sliderRotation = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 360, - Minimum = 0, - Value = 5 - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.BindingContext = sliderRotation; - _listView.SetBinding(Image.RotationProperty, "Value"); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - sliderRotation, - _listView, - _labelOne, - } - }, - Title = "Test: Rotation", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Footer property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Footer A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if footer is displayed after all other children.")] - [Step(3, "Click BACK button: Click Pass if footer is displayed after all other children.")] - [Postcondition(1, "NA")] - public async Task Footer_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Footer: should display after all other children.", - HeightRequest = 200 - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.Footer = _labelOne; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: Footer", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper FooterTemplate property.")] - [Property("SPEC", "Xamarin.Forms.ListView.FooterTemplate A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if footer text is displayed on a button.")] - [Step(3, "Click BACK button: Click Pass if footer text is displayed on a button.")] - [Postcondition(1, "NA")] - public async Task FooterTemplate_UILK() - { - /*TEST CODE*/ - _listView.FooterTemplate = new DataTemplate(typeof(Button)) - { - Bindings = { - { Button.TextProperty, new Binding (".") } - } - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.Footer = "This footer text will apppear on a Button."; - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: FooterTemplate", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper GroupDisplayBinding property.")] - [Property("SPEC", "Xamarin.Forms.ListView.GroupDisplayBinding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if list of people is displayed, grouped using FirstInitial.")] - [Step(3, "Click BACK button: Click Pass if grouped people are displayed.")] - [Postcondition(1, "NA")] - public async Task GroupDisplayBinding_UILK() - { - /*TEST CODE*/ - _labelOne = new Label() - { - Text = "First Initial will be the Group Header.", - }; - - _listView.IsGroupingEnabled = true; - _listView.GroupDisplayBinding = new Binding("FirstInitial"); - - var template = new DataTemplate(typeof(TextCell)); - template.SetBinding(TextCell.TextProperty, "FullName"); - template.SetBinding(TextCell.DetailProperty, "Address"); - - _listView.ItemTemplate = template; - _listView.ItemsSource = new[] { - new Group ("C") { - new Person { FullName = "Caprice Nave" } - }, - new Group ("J") { - new Person { FullName = "James Smith", Address = "404 Nowhere Street" }, - new Person { FullName = "John Doe", Address = "404 Nowhere Ave" } - } - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: GroupDisplayBinding", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper GroupHeaderTemplate property.")] - [Property("SPEC", "Xamarin.Forms.ListView.GroupHeaderTemplate A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if group header is replaced with an Entry Cell.")] - [Step(3, "Click BACK button: Click Pass if Group Header is replaced with entry cell.")] - [Postcondition(1, "NA")] - public async Task GroupHeaderTemplate_UILK() - { - /*TEST CODE*/ - _labelOne = new Label() - { - Text = "The group header will be replaced with an entry cell:", - }; - - _listView.IsGroupingEnabled = true; - //_listView.GroupDisplayBinding = new Binding("FirstInitial"); - _listView.GroupShortNameBinding = new Binding("FirstInitial"); - _listView.GroupHeaderTemplate = new DataTemplate(typeof(EntryCell)); - - var template = new DataTemplate(typeof(TextCell)); - template.SetBinding(TextCell.TextProperty, "FullName"); - template.SetBinding(TextCell.DetailProperty, "Address"); - - _listView.ItemTemplate = template; - _listView.ItemsSource = new[] { - new Group ("C") { - new Person { FullName = "Caprice Nave" } - }, - new Group ("J") { - new Person { FullName = "James Smith", Address = "404 Nowhere Street" }, - new Person { FullName = "John Doe", Address = "404 Nowhere Ave" } - } - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: GroupHeaderTemplate", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper GroupShortNameBinding property.")] - [Property("SPEC", "Xamarin.Forms.ListView.GroupShortNameBinding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "This test will be automatically passed, due to limitation on platform ")] - [Step(1, "Click run TC")] - [Step(2, "Check if list of people is displayed, grouped using FirstInitial.")] - [Step(3, "Click BACK button: Click Pass if grouped people are displayed.")] - [Postcondition(1, "NA")] - public async Task GroupShortNameBinding_UILK() - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper Header property.")] - [Property("SPEC", "Xamarin.Forms.ListView.Header A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if Header is displayed above all other children.")] - [Step(3, "Click BACK button: Click Pass if Header is displayed above all.")] - [Postcondition(1, "NA")] - public async Task Header_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "Header: should display above all other children." - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.Header = _labelOne; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: Header", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper HeaderTemplate property.")] - [Property("SPEC", "Xamarin.Forms.ListView.HeaderTemplate A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if header text is displayed on a button.")] - [Step(3, "Click BACK button: Click Pass if header text is displayed on a button.")] - [Postcondition(1, "NA")] - public async Task HeaderTemplate_UILK() - { - /*TEST CODE*/ - _listView.HeaderTemplate = new DataTemplate(typeof(Button)) - { - Bindings = { - { Button.TextProperty, new Binding (".") } - } - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.Header = "This header text will apppear on a Button."; - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: HeaderTemplate", - BackgroundColor = Color.White - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper IsGroupingEnabled property.")] - [Property("SPEC", "Xamarin.Forms.ListView.IsGroupingEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if one item is displayed. (if you can't see the item, scroll down the list)")] - [Step(3, "Click BACK button: Click Pass if one item is displayed.")] - [Postcondition(1, "NA")] - public async Task IsGroupingEnabled_UILK() - { - /*TEST CODE*/ - _labelOne = new Label() - { - Text = "Grouping is disabled", - }; - - _listView.IsGroupingEnabled = false; - _listView.GroupDisplayBinding = new Binding("FirstInitial"); - _listView.GroupShortNameBinding = new Binding("FirstInitial"); - - var template = new DataTemplate(typeof(TextCell)); - template.SetBinding(TextCell.TextProperty, "FullName"); - template.SetBinding(TextCell.DetailProperty, "Address"); - - _listView.ItemTemplate = template; - _listView.ItemsSource = new object[] { - new Group ("C") { - new Person { FullName = "Caprice Nave" } - }, - new Group ("J") { - new Person { FullName = "James Smith", Address = "404 Nowhere Street" }, - }, - new Person { FullName = "James Smith", Address = "404 Nowhere Street" }, - }; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: IsGroupingEnabled", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper SelectedItem property.")] - [Property("SPEC", "Xamarin.Forms.ListView.SelectedItem A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if first item of list view is selected.")] - [Step(3, "Click BACK button: Click Pass if first item is selected.")] - [Postcondition(1, "NA")] - public async Task SelectedItem_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "The first item should be selected.", - BackgroundColor = Color.White - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children." - }; - - _listView.ItemsSource = items; - _listView.SelectedItem = items[0]; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: SelectedItem" - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - // Currently, Xamarin Forms Limitation - //[Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper SeparatorColor property.")] - [Property("SPEC", "Xamarin.Forms.ListView.SeparatorColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if separator color of list view item is green.")] - [Step(3, "Click BACK button: Click Pass if listview separator color is green.")] - [Postcondition(1, "NA")] - public async Task SeparatorColor_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "ListView Separator Color should be green.", - HeightRequest = 200, - BackgroundColor = Color.White - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children.", - "This line is the third Children.", - "This line is the fourth Children." - }; - - _listView.SeparatorVisibility = SeparatorVisibility.Default; - _listView.SeparatorColor = Color.Green; - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: SeparatorColor", - BackgroundColor = Color.Red - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - // Currently, Xamarin Forms Limitation - //[Test] - [Category("P1")] - [Description("Check whether ListView is displayed with proper SeparatorVisibility property.")] - [Property("SPEC", "Xamarin.Forms.ListView.SeparatorVisibility A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if separator is visible and separator color of list view item is green.")] - [Step(3, "Click BACK button: Click Pass if listview separator is visible.")] - [Postcondition(1, "NA")] - public async Task SeparatorVisibility_UILK() - { - /*TEST CODE*/ - _labelOne = new Label - { - Text = "ListView Separator should be visible:", - HeightRequest = 200, - BackgroundColor = Color.White - }; - - var items = new List() - { - "This line is the first Children.", - "This line is the second Children.", - "This line is the third Children.", - "This line is the fourth Children." - }; - - _listView.SeparatorVisibility = SeparatorVisibility.Default; - _listView.SeparatorColor = Color.Green; - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _labelOne, - _listView - } - }, - Title = "Test: SeparatorVisibility", - BackgroundColor = Color.Red - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether listview is scrolled to expected item.")] - [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the button to scroll to last or top.")] - [Step(3, "Click BACK button: Click Pass if scrolling is working properly.")] - [Postcondition(1, "NA")] - [Property("COVPARAM", "")] - public async Task ScrollTo_UIBH() - { - _button = new Button(); - _button.Text = "Scroll to Last"; - - var items = new List(); - for (int i = 1; i < 50; i++) - { - String text = "Sentence #" + i; - items.Add(text); - } - - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button, - _listView - } - }, - Title = "Test: ScrollTo", - BackgroundColor = Color.Gray - }; - - _button.Clicked += onScrollToItemPosition; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onScrollToItemPosition; - } - - private void onScrollToItemPosition(object sender, System.EventArgs e) - { - if (_button.Text == "Scroll to Last") - { - _button.Text = "Scroll to Top"; - _listView.ScrollTo("Sentence #49", ScrollToPosition.Start, true); - } - else - { - _button.Text = "Scroll to Last"; - _listView.ScrollTo("Sentence #1", ScrollToPosition.Start, true); - } - } - - [Test] - [Category("P1")] - [Description("Check whether listview is scrolled to expected item of expected group.")] - [Property("SPEC", "Xamarin.Forms.ListView.ScrollTo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the button to scroll to last or top of the group list.")] - [Step(3, "Click BACK button: Click Pass if scrolling is working properly.")] - [Postcondition(1, "NA")] - [Property("COVPARAM", "")] - public async Task ScrollTo_OBJECT_UIBH() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Scroll to Last"; - _labelOne = new Label() - { - Text = "Click the button to scroll to last or top of the group list.", - }; - - _listView.IsGroupingEnabled = true; - _listView.GroupDisplayBinding = new Binding("FirstInitial"); - _listView.GroupShortNameBinding = new Binding("FirstInitial"); - - var template = new DataTemplate(typeof(TextCell)); - template.SetBinding(TextCell.TextProperty, "FullName"); - template.SetBinding(TextCell.DetailProperty, "Address"); - mygroup = new[] { - new Group ("C") { - new Person { FullName = "Caprice Nave"}, - new Person { FullName = "Caprice Nave-1" }, - new Person { FullName = "Caprice Nave-2" }, - new Person { FullName = "Caprice Nave-3" }, - new Person { FullName = "Caprice Nave-4" }, - new Person { FullName = "Caprice Nave-5" }, - new Person { FullName = "Caprice Nave-6" }, - new Person { FullName = "Caprice Nave-7" }, - new Person { FullName = "Caprice Nave-8" }, - new Person { FullName = "Caprice Nave-9" }, - new Person { FullName = "Caprice Nave-10" }, - new Person { FullName = "Caprice Nave-11" }, - new Person { FullName = "Caprice Nave-12" }, - new Person { FullName = "Caprice Nave-13" } - }, - new Group ("J") { - new Person { FullName = "James Smith", Address = "404 Nowhere Street" }, - new Person { FullName = "John Doe", Address = "404 Nowhere Ave" } - }, - new Group ("F") { - new Person { FullName = "Caprice Nave"}, - new Person { FullName = "Caprice Nave-1" }, - new Person { FullName = "Caprice Nave-2" }, - new Person { FullName = "Caprice Nave-3" }, - new Person { FullName = "Caprice Nave-4" }, - new Person { FullName = "Caprice Nave-5" }, - new Person { FullName = "Caprice Nave-6" }, - new Person { FullName = "Caprice Nave-7" }, - new Person { FullName = "Caprice Nave-8" }, - new Person { FullName = "Caprice Nave-9" }, - new Person { FullName = "Caprice Nave-10" }, - new Person { FullName = "Caprice Nave-11" }, - new Person { FullName = "Caprice Nave-12" }, - new Person { FullName = "Caprice Nave-13" } - }, - new Group ("G") { - new Person { FullName = "Caprice Nave"}, - new Person { FullName = "Caprice Nave-1" }, - new Person { FullName = "Caprice Nave-2" }, - new Person { FullName = "Caprice Nave-3" }, - new Person { FullName = "Caprice Nave-4" }, - new Person { FullName = "Caprice Nave-5" }, - new Person { FullName = "Caprice Nave-6" }, - new Person { FullName = "Caprice Nave-7" }, - new Person { FullName = "Caprice Nave-8" }, - new Person { FullName = "Caprice Nave-9" }, - new Person { FullName = "Caprice Nave-10" }, - new Person { FullName = "Caprice Nave-11" }, - new Person { FullName = "Caprice Nave-12" }, - new Person { FullName = "Caprice Nave-13" } - }, - new Group ("H") { - new Person { FullName = "Caprice Nave"}, - new Person { FullName = "Caprice Nave-1" }, - new Person { FullName = "Caprice Nave-2" }, - new Person { FullName = "Caprice Nave-3" }, - new Person { FullName = "Caprice Nave-4" }, - new Person { FullName = "Caprice Nave-5" }, - new Person { FullName = "Caprice Nave-6" }, - new Person { FullName = "Caprice Nave-7" }, - new Person { FullName = "Caprice Nave-8" }, - new Person { FullName = "Caprice Nave-9" }, - new Person { FullName = "Caprice Nave-10" }, - new Person { FullName = "Caprice Nave-11" }, - new Person { FullName = "Caprice Nave-12" }, - new Person { FullName = "Caprice Nave-13" } - }, - }; - - _listView.ItemTemplate = template; - _listView.ItemsSource = mygroup; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _button, - _listView, - } - }, - Title = "Test: ScrollTo", - BackgroundColor = Color.White - }; - - _button.Clicked += onScrollToGroupPosition; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onScrollToGroupPosition; - } - - private void onScrollToGroupPosition(object sender, System.EventArgs e) - { - if (_button.Text == "Scroll to Last") - { - _button.Text = "Scroll to Top"; - var person = mygroup[4][13]; - var group = mygroup[4]; - _listView.ScrollTo(person, group, ScrollToPosition.Start, true); - } - else - { - var person = mygroup[0][1]; - var group = mygroup[0]; - _button.Text = "Scroll to Last"; - _listView.ScrollTo(person, group, ScrollToPosition.Start, true); - } - } - - [Test] - [Category("P1")] - [Description("Check whether ItemAppearing events can be invoked or not when an item appear in ListView.")] - [Property("SPEC", "Xamarin.Forms.ListView.ItemAppearing E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click BACK button: Testcase result will show PASS automatically or it's FAIL")] - [Postcondition(1, "NA")] - public async Task ItemAppearing_CHECK_EVENT() - { - /*TEST CODE*/ - var items = new List() - { - "This is children One", - "This is children Two", - "This is children Three", - }; - - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: ItemAppearing", - BackgroundColor = Color.Green - }; - - _listView.ItemAppearing += onItemAppearing; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listView.ItemAppearing -= onItemAppearing; - } - - private void onItemAppearing(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ItemSelected events can be invoked or not when an item of ListView is Selected.")] - [Property("SPEC", "Xamarin.Forms.ListView.ItemSelected E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select the Item")] - [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "NA")] - public async Task ItemSelected_CHECK_EVENT() - { - /*TEST CODE*/ - var items = new List() - { - "Tap this Text." - }; - - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: ItemSelected", - BackgroundColor = Color.Green - }; - _listView.ItemSelected += onItemSelected; - _testPage.ExecuteTC(page); - - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listView.ItemSelected -= onItemSelected; - } - - private void onItemSelected(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ItemTapped events can be invoked or not when an item of ListView is Tapped.")] - [Property("SPEC", "Xamarin.Forms.ListView.ItemTapped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Tap the Item")] - [Step(3, "Click BACK button: Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "NA")] - public async Task ItemTapped_CHECK_EVENT() - { - /*TEST CODE*/ - var items = new List() - { - "Tap this Text." - }; - - _listView.ItemsSource = items; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _listView - } - }, - Title = "Test: ItemTapped", - BackgroundColor = Color.Green - }; - _listView.ItemTapped += onItemTapped; - _testPage.ExecuteTC(page); - - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listView.ItemTapped -= onItemTapped; - } - - private void onItemTapped(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMasterDetailPage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMasterDetailPage.cs deleted file mode 100644 index 08ac9a274..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMasterDetailPage.cs +++ /dev/null @@ -1,590 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class MasterDetailPageTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private ListView _listView; - private Label _detail, _header; - private static Button _button; - private static Boolean isBackPressCheck, appearingCheck, isParentSet; - private CustomMasterDetailPage _masterpage; - - public class CustomMasterDetailPage : MasterDetailPage - { - protected override bool OnBackButtonPressed() - { - if (isBackPressCheck) - { - Assert.True(true); - ManualTest.Confirm(); - } - return base.OnBackButtonPressed(); - } - - protected override void OnAppearing() - { - if (appearingCheck) - { - Assert.True(true); - ManualTest.Confirm(); - } - base.OnAppearing(); - } - - protected override void OnDisappearing() - { - if (appearingCheck) - { - Assert.True(true); - ManualTest.Confirm(); - } - base.OnDisappearing(); - } - - protected override void OnParentSet() - { - if (isParentSet) - { - Assert.True(true); - ManualTest.Confirm(); - } - base.OnParentSet(); - } - } - - private void CreateMasterPage(CustomMasterDetailPage masterPage) - { - _header = new Label - { - Text = "MasterDetailPage", - FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), - HorizontalOptions = LayoutOptions.Center - }; - - _detail = new Label - { - Text = "Detail Page", - FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), - HorizontalOptions = LayoutOptions.Center - }; - - string[] pageDetailArray = - { - "Page 1", "Page 2", "Page 3", "Page 4" - }; - _listView = new ListView - { - ItemsSource = pageDetailArray - }; - - masterPage.Master = new ContentPage - { - Title = _header.Text, - Content = new StackLayout - { - Children = - { - _header, - _listView - } - } - }; - masterPage.Detail = new ContentPage { Content = _detail }; - _listView.ItemSelected += (sender, arg) => - { - _detail.Text = arg.SelectedItem.ToString(); - }; - _navigationPage.PushAsync(masterPage); - } - - [SetUp] - public void Setup() - { - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - _masterpage = new CustomMasterDetailPage(); - Console.WriteLine("MasterDetailPageTests --------------- Setup()"); - } - else - { - Console.WriteLine("Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - if (_masterpage != null) - { - _masterpage.IsGestureEnabled = true; - _masterpage = null; - } - Console.WriteLine("MasterDetailPageTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage.BackgroundColor is displayed properly?")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the button to change BackgroundColor accordingly.")] - [Step(3, "Click BACK button: Click Pass if MasterDetailPage BackgroundColor is changed accordingly.")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_UILK() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Red"; - _masterpage = new CustomMasterDetailPage(); - - CreateMasterPage(_masterpage); - - _masterpage.BackgroundColor = Color.Green; - _detail.Text = "Click the button to change Background Color."; - _masterpage.Detail = new ContentPage - { - Title = "Test: BackgroundColor", - Content = new StackLayout - { - Children = - { - _detail, - _button - } - } - }; - - _button.Clicked += onRedOrGreen; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button.Clicked -= onRedOrGreen; - } - - private void onRedOrGreen(object sender, System.EventArgs e) - { - if (_button.Text == "Red") - { - _masterpage.BackgroundColor = Color.Red; - _button.Text = "Green"; - } - else - { - _masterpage.BackgroundColor = Color.Green; - _button.Text = "Red"; - } - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper Opacity property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Move the slider position to check if MasterDetailPage Opacity is changing.")] - [Step(3, "Click BACK button: Click Pass if Opacity changes accordingly.")] - [Postcondition(1, "NA")] - public async Task Opacity_UIBH() - { - /*TEST CODE*/ - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - _masterpage = new CustomMasterDetailPage(); - - CreateMasterPage(_masterpage); - - _masterpage.BackgroundColor = Color.Green; - _detail.Text = "Move the slider position to change page Opacity."; - _masterpage.Detail = new ContentPage - { - Title = "Test: Opacity", - Content = new StackLayout - { - Children = - { - _detail, - sliderOpacity - } - } - }; - - _masterpage.BindingContext = sliderOpacity; - _masterpage.SetBinding(MasterDetailPage.OpacityProperty, "Value"); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage visibility is changed properly.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the Button to change visibility.")] - [Step(3, "Click BACK button: Click Pass if the page disappear.")] - [Postcondition(1, "NA")] - public async Task IsVisible_UIBH() - { - /*TEST CODE*/ - _button = new Button(); - _button.Text = "Hide"; - _masterpage = new CustomMasterDetailPage(); - - CreateMasterPage(_masterpage); - - _masterpage.BackgroundColor = Color.Green; - _detail.Text = "Click the button."; - _masterpage.Detail = new ContentPage - { - Title = "Test: IsVisible", - Content = new StackLayout - { - Children = - { - _detail, - _button - } - } - }; - - _button.Clicked += (sender, e) => - { - _masterpage.IsVisible = false; - }; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper Detail property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Detail A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if a line of text is visible.")] - [Step(3, "Click BACK button: Click Pass if a line is visible.")] - [Postcondition(1, "NA")] - public async Task Detail_UILK() - { - /*TEST CODE*/ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - _detail.Text = "This line should be visible."; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper IsGestureEnabled property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsGestureEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if a bar should be visible at left to view page list as the gesture is not enabled.")] - [Step(3, "Click BACK button: Click Pass if gesture is not enabled.")] - [Postcondition(1, "NA")] - public async Task IsGestureEnabled_UIBH() - { - if (Device.Idiom == TargetIdiom.TV || Device.Idiom == TargetIdiom.Phone) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - /*TEST CODE*/ - _masterpage = new CustomMasterDetailPage(); - _masterpage.IsGestureEnabled = false; - CreateMasterPage(_masterpage); - _detail.Text = "Gesture is disabled.So a bar should be visible at left to view page list."; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper IsPresented property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresented A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if by default the page list is opened.")] - [Step(3, "Click BACK button: Click Pass if by default page list is opened.")] - [Postcondition(1, "NA")] - public async Task IsPresented_UIBH() - { - /*TEST CODE*/ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - masterPage.IsPresented = true; - CreateMasterPage(masterPage); - _detail.Text = "By default the page list should be opened."; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper Master property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.Master A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check the master page menu (swipe from left to right to see page list at left side of the page).")] - [Step(3, "Click BACK button: Click Pass if a new master page is visible (Titled: NEW MASTER page)")] - [Postcondition(1, "NA")] - public async Task Master_UILK() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - /*TEST CODE*/ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - _detail.Text = "Swipe from left to right to see page list."; - - string[] pageDetailArray = - { - "New Page 1", "New Page 2", "New Page 3", "New Page 4" - }; - - _listView.ItemsSource = pageDetailArray; - _header.Text = "NEW MASTER page"; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MasterDetailPage is displayed with proper MasterBehavior property.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.MasterBehavior A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Swipe the screen from left to right.")] - [Step(3, "Click BACK button: Click Pass if master page popover.")] - [Postcondition(1, "NA")] - public async Task MasterBehavior_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /*TEST CODE*/ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - masterPage.MasterBehavior = MasterBehavior.Popover; - _detail.Text = "Swipe the screen from left to right."; - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether OnAppearing is raised when a detail appears.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnAppearing M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(3, "Testcase result will show PASS or mark FAIL.")] - [Postcondition(1, "NA")] - public async Task OnAppearing_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /* TEST CODE */ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - _detail.Text = "Press back button."; - appearingCheck = true; - - await ManualTest.WaitForConfirm(); - appearingCheck = false; - } - - [Test] - [Category("P1")] - [Description("Check whether OnBackButtonPressed is raised when the back button is pressed or not.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnBackButtonPressed M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(3, "Testcase result will show PASS of FAIL automatically")] - [Postcondition(1, "NA")] - public async Task OnBackButtonPressed_UIBH() - { - /* TEST CODE */ - isBackPressCheck = true; - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - - await ManualTest.WaitForConfirm(); - isBackPressCheck = false; - - /* - * POSTCONDITION - * Remove event handler - */ - _listView.ItemSelected -= (sender, arg) => - { - _detail.Text = arg.SelectedItem.ToString(); - }; - } - - [Test] - [Category("P1")] - [Description("Check whether OnDisappearing is raised when a detail disappears.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnDisappearing M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(3, "Testcase result will show PASS or mark FAIL.")] - [Postcondition(1, "NA")] - public async Task OnDisappearing_UIBH() - { - /* TEST CODE */ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - _detail.Text = "Press back button."; - appearingCheck = true; - - await ManualTest.WaitForConfirm(); - appearingCheck = false; ; - } - - [Test] - [Category("P1")] - [Description("Check whether OnParentSet is raised when Parent property is set.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.OnParentSet M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(3, "Testcase result will show PASS or mark FAIL.")] - [Postcondition(1, "NA")] - public async Task OnParentSet_UIBH() - { - /* TEST CODE */ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - _detail.Text = "Press back button."; - masterPage.Parent = _navigationPage; - isParentSet = true; - - await ManualTest.WaitForConfirm(); - isParentSet = false; - } - - [Test] - [Category("P1")] - [Description("Check whether IsPresentedChanged is raised when IsPresent property of master is changed.")] - [Property("SPEC", "Xamarin.Forms.MasterDetailPage.IsPresentedChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Swipe left to right to view page list. And then press BACK Button")] - [Step(3, "Testcase result will show PASS automatically or otherwise it's FAIL")] - [Postcondition(1, "NA")] - public async Task IsPresentedChanged_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - /* TEST CODE */ - CustomMasterDetailPage masterPage = new CustomMasterDetailPage(); - CreateMasterPage(masterPage); - masterPage.IsPresented = false; - _detail.Text = "Swipe left to right to view page list."; - - masterPage.IsPresentedChanged += onMasterPresented; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - masterPage.IsPresentedChanged -= onMasterPresented; - } - - private void onMasterPresented(object sender, System.EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMenuItem.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMenuItem.cs deleted file mode 100755 index 2403895df..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMenuItem.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using XamarinApplication.Tizen; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class MenuItemTests - { - private static NavigationPage _mainPage = (NavigationPage)Program.GetApp().MainPage; - private static TestPage _testPage = TestPage.GetInstance(); - private static string _file = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/click.jpg"; - - //Create a class that inherit ToolbarItem to test Clicked event and OnClicked of MenuItem. - //Because ToolbarItem inherit MenuItem. - class SubToolbarItem : ToolbarItem - { - public bool FlagOnClicked { get; set; } - - protected override void OnClicked() - { - FlagOnClicked = true; - ManualTest.Confirm(); - base.OnClicked(); - } - } - - private void CreateLayout() - { - var page = new ContentPage(); - ListView listview = new ListView(); - listview.ItemTemplate = new DataTemplate(() => - { - var _menuItemI = new MenuItem { Text = "MenuI" }; - _menuItemI.SetBinding(MenuItem.CommandParameterProperty, new Binding(".")); - _menuItemI.Clicked += (sender, args) => - { - ManualTest.Confirm(); - }; - var _menuItemII = new MenuItem { Text = "MenuII" }; - _menuItemII.SetBinding(MenuItem.CommandParameterProperty, new Binding(".")); - var _customCell = new ViewCell(); - _customCell.ContextActions.Add(_menuItemI); - _customCell.ContextActions.Add(_menuItemII); - _customCell.View = new Label { Text = "List Item" }; - - return _customCell; - }); - List listData = new List(); - listData.Add("TestItem1"); - listData.Add("TestItem2"); - listData.Add("TestItem3"); - listview.ItemsSource = listData; - page.Content = listview; - _mainPage.PushAsync(page); - } - - [SetUp] - public void SetUp() - { - Console.WriteLine("MenuItemTests --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("MenuItemTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check whether Clicked event is invoked when click on MenuItem or not.")] - [Property("SPEC", "Xamarin.Forms.MenuItem.Clicked E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on Toolbar Button (Top-Right of Screen)")] - [Postcondition(1, "Back to TestPage")] - [Postcondition(2, "Test result will show PASS or FAIL automatically")] - public async Task Clicked_EVENT_CHECK() - { - if (Device.Idiom == TargetIdiom.Phone) - { - /* Precondition: ToolbarItem inherit MenuItem. Can test Clicked event by ToolbarItem - - Create new page have a ToolbarItem - */ - ToolbarItem toolbarItem = new ToolbarItem(); - //toolbarItem.Text = "Click Me!"; - var fileImageSource = new FileImageSource() - { - File = _file, - }; - toolbarItem.Icon = fileImageSource; - ContentPage testPage = new ContentPage() - { - Title = "Test: OnClicked" - }; - testPage.ToolbarItems.Add(toolbarItem); - var label = new Label() { Text = "Click on Image of Toolbar Button (Top-Right of Screen)" }; - testPage.Content = label; - await _mainPage.PushAsync(testPage); - /* TESTCODE */ - //CreateLayout(); - toolbarItem.Clicked += (sender, args) => - { - ManualTest.Confirm(); - label.Text = "Back to test page"; - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - toolbarItem.Clicked -= (sender, args) => - { - }; - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Check whether OnClicked is invoked when click on MenuItem or not.")] - [Property("SPEC", "Xamarin.Forms.MenuItem.OnClicked M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limi tation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on Toolbar Button (Top-Right of Screen)")] - [Postcondition(1, "Back to TestPage")] - public async Task OnClicked_CHECK() - { - if (Device.Idiom == TargetIdiom.Phone) - { - /* Precondition: ToolbarItem inherit MenuItem. Can test Clicked event by ToolbarItem - - Create new page have a ToolbarItem - */ - SubToolbarItem toolbarItem = new SubToolbarItem(); - //toolbarItem.Text = "Click Me!"; - var fileImageSource = new FileImageSource() - { - File = _file, - }; - toolbarItem.Icon = fileImageSource; - ContentPage testPage = new ContentPage() - { - Title = "Test: OnClicked" - }; - testPage.ToolbarItems.Add(toolbarItem); - var label = new Label() { Text = "Click on Toolbar Button (Top-Right of Screen)\n After press back button" }; - testPage.Content = label; - await _mainPage.PushAsync(testPage); - - /* TESTCODE */ - toolbarItem.FlagOnClicked = false; - await ManualTest.WaitForConfirm(); - Assert.IsTrue(toolbarItem.FlagOnClicked, "OnClicked is not invoked"); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMultiPageTemplate.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMultiPageTemplate.cs deleted file mode 100755 index bd6c0457b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSMultiPageTemplate.cs +++ /dev/null @@ -1,848 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; -using System.Threading.Tasks; -using System.Runtime.CompilerServices; -using XamarinApplication.Tizen; -using System.Collections.Specialized; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class MultiPageTemplateTests - { - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static TestPage _testPage = TestPage.GetInstance(); - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - class CustomizeMultiPage : TabbedPage - { - public bool _tcOnBackButtonPressed = false; - public bool flagOnBackButtonPressed = false; - public bool _tcOnCurrentPageChanged = false; - public bool _flagOnCurrentPageChanged = false; - public bool _tcOnPropertyChanged = false; - public bool _flagOnPropertyChanged = false; - public bool _tcOnPagesChanged = false; - public bool _flagOnPagesChanged = false; - public bool _tcOnChildAdded = false; - public bool _flagOnChildAdded = false; - - public CustomizeMultiPage() : base() - { - this.ItemsSource = new NamedColor[] { - new NamedColor ("Red", Color.Red), - new NamedColor ("Yellow", Color.Yellow), - new NamedColor ("Green", Color.Green), - new NamedColor ("Aqua", Color.Aqua), - new NamedColor ("Blue", Color.Blue), - new NamedColor ("Purple", Color.Purple) - }; - this.ItemTemplate = new DataTemplate(() => - { - return new NamedColorPage(); - }); - } - - protected override bool OnBackButtonPressed() - { - if (_tcOnBackButtonPressed) - { - flagOnBackButtonPressed = true; - ManualTest.Confirm(); - } - return base.OnBackButtonPressed(); - } - - protected override void OnCurrentPageChanged() - { - if (_tcOnCurrentPageChanged) - { - _flagOnCurrentPageChanged = true; - ManualTest.Confirm(); - } - base.OnCurrentPageChanged(); - } - - protected override void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - if (_tcOnPropertyChanged) - { - _flagOnPropertyChanged = true; - ManualTest.Confirm(); - } - base.OnPropertyChanged(propertyName); - } - - protected override async void OnPagesChanged(NotifyCollectionChangedEventArgs e) - { - if (_tcOnPagesChanged) - { - _flagOnPagesChanged = true; - ManualTest.Confirm(); - await _navigationPage.PopAsync(); - } - base.OnPagesChanged(e); - } - - protected override async void OnChildAdded(Element child) - { - if (_tcOnChildAdded) - { - _flagOnChildAdded = true; - ManualTest.Confirm(); - await _navigationPage.PopAsync(); - } - base.OnChildAdded(child); - } - } - - // Data type: - class NamedColor - { - public NamedColor(string name, Color color) - { - this.Name = name; - this.Color = color; - } - - public string Name { private set; get; } - - public Color Color { private set; get; } - - public override string ToString() - { - return Name; - } - } - - // Format page - class NamedColorPage : ContentPage - { - public NamedColorPage() - { - // This binding is necessary to label the tabs in - // the TabbedPage. - this.SetBinding(ContentPage.TitleProperty, "Name"); - // BoxView to show the color. - BoxView boxView = new BoxView - { - WidthRequest = 100, - HeightRequest = 100, - HorizontalOptions = LayoutOptions.Center - }; - boxView.SetBinding(BoxView.ColorProperty, "Color"); - - // Build the page - this.Content = boxView; - } - } - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Setup---------------------------------"); - if (ManualTest.IsWearable()) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "MultiPage CLASS: Teardown---------------------------------"); - } - - [Test] - [Category("P1")] - [Description("Check whether CurrentPage has been displayed or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.CurrentPage A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click the second's tab with Page2 text")] - [Step(3, "Press Back Button")] - [Step(4, "Testcase result will show PASS automatically otherwise FAIL")] - [Postcondition(1, "Back to TestPage")] - public async Task CurrentPage_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var btnAdd = new Button - { - Text = "Change Page", - BackgroundColor = Color.Blue, - WidthRequest = 200, - HeightRequest = 100, - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - new Label - { - Text = "This is a Label on Page1" - } - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - page2.Appearing += (s, o) => - { - ManualTest.Confirm(); - }; - btnAdd.Clicked += (s, o) => - { - multiPage.CurrentPage = page2; - }; - //myMultiPage.ItemsSource = new[] { cPage }; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether SelectedItem property is changed or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.SelectedItem A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press Back Button")] - [Step(3, "Pass If Page2 has been displayed otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SelectedItem_MultiPage_UILK() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - multiPage.SelectedItem = page2; - - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ItemsSource property is displayed or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.ItemsSource A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press Back Button")] - [Step(3, "Pass If Page has been displayed with 6 Color Names otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task ItemsSource_MultiPage_UILK() - { - var multiPage = new CustomizeMultiPage(); - - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ItemTemplate property is displayed or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.ItemTemplate A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press all color tab")] - [Step(3, "Press Back Button")] - [Step(4, "Pass If color tab has been displayed with corresponding color box otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task ItemTemplate_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether CurrentPageChanged event has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.CurrentPageChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Page2' Tab")] - [Step(3, "Press Back Button")] - [Step(4, "Testcase result will show PASS automatically otherwise FAIL")] - [Postcondition(1, "Back to TestPage")] - public async Task CurrentPageChanged_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - multiPage.CurrentPageChanged += (s, o) => - { - ManualTest.Confirm(); - }; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether PagesChanged event has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.PagesChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press 'Add Page' button")] - [Step(3, "If PagesChanged event invoked Testcase result will show PASS automatically otherwise FAIL")] - [Postcondition(1, "Back to TestPage")] - public async Task PagesChanged_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var btnAdd = new Button - { - Text = "Add Page", - BackgroundColor = Color.Blue, - WidthRequest = 200, - HeightRequest = 100, - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - multiPage.Children.Add(page1); - //multiPage.Children.Add(page2); - - multiPage.PagesChanged += async (s, o) => - { - Assert.True(true); - ManualTest.Confirm(); - await _navigationPage.PopAsync(); - }; - btnAdd.Clicked += (s, o) => - { - //multiPage.CurrentPage = page2; - multiPage.Children.Add(page2); - //multiPage.Children.Remove(page2); - }; - - await _navigationPage.PushAsync(multiPage); - //_testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether OnCurrentPageChanged method has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.OnCurrentPageChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Page2' Tab")] - [Step(3, "Press Back Button")] - [Step(4, "Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnCurrentPageChanged_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage._flagOnCurrentPageChanged = false; - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - multiPage._tcOnCurrentPageChanged = true; - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - Assert.IsTrue(multiPage._flagOnCurrentPageChanged, "OnCurrentPageChanged is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether OnChildAdded method has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.OnChildAdded M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Add Child' Button")] - [Step(3, "If OnChildAdded method invoked Testcase result will show PASS automatically otherwise FAIL")] - [Postcondition(1, "Back to TestPage")] - public async Task OnChildAdded_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage._flagOnChildAdded = false; - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var btnAdd = new Button - { - Text = "Add Child", - BackgroundColor = Color.Blue, - WidthRequest = 200, - HeightRequest = 100, - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - btnAdd.Clicked += (s, o) => - { - //multiPage.SelectedItem = page2; - multiPage.Children.Add(page2); - //multiPage.Children.Remove(page2); - }; - multiPage.Children.Add(page1); - //multiPage.Children.Add(page2); - - multiPage._tcOnChildAdded = true; - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - Assert.IsTrue(multiPage._flagOnChildAdded, "OnChildAdded is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether OnPagesChanged method has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.OnPagesChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Add Page' button")] - [Step(3, "If OnPagesChanged method invoked Testcase result will show PASS automatically otherwise FAIL")] - [Postcondition(1, "Back to TestPage")] - public async Task OnPagesChanged_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage._flagOnPagesChanged = false; - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - - var btnAdd = new Button - { - Text = "Add Page", - BackgroundColor = Color.Blue, - WidthRequest = 200, - HeightRequest = 100, - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - btnAdd.Clicked += (s, o) => - { - //multiPage.SelectedItem = page2; - multiPage.Children.Add(page2); - //multiPage.Children.Remove(page2); - }; - multiPage.Children.Add(page1); - //multiPage.Children.Add(page2); - - multiPage._tcOnPagesChanged = true; - await _navigationPage.PushAsync(multiPage); - await ManualTest.WaitForConfirm(); - Assert.IsTrue(multiPage._flagOnPagesChanged, "OnPagesChanged is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether OnPropertyChanged method has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.OnPropertyChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press 'Page2' Tab")] - [Step(3, "Press Back Button")] - [Step(4, "Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnPropertyChanged_MultiPage_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - await _navigationPage.PushAsync(multiPage); - multiPage._tcOnPropertyChanged = true; - multiPage._flagOnPropertyChanged = false; - await ManualTest.WaitForConfirm(); - Assert.IsTrue(multiPage._flagOnPropertyChanged, "OnPropertyChanged is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check override method OnBackButtonPressed is invoked.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.OnBackButtonPressed M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(3, "Select each color tab")] - [Postcondition(1, "Back to TestPage")] - [Postcondition(2, "Test result will show PASS or FAIL automatically")] - public async Task OnBackButtonPressed_OVERRIDE_METHOD() - { - CustomizeMultiPage customMultiPage = new CustomizeMultiPage(); - customMultiPage._tcOnBackButtonPressed = true; - await _navigationPage.PushAsync(customMultiPage); - customMultiPage.flagOnBackButtonPressed = false; - await ManualTest.WaitForConfirm(); - Assert.IsTrue(customMultiPage.flagOnBackButtonPressed, "OnBackButtonPressed is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether Appearing event has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.Appearing E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click back button")] - [Step(3, "If Appearing event fire the TC will pass autometically, fail otherwise")] - [Postcondition(1, "N/A")] - public async Task Appearing_UIBH() - { - /* TEST CODE */ - CustomizeMultiPage multiPage = new CustomizeMultiPage(); - multiPage.Title = "Appearing Test"; - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - multiPage.Appearing += (sender, e) => - { - Assert.IsTrue(true); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Disappearing event has been evoked or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.Disappearing E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click back button")] - [Step(3, "If Disappearing event fire the TC will pass autometically, fail otherwise")] - [Postcondition(1, "N/A")] - public async Task Disappearing_UIBH() - { - /* TEST CODE */ - CustomizeMultiPage multiPage = new CustomizeMultiPage(); - multiPage.Title = "Disappearing Test"; - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - var page1 = new ContentPage(); - page1.Title = "Page1"; - var page2 = new ContentPage(); - page2.Title = "Page2"; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - multiPage.Disappearing += (sender, e) => - { - Assert.IsTrue(true); - ManualTest.Confirm(); - }; - - _testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Title can set or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.Title A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change Title button")] - [Step(3, "Click Pass if Title is changed, vice versa")] - [Postcondition(1, "Click back button")] - public async Task Title_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - multiPage.Title = "Title"; - - var btnAdd = new Button - { - Text = "Change Title", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - btnAdd.Clicked += (s, o) => - { - multiPage.Title = "Title Changed"; - }; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - _testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether BackgroundColor can set or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click Change BackgroundColor button")] - [Step(3, "Click Pass if BackgroundColor is changed, vice versa")] - [Postcondition(1, "Click back button")] - public async Task BackgroundColor_UIBH() - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - multiPage.BackgroundColor = Color.Green; - - var btnAdd = new Button - { - Text = "Change BackgroundColor", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - btnAdd.Clicked += (s, o) => - { - multiPage.BackgroundColor = Color.Yellow; - }; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - _testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether ToolbarItems can set or not.")] - [Property("SPEC", "Xamarin.Forms.MultiPage.ToolbarItems A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click Add ToolbarItems button")] - [Step(3, "Click Pass if ToolbarItems is added, vice versa")] - [Postcondition(1, "Click back button")] - public async Task ToolbarItems_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - var multiPage = new CustomizeMultiPage(); - multiPage.ItemsSource = null; - multiPage.ItemTemplate = null; - var btnAdd = new Button - { - Text = "Add ToolbarItems", - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand - }; - var stackLayout = new StackLayout - { - VerticalOptions = LayoutOptions.EndAndExpand, - Children = - { - btnAdd - } - }; - - var page1 = new ContentPage(); - page1.Title = "Page1"; - page1.Content = stackLayout; - var page2 = new ContentPage(); - page2.Title = "Page2"; - - btnAdd.Clicked += (s, o) => - { - multiPage.ToolbarItems.Add(new ToolbarItem - { - Icon = _appResourcePath + "icon/settings_restart.png", - Name = "Restart", - Command = new Command(() => { }), - Order = ToolbarItemOrder.Primary - } - ); - - multiPage.ToolbarItems.Add(new ToolbarItem - { - Icon = _appResourcePath + "icon/settings_date_and_time.png", - Name = "Settings", - Command = new Command(() => { }), - Order = ToolbarItemOrder.Secondary - } - ); - }; - multiPage.Children.Add(page1); - multiPage.Children.Add(page2); - - _testPage.ExecuteTC(multiPage); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSNavigationPage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSNavigationPage.cs deleted file mode 100755 index 83727598e..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSNavigationPage.cs +++ /dev/null @@ -1,1419 +0,0 @@ -/* - * 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; -using System; -using System.Threading.Tasks; -using WT = WearableTemplate; - -using Common = NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.NavigationPage test")] - public class NavigationPageTests - { - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static TestPage _testPage = TestPage.GetInstance(); - private static NavigationPage _navigationpage; - private static StackLayout imageGray; - private static StackLayout imageRed; - private static StackLayout imageGreen; - - public class CustomNavigationPage : NavigationPage - { - public bool _flagOnBackButtonPressed; - - public CustomNavigationPage() - { - this.Title = "<= Press This Back Button"; - this.BarTextColor = Color.Red; - } - - public CustomNavigationPage(Page page) : base(page) - { - //base(page); - this.Title = "<= Press This Back Button"; - this.BarTextColor = Color.Red; - } - - protected override bool OnBackButtonPressed() - { - _flagOnBackButtonPressed = true; - ManualTest.Confirm(); - return base.OnBackButtonPressed(); - } - } - - [SetUp] - public void SetUp() - { - Console.WriteLine("NavigationPageTests --------------- SetUp()"); - if (ManualTest.IsWearable()) - { - _navigationPage = WT.TestPage.GetInstance().getNavigationPage(); - } - else - { - _navigationPage = Common.TestPage.GetInstance().getNavigationPage(); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("NavigationPageTests --------------- TearDown()"); - } - - private void CreateNavigationPage() - { - imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - var page = new ContentPage - { - Content = mainUI, - }; - - _navigationpage = new NavigationPage(page) - { - Title = "Press This Back Button" - }; - - _testPage.ExecuteTC(_navigationpage); - } - - [Test] - [Category("P1")] - [Description("Check whether OnBackButtonPressed event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.OnBackButtonPressed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press back button")] - [Step(2, "Testcase result will show PASS of FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnBackButtonPressed_EVENT() - { - /* TEST CODE */ - CustomNavigationPage navigationPage = new CustomNavigationPage(new ContentPage()); - //NavigationPage navigationPage = new NavigationPage(new Page()); - //await navigationPage.PushAsync(new ContentPage()); - await _navigationPage.PushAsync(navigationPage); - navigationPage._flagOnBackButtonPressed = false; - await ManualTest.WaitForConfirm(); - Assert.IsTrue(navigationPage._flagOnBackButtonPressed, "OnBackButtonPressed is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether BarBackgroundColor property is changed or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.BarBackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BarBackgroundColor of NavigationPage is changed")] - [Step(3, "Pass If BackgroundColor of NavigationPage changed otherwise Fail")] - [Postcondition(1, "NA")] - public async Task BarBackgroundColor_NavigationPage_UIBH() - { - if (Device.Idiom == TargetIdiom.Unsupported) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - CreateNavigationPage(); - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _navigationPage.BarBackgroundColor = Color.Red; - _navigationPage.Title = "RED"; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _navigationPage.BarBackgroundColor = Color.Green; - _navigationPage.Title = "GREEN"; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += (s, e) => - { - _navigationPage.BarBackgroundColor = Color.Gray; - _navigationPage.Title = "GRAY"; - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - _navigationPage.BarBackgroundColor = Color.Default; - - NavigationPage.SetHasNavigationBar(_navigationPage, false); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether BarTextColor property is changed or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.BarTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BarTextColor of NavigationPage is changed")] - [Step(3, "Pass If BarTextColor of NavigationPage changed otherwise Fail")] - [Postcondition(1, "NA")] - public async Task BarTextColor_NavigationPage_UIBH() - { - CreateNavigationPage(); - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _navigationPage.Title = "RED"; - _navigationPage.BarTextColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _navigationPage.Title = "GREEN"; - _navigationPage.BarTextColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _navigationPage.Title = "GRAY"; - _navigationPage.BarTextColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - await ManualTest.WaitForConfirm(); - } - - // Need to FIX - // [Test] - [Category("P1")] - [Description("Check whether SetBackButtonTitle property is set or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.SetBackButtonTitle M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check whether SetBackButtonTitle property is set to '*' or not")] - [Step(3, "Pass If Back Button Title is * otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SetBackButtonTitle_NavigationPage_UIBL() - { - /* TEST CODE */ - var page = new ContentPage(); - - var value = "*"; - NavigationPage.SetBackButtonTitle(page, value); - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether BackButton has been displayed or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasBackButton M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Select BackButton true and false then observe Back Button has been displayed and hidden")] - [Step(3, "Pass If Back Button display changed otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SetHasBackButton_NavigationPage_UIBH() - { - /* TEST CODE */ - if (Device.Idiom == TargetIdiom.Phone) - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "BackButton SHOW", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - imageGray = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "BackButton HIDE", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGray - } - } - } - }; - - var page = new ContentPage - { - Content = mainUI, - }; - NavigationPage.SetHasBackButton(page, true); - - _testPage.ExecuteTC(page); - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - NavigationPage.SetHasBackButton(page, true); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - NavigationPage.SetHasBackButton(page, false); - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Check whether SetHasNavigationBar property is changed or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.SetHasNavigationBar M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select Navigation Bar true and false then observe Navigation Bar has been displayed and hidden")] - [Step(3, "Pass If Navigation Bar display changed otherwise Fail")] - [Postcondition(1, "NA")] - public async Task SetHasNavigationBar_NavigationPage_UIBH() - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "NavigationBar SHOW", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - imageGray = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "NavigationBar HIDE", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGray - } - } - } - }; - - var page = new ContentPage - { - Content = mainUI, - }; - NavigationPage.SetHasNavigationBar(page, true); - - _testPage.ExecuteTC(page); - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - NavigationPage.SetHasNavigationBar(page, true); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - NavigationPage.SetHasNavigationBar(page, false); - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - await ManualTest.WaitForConfirm(); - } - - //[Test] - [Category("P1")] - [Description("Check whether SetTitleIcon property is set or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.SetTitleIcon M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check whether Title Icon is displayed or not")] - [Step(3, "Pass If Title Icon Title is displayed otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SetTitleIcon_NavigationPage_UIBL() - { - /* TEST CODE */ - var value1 = new FileImageSource(); - var file1 = "../shared/res/Tizen.XamarinForms.Manual.Tests.png"; - value1.File = file1; - - var page = new ContentPage(); - NavigationPage.SetTitleIcon(page, value1); - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether a page is presented or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")] - [Step(4, "Click on 'Press This Back Button'")] - [Step(5, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PushAsync_NavigationPage_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage); - - var page2 = new ContentPage - { - Title = "Page 2", - //Content = imageGreen - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - // [Test] UX guilde will be fixed, then add it. - [Category("P1")] - [Description("Check whether a page is presented with animation or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PushAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed with animation or not")] - [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")] - [Step(4, "Click on 'Press This Back Button'")] - [Step(5, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PushAsync_NavigationPage_WITH_ANIMATION_UIBH() - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Button() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >> Without Animation", - //HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - }, - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed, - BackgroundColor = Color.Red - }); - navigationPage.Title = "Press This Back Button"; - - await _navigationPage.PushAsync(navigationPage, true); - - var page2 = new ContentPage - { - Title = "Page 2", - //Content = imageGreen - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2, true); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether top page is removed or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Back To Page1' observe Page1 is displayed or not")] - [Step(4, "Click on 'Press This Back Button'")] - [Step(5, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PopAsync_NavigationPage_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGreen = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "<< Back To Page1", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage); - - var page2 = new ContentPage - { - Title = "Page 2", - Content = imageGreen - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - await navigationPage.PopAsync(); - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - // [Test] UX guilde will be fixed, then add it. - [Category("P1")] - [Description("Check whether top page is removed with animation or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PopAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Back To Page1' observe Page1 is displayed with animation or not")] - [Step(4, "Click on 'Press This Back Button'")] - [Step(5, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PopAsync_NavigationPage_WITH_ANIMATION_UIBH() - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGreen = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "<< Back To Page1", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage, true); - - var page2 = new ContentPage - { - Title = "Page 2", - Content = imageGreen - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2, true); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - await navigationPage.PopAsync(true); - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether all page is removed except root page or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")] - [Step(4, "Click on 'Back To Page1' observe Page1 is displayed or not")] - [Step(5, "Click on 'Press This Back Button'")] - [Step(6, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PopToRootAsync_NavigationPage_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - _navigationPage.BarBackgroundColor = Color.Default; - _navigationPage.BarTextColor = Color.Default; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - }; - var imageBlue = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - }; - var imageGreen = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage); - - var page2 = new ContentPage - { - Title = "Page 2", - Content = imageBlue - }; - var page3 = new ContentPage - { - Title = "Page 3", - Content = imageGreen - }; - - var button1 = new Button - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - }; - button1.Clicked += async (s, e) => - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.Children.Add(button1); - - var button2 = new Button - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page3 >>", - BackgroundColor = Color.Black, - }; - button2.Clicked += async (s, e) => - { - await navigationPage.PushAsync(page3); - await Task.Delay(2000); - }; - imageBlue.Children.Add(button2); - - var button3 = new Button - { - VerticalOptions = LayoutOptions.Center, - Text = "<< Back To Page1", - BackgroundColor = Color.Black, - }; - button3.Clicked += async (s, e) => - { - await navigationPage.PopToRootAsync(); - await Task.Delay(2000); - }; - imageGreen.Children.Add(button3); - - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - //[Test] UX guilde will be fixed, then add it. - [Category("P1")] - [Description("Check whether all page is removed except root page with animation or not.")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PopToRootAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")] - [Step(4, "Click on 'Back To Page1' observe Page1 is displayed with animation or not")] - [Step(5, "Click on 'Press This Back Button'")] - [Step(6, "Pass If Everything goes well otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PopToRootAsync_NavigationPage_WITH_ANIMATION_UIBH() - { - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - var imageBlue = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page3 >>", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - var imageGreen = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "<< Back To Page1", - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage); - - var page2 = new ContentPage - { - Title = "Page 2", - Content = imageBlue - }; - var page3 = new ContentPage - { - Title = "Page 3", - Content = imageGreen - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2, true); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerBlue = new TapGestureRecognizer(); - tapGestureRecognizerBlue.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page3, true); - await Task.Delay(2000); - }; - imageBlue.GestureRecognizers.Add(tapGestureRecognizerBlue); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - await navigationPage.PopToRootAsync(true); - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - await ManualTest.WaitForConfirm(); - } - - private static void OnPushed(object sender, EventArgs e) - { - // If your test is fail, you should set Assert.True(false , "msg"); - Assert.True(true); - // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code. - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Pushed event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.Pushed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Press This Back Button' observe Page1 is displayed or not")] - [Step(4, "Click on 'Press This Back Button'")] - [Step(5, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Pushed_NavigationPage_EVENT() - { - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.CenterAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 400, - BackgroundColor = Color.White, - - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "Go To Page2 >>", - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalTextAlignment = TextAlignment.Center, - //Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - NavigationPage navigationPage = new NavigationPage(new ContentPage - { - Title = "Page 1", - Content = imageRed - }); - navigationPage.Title = "Press This Back Button"; - await _navigationPage.PushAsync(navigationPage); - - var page2 = new ContentPage - { - Title = "Page 2", - //Content = imageGreen - }; - - navigationPage.Pushed += OnPushed; - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - await ManualTest.WaitForConfirm(); - navigationPage.Pushed -= OnPushed; - } - - [Test] - [Category("P1")] - [Description("Check whether Popped event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.Popped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on '< - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - navigationPage.Popped += OnPushed; - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - await navigationPage.PopAsync(); - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - await ManualTest.WaitForConfirm(); - navigationPage.Popped += OnPushed; - } - - [Test] - [Category("P1")] - [Description("Check whether PoppedToRoot event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.NavigationPage.PoppedToRoot E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on 'Go To Page2>>' observe Page2 is displayed or not")] - [Step(3, "Click on 'Go To Page3>>' observe Page3 is displayed or not")] - [Step(4, "Click on '< - { - await navigationPage.PushAsync(page2); - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerBlue = new TapGestureRecognizer(); - tapGestureRecognizerBlue.Tapped += async (s, e) => - { - await navigationPage.PushAsync(page3); - await Task.Delay(2000); - }; - imageBlue.GestureRecognizers.Add(tapGestureRecognizerBlue); - - navigationPage.Pushed += OnPushed; - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - await navigationPage.PopToRootAsync(); - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - await ManualTest.WaitForConfirm(); - navigationPage.Pushed -= OnPushed; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPage.cs deleted file mode 100755 index b935b311b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPage.cs +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using WT = WearableTemplate; -using Common = NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class PageTests - { - private static Page _page = TestPage.GetInstance().getNavigationPage(); - - public class CustomNavigationPage : NavigationPage - { - public bool _flagOnBackButtonPressed; - - protected override bool OnBackButtonPressed() - { - _flagOnBackButtonPressed = true; - ManualTest.Confirm(); - return base.OnBackButtonPressed(); - } - } - - [SetUp] - public void SetUp() - { - Console.WriteLine("PageTests --------------- SetUp()"); - if (ManualTest.IsWearable()) - { - _page = WT.TestPage.GetInstance().getNavigationPage(); - } - else - { - _page = Common.TestPage.GetInstance().getNavigationPage(); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("PageTests --------------- TearDown()"); - } - - private void CreateNavigationPage() - { - } - - [Test] - [Category("P1")] - [Description("Check an alert occur. Please click 'Cancel' to turn off it.")] - [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, string, string")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe Alert")] - [Step(3, "Click Pass if alert occur, vice versa")] - [Postcondition(1, "NA")] - public async Task DisplayAlert_RETURN() - { - /* TEST CODE */ - await _page.DisplayAlert("AlertPage", "This is an alert. If you want to turn off this please click Cancel. Then click Pass", "Cancel"); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check an alert occur. Please click 'No'.")] - [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, string, string, string")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe Alert")] - [Step(3, "Click 'No'")] - [Step(4, "Testcase result will show automatically")] - [Postcondition(1, "Click back button")] - public async Task DisplayAlert_CONFIRM_NO() - { - /* TEST CODE */ - var confirm = await _page.DisplayAlert("AlertPage", "This is an alert. Please click No", "Yes", "No"); - Assert.IsInstanceOf(confirm); - Assert.IsFalse(confirm, "Confirm should be return false"); - TestPage.GetInstance().UnlockUIButton(); - } - - [Test] - [Category("P1")] - [Description("Check an alert occur. Please click 'Yes'.")] - [Property("SPEC", "Xamarin.Forms.Page.DisplayAlert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, string, string, string")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Observe Alert")] - [Step(3, "Click 'Yes'")] - [Step(4, "Testcase result will show automatically")] - [Postcondition(1, "Click back button")] - public async Task DisplayAlert_CONFIRM_YES() - { - /* TEST CODE */ - var confirm = await _page.DisplayAlert("AlertPage", "This is an alert. Please click Yes", "Yes", "No"); - Assert.IsInstanceOf(confirm); - Assert.IsTrue(confirm, "Confirm should be return true"); - TestPage.GetInstance().UnlockUIButton(); - } - - [Test] - [Category("P1")] - [Description("Check an alert occur. Click any button then check log return.")] - [Property("SPEC", "Xamarin.Forms.Page.DisplayActionSheet M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, string, string, string")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Alert show an action sheet")] - [Step(3, "Click any button(except 'Cancel')")] - [Step(4, "This TC is pass if DisplayActionSheet dissappear")] - [Postcondition(1, "Click back button")] - public async Task DisplayActionSheet_RETURN() - { - /* TEST CODE */ - var confirm = await _page.DisplayActionSheet("AlertPage", "Cancel", "Destruction", "Btn0", "Btn1", "Btn2"); - Tizen.Log.Debug("TCT", "DisplayActionSheet_RETURN return string is :" + confirm.ToString()); - Console.WriteLine("DisplayActionSheet_RETURN return string is :" + confirm.ToString()); - Assert.IsInstanceOf(confirm); - TestPage.GetInstance().UnlockUIButton(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPanGestureRecognizer.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPanGestureRecognizer.cs deleted file mode 100755 index 70fcc3e69..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPanGestureRecognizer.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.PanGestureRecognizer test")] - public class PanGestureRecognizerTests - { - private bool _flagPanUpdated = false; - private PanGestureRecognizer _panGestureRecognizer; - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - - [SetUp] - public void Setup() - { - Console.WriteLine("PanGestureRecognizerTests --------------- Setup()"); - _panGestureRecognizer = new PanGestureRecognizer(); - if (ManualTest.IsWearable()) - { - _navigationPage = WearableTemplate.TestPage.GetInstance().getNavigationPage(); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("PanGestureRecognizerTests --------------- TearDown()"); - _panGestureRecognizer = null; - } - - private void CreateLayout() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); - - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - Image image = new Image() - { - Source = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/a.jpg", - }; - image.GestureRecognizers.Add(_panGestureRecognizer); - layout.Children.Add(image); - - _navigationPage.PushAsync(new ContentPage { Content = layout, Title = "Test PanUpdated" }); - } - - [Test] - [Category("P1")] - [Description("Check whether PanUpdated Event is raised when the pan gesture changes.")] - [Property("SPEC", "Xamarin.Forms.PanGestureRecognizer.PanUpdated E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Slide your finger on shown image")] - [Step(3, "Click Back button")] - [Step(4, "Testcase result will show PASS of FAIL automatically")] - [Postcondition(1, "NA")] - public async Task PanUpdated_EVENT() - { - /* TEST CODE */ - _panGestureRecognizer.TouchPoints = 3; - _panGestureRecognizer.PanUpdated += onPanUpdated; - _flagPanUpdated = false; - CreateLayout(); - await ManualTest.WaitForConfirm(); - Assert.IsTrue(_flagPanUpdated, "PanUpdated is not called"); - - /* - * POSTCONDITION - * Remove event handler - */ - _panGestureRecognizer.PanUpdated -= onPanUpdated; - } - - private void onPanUpdated(object sender, PanUpdatedEventArgs e) - { - _flagPanUpdated = true; - TLogger.Write("PanUpdated Event!!!"); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPicker.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPicker.cs deleted file mode 100755 index 2357d826b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPicker.cs +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Picker test")] - public class PickerTests - { - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static TestPage _testPage = TestPage.GetInstance(); - private static Picker _picker; - private static Dictionary _nameToColor; - private static ContentPage _page; - private static BoxView _boxView; - - [SetUp] - public void SetUp() - { - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - Console.WriteLine("PickerTests --------------- SetUp()"); - _picker = new Picker(); - } - else - { - Console.WriteLine("Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("PickerTests --------------- TearDown()"); - } - - private static void CreateColorPicker() - { - _nameToColor = new Dictionary - { - { "Aqua", Color.Aqua }, { "Black", Color.Black }, - { "Blue", Color.Blue }, - { "Gray", Color.Gray }, { "Green", Color.Green }, - { "Lime", Color.Lime }, { "Maroon", Color.Maroon }, - { "Navy", Color.Navy }, { "Olive", Color.Olive }, - { "Purple", Color.Purple }, { "Red", Color.Red }, - { "Silver", Color.Silver }, { "Teal", Color.Teal }, - { "White", Color.White }, { "Yellow", Color.Yellow } - }; - foreach (string colorName in _nameToColor.Keys) - { - _picker.Items.Add(colorName); - } - - _boxView = new BoxView - { - WidthRequest = 150, - HeightRequest = 150, - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand - }; - - _page = new ContentPage - { - Content = new StackLayout - { - Children = - { - _picker,_boxView - } - } - }; - - _testPage.ExecuteTC(_page); - } - - [Test] - [Category("P1")] - [Description("Check whether the title for the Picker is displayed or not")] - [Property("SPEC", "Xamarin.Forms.Picker.Title A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker")] - [Step(3, "Pass If Picker Title is displayed otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task Title_Picker_UILK() - { - /* TEST CODE */ - CreateColorPicker(); - _picker.Title = "Picker Title"; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether the TextColor property is worked properly or not")] - [Property("SPEC", "Xamarin.Forms.Picker.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "When you test on TV, you should click Picker and then check the text color.")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker and select any item.")] - [Step(3, "Pass If Picker Text Color is Red, otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task TextColor_Picker_UILK() - { - /* TEST CODE */ - CreateColorPicker(); - _picker.Title = "Picker Title"; - _picker.TextColor = Color.Red; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether the SelectedItem property is worked properly or not")] - [Property("SPEC", "Xamarin.Forms.Picker.SelectedItem A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker")] - [Step(3, "Select any item on Picker")] - [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SelectedItem_Picker_UILK() - { - /* TEST CODE */ - CreateColorPicker(); - _picker.Title = "Picker Title"; - _picker.TextColor = Color.Green; - _picker.SelectedItem = _picker.Items[4]; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether the SelectedIndex property is worked properly or not")] - [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker")] - [Step(3, "Select any item on Picker")] - [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SelectedIndex_Picker_UILK() - { - /* TEST CODE */ - CreateColorPicker(); - _picker.Title = "Picker Title"; - _picker.TextColor = Color.Red; - _picker.SelectedIndex = 5; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether the SelectedIndex property is worked properly or not")] - [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker")] - [Step(3, "Select any item on Picker")] - [Step(4, "Pass If picker's text is same with text of selected item, otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task ItemsSource_Picker_UILK() - { - /* TEST CODE */ - //CreateColorPicker(); - - var colorTable = new List() - { - { "Color.Aqua" }, - { "Color.Blue"}, - { "Color.Fuchsia"}, - { "Color.Green"}, - }; - var picker = new Picker(); - picker.Title = "Picker Title"; - picker.TextColor = Color.Red; - - string[] pageDetailArray = - { - "PickerItem 1", "PickerItem 2", "PickerItem 3", "PickerItem 4" - }; - picker.ItemsSource = pageDetailArray; - - var page = new ContentPage - { - Content = new StackLayout - { - Children = - { - picker - } - } - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether the SelectedIndexChanged event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.Picker.SelectedIndexChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on Picker")] - [Step(3, "Select any color from the color list")] - [Step(3, "Pass If a BoxView Color is changed accordingly otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task SelectedIndexChanged_Picker_EVENT() - { - /* TEST CODE */ - CreateColorPicker(); - _picker.Title = "Picker Title"; - - _picker.SelectedIndexChanged += (sender, args) => - { - if (_picker.SelectedIndex == -1) - { - _boxView.Color = Color.Default; - } - else - { - string colorName = _picker.Items[_picker.SelectedIndex]; - _boxView.Color = _nameToColor[colorName]; - } - }; - - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPinchGestureRecognizer.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPinchGestureRecognizer.cs deleted file mode 100755 index 19f22430a..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSPinchGestureRecognizer.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.PinchGestureRecognizer test")] - public class PinchGestureRecognizerTests - { - private bool _flagPinchUpdated = false; - private static TestPage _testPage = TestPage.GetInstance(); - private PinchGestureRecognizer _pinchGestureRecognizer; - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - - [SetUp] - public void Setup() - { - Console.WriteLine("PinchGestureRecognizerTests --------------- Setup()"); - _pinchGestureRecognizer = new PinchGestureRecognizer(); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("PinchGestureRecognizerTests --------------- TearDown()"); - _pinchGestureRecognizer = null; - } - - private void CreateLayout() - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); - - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - Image image = new Image() - { - Source = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TED/thumbnail/a.jpg", - }; - image.GestureRecognizers.Add(_pinchGestureRecognizer); - layout.Children.Add(image); - _navigationPage.PushAsync(new ContentPage { Content = layout, Title = "Test: PinchUpdated" }); - } - - [Test] - [Category("P1")] - [Description("Check whether PinchUpdated Event is raised when the pan gesture changes.")] - [Property("SPEC", "Xamarin.Forms.PinchGestureRecognizer.PinchUpdated E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Dao Trong Hieu, tronghieu.d@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Action as zoom image")] - [Step(3, "Zoom event will pass automatically ( althought image not zoom in view)")] - [Postcondition(1, "Press back to return Test Page")] - public async Task PinchUpdated_EVENT() - { - /* TEST CODE */ - if (Device.Idiom == TargetIdiom.Phone) - { - _pinchGestureRecognizer.PinchUpdated += onPinchUpdatedGestureRecognizer; - _flagPinchUpdated = false; - CreateLayout(); - await ManualTest.WaitForConfirm(); - Assert.IsTrue(_flagPinchUpdated, "PinchUpdated is not called"); - - /* - * POSTCONDITION - * Remove event handler - */ - _pinchGestureRecognizer.PinchUpdated -= onPinchUpdatedGestureRecognizer; - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - private void onPinchUpdatedGestureRecognizer(object sender, PinchGestureUpdatedEventArgs e) - { - _flagPinchUpdated = true; - TLogger.Write("PinchUpdated Event!!!"); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSProgressBar.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSProgressBar.cs deleted file mode 100755 index a5fb4a6c8..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSProgressBar.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using WT = WearableTemplate; -using Common = NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.ProgressBar test")] - public class ProgressBarTests - { - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static TestPage _testPage = TestPage.GetInstance(); - private static ProgressBar _progressBar; - private static Button _btnProgressIncrease, _btnProgressDecrease; - private static StackLayout _stackLayout, _mainStack; - - [SetUp] - public void SetUp() - { - Console.WriteLine("ProgressBarTests --------------- SetUp()"); - _progressBar = new ProgressBar(); - _btnProgressIncrease = new Button(); - _btnProgressDecrease = new Button(); - - if (ManualTest.IsWearable()) - { - _navigationPage = WT.TestPage.GetInstance().getNavigationPage(); - } - else - { - _navigationPage = Common.TestPage.GetInstance().getNavigationPage(); - } - - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("ProgressBarTests --------------- TearDown()"); - } - - private static void CreateProgressBarNewPage(string progressBarText) - { - _progressBar = new ProgressBar() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - _btnProgressIncrease = new Button() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - FontAttributes = FontAttributes.Bold, - WidthRequest = 50, - Text = "+" - }; - _btnProgressDecrease = new Button() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - FontAttributes = FontAttributes.Bold, - WidthRequest = 50, - Text = "-" - }; - - _stackLayout = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - _progressBar, _btnProgressIncrease, _btnProgressDecrease - }, - Spacing = 20, - }; - _mainStack = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - Children = - { - _stackLayout, - }, - Padding = new Thickness() - { - Left = 50, - Right = 50 - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = _mainStack, - Title = progressBarText, - }); - } - - [Test] - [Category("P1")] - [Description("Check whether the Progress increase/decrease in progressbar or not")] - [Property("SPEC", "Xamarin.Forms.ProgressBar.Progress A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on (+) or (-) Button")] - [Step(3, "Pass If Progress increase or decrease accordingly otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task Progress_ProgressBar_UILK() - { - /* TEST CODE */ - var text = "ProgressBarTest-Progress"; - double d = 0.0; - CreateProgressBarNewPage(text); - _progressBar.IsVisible = true; - - _btnProgressIncrease.IsVisible = true; - _btnProgressIncrease.Clicked += (s, e) => - { - d += 0.2; - if (d > 1.0) - d = 1.0; - _progressBar.Progress=d; - }; - - _btnProgressDecrease.IsVisible = true; - _btnProgressDecrease.Clicked += (s, e) => - { - d -= 0.2; - if (d < 0.0) - d = 0.0; - _progressBar.Progress = d; - }; - - await ManualTest.WaitForConfirm(); - } - - // Tizen Limitation in preview3 - //[Test] - [Category("P1")] - [Description("Check whether the Progress increase/decrease in progressbar or not")] - [Property("SPEC", "Xamarin.Forms.ProgressBar.ProgressTo A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on (+) or (-) Button")] - [Step(3, "Pass If Progress increase or decrease accordingly with BounceOut animation otherwise Fail")] - [Postcondition(1, "Back to TestPage")] - public async Task ProgressTo_ProgressBar_UILK() - { - /* TEST CODE */ - var text = "ProgressBarTest-Progress"; - double d = 0.0; - CreateProgressBarNewPage(text); - _progressBar.IsVisible = true; - - _btnProgressIncrease.IsVisible = true; - _btnProgressIncrease.Clicked += async (s, e) => - { - d += 0.2; - if (d > 1.0) - d = 1.0; - await _progressBar.ProgressTo(d, 1, Easing.BounceOut); - }; - - _btnProgressDecrease.IsVisible = true; - _btnProgressDecrease.Clicked += async (s, e) => - { - d -= 0.2; - if (d < 0.0) - d = 0.0; - await _progressBar.ProgressTo(d, 1, Easing.BounceOut); - }; - - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSRelativeLayout.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSRelativeLayout.cs deleted file mode 100755 index eda03af23..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSRelativeLayout.cs +++ /dev/null @@ -1,1122 +0,0 @@ -/* - * 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; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Threading.Tasks; -using Xamarin.Forms.Platform.Tizen; -using WT = WearableTemplate; - -using Common = NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.RelativeLayout test")] - public class RelativeLayoutTests - { - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static TestPage _testPage = TestPage.GetInstance(); - private static RelativeLayout _relativeLayout; - private static StackLayout _stackLayout, _mainStack; - private static Point point; - private static Point p; - - private static Boolean isOnAdd; - - public class CustomRelativeLayout : RelativeLayout - { - public bool _flagOnAdded; - public bool _flagOnRemoved; - public bool _flagOnSize; - - protected override void OnAdded(View view) - { - //if (isOnAdd) - //{ - _flagOnAdded = true; - //TLogger.Write("MasterDetailPage-OnBackButtonPressed!!!"); - //ManualTest.Confirm(); - //} - base.OnAdded(view); - } - - protected override void OnRemoved(View view) - { - _flagOnRemoved = true; - base.OnRemoved(view); - } - - protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint) - { - _flagOnSize = true; - return base.OnSizeRequest(widthConstraint, heightConstraint); - } - } - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - Console.WriteLine("RelativeLayoutTests --------------- SetUp()"); - _relativeLayout = new RelativeLayout(); - if (ManualTest.IsWearable()) - { - _navigationPage = WT.TestPage.GetInstance().getNavigationPage(); - } - else - { - _navigationPage = Common.TestPage.GetInstance().getNavigationPage(); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("RelativeLayoutTests --------------- TearDown()"); - } - - private static void CreateRelativeLayout(CustomRelativeLayout relativeLayout) - { - //relativeLayout = new RelativeLayout() - //{ - // HorizontalOptions = LayoutOptions.FillAndExpand, - // VerticalOptions = LayoutOptions.FillAndExpand, - // Padding = new Thickness(20), - // BackgroundColor = Color.Red, - //}; - //Point point; - point.X = 50; - point.Y = 20; - Button[] buttons = new Button[100]; - var layoutSub = new StackLayout() - { - IsVisible = true, - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - }; - var count = 0; - var btnAdd = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - Text = "Add", - WidthRequest = 150, - //HeightRequest = 80, - }; - var btnRemove = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - Text = "Remove", - WidthRequest = 150, - //HeightRequest = 80, - }; - btnAdd.Clicked += (s, e) => - { - if (count < 15) - { - count++; - buttons[count] = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Start, - Text = "Test " + count, - WidthRequest = 200, - //HeightRequest = 80, - }; - //relativeLayout.Children.Add(buttons[count], point); - relativeLayout.Children.Add(buttons[count], Constraint.Constant(0), - Constraint.Constant(0), - Constraint.Constant(200), - Constraint.Constant(100)); - if (point.X < 330) - { - point.X += 100; - } - else - { - point.Y += 100; - point.X = 50; - } - } - }; - btnRemove.Clicked += (s, e) => - { - if (count >= 1) - { - relativeLayout.Children.Remove(buttons[count]); - if (point.X <= 50) - { - point.Y -= 100; - point.X = 410; - } - else - { - point.X -= 180; - } - count--; - } - }; - layoutSub.Children.Add(btnAdd); - layoutSub.Children.Add(btnRemove); - //Point p; - p.X = 50; - p.Y = 50; - //relativeLayout.Children.Add(layoutSub, p); - //relativeLayout.Children.Add(layoutSub, Constraint.Constant(0), - // Constraint.Constant(100), - // Constraint.Constant(300), - // Constraint.Constant(200)); - - relativeLayout.Children.Add(layoutSub, Constraint.RelativeToParent((parent) => - { - return 0; - })); - - var contentPage = new ContentPage() - { - Content = relativeLayout - }; - contentPage.Title = "RelativeLayout Test"; - //window.CurrentPage = contentPage; - _testPage.ExecuteTC(contentPage); - } - - [Test] - [Category("P1")] - [Description("Check whether OnAdded method is invoked or not")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnAdded M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Add' button")] - [Step(3, "Press back button")] - [Step(4, "Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnAdded_RelativeLayout_UIBH() - { - /* TEST CODE */ - CustomRelativeLayout relativeLayout = new CustomRelativeLayout(); - relativeLayout._flagOnAdded = false; - //CreateRelativeLayout(relativeLayout); - var btnAdd = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Text = "Add", - WidthRequest = 300, - //HeightRequest = 80, - }; - btnAdd.Clicked += (s, e) => - { - var buttons = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand, - Text = "Test Button ", - WidthRequest = 300, - //HeightRequest = 80, - }; - - relativeLayout.Children.Add(buttons, Constraint.Constant(100), - Constraint.Constant(0), - Constraint.Constant(150), - Constraint.Constant(100)); - - if (relativeLayout._flagOnAdded == true) - ManualTest.Confirm(); - }; - - relativeLayout.Children.Add(btnAdd, - Constraint.RelativeToParent((parent) => - { - return parent.Width / 6; - }), - Constraint.RelativeToParent((parent) => - { - return parent.Height / 2; - })); - relativeLayout._flagOnAdded = false; - - var contentPage = new ContentPage() - { - Content = relativeLayout - }; - contentPage.Title = "RelativeLayout Test"; - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - //isOnAdd = false; - btnAdd.Clicked -= (s, e) => - { - }; - Assert.IsTrue(relativeLayout._flagOnAdded, "OnAdded is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether OnRemoved method is invoked or not")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnRemoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press Add button")] - [Step(3, "Press Remove button")] - [Step(4, "Press back button")] - [Step(5, "Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnRemoved_RelativeLayout_UIBH() - { - /* TEST CODE */ - CustomRelativeLayout relativeLayout = new CustomRelativeLayout(); - relativeLayout._flagOnRemoved = false; - //CreateRelativeLayout(relativeLayout); - var btnAdd = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Text = "Add", - WidthRequest = 300, - //HeightRequest = 80, - }; - var btnRemove = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - Text = "Remove", - WidthRequest = 300, - //HeightRequest = 80, - }; - var buttons = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.StartAndExpand, - Text = "Test Button ", - WidthRequest = 300, - //HeightRequest = 80, - }; - btnAdd.Clicked += (s, e) => - { - relativeLayout.Children.Add(buttons, Constraint.Constant(200), - Constraint.Constant(0), - Constraint.Constant(300), - Constraint.Constant(200)); - }; - btnRemove.Clicked += (s, e) => - { - relativeLayout.Children.Remove(buttons); - if (relativeLayout._flagOnRemoved == true) - ManualTest.Confirm(); - }; - - relativeLayout.Children.Add(btnAdd, - Constraint.RelativeToParent((parent) => - { - return parent.Width / 6; - }), - Constraint.RelativeToParent((parent) => - { - return parent.Height / 3; - })); - relativeLayout.Children.Add(btnRemove, - Constraint.RelativeToParent((parent) => - { - return parent.Width / 6; - }), - Constraint.RelativeToParent((parent) => - { - return parent.Height / 2; - })); - relativeLayout._flagOnRemoved = false; - - var contentPage = new ContentPage() - { - Content = relativeLayout - }; - contentPage.Title = "RelativeLayout Test"; - _testPage.ExecuteTC(contentPage); - - //_testPage.ExecuteTC(relativeLayout); - await ManualTest.WaitForConfirm(); - btnAdd.Clicked -= (s, e) => - { - }; - Assert.IsTrue(relativeLayout._flagOnRemoved, "OnRemoved is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check whether OnSizeRequest method is invoked or not")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.OnSizeRequest M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Press 'Change Size' button")] - [Step(3, "Press back button")] - [Step(4, "Testcase result will show PASS or FAIL automatically")] - [Postcondition(1, "Back to TestPage")] - public async Task OnSizeRequest_RelativeLayout_UIBH() - { - /* TEST CODE */ - CustomRelativeLayout relativeLayout = new CustomRelativeLayout(); - relativeLayout._flagOnSize = false; - //CreateRelativeLayout(relativeLayout); - var btnRemove = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - Text = "Change Size", - WidthRequest = 300, - //HeightRequest = 80, - }; - - btnRemove.Clicked += (s, e) => - { - relativeLayout.WidthRequest = 80.00; - relativeLayout.HeightRequest = 100.00; - relativeLayout.GetSizeRequest(80.00, 100.00); - - if (relativeLayout._flagOnSize == true) - ManualTest.Confirm(); - }; - - relativeLayout.Children.Add(btnRemove, - Constraint.RelativeToParent((parent) => - { - return parent.Width / 6; - }), - Constraint.RelativeToParent((parent) => - { - return parent.Height / 2; - })); - relativeLayout._flagOnSize = false; - - var contentPage = new ContentPage() - { - Content = relativeLayout - }; - contentPage.Title = "RelativeLayout Test"; - _testPage.ExecuteTC(contentPage); - await ManualTest.WaitForConfirm(); - btnRemove.Clicked -= (s, e) => - { - }; - Assert.IsTrue(relativeLayout._flagOnSize, "OnSizeRequest is not invoked"); - } - - [Test] - [Category("P1")] - [Description("Check the IsVisible property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click 'Visible' and 'Hide' button")] - [Step(3, "Observe change of the layout")] - [Step(4, "Testcase PASS if click Visible button -> Show the layout and click Hide button-> Hide the layout, otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_IsVisible_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - var mBtnVisible = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Visible", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnHide = new Button - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.End, - Text = "Hide", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnVisible, - mBtnHide - }, - }, - Title = "IsVisible Test", - }; - - mBtnVisible.Clicked += (e, o) => - { - simpleLayout.IsVisible = true; - }; - - mBtnHide.Clicked += (e, o) => - { - simpleLayout.IsVisible = false; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnVisible.Clicked -= (e, o) => - { - simpleLayout.IsVisible = true; - }; - - mBtnHide.Clicked -= (e, o) => - { - simpleLayout.IsVisible = false; - }; - } - - [Test] - [Category("P1")] - [Description("Check the BackgroundColor property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of layout is changed")] - [Step(3, "Testcase PASS If BackgroundColor of Layout changed otherwise FAIL")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_BackgroundColor_Change_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - var mBtnRed = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Red, - Text = "Red", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - var mBtnGreen = new Button - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.End, - BackgroundColor = Color.Green, - Text = "Green", - Margin = new Thickness() - { - Right = 10, - Left = 10 - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - mBtnRed, - mBtnGreen - }, - }, - Title = "BackgoundColor Test", - }; - - mBtnRed.Clicked += (e, o) => - { - simpleLayout.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked += (e, o) => - { - simpleLayout.BackgroundColor = Color.Green; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - mBtnRed.Clicked -= (e, o) => - { - simpleLayout.BackgroundColor = Color.Red; - }; - - mBtnGreen.Clicked -= (e, o) => - { - simpleLayout.BackgroundColor = Color.Green; - }; - } - - [Test] - [Category("P1")] - [Description("Check the HeightRequest & WidthRequest property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.Width A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of the layout changed otherwise Fail")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_WidthAndHeight_CHANGE_SIZE_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - sliderHorizontal, - sliderVertical - }, - }, - Title = "Size Layout Test", - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - simpleLayout.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - simpleLayout.HeightRequest = sliderVertical.Value; - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - sliderHorizontal.ValueChanged -= (o, e) => - { - simpleLayout.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged -= (o, e) => - { - simpleLayout.HeightRequest = sliderVertical.Value; - }; - } - - [Test] - [Category("P1")] - [Description("Check the Opacity property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of layout changed otherwise Fail")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_Opacity_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - simpleLayout.BindingContext = sliderOpacity; - simpleLayout.SetBinding(Button.OpacityProperty, "Value"); - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - sliderOpacity, - }, - }, - Title = "OpacityTest", - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check the Margin property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview (Margin Options)")] - [Step(4, "Pass If Margin of layout changed otherwise Fail")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_Margin_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.Fill, - HorizontalOptions = LayoutOptions.Fill, - HeightRequest = 100, - WidthRequest = 300 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin Options"; - var title = "Margin Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Margin = new Thickness(0, 50, 0, 0); - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Margin = new Thickness(0, 100, 0, 0); - } - else - { - simpleLayout.Margin = new Thickness(0, 150, 0, 0); - } - }; - - /* - * POSTCONDITION - * Remove event handler - */ - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Rotation property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview (Rotation Options)")] - [Step(3, "Pass If Rotation of layout changed otherwise Fail")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_Rotation_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation Options"; - var title = "Rotation Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Rotation = 50; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Rotation = 90; - } - else - { - simpleLayout.Rotation = 180; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check the Scale property")] - [Property("SPEC", "Xamarin.Forms.RelativeLayout.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of layout changed otherwise Fail")] - [Postcondition(1, "Click Back button.")] - public async Task RelativeLayout_Scale_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - RelativeLayout simpleLayout = new RelativeLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.CenterAndExpand, - HorizontalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 100, - WidthRequest = 300 - }; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - //CreatePageTestToButton(text, title, dataTest); - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - simpleLayout.Scale = 0.5; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - simpleLayout.Scale = 1.0; - } - else - { - simpleLayout.Scale = 2.0; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - simpleLayout, - _listview, - }, - BackgroundColor = Color.Navy - }, - Title = title, - }; - - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSScrollView.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSScrollView.cs deleted file mode 100755 index ae4de1da9..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSScrollView.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 System; -using System.Threading.Tasks; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Xamarin.Forms; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.ScrollView test")] - public class ScrollViewTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ScrollView _scrollView; - private static Button _button1, _button2, _button3; - private static ListView _listView; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private static void CreateScrollViewPage(string scrollView) - { - List mLstStr = new List(); - for(int i=1; i<=50; i++) - { - mLstStr.Add("Item "+i); - } - - _listView = new ListView - { - ItemsSource = mLstStr, - }; - _button1 = new Button() - { - Text= "Scroll To Start", - }; - _button2 = new Button() - { - Text = "Scroll To Center", - }; - _button3 = new Button() - { - Text = "Scroll To End", - }; - var layoutButton = new StackLayout() - { - Orientation = StackOrientation.Vertical, - Children = - { - _button1, _button2, _button3 - } - }; - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children= - { - _listView, - layoutButton - } - }; - - _scrollView = new ScrollView() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Orientation = ScrollOrientation.Vertical, - Content = layout, - }; - _button1.Clicked += (sender, o) => - { - _scrollView.ScrollToAsync(_listView, ScrollToPosition.Start, true); - }; - _button2.Clicked += (sender, o) => - { - _scrollView.ScrollToAsync(_listView, ScrollToPosition.Center, true); - //Console.WriteLine("[TUnit] : ScrollToPosition.Center"); - }; - _button3.Clicked += (sender, o) => - { - _scrollView.ScrollToAsync(_listView, ScrollToPosition.End, true); - }; - - var stackLayout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - stackLayout.Children.Add(_scrollView); - _testPage.ExecuteTC(new ContentPage() - { - Content = stackLayout, - Title=scrollView, - }); - } - - //[Test] - [Category("P1")] - [Description("Check whether the method ScrollToAsync is readable or not.")] - [Property("SPEC", "Xamarin.Forms.ScrollView.ScrollToAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.Element, Xamarin.Forms.ScrollToPosition, bool")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button after new page shown and check")] - [Step(3, "Confirm False or True")] - [Postcondition(1, "NA")] - public async Task ScrollToAsync_CHECK() - { - CreateScrollViewPage("Test: ScrollToAsync"); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _button1.Clicked -= (sender, o) => - { - }; - _button2.Clicked -= (sender, o) => - { - }; - _button3.Clicked -= (sender, o) => - { - }; - } - } -} - - - diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSearchBar.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSearchBar.cs deleted file mode 100755 index 01ae8b709..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSearchBar.cs +++ /dev/null @@ -1,1114 +0,0 @@ -/* - * 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 System; -using System.Threading.Tasks; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Xamarin.Forms; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.SearchBar test")] - public class SearchBarTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static SearchBar _searchBar; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void Init() - { - if (ManualTest.IsWearable()) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not supported on this profile"); - } - else - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private static void CreateSearchBarPage(string searchBar) - { - var resultsLabel = new Label - { - Text = "Result will appear here.", - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - _searchBar = new SearchBar - { - Placeholder = "Enter search term", - SearchCommand = new Command(() => { resultsLabel.Text = "Result: " + _searchBar.Text + " is what you asked for."; }) - }; - - var page = new ContentPage - { - Title = searchBar, - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Start, - Children = { - new Label { - HorizontalTextAlignment = TextAlignment.Center, - Text = "SearchBar", - }, - _searchBar, - new ScrollView - { - Content = new StackLayout { - Children= - { - resultsLabel - } - }, - VerticalOptions = LayoutOptions.FillAndExpand - } - }, - Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) - } - }; - _testPage.ExecuteTC(page); - } - - private static void onSearchButtonPressed(object sender, EventArgs e) - { - _testPage.getNavigationPage().PopAsync(); - Assert.True(true); - ManualTest.Confirm(); - } - - private static void onTextChanged(object sender, EventArgs e) - { - _testPage.getNavigationPage().PopAsync(); - Assert.True(true); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Handle event SearchButtonPressed SearchBar.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.SearchButtonPressed M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Type some string in search bar")] - [Step(3, "Click search button in virtual keyboard")] - [Step(4, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task SearchButtonPressed_CHECK() - { - if (Device.Idiom == TargetIdiom.Phone) - { - // did find searchButton - CreateSearchBarPage("Test: SearchButtonPressed"); - _searchBar.SearchButtonPressed += onSearchButtonPressed; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _searchBar.SearchButtonPressed -= onSearchButtonPressed; - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Check whether TextChanged event is envoked or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.TextChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Type some string in search bar")] - [Step(3, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task TextChanged_SearchBar_EVENT() - { - SearchBar srBar = new SearchBar(); - var page = new ContentPage - { - Content = new StackLayout - { - Children = { - srBar - } - } - }; - _testPage.ExecuteTC(page); - - srBar.TextChanged += onTextChanged; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - srBar.TextChanged -= onTextChanged; - } - - [Test] - [Category("P1")] - [Description("Check whether Text is displayed in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Pass If 'Hi' is displayed in searchBar and type any string in searchbar otherwise Fail")] - [Postcondition(1, "NA")] - public async Task Text_SearchBar_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - SearchBar srBar = new SearchBar(); - var page = new ContentPage - { - Content = new StackLayout - { - Children = { - srBar - } - } - }; - _testPage.ExecuteTC(page); - - srBar.Text = "Hi"; - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Check whether TextColor is displayed in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (Green) or (Blue) or (Red)")] - [Step(4, "Pass If TextColor changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task TextColor_SearchBar_UIBH() - { - SearchBar srBar = new SearchBar(); - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Green"; - dataTest[1] = "Blue"; - dataTest[2] = "Red"; - var text = "Select a TextColor"; - var title = "TextColor Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.TextColor = Color.Green; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.TextColor = Color.Blue; - } - else - { - srBar.TextColor = Color.Red; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether Placeholder is displayed in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.Placeholder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Pass If 'Placeholder Text' is displayed in searchBar when it is empty otherwise Fail")] - [Postcondition(1, "NA")] - public async Task Placeholder_SearchBar_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - SearchBar srBar = new SearchBar(); - var page = new ContentPage - { - Content = new StackLayout - { - Children = { - srBar - } - } - }; - _testPage.ExecuteTC(page); - - srBar.Placeholder = "Placeholder Text"; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether PlaceholderColor is displayed in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.PlaceholderColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on (Green) or (Blue) or (Red)")] - [Step(3, "Pass If 'Placeholder Text' is displayed in searchBar when it is empty with specific color otherwise Fail")] - [Postcondition(1, "NA")] - public async Task PlaceholderColor_SearchBar_UIBH() - { - SearchBar srBar = new SearchBar(); - srBar.Placeholder = "Placeholder Text"; - srBar.PlaceholderColor = Color.Green; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Green"; - dataTest[1] = "Blue"; - dataTest[2] = "Red"; - var text = "Select a PlaceholderColor"; - var title = "PlaceholderColor Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.PlaceholderColor = Color.Green; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.PlaceholderColor = Color.Blue; - } - else - { - srBar.PlaceholderColor = Color.Red; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether FontSize is displayed properly in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.FontSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (20) or (25) or (30)")] - [Step(4, "Pass If FontSize changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task FontSize_SearchBar_UIBH() - { - SearchBar srBar = new SearchBar(); - srBar.Text = "Hi"; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "20"; - dataTest[1] = "25"; - dataTest[2] = "30"; - var text = "Select a FontSize"; - var title = "FontSize Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.FontSize = 20.00; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.FontSize = 25.00; - } - else - { - srBar.FontSize = 30.00; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether FontAttributes is displayed properly in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.FontAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (None) or (Bold) or (Italic)")] - [Step(4, "Pass If Text FontAttributes changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task FontAttributes_SearchBar_UIBH() - { - SearchBar srBar = new SearchBar(); - srBar.Text = "Hi"; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "None"; - dataTest[1] = "Bold"; - dataTest[2] = "Italic"; - var text = "Select a FontAttributes"; - var title = "FontAttributes Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals("None")) - { - srBar.FontAttributes = FontAttributes.None; - } - else if (ctlTest.Name.Equals("Bold")) - { - srBar.FontAttributes = FontAttributes.Bold; - } - else - { - srBar.FontAttributes = FontAttributes.Italic; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether FontFamily is displayed properly in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "Several fonts are not supported on TV product")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (Times New Roman) or (Sans) or (Sans Bold)")] - [Step(4, "Pass If Text FontFamily changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task FontFamily_SearchBar_UIBH() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - SearchBar srBar = new SearchBar(); - srBar.Text = "Hi"; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Times New Roman"; - dataTest[1] = "Sans"; - dataTest[2] = "Sans Bold"; - var text = "Select a FontFamily"; - var title = "FontFamily Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.FontFamily = "Times New Roman:style=Regular"; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.FontFamily = "Sans:style=Regular"; - } - else - { - srBar.FontFamily = "Sans:style=Bold"; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether FontFamily is displayed properly in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (Center) or (End) or (Start)")] - [Step(4, "Pass If TextAlignment changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task HorizontalTextAlignment_SearchBar_UIBH() - { - SearchBar srBar = new SearchBar(); - srBar.Text = "Hi"; - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Center"; - dataTest[1] = "End"; - dataTest[2] = "Start"; - var text = "Select a TextAlignment"; - var title = "HorizontalTextAlignment Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.HorizontalTextAlignment = TextAlignment.Center; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.HorizontalTextAlignment = TextAlignment.End; - } - else - { - srBar.HorizontalTextAlignment = TextAlignment.Start; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Check whether FontSize is displayed properly in SearchBar or not.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.FontSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click on searchbar and type something")] - [Step(3, "Click on (Green) or (Blue) or (Red)")] - [Step(4, "Pass If CancelButtonColor changes accordingly otherwise Fail")] - [Postcondition(1, "NA")] - public async Task CancelButtonColor_SearchBar_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - SearchBar srBar = new SearchBar(); - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Green"; - dataTest[1] = "Blue"; - dataTest[2] = "Red"; - var text = "Select a CancelButtonColor"; - var title = "CancelButtonColor Test"; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - var _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _listview.ItemTapped += (o, e) => - { - ControlTest ctlTest = (ControlTest)e.Item; - if (ctlTest.Name.Equals(dataTest[0])) - { - srBar.CancelButtonColor = Color.Green; - } - else if (ctlTest.Name.Equals(dataTest[1])) - { - srBar.CancelButtonColor = Color.Blue; - } - else - { - srBar.CancelButtonColor = Color.Red; - } - }; - - ContentPage page = new ContentPage - { - Content = new StackLayout - { - HorizontalOptions = LayoutOptions.Fill, - VerticalOptions = LayoutOptions.Fill, - Children = - { - srBar, - new Label - { - Text=text, - TextColor=Color.White, - HorizontalOptions = LayoutOptions.Center - }, - _listview, - }, - BackgroundColor = Color.Gray - }, - Title = title, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Test: Handle event SearchButtonPressed SearchBar.")] - [Property("SPEC", "Xamarin.Forms.SearchBar.SearchButtonPressed A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Type some string in search bar")] - [Step(3, "Click search button in virtual keyboard")] - [Step(4, "Pass if Search result shows below SearchBar otherwise Fail")] - [Postcondition(1, "NA")] - public async Task SearchCommand_SearchBar_UIBH() - { - if (Device.Idiom == TargetIdiom.Phone) - { - CreateSearchBarPage("Test: SearchCommand"); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSlider.cs deleted file mode 100755 index cbf271610..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSlider.cs +++ /dev/null @@ -1,1032 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class SliderTests - { - private static ListView _listview; - private static Slider _slider1, _slider2, _slider3; - private static Label _label1, _label2; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Slider CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Slider CLASS: Teardown---------------------------------"); - _slider1 = null; - _slider2 = null; - _slider3 = null; - _label1 = null; - _label2 = null; - } - - private static void OnValueChanged(object sender, EventArgs e) - { - Assert.True(true); - _label1.IsVisible = true; - _label1.Text = "Value Changed Event Called."; - ManualTest.Confirm(); - } - - private static void OnValueChangedShowValue(object sender, EventArgs e) - { - var val = (int)_slider1.Value; - _label1.Text = "Slider Value: " + val.ToString(); - } - - private static void OnValueChangedShowValueMax(object sender, EventArgs e) - { - _label2.IsVisible = true; - var val1 = (int)_slider1.Maximum; - _label2.Text = "Changed Max Value: " + val1.ToString(); - var val = (int)_slider1.Value; - _label1.Text = "Slider Value: " + val.ToString(); - } - - private static void OnValueChangedShowValueMin(object sender, EventArgs e) - { - _label2.IsVisible = true; - var val1 = (int)_slider1.Minimum; - _label2.Text = "Changed Min Value: " + val1.ToString(); - var val = (int)_slider1.Value; - _label1.Text = "Slider Value: " + val.ToString(); - } - - private static void CreateSlider(string Text) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateSlider"); - - _slider1 = new Slider() - { - IsVisible = false, - Minimum = 0.00, - Maximum = 40.00, - Value = 30.00, - HorizontalOptions = LayoutOptions.FillAndExpand, - Scale = 1.0 - }; - - _label1 = new Label() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - TextColor = new Color(255, 0, 0) - }; - _label2 = new Label() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - TextColor = new Color(0, 255, 0) - }; - } - - public void CreatePageTestToSlider(String txtDisplay, String title, String[] dataTest) - { - _slider2 = new Slider - { - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 350, - HeightRequest = 100, - IsEnabled = true, - }; - Label labelDisplay = new Label - { - Text = txtDisplay, - TextColor = Color.Red, - HorizontalOptions = LayoutOptions.Center - }; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _slider2, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the maximum value for the slider.")] - [Property("SPEC", "Xamarin.Forms.Slider.Maximum A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if the Maximum value is 50.")] - [Step(3, "If after sliding right maximum value is 50 then pass.")] - [Postcondition(1, "N/A")] - public async Task Maximum_Slider_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - CreateSlider("Slider Maximum Value Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = true; - _label1.Text = "Maximum value is 50 here."; - _label2.Text = "Slider Value: " + _slider1.Value.ToString(); - _slider1.Maximum = 50.00; - _slider1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_slider1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the minimum value for the slider.")] - [Property("SPEC", "Xamarin.Forms.Slider.Minimum A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if the Minimum value is 10.")] - [Postcondition(1, "NA")] - public async Task Minimum_Slider_UIBH() - { - CreateSlider("Slider Minimum Value Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = true; - _label1.Text = "Minimum value is 10 here."; - _label2.Text = "Slider Value: " + _slider1.Value.ToString(); - _slider1.Minimum = 10.00; - _slider1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_slider1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the value of the slider displays.")] - [Property("SPEC", "Xamarin.Forms.Slider.Value A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if the value is 20.")] - [Postcondition(1, "NA")] - public async Task Value_UIBH() - { - CreateSlider("Slider Value Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - _label1.HeightRequest = 100; - _label1.Text = "Value is 20 here. Slider position will set to middle."; - _slider1.Value = 20.00; - _slider1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_slider1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Whenever the slider value is changed by using the thumb.")] - [Property("SPEC", "Xamarin.Forms.Slider.ValueChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Start and then stop dragging the slider.")] - [Step(3, "if Value Change event called then TC will Pass automatically.")] - [Postcondition(1, "NA")] - public async Task ValueChanged_Slider_CB() - { - /* TEST CODE */ - CreateSlider("ValueChanged Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = false; - _slider1.ValueChanged += OnValueChanged; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_slider1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - - _slider1.ValueChanged -= OnValueChanged; - } - - [Test] - [Category("P1")] - [Description("Check whether ValueProperty's bound or not.")] - [Property("SPEC", "Xamarin.Forms.Slider.ValueProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if dragging slider change the value.")] - [Postcondition(1, "NA")] - public async Task ValueProperty_UIBH() - { - CreateSlider("Slider ValueProperty Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - - _label1.SetBinding(Label.TextProperty, new Binding("Value", stringFormat: "Slider Value : {0}", source: _slider1)); - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1, - _slider1, - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MaximumProperty's bound or not.")] - [Property("SPEC", "Xamarin.Forms.Slider.MaximumProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if first slider change the Max value of slider after binding with second slider.")] - [Step(3, "Check if first slider Max value change from 40 to 10 after binding with second slider's Max value. Max value of first slider doesn't change corresponding to second slider value property")] - [Postcondition(1, "NA")] - public async Task MaximumProperty_UIBH() - { - CreateSlider("Slider ValueProperty Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = false; - _label1.Text = "Maximum value is 40 before binding."; - Slider slider2 = new Slider - { - Value = 10.00, - Minimum = 0, - Maximum = 10.00, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - _slider1.BindingContext = slider2; - _slider1.SetBinding(Slider.MaximumProperty, "Maximum"); - _slider1.ValueChanged += OnValueChangedShowValueMax; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_slider1,_label2, - new Label - { - Text = "Second slider maximum Value is 10", - TextColor = Color.Red - }, - slider2 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether MinimumProperty's bound or not.")] - [Property("SPEC", "Xamarin.Forms.Slider.MinimumProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if first slider change the Min value of slider after binding with second slider.")] - [Step(3, "Check if first slider Min value change from 0 to 3 after binding with second slider's Min value. Min value of first slider doesn't change corresponding to second slider value property")] - [Postcondition(1, "NA")] - public async Task MinimumProperty_UIBH() - { - CreateSlider("Slider ValueProperty Test!"); - _slider1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = false; - _label1.Text = "Minimum value is 0 before binding."; - Slider slider3 = new Slider - { - Value = 5, - Minimum = 0, - Maximum = 10.00, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - slider3.Minimum = 3; - - _slider1.BindingContext = slider3; - _slider1.SetBinding(Slider.MinimumProperty, "Minimum"); - _slider1.ValueChanged += OnValueChangedShowValueMin; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_slider1,_label2, - new Label - { - Text = "Second slider minimum Value is 3", - TextColor = Color.Red - }, - slider3 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.Slider.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click slider after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsVisible of Slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_Slider_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToSlider(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _slider2.IsVisible = false; - } - else - { - _slider2.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.Slider.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click slider after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsEnabled of Slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_Slider_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToSlider(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _slider2.IsEnabled = false; - } - else - { - _slider2.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.Slider.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click slider after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Scale of Slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_Slider_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToSlider(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _slider2.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _slider2.Scale = 1.0; - } - else - { - _slider2.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.Slider.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click slider after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Rotation of Slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_Slider_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToSlider(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _slider2.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _slider2.Rotation = 90; - } - else - { - _slider2.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.Slider.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click slider after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Margin of slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_Slider_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToSlider(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _slider2.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _slider2.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _slider2.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Slider look")] - [Property("SPEC", "Xamarin.Forms.Slider Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of Slider changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Slider_Opacity_LOOK() - { - _slider3 = new Slider() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 220, - }; - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _slider3.BindingContext = sliderOpacity; - _slider3.SetBinding(Slider.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _slider3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Opacity: ", - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Slider look")] - [Property("SPEC", "Xamarin.Forms.Slider Width")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width after observe")] - [Step(3, "Pass If Width of Slider changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Slider_Width_CHANGE_SIZE() - { - _slider3 = new Slider() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 120 - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _slider3.WidthRequest = sliderHorizontal.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 20, - }, - Spacing = 25, - Children = - { - _slider3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Width: ", - }, - sliderHorizontal - } - }, - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Slider look")] - [Property("SPEC", "Xamarin.Forms.Slider.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Slider is changed")] - [Step(3, "Pass If BackgroundColor of Slider changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_Slider_COLOR_CHANGE() - { - _slider3 = new Slider() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 120 - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _slider3.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _slider3.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _slider3.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _slider3, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - if (ManualTest.IsWearable()) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - } - - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStackLayout.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStackLayout.cs deleted file mode 100755 index 4952d0bcb..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStackLayout.cs +++ /dev/null @@ -1,828 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class StackLayoutTests - { - private static Label _horizontalTitle, _verticalTitle; - private static ListView _listview; - private static StackLayout _controlStackLayout, _horizontalStackLayout, _verticalStackLayout, _simpleStackLayout, _stackLayout3, _stackLayout4; - private static Button _spacePlus, _spaceMinus, _horizontalButton1, _horizontalButton2, _verticalButton1, _verticalButton2, _focusButton, _button; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "StackLayout CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "StackLayout CLASS: Teardown---------------------------------"); - _stackLayout3 = null; - _stackLayout4 = null; - _simpleStackLayout = null; - _verticalStackLayout = null; - _horizontalStackLayout = null; - _controlStackLayout = null; - } - - private static void CreateStackLayout(string entryText) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateStackLayout"); - _horizontalTitle = new Label() - { - TextColor = new Color(0, 0, 255) - }; - _verticalTitle = new Label() - { - TextColor = new Color(0, 0, 255) - }; - _horizontalButton1 = new Button() - { - Text = "Button1", - TextColor = new Color(255, 255, 255) - }; - _horizontalButton2 = new Button() - { - Text = "Button2", - TextColor = new Color(255, 255, 255) - }; - _verticalButton1 = new Button() - { - Text = "Button1", - TextColor = new Color(255, 255, 255) - }; - _verticalButton2 = new Button() - { - Text = "Button2", - TextColor = new Color(255, 255, 255) - }; - _focusButton = new Button() - { - Text = "Button for focus", - TextColor = new Color(255, 255, 255) - }; - _horizontalStackLayout = new StackLayout() - { - IsVisible = false, - Orientation = StackOrientation.Horizontal, - Children = - { - _horizontalButton1,_horizontalButton2 - }, - Spacing = 20, - }; - _verticalStackLayout = new StackLayout() - { - IsVisible = false, - Orientation = StackOrientation.Vertical, - Children = - { - _verticalButton1,_verticalButton2, - }, - Spacing = 20, - }; - _spacePlus = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "Spacing+", - TextColor = new Color(255, 255, 255) - }; - _spaceMinus = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "Spacing-", - TextColor = new Color(255, 255, 255), - }; - _controlStackLayout = new StackLayout() - { - IsVisible = false, - VerticalOptions = LayoutOptions.EndAndExpand, - Orientation = StackOrientation.Horizontal, - Children = - { - _spacePlus,_spaceMinus - }, - Spacing = 100 - }; - } - - //support function - public void CreatePageTestToStackLayout(String txtDisplay, String title, String[] dataTest) - { - _button = new Button - { - Text = "Click Me !", - HorizontalOptions = LayoutOptions.Center, - Font = Font.SystemFontOfSize(NamedSize.Medium), - WidthRequest = 350, - }; - - _simpleStackLayout = new StackLayout - { - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 550, - BackgroundColor = Color.Green, - IsEnabled = true, - Children = - { - _button - }, - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _simpleStackLayout, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the value which indicates the direction which child views are positioned.")] - [Property("SPEC", "Xamarin.Forms.StackLayout.Orientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check orientation horizontal and vertical")] - [Step(3, "Confirm pass or fail, If you can see 4 buttons")] - [Postcondition(1, "NA")] - public async Task Orientation_StackLayout_UIBH() - { - /* TEST CODE */ - CreateStackLayout("StackLayout Orientation Test!"); - _horizontalStackLayout.IsVisible = true; - _verticalStackLayout.IsVisible = true; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _horizontalStackLayout, _verticalStackLayout - } - }, - Title = "Test: Source", - BackgroundColor = Color.Blue - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets a value which indicates the amount of space between each children.")] - [Property("SPEC", "Xamarin.Forms.StackLayout.Spacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC and click Spacing+/Spacing- button")] - [Step(2, "Check item spacing")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Spacing_StackLayout_BHBH() - { - /* TEST CODE */ - CreateStackLayout("StackLayout Orientation Test!"); - _horizontalStackLayout.IsVisible = true; - _horizontalStackLayout.Spacing = 0; - _controlStackLayout.IsVisible = true; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _horizontalStackLayout, _controlStackLayout - } - }, - Title = "Test: Source", - BackgroundColor = Color.White - }; - _testPage.ExecuteTC(page); - _spacePlus.Clicked += (object sender, EventArgs e) => - { - _horizontalStackLayout.Spacing += 10; - }; - _spaceMinus.Clicked += (object sender, EventArgs e) => - { - if (_horizontalStackLayout.Spacing != 0) - { - _horizontalStackLayout.Spacing -= 10; - } - }; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.StackLayout.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of Button changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_StackLayout_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToStackLayout(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _button.IsEnabled = false; - } - else - { - _button.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.StackLayout.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsVisible of Slider changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_StackLayout_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToStackLayout(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _simpleStackLayout.IsVisible = false; - } - else - { - _simpleStackLayout.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.StackLayout.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of StackLayout changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_StackLayout_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToStackLayout(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _simpleStackLayout.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _simpleStackLayout.Scale = 1.0; - } - else - { - _simpleStackLayout.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.StackLayout.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of StackLayout changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_StackLayout_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToStackLayout(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _simpleStackLayout.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _simpleStackLayout.Rotation = 90; - } - else - { - _simpleStackLayout.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.StackLayout.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Margin of StackLayout changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_StackLayout_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToStackLayout(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _simpleStackLayout.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _simpleStackLayout.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _simpleStackLayout.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: StackLayout look")] - [Property("SPEC", "Xamarin.Forms.StackLayout Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of StackLayout changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_StackLayout_LOOK() - { - _stackLayout3 = new StackLayout() - { - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 550, - HeightRequest = 100, - BackgroundColor = Color.Blue, - IsEnabled = true, - }; - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _stackLayout3.BindingContext = sliderOpacity; - _stackLayout3.SetBinding(StackLayout.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Spacing = 25, - Children = - { - _stackLayout3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Opacity: ", - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity StackLayout Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: StackLayout look")] - [Property("SPEC", "Xamarin.Forms.StackLayout WidthAndHeight")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Width and Height after observe")] - [Step(3, "Pass If Height and Width of StackLayout changed otherwise false")] - [Postcondition(1, "NA")] - public async Task WidthAndHeight_StackLayout_CHANGE_SIZE() - { - _stackLayout4 = new StackLayout() - { - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 450, - HeightRequest = 100, - BackgroundColor = Color.Blue, - IsEnabled = true, - }; - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 100, - Value = 100 - }; - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 100, - Value = 100 - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _stackLayout4.WidthRequest = sliderHorizontal.Value; - }; - - sliderVertical.ValueChanged += (o, e) => - { - _stackLayout4.HeightRequest = sliderVertical.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _stackLayout4, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Width: ", - }, - sliderHorizontal - } - }, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Height: ", - }, - sliderVertical - } - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size StackLayout Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: StackLayout look")] - [Property("SPEC", "Xamarin.Forms.StackLayout.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of StackLayout is changed")] - [Step(3, "Pass If BackgroundColor of StackLayout changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_StackLayout_COLOR_CHANGE() - { - _stackLayout4 = new StackLayout() - { - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 450, - HeightRequest = 100, - BackgroundColor = Color.HotPink, - IsEnabled = true, - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _stackLayout4.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _stackLayout4.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _stackLayout4.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _stackLayout4, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStepper.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStepper.cs deleted file mode 100755 index e9333dd3b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSStepper.cs +++ /dev/null @@ -1,881 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class StepperTests - { - private static ListView _listview; - private static Stepper _stepper1, _stepper2, _stepper3; - private static Label _label1, _label2; - private static TestPage _testPage = TestPage.GetInstance(); - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Stepper CLASS: Setup---------------------------------"); - if (Device.Idiom != TargetIdiom.Phone) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Stepper CLASS: Teardown---------------------------------"); - _stepper1 = null; - _stepper2 = null; - _label1 = null; - _label2 = null; - } - - private static void OnValueChangedShowValue(object sender, EventArgs e) - { - var val = (int)_stepper1.Value; - _label2.Text = "Stepper current Value: " + val.ToString(); - } - - //support function - private static void CreateStepper(string Text) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateStepper"); - - _stepper1 = new Stepper() - { - IsVisible = false, - Value = 10, - Minimum = 0, - Maximum = 10, - Increment = 1.0, - HorizontalOptions = LayoutOptions.FillAndExpand, - Scale = 1.0 - }; - - _label1 = new Label() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - TextColor = new Color(255, 0, 0) - }; - _label2 = new Label() - { - IsVisible = false, - HorizontalOptions = LayoutOptions.FillAndExpand, - TextColor = new Color(0, 255, 0) - }; - } - - public void CreatePageTestToStepper(String txtDisplay, String title, String[] dataTest) - { - _stepper2 = new Stepper - { - Margin = new Thickness(0, 250, 0, 0), - //Text = "This is Slider test", - HorizontalOptions = LayoutOptions.Center, - //Font = Font.SystemFontOfSize(NamedSize.Medium), - WidthRequest = 350, - HeightRequest = 100, - Value = 5, - Minimum = 0, - Maximum = 10, - Increment = 0.1, - IsEnabled = true, - }; - Label labelDisplay = new Label - { - Margin = new Thickness(0, 200, 0, 0), - Text = txtDisplay, - TextColor = Color.Red, - Font = Font.SystemFontOfSize(NamedSize.Large), - HorizontalOptions = LayoutOptions.Center - }; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _stepper2, - labelDisplay, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the Increment value for the stepper.")] - [Property("SPEC", "Xamarin.Forms.Stepper.Increment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Check if the Increment value is 2.")] - [Step(3, "If after stepping right the increment value is 2 then Pass.")] - [Postcondition(1, "N/A")] - public async Task Increment_Stepper_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - CreateStepper("Stepper Increment Value Test!"); - _stepper1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = true; - _label1.Text = "Default Increment value is 2 here."; - _label2.Text = "Stepper current Increment Value: " + _stepper1.Value.ToString(); - _stepper1.Maximum = 20; - _stepper1.Increment = 2; - _stepper1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_stepper1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the maximum value for the stepper.")] - [Property("SPEC", "Xamarin.Forms.Stepper.Maximum A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Check if the Maximum value is 20.")] - [Step(3, "If after stepping right maximum value is 20 then pass.")] - [Postcondition(1, "N/A")] - public async Task Maximum_Stepper_UIBH() - { - /*PRE CONDITION - * - */ - //TEST CODE - CreateStepper("Stepper Maximum Value Test!"); - _stepper1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = true; - _label1.Text = "Maximum value is 20 here."; - _label2.Text = "Stepper current Value: " + _stepper1.Value.ToString(); - _stepper1.Maximum = 20.00; - _stepper1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_stepper1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the minimum value for the stepper.")] - [Property("SPEC", "Xamarin.Forms.Stepper.Minimum A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Check if the Minimum value is 5.")] - [Postcondition(1, "NA")] - public async Task Minimum_Stepper_UIBH() - { - CreateStepper("Stepper Minimum Value Test!"); - _stepper1.IsVisible = true; - _label1.IsVisible = true; - _label2.IsVisible = true; - _label1.Text = "Minimum value is 5 here."; - _label2.Text = "Stepper Value: " + _stepper1.Value.ToString(); - _stepper1.Minimum = 5.00; - _stepper1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_stepper1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets or gets the current value of the stepper displays.")] - [Property("SPEC", "Xamarin.Forms.Stepper.Value A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Check if the value is 5.")] - [Postcondition(1, "NA")] - public async Task Value_UIBH() - { - CreateStepper("Stepper Value Test!"); - _stepper1.IsVisible = true; - _label1.IsVisible = true; - _label1.HeightRequest = 100; - _label1.Text = "Value is 5 here. Stepper position will set to middle."; - _stepper1.Value = 5.00; - _stepper1.ValueChanged += OnValueChangedShowValue; - - var page = new ContentPage() - { - Content = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - _label1,_label2,_stepper1 - } - }, - Title = "Test: Source", - BackgroundColor = Color.White, - }; - _testPage.ExecuteTC(page); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.Stepper.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click stepper after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsVisible of stepper changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_Stepper_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToStepper(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _stepper2.IsVisible = false; - } - else - { - _stepper2.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UIBH")] - [Property("SPEC", "Xamarin.Forms.Stepper.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click stepper after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If IsEnabled of stepper changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_Stepper_UIBH() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToStepper(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _stepper2.IsEnabled = false; - } - else - { - _stepper2.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.Stepper.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click stepper after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Scale of stepper changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_Stepper_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToStepper(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _stepper2.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _stepper2.Scale = 1.0; - } - else - { - _stepper2.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.Stepper.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click stepper after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Rotation of Stepper changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_Stepper_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToStepper(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _stepper2.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _stepper2.Rotation = 90; - } - else - { - _stepper2.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.Stepper.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Click stepper after new page shown and check")] - [Step(3, "Click item of Listview")] - [Step(4, "Pass If Margin of stepper changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_Stepper_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToStepper(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _stepper2.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _stepper2.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _stepper2.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Stepper look")] - [Property("SPEC", "Xamarin.Forms.Stepper Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Stepper after observe")] - [Step(3, "Pass If Opacity of Stepper changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Stepper_Opacity_LOOK() - { - _stepper3 = new Stepper() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 220, - }; - var stepperOpacity = new Stepper() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1, - Increment = 0.1 - }; - - _stepper3.BindingContext = stepperOpacity; - _stepper3.SetBinding(Stepper.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _stepper3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Opacity: ", - Font = Font.SystemFontOfSize(NamedSize.Large) - }, - stepperOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Stepper look")] - [Property("SPEC", "Xamarin.Forms.Stepper Width")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Chagne the value of slider for observing the width of Stepper")] - [Step(3, "Pass If Width of stepper changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Stepper_Width_CHANGE_SIZE() - { - _stepper3 = new Stepper() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 120, - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = (Device.Idiom == TargetIdiom.Phone) ? 320 : 120, - Value = (Device.Idiom == TargetIdiom.Phone) ? 320 : 120, - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _stepper3.WidthRequest = sliderHorizontal.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 20, - }, - Spacing = 25, - Children = - { - _stepper3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Width: ", - Font = Font.SystemFontOfSize(NamedSize.Large) - }, - sliderHorizontal - } - }, - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Stepper Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Stepper look")] - [Property("SPEC", "Xamarin.Forms.Stepper.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Stepper is changed")] - [Step(3, "Pass If BackgroundColor of Stepper changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_Stepper_COLOR_CHANGE() - { - _stepper3 = new Stepper() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 120, - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _stepper3.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _stepper3.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _stepper3.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _stepper3, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitch.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitch.cs deleted file mode 100755 index e5065eb0b..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitch.cs +++ /dev/null @@ -1,743 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class SwitchTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static Label _label; - private static Switch _switch, _switch1, _switch2, _switch3, _switch4; - private static ListView _listview; - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Switch CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Switch CLASS: Teardown---------------------------------"); - _switch = null; - _switch1 = null; - _switch2 = null; - _switch3 = null; - _switch4 = null; - _label = null; - } - - /*-------supporting functions------*/ - - private static void CreateSwitchTest(String title) - { - bool checkValue = false; - var label2 = new Label - { - Text = " IsToggled: " - }; - _label = new Label - { - Text = checkValue.ToString(), - TextColor = Color.Black, - BackgroundColor = Color.White - }; - _switch = new Switch - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand - }; - var layout = new StackLayout - { - Orientation = StackOrientation.Vertical, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - IsVisible = true, - Children = { - new StackLayout { - Orientation = StackOrientation.Horizontal, - Children = { label2, _label } - }, - _switch, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - layout - }, - }, - Title = title - }); - } - - public void CreatePageTestToSwitch(String txtDisplay, String title, String[] dataTest) - { - _switch1 = new Switch - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - WidthRequest = 350, - IsEnabled = true - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _switch1, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - private static void OnToggledCB(object sender, EventArgs e) - { - _label.Text = _switch.IsToggled.ToString(); - } - - [Test] - [Category("P1")] - [Description("Test: Handle event Toggled Switch")] - [Property("SPEC", "Xamarin.Forms.Switch.IsToggled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check for Toggled of Switch")] - [Step(3, "Click back button")] - [Postcondition(1, "NA")] - public async Task IsToggled_UIBH() - { - CreateSwitchTest("Switch Toggled Test"); - _switch.Toggled += OnToggledCB; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.Switch.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If IsVisible of Switch changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_Switch_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToSwitch(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _switch1.IsVisible = false; - } - else - { - _switch1.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.Switch.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of Switch changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_Switch_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Scroll below listview, and select Enable or Disable"; - var title = "IsEnabled Test"; - CreatePageTestToSwitch(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _switch1.IsEnabled = false; - } - else - { - _switch1.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.Switch.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of Switch changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_Switch_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "0.5"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToSwitch(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _switch1.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _switch1.Scale = 1.0; - } - else - { - _switch1.Scale = 0.5; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.Switch.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of Switch changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_Switch_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0"; - dataTest[1] = "180"; - dataTest[2] = "0"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToSwitch(text, title, dataTest); - _switch1.Rotation = 180; - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _switch1.Rotation = 0; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _switch1.Rotation = 180; - } - else - { - _switch1.Rotation = 0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.Switch.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Margin of switch changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_Switch_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToSwitch(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _switch1.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _switch1.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _switch1.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Switch look")] - [Property("SPEC", "Xamarin.Forms.Switch Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Switch after observe")] - [Step(3, "Pass If Opacity of Switch changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_Switch_LOOK() - { - _switch3 = new Switch() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - BackgroundColor = Color.Pink, - HeightRequest = 80, - WidthRequest = 80, - }; - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _switch3.BindingContext = sliderOpacity; - _switch3.SetBinding(Switch.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Spacing = 25, - Children = - { - _switch3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Opacity: ", - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - //[Test] - //[Category("P1")] - //[Description("Test: Switch look")] - //[Property("SPEC", "Xamarin.Forms.Switch WidthAndHeight")] - //[Property("SPEC_URL", "-")] - //[Property("CRITERIA", "PRW")] - //[Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - //[Precondition(1, "NA")] - //[Step(1, "Click run TC")] - //[Step(2, "Seek Switch for Width and Height after observe")] - //[Step(3, "Pass If Height and Width of Switch changed otherwise false")] - //[Postcondition(1, "NA")] - //public async Task WidthAndHeight_Switch_CHANGE_SIZE() - //{ - // _switch2 = new Switch() - // { - // Margin = new Thickness(0, 250, 0, 0), - // HorizontalOptions = LayoutOptions.Center, - // WidthRequest = 450, - // HeightRequest = 250, - // BackgroundColor = Color.Blue, - // IsEnabled = true, - // }; - - // var sliderHorizontal = new Slider() - // { - // HorizontalOptions = LayoutOptions.FillAndExpand, - // BackgroundColor = Color.Pink, - // Maximum = 500, - // Minimum = 120 - // }; - - // var sliderVertical = new Slider() - // { - // HorizontalOptions = LayoutOptions.FillAndExpand, - // BackgroundColor = Color.Pink, - // Maximum = 500, - // Minimum = 80 - // }; - - // sliderHorizontal.ValueChanged += (o, e) => - // { - // _switch2.WidthRequest = sliderHorizontal.Value; - // }; - - // sliderVertical.ValueChanged += (o, e) => - // { - // _switch2.HeightRequest = sliderVertical.Value; - // }; - - // var mainUI = new StackLayout() - // { - // HorizontalOptions = LayoutOptions.FillAndExpand, - // VerticalOptions = LayoutOptions.FillAndExpand, - // BackgroundColor = Color.White, - // Padding = new Thickness() - // { - // Top = 20, - // Bottom = 20, - // }, - // Spacing = 25, - // Children = - // { - // _switch2, - // new StackLayout() { - // Orientation = StackOrientation.Horizontal, - // HorizontalOptions = LayoutOptions.FillAndExpand, - // Padding = new Thickness() { - // Left = 20, - // Right = 20, - // }, - // Children = - // { - // new Label() - // { - // Text = "Width: ", - // Font = Font.SystemFontOfSize(NamedSize.Large) - // }, - // sliderHorizontal - // } - // }, - // new StackLayout() { - // Orientation = StackOrientation.Horizontal, - // HorizontalOptions = LayoutOptions.FillAndExpand, - // Padding = new Thickness() { - // Left = 20, - // Right = 20, - // }, - // Children = - // { - // new Label() - // { - // Text = "Height: ", - // Font = Font.SystemFontOfSize(NamedSize.Large) - // }, - // sliderVertical - // } - // } - // } - // }; - // _testPage.ExecuteTC(new ContentPage() - // { - // Content = mainUI, - // Title = "Size Switch Test" - // }); - // await ManualTest.WaitForConfirm(); - //} - - [Test] - [Category("P1")] - [Description("Test: Switch look")] - [Property("SPEC", "Xamarin.Forms.Switch.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of Switch is changed")] - [Step(3, "Pass If BackgroundColor of Switch changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_Switch_COLOR_CHANGE() - { - _switch4 = new Switch() - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 120 - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _switch4.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _switch4.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _switch4.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _switch4, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitchCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitchCell.cs deleted file mode 100755 index 442e5adb2..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSSwitchCell.cs +++ /dev/null @@ -1,390 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class SwitchCellTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ListView _listview; - private static SwitchCell _switchCell1, _switchCell2, _switchCell3, _switchCell14; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "SwitchCell CLASS: Teardown---------------------------------"); - } - - private static void CreateSwitchCellTest(String title) - { - var label2 = new Label - { - Text = " Switch Cell" - }; - _switchCell1 = new SwitchCell - { - Text = "Switch Cell On" - }; - - _switchCell2 = new SwitchCell - { - Text = "Switch Cell Off" - }; - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _switchCell1,_switchCell2 - } - } - }; - - var layout = new StackLayout - { - Orientation = StackOrientation.Vertical, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - IsVisible = true, - Children = { - new StackLayout { - Orientation = StackOrientation.Horizontal, - Padding = new Thickness () { - Bottom = 50, - }, - Children = { label2 } - }, - tableView, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - layout - }, - BackgroundColor = Color.Crimson, - }, - Title = title - }); - } - - public void CreatePageTestToSwitchCell(String txtDisplay, String title, String[] dataTest) - { - _switchCell14 = new SwitchCell - { - Text = "Switch Cell" - }; - - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _switchCell14 - } - } - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - tableView, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the state of the switch.")] - [Property("SPEC", "Xamarin.Forms.SwitchCell.On A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the switch is on and off states in respective switch cells.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task ON_SwitchCell_UILK() - { - /* TEST CODE */ - CreateSwitchCellTest("Switch Cell On Off Test"); - _switchCell1.On = true; - _switchCell2.On = false; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the text displayed next to the switch.")] - [Property("SPEC", "Xamarin.Forms.SwitchCell. A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the swicth cell has text \" SRBD \".")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Text_SwitchCell_UIBH() - { - /* TEST CODE */ - _switchCell3 = new SwitchCell(); - var label2 = new Label - { - Text = " Switch Cell" - }; - TableView tableView = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot - { - new TableSection - { - _switchCell3 - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - label2,tableView - }, - BackgroundColor = Color.White, - }, - Title = "Switch Cell Text Test" - }); - _switchCell3.Text = "SRBD"; - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.SwitchCell.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If IsEnabled of Switch Cell changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_SwitchCell_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Scroll below listview, and select Enable or Disable"; - var title = "IsEnabled Test"; - CreatePageTestToSwitchCell(text, title, dataTest); - - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _switchCell14.IsEnabled = false; - } - else - { - _switchCell14.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - //[Test] - //[Category("P1")] - //[Description("Test: SwitchCell look")] - //[Property("SPEC", "Xamarin.Forms.SwitchCell Height")] - //[Property("SPEC_URL", "-")] - //[Property("CRITERIA", "PRW")] - //[Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - //[Precondition(1, "NA")] - //[Step(1, "Click run TC")] - //[Step(2, "Seek SwitchCell for Height after observe")] - //[Step(3, "Pass If Height of SwitchCell changed otherwise false")] - //[Postcondition(1, "NA")] - //public async Task SwitchCell_Height_CHANGE_SIZE() - //{ - // _switchCell14 = new SwitchCell() - // { - // Text = "Switch Cell", - // Height = 10 - // }; - // TableView tableView = new TableView - // { - // Intent = TableIntent.Form, - // Root = new TableRoot - // { - // new TableSection - // { - // _switchCell14 - // } - // } - // }; - - // var sliderVertical = new Slider() - // { - // HorizontalOptions = LayoutOptions.FillAndExpand, - // BackgroundColor = Color.Pink, - // Maximum = 500, - // Minimum = 80 - // }; - - // sliderVertical.ValueChanged += (o, e) => - // { - // _switchCell14.Height = sliderVertical.Value; - // }; - - // var mainUI = new StackLayout() - // { - // HorizontalOptions = LayoutOptions.FillAndExpand, - // VerticalOptions = LayoutOptions.FillAndExpand, - // BackgroundColor = Color.Green, - // Padding = new Thickness() - // { - // Top = 20, - // Bottom = 20, - // }, - // Spacing = 25, - // Children = - // { - // tableView, - // new StackLayout() { - // Orientation = StackOrientation.Horizontal, - // HorizontalOptions = LayoutOptions.FillAndExpand, - // Padding = new Thickness() { - // Left = 20, - // Right = 20, - // }, - // Children = - // { - // new Label() - // { - // Text = "Height: ", - // Font = Font.SystemFontOfSize(NamedSize.Large) - // }, - // sliderVertical - // } - // }, - - // } - // }; - // _testPage.ExecuteTC(new ContentPage() - // { - // Content = mainUI, - // Title = "Size Switch Cell Test" - // }); - // await ManualTest.WaitForConfirm(); - //} - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTabbedPage.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTabbedPage.cs deleted file mode 100755 index 028dde384..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTabbedPage.cs +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class TabbedPageTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static NavigationPage _navigationPage = TestPage.GetInstance().getNavigationPage(); - private static Boolean isParentSet; - - class TabbedPageDemoPage : TabbedPage - { - public TabbedPageDemoPage() - { - this.Title = "TabbedPage"; - this.Children.Add(new ContentPage - { - Title = "Blue", - Content = new BoxView - { - Color = Color.Blue, - HeightRequest = 100f, - VerticalOptions = LayoutOptions.Center - }, - }); - this.Children.Add(new ContentPage - { - Title = "Blue and Red", - Content = new StackLayout - { - Children = { - new BoxView { Color = Color.Blue }, - new BoxView { Color = Color.Red} - }, - HeightRequest = 100f, - } - }); - } - - protected override void OnParentSet() - { - if (isParentSet) - { - Assert.True(true); - ManualTest.Confirm(); - } - base.OnParentSet(); - } - } - - [SetUp] - public void Setup() - { - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TabbedPageTests --------------- Setup()"); - } - else - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("TabbedPageTests --------------- TearDown()"); - } - - // Exclude this TC due to Tizen Limit - //[Test] - [Category("P1")] - [Description("Check whether tabbed page bar background color can be changed.")] - [Property("SPEC", "Xamarin.Forms.TabbedPage.BarBackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if tabbed page bar background (background color of 'Blue' and 'Blue and Red' tab) is yellow.")] - [Step(3, "Click BACK button: Click Pass if bar background color is yellow or mark fail.")] - [Postcondition(1, "NA")] - public async Task BarBackgroundColor_UILK() - { - /*TEST CODE*/ - TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage(); - tabbedPageDemoPage.BarBackgroundColor = Color.Yellow; - - _testPage.ExecuteTC(tabbedPageDemoPage); - await ManualTest.WaitForConfirm(); - } - - // Exclude this TC due to Tizen Limit - //[Test] - [Category("P1")] - [Description("Check whether tabbed page bar text color can be changed.")] - [Property("SPEC", "Xamarin.Forms.TabbedPage.BarTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Check if tabbed page bar text color (text color of 'Blue' and 'Blue and Red') is red.")] - [Step(3, "Click BACK button: Click Pass if bar text color is red or mark fail.")] - [Postcondition(1, "NA")] - public async Task BarTextColor_UILK() - { - /*TEST CODE*/ - TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage(); - tabbedPageDemoPage.BarTextColor = Color.Red; - - _testPage.ExecuteTC(tabbedPageDemoPage); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether onparentset is called when parent is set.")] - [Property("SPEC", "Xamarin.Forms.TabbedPage.OnParentSet M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click BACK button: TC will pass automatically or mark fail.")] - [Postcondition(1, "NA")] - public async Task OnParentSet_UIBH() - { - /* TEST CODE */ - TabbedPageDemoPage tabbedPageDemoPage = new TabbedPageDemoPage(); - tabbedPageDemoPage.Parent = _navigationPage; - isParentSet = true; - - _testPage.ExecuteTC(tabbedPageDemoPage); - await ManualTest.WaitForConfirm(); - isParentSet = false; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTableView.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTableView.cs deleted file mode 100755 index 7bbd95557..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTableView.cs +++ /dev/null @@ -1,1477 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class TableViewTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ListView _listview; - private static Slider _slider1; - private static Button _button1, _button2; - private static Label _label1, _label2, _label3; - private static TableView _tableView1, _tableView2, _tableView3, _tableView4, _tableView5, _tableView6, _tableView7, _tableView8, _tableView9; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - class customTableViewClass : TableView - { - public bool IsBindingContextChanged = false; - - protected override void OnBindingContextChanged() - { - Assert.IsTrue(true); - ManualTest.Confirm(); - } - - protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint) - { - Assert.IsTrue(true); - ManualTest.Confirm(); - return base.OnSizeRequest(widthConstraint, heightConstraint); - } - - protected override void OnModelChanged() - { - Assert.IsTrue(true); - ManualTest.Confirm(); - base.OnModelChanged(); - } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TableView CLASS: Teardown---------------------------------"); - _tableView1 = null; - _tableView2 = null; - _tableView3 = null; - _tableView4 = null; - _tableView5 = null; - _tableView6 = null; - _tableView7 = null; - _tableView8 = null; - _tableView9 = null; - } - - private static void OnRowHeightChange(object sender, EventArgs e) - { - _tableView7.RowHeight = (int)_slider1.Value; - } - - private static void CreateTableView(String title) - { - var label2 = new Label - { - Text = " Table View" - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - } - }, - new TableSection ("Section 2 Title") { - new EntryCell { - Label = "Another EntryCell:", - Placeholder = "phone keyboard", - Keyboard = Keyboard.Telephone - }, - new SwitchCell { - Text = "SwitchCell:" - } - } - } - }; - - _tableView2 = new TableView - { - Intent = TableIntent.Menu, - Root = new TableRoot("Table View Menu") { - new TableSection ("Section 1 Title") { - new TextCell { - Text = "Label", - }, - }, - new TableSection ("Section 2 Title") { - new TextCell { - Text = "Image", - }, - } - } - }; - - var layout = new StackLayout - { - Orientation = StackOrientation.Vertical, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - IsVisible = true, - Children = { - _tableView1, - _tableView2 - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - layout - }, - BackgroundColor = Color.White, - }, - Title = title - }); - } - - public void CreatePageTestToTableView(String txtDisplay, String title, String[] dataTest) - { - _tableView4 = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - }, - }, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 250, - HeightRequest = 100, - IsEnabled = true, - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _listview, - _tableView4, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Test: TableView look")] - [Property("SPEC", "Xamarin.Forms.TableView")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the table view UI is visible.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TableView_LOOK_UILK() - { - /* TEST CODE */ - CreateTableView("Table View Test"); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: TableView Intent")] - [Property("SPEC", "Xamarin.Forms.TableView Intent")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the table view UI is visible.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Intent_TableView_UILK() - { - /* TEST CODE */ - _label1 = new Label - { - Text = "Image " - }; - - _label2 = new Label - { - Text = "Data" - }; - - _label3 = new Label - { - Text = "Name" - }; - - _tableView6 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell - { - Text = "Image" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Name" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Data" - } - }, - new TableSection ("Section 2 Title") - { - new TextCell - { - Text = "Image" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Name" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Data" - } - } - }, - }; - _tableView6.Intent = TableIntent.Form; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView6 - }, - BackgroundColor = Color.Blue, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the root of the table.")] - [Property("SPEC", "Xamarin.Forms.TableView root")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the table view UI is visible.")] - [Step(3, "Check if the table view has a root and Root1 is visible.")] - [Step(4, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Root_TableView_UILK() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "Table View Root ", - }; - - var root = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - } - }, - }; - - _tableView7 = new TableView - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 300, - IsEnabled = true, - Root = root - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2, _tableView7 - }, - BackgroundColor = Color.Blue, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - // Exclude this TC due to Tizen Limit - //[Test] - [Category("P1")] - [Description("The height of the items in the list.")] - [Property("SPEC", "Xamarin.Forms.TableView RowHeight")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the table view UI is visible.")] - [Step(3, "Click the button to set row height.")] - [Step(4, "If the row height increase press pass otherwise fail")] - [Postcondition(1, "NA")] - public async Task RowHeight_TableView_UILK() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "Row Height Test ", - HorizontalTextAlignment = TextAlignment.Center - }; - - var root = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "Root 1 TextCell 1 Text", - Detail = "TextCell Detail" - }, - new TextCell { - Text = "Root 1 TextCell 2 Text", - Detail = "TextCell Detail" - }, - new TextCell { - Text = "Root 1 TextCell 3 Text", - Detail = "TextCell Detail" - } - } - }; - - _tableView5 = new TableView - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 400, - HeightRequest = 300, - RowHeight = 10, - IsEnabled = true, - HasUnevenRows = false, - Root = root, - }; - - _button1 = new Button() - { - Text = "Tap to set table view row height 30", - TextColor = new Color(255, 255, 255) - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _tableView5.RowHeight = 30; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2,_button1, _tableView5 - }, - BackgroundColor = Color.Blue, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets a value of HasUnevenRows property of TableView.")] - [Property("SPEC", "Xamarin.Forms.TableView RowHeight")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Click the button.")] - [Step(3, "Check if the label text shows true.")] - [Step(4, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task HasUnevenRows_TableView_UIBH() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "HasUnevenRows Test ", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - var root = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "Root 1 TextCell1 Text", - Detail = "TextCell Detail" - }, - new TextCell { - Text = "Root 1 TextCell2 Text", - Detail = "TextCell Detail" - }, - new TextCell { - Text = "Root 1 TextCell3 Text", - Detail = "TextCell Detail" - } - } - }; - - _tableView7 = new TableView - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 300, - RowHeight = 10, - IsEnabled = true, - HasUnevenRows = true, - Root = root - }; - _button1 = new Button() - { - Text = "Tap to see HasUnevenRows is True", - TextColor = new Color(255, 255, 255) - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _label2.Text = _tableView7.HasUnevenRows.ToString(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2,_button1, _tableView7, - }, - BackgroundColor = Color.Blue, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Method is called when the binding context changes.")] - [Property("SPEC", "Xamarin.Forms.TableView OnBindingContextChanged")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if 2 table view UI is visible.")] - [Step(3, "Click the button to change the binding context.")] - [Step(4, "Check if height of 2nd table view is set to 1st table view.")] - [Step(5, "Check if the label above the button is changed.")] - [Step(6, "Press back button : TC will pass automatically otherwise mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnBindingContextChanged_TableView_UIBH() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "OnBindingContextChanged Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - var root1 = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - }, - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - } - }, - }; - - var root2 = new TableRoot("Table View Form ") { - new TableSection ("Root 2") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - } - }, - }; - customTableViewClass _customTableView1 = new customTableViewClass - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 300, - IsEnabled = true, - Root = root1, - HasUnevenRows = true - }; - - customTableViewClass _customTableView2 = new customTableViewClass - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 500, - IsEnabled = true, - Root = root2, - HasUnevenRows = false - }; - - _button2 = new Button() - { - Text = "Click the button", - TextColor = new Color(255, 255, 255) - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _customTableView1.BindingContext = _customTableView2; - _customTableView1.SetBinding(TableView.HeightRequestProperty, "HeightRequest"); - _label2.Text = "Height of 2nd table view is set to 1st table view"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2,_button2,_customTableView1,_customTableView2 - }, - BackgroundColor = Color.Blue, - }, - }); - - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Method is called when a size request is made.")] - [Property("SPEC", "Xamarin.Forms.TableView OnSizeRequest")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if table view UI is visible.")] - [Step(3, "Click the button to change size.")] - [Step(4, "Press back button : TC will pass automatically otherwise mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnSizeRequest_TableView_UIBH() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "OnSizeRequest Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - var root1 = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - }, - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - } - }, - }; - - var root2 = new TableRoot("Table View Form ") { - new TableSection ("Root 2") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - } - }, - }; - customTableViewClass _customTableView3 = new customTableViewClass - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 300, - IsEnabled = true, - Root = root1, - HasUnevenRows = true - }; - - _button2 = new Button() - { - Text = "Click this button", - TextColor = Color.White - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _customTableView3.HeightRequest = 400.0; - _customTableView3.WidthRequest = 600.0; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2,_button2,_customTableView3 - }, - BackgroundColor = Color.Blue, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Method is called when the model changes.")] - [Property("SPEC", "Xamarin.Forms.TableView OnModelChanged")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if table view UI is visible.")] - [Step(3, "Click the button to change model.")] - [Step(4, "Press back button : TC will pass automatically otherwise mark Fail.")] - [Postcondition(1, "NA")] - public async Task OnModelChanged_TableView_UIBH() - { - /* TEST CODE */ - _label2 = new Label - { - Text = "OnModelChanged Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - var root1 = new TableRoot("Table View Form ") { - new TableSection ("Root 1") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - }, - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - } - }, - }; - - var root2 = new TableRoot("Table View Form ") { - new TableSection ("Root 2") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - new EntryCell { - Label = "EntryCell:", - Placeholder = "default keyboard", - Keyboard = Keyboard.Default - } - }, - }; - customTableViewClass _customTableView4 = new customTableViewClass - { - Intent = TableIntent.Form, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 500, - HeightRequest = 300, - IsEnabled = true, - Root = root1, - HasUnevenRows = true - }; - - _button2 = new Button() - { - Text = "Click this button", - TextColor = Color.White - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _customTableView4.Root = root2; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label2,_button2,_customTableView4 - }, - BackgroundColor = Color.Blue, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: TableView look")] - [Property("SPEC", "Xamarin.Forms.TableView Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity TableView after observe")] - [Step(3, "Pass If Opacity of TableView changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_TableView_LOOK() - { - _tableView3 = new TableView() - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail" - }, - }, - new TableSection ("Section 2 Title") { - new EntryCell { - Label = "Another EntryCell:", - Placeholder = "phone keyboard", - Keyboard = Keyboard.Telephone - }, - } - }, - WidthRequest = 550, - HeightRequest = 100, - BackgroundColor = Color.HotPink, - IsEnabled = true, - }; - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _tableView3.BindingContext = sliderOpacity; - _tableView3.SetBinding(TableView.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _tableView3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text = "Opacity: " - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity StackLayout Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: TableView look")] - [Property("SPEC", "Xamarin.Forms.TableView Width")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Behavior about width of TableView is depends on UX of TV product")] - [Step(1, "Click run TC")] - [Step(2, "Seek TableView for Width after observe")] - [Step(3, "Pass If Width changed otherwise Fail")] - [Postcondition(1, "NA")] - public async Task Width_TableView_CHANGE_SIZE() - { - if (Device.Idiom == TargetIdiom.TV) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - - _tableView3 = new TableView() - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell { - Text = "TextCell Text", - Detail = "TextCell Detail", - } - }, - }, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 450, - HeightRequest = 250, - BackgroundColor = Color.HotPink, - IsEnabled = true, - }; - - var sliderHorizontal = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 120 - }; - - sliderHorizontal.ValueChanged += (o, e) => - { - _tableView3.WidthRequest = sliderHorizontal.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 20, - }, - Spacing = 25, - Children = - { - _tableView3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Width: " - }, - sliderHorizontal - } - }, - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Table View Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.TableView.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsVisible of TableView changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_TableView_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToTableView(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _tableView4.IsVisible = false; - } - else - { - _tableView4.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.TableView.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of TableView changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_TableView_UILK() - { - if (Device.Idiom == TargetIdiom.Unsupported) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not supported"); - } - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToTableView(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _tableView4.IsEnabled = false; - } - else - { - _tableView4.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.TableView.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of TableView changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_TableView_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToTableView(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _tableView4.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _tableView4.Scale = 1.0; - } - else - { - _tableView4.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.TableView.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of TableView changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_TableView_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToTableView(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _tableView4.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _tableView4.Rotation = 90; - } - else - { - _tableView4.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.TableView.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Margin of TableView changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_TableView_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToTableView(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _tableView4.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _tableView4.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _tableView4.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: TableView look")] - [Property("SPEC", "Xamarin.Forms.TableView.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of TableView is changed")] - [Step(3, "Pass If BackgroundColor of TableView changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_TableView_COLOR_CHANGE() - { - _tableView5 = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - new TextCell - { - Text = "Image" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Name" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Data" - } - }, - new TableSection ("Section 2 Title") - { - new TextCell - { - Text = "Image" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Name" - }, - new TextCell - { - Text = "Data" - }, - new TextCell - { - Text = "Data" - } - } - }, - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 350, - HeightRequest = 200, - IsEnabled = true, - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _tableView5.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _tableView5.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _tableView5.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _tableView5, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - if (ManualTest.IsWearable()) - { - Console.WriteLine("Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - else - { - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTapGestureRecognizer.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTapGestureRecognizer.cs deleted file mode 100755 index 4a4e4af08..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTapGestureRecognizer.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 System; -using System.Threading.Tasks; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Xamarin.Forms; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.TapGestureRecognizer test")] - public class TapGestureRecognizerTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static TapGestureRecognizer _tapGestureRecognizer; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private static void CreateTapGestureRecognizerPage(string tapGestureRecognizer) - { - _tapGestureRecognizer = new TapGestureRecognizer(); - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - Text="Tap to page", - HorizontalOptions=LayoutOptions.Center, - } - } - }; - layout.GestureRecognizers.Add(_tapGestureRecognizer); - var page = new ContentPage - { - Title = tapGestureRecognizer, - Content = layout, - }; - _testPage.ExecuteTC(page); - } - - [Test] - [Category("P1")] - [Description("Test: Handle event tapped")] - [Property("SPEC", "Xamarin.Forms.TapGestureRecognizer.Tapped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Tap after new page shown")] - [Step(3, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Tapped_EVENT() - { - _tapGestureRecognizer = new TapGestureRecognizer(); - var label = new Label - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Text = "Click", - TextColor = Color.Black, - BackgroundColor = Color.White - }; - label.GestureRecognizers.Add(_tapGestureRecognizer); - _tapGestureRecognizer.Tapped += onTapped; - - _testPage.ExecuteTC(new StackLayout - { - Children = - { - label - } - }); - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _tapGestureRecognizer.Tapped -= onTapped; - } - - private static void onTapped(object sender, EventArgs e) - { - Assert.True(true); - ManualTest.Confirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTextCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTextCell.cs deleted file mode 100644 index 853b5745f..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTextCell.cs +++ /dev/null @@ -1,646 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class TextCellTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ListView _listview; - private static Label _label1, _label2, _label3, _label4; - private static TextCell _textCell1, _textCell2; - private static TableView _tableView1, _tableView2, _tableView3, _tableView4, _tableView5, _tableView6, _tableView7, _tableView8, _tableView9; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TextCell CLASS: Teardown---------------------------------"); - } - - //support function - public void CreatePageTestToTextCell(String txtDisplay, String title, String[] dataTest) - { - _textCell1 = new TextCell - { - Text = "Text Cell 1", - TextColor = Color.Red - }; - - _textCell2 = new TextCell - { - Text = "Text Cell 2", - TextColor = Color.Green - }; - - _tableView2 = new TableView - { - Intent = TableIntent.Settings, - BackgroundColor = Color.Green, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - }, - new TableSection ("Section 2 Title") - { - _textCell2 - }, - } - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(100, 0, 0, 0), - TextColor = Color.Black, - BackgroundColor = Color.White, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView2, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Test: TextCell Look")] - [Property("SPEC", "Xamarin.Forms.TextCell")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the Text Cell 1 in Table View with Text Color Red.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_LOOK_UILK() - { - /* TEST CODE */ - _textCell1 = new TextCell - { - Text = "Text Cell 1", - TextColor = Color.Red - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the secondary text to be displayed in the TextCell.")] - [Property("SPEC", "Xamarin.Forms.TextCell Detail")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the secondary text is visible under \"Text Cell 1\" ")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_Detail_UILK() - { - /* TEST CODE */ - if (Device.Idiom == TargetIdiom.Phone) - { - _textCell1 = new TextCell - { - Text = "Text Cell 1", - TextColor = Color.Red - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - } - } - }; - - _textCell1.Detail = "This is secondary text"; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Gets or sets the color to render the secondary text.")] - [Property("SPEC", "Xamarin.Forms.TextCell Detail")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the secondary text color is Green.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_DetailColor_UILK() - { - /* TEST CODE */ - if (Device.Idiom == TargetIdiom.Phone) - { - _textCell1 = new TextCell - { - Text = "Text Cell 1", - TextColor = Color.Red - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - } - } - }; - - _textCell1.Detail = "This is secondary text"; - _textCell1.DetailColor = Color.Green; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [Test] - [Category("P1")] - [Description("Gets or sets the primary text to be displayed.")] - [Property("SPEC", "Xamarin.Forms.TextCell Text")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check The primary text of Text Cell is Primary Text.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_Text_UILK() - { - /* TEST CODE */ - _textCell1 = new TextCell - { - Text = "Text Cell 1", - TextColor = Color.Red - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - } - } - }; - - _textCell1.Text = "Primary Text"; - _textCell1.Detail = "This is secondary text"; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the color to render the primary text.")] - [Property("SPEC", "Xamarin.Forms.TextCell TextColor")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if clicking the image button changes the text color.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_TextColor_UILK() - { - _textCell1 = new TextCell - { - Text = "Tap this text.", - TextColor = Color.Black - }; - - _tableView3 = new TableView - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell1 - } - } - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _textCell1.TextColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _textCell1.TextColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _textCell1.TextColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Children = - { - _tableView3, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the ICommand to be executed when the TextCell is tapped.")] - [Property("SPEC", "Xamarin.Forms.TextCell Command")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check after tapping the text in text cell the text is changed.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_Command_UILK() - { - /* TEST CODE */ - _textCell1 = new TextCell - { - Text = "Tap this text.", - }; - - var _textCell0 = new TextCell - { - Text = "dummy for space", - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell0, - _textCell1 - } - } - }; - - _textCell1.Command = new Command(() => - { - _textCell1.Text = "Text tapped Command Executed."; - _textCell1.TextColor = Color.Purple; - }); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the parameter passed when invoking the Command.")] - [Property("SPEC", "Xamarin.Forms.TextCell CommandParameter")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check after tapping the text in text cell the text is SRBD.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TextCell_CommandParameter_UILK() - { - /* TEST CODE */ - _textCell1 = new TextCell - { - Text = "Tap this text.", - }; - - var _textCell0 = new TextCell - { - Text = "dummy for space", - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Settings, - Root = new TableRoot("Table View Form") { - new TableSection ("Section 1 Title") { - _textCell0, - _textCell1 - } - } - }; - - _textCell1.CommandParameter = "SRBD"; - _textCell1.Command = new Command(() => { _textCell1.Text = (string)_textCell1.CommandParameter; }); - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.TextCell.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(4, "Pass If IsEnabled of 'Text Cell 1' changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_TextCell_UILK() - { - if (Device.Idiom == TargetIdiom.Unsupported) - { - _testPage.UnlockUIButton(); - Assert.Pass("Not supported"); - } - - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - dataTest[2] = "Enable"; - var text = "Scroll below listview, and select Enable or Disable"; - var title = "IsEnabled Test"; - CreatePageTestToTextCell(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _textCell1.IsEnabled = false; - } - else - { - _textCell1.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTimePicker.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTimePicker.cs deleted file mode 100755 index 6110e1d37..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSTimePicker.cs +++ /dev/null @@ -1,808 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class TimePickerTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ListView _listview; - private static TimePicker _timePicker1, _timePicker2, _timePicker3, _timePicker4, _timePicker5; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - if (Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.TV) - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Setup---------------------------------"); - } - else - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Not supported on this profile"); - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Teardown---------------------------------"); - _timePicker1 = null; - _timePicker2 = null; - _timePicker3 = null; - _timePicker4 = null; - _timePicker5 = null; - } - - public void CreatePageTestToTimePicker(String txtDisplay, String title, String[] dataTest) - { - _timePicker2 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - HorizontalOptions = LayoutOptions.Center, - Time = new TimeSpan(17, 0, 0), - WidthRequest = 350, - HeightRequest = 100, - IsEnabled = true - }; - - Label labelDisplay = new Label - { - Margin = new Thickness(0, 200, 0, 0), - Text = txtDisplay, - TextColor = Color.Red, - Font = Font.SystemFontOfSize(NamedSize.Large), - HorizontalOptions = LayoutOptions.Center - }; - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]), - new ControlTest(dataTest[2]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _timePicker2, - labelDisplay, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Test: TimePicker Look")] - [Property("SPEC", "Xamarin.Forms.TimePicker")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if TimePicker is visible with black text.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TimePicker_LOOK_UILK() - { - /* TEST CODE */ - _timePicker1 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - TextColor = Color.Black - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _timePicker1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the text color of time picker.")] - [Property("SPEC", "Xamarin.Forms.TimePicker.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if Time Picker text color is red.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TimePicker_TextColor_UILK() - { - /* TEST CODE */ - _timePicker1 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - }; - - _timePicker1.TextColor = Color.Red; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _timePicker1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("The format of the time to display to the user.")] - [Property("SPEC", "Xamarin.Forms.TimePicker Format")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check the format of time picker is HH:MM.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TimePicker_Format_UILK() - { - /* TEST CODE */ - _timePicker1 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - TextColor = Color.Black - }; - - _timePicker1.Format = "HH:mm"; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _timePicker1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the displayed time of Time Picker.")] - [Property("SPEC", "Xamarin.Forms.TimePicker Time")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check the Time of time picker is 6:00 PM.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task TimePicker_Time_UILK() - { - /* TEST CODE */ - _timePicker1 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - TextColor = Color.Black - }; - - _timePicker1.Time = new TimeSpan(18, 0, 0); - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _timePicker1 - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: IsVisible UILK")] - [Property("SPEC", "Xamarin.Forms.TimePicker.IsVisible A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsVisible of TimePicker changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsVisible_TimePicker_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Visible"; - dataTest[1] = "Invisible"; - //dataTest[2] = "Visible"; - var text = "Select a IsVisible test"; - var title = "IsVisible Test"; - CreatePageTestToTimePicker(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _timePicker2.IsVisible = false; - } - else - { - _timePicker2.IsVisible = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* POSTCONDITION 1480 - * Remove event handler 1481 - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.TimePicker.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of TimePicker changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_TimePicker_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToTimePicker(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _timePicker2.IsEnabled = false; - } - else - { - _timePicker2.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Scale UILK")] - [Property("SPEC", "Xamarin.Forms.TimePicker.Scale A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Scale of TimePicker changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Scale_TimePicker_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "0.5"; - dataTest[1] = "1.0"; - dataTest[2] = "2.0"; - var text = "Select a Scale test"; - var title = "Scale Test"; - CreatePageTestToTimePicker(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _timePicker2.Scale = 0.5; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _timePicker2.Scale = 1.0; - } - else - { - _timePicker2.Scale = 2.0; - } - }; - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Rotation UILK")] - [Property("SPEC", "Xamarin.Forms.TimePicker.Rotation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Rotation of TimePicker changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Rotation_TimePicker_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "50"; - dataTest[1] = "90"; - dataTest[2] = "180"; - var text = "Select a Rotation test"; - var title = "Rotation Test"; - CreatePageTestToTimePicker(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _timePicker2.Rotation = 50; - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _timePicker2.Rotation = 90; - } - else - { - _timePicker2.Rotation = 180; - } - }; - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Margin UILK")] - [Property("SPEC", "Xamarin.Forms.TimePicker.Margin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If Margin of TimePicker changed otherwise False")] - [Postcondition(1, "NA")] - public async Task Margin_TimePicker_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "MarginTop: 50"; - dataTest[1] = "MarginTop: 100"; - dataTest[2] = "MarginTop: 150"; - var text = "Select a Margin test"; - var title = "Margin Test"; - CreatePageTestToTimePicker(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[0])) - { - _timePicker2.Margin = new Thickness(0, 50, 0, 0); - } - else if (controlTest.Name.Equals(dataTest[1])) - { - _timePicker2.Margin = new Thickness(0, 100, 0, 0); - } - else - { - _timePicker2.Margin = new Thickness(0, 150, 0, 0); - } - }; - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - - [Test] - [Category("P1")] - [Description("Test: Slider look")] - [Property("SPEC", "Xamarin.Forms.TimePicker Opacity")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Opacity Slider after observe")] - [Step(3, "Pass If Opacity of TimePicker changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Opacity_TimePicker_LOOK() - { - _timePicker3 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - TextColor = Color.Black - }; - - var sliderOpacity = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.BlueViolet, - Maximum = 1, - Minimum = 0, - Value = 1 - }; - - _timePicker3.BindingContext = sliderOpacity; - _timePicker3.SetBinding(TimePicker.OpacityProperty, "Value"); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 50, - }, - Spacing = 25, - Children = - { - _timePicker3, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Opacity: ", - Font = Font.SystemFontOfSize(NamedSize.Large) - }, - sliderOpacity - } - }, - } - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Opacity Slider Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: TimePicker look")] - [Property("SPEC", "Tizen.UI.TimePicker.Height A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Seek Silder for Height after observe")] - [Step(3, "Pass If Height of TimePicker changed otherwise false")] - [Postcondition(1, "NA")] - public async Task Height_TimePicker_CHANGE_SIZE() - { - _timePicker4 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - TextColor = Color.Black - }; - - var sliderVertical = new Slider() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Pink, - Maximum = 500, - Minimum = 80 - }; - - sliderVertical.ValueChanged += (o, e) => - { - _timePicker4.HeightRequest = sliderVertical.Value; - }; - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - Padding = new Thickness() - { - Top = 20, - Bottom = 20, - }, - Spacing = 25, - Children = - { - _timePicker4, - new StackLayout() { - Orientation = StackOrientation.Horizontal, - HorizontalOptions = LayoutOptions.FillAndExpand, - Padding = new Thickness() { - Left = 20, - Right = 20, - }, - Children = - { - new Label() - { - Text = "Height: ", - Font = Font.SystemFontOfSize(NamedSize.Large) - }, - sliderVertical - } - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "Size Time Picker Test" - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Test: TimePicker look")] - [Property("SPEC", "Xamarin.Forms.TimePicker.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "When you test on TV, you should click TimePicker after changing color.")] - [Step(1, "Click run TC")] - [Step(2, "Select a Color after observe BackgroundColor of TimePicker is changed")] - [Step(3, "Pass If BackgroundColor of TimePicker changed otherwise false")] - [Postcondition(1, "NA")] - public async Task BackgroundColor_TimePicker_COLOR_CHANGE() - { - _timePicker5 = new TimePicker - { - Margin = new Thickness(100, 200, 100, 0), - Time = new TimeSpan(17, 0, 0), - TextColor = Color.Black - }; - - var imageRed = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Red, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "RED", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGreen = new StackLayout() - { - BackgroundColor = Color.Green, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GREEN", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var imageGray = new StackLayout() - { - BackgroundColor = Color.Gray, - HorizontalOptions = LayoutOptions.FillAndExpand, - Children = - { - new Label() - { - VerticalOptions = LayoutOptions.Center, - Text = "GRAY", - HorizontalTextAlignment = TextAlignment.Center, - VerticalTextAlignment = TextAlignment.Center, - Font = Font.BoldSystemFontOfSize(NamedSize.Large) - } - } - }; - - var tapGestureRecognizerRed = new TapGestureRecognizer(); - tapGestureRecognizerRed.Tapped += async (s, e) => - { - _timePicker5.BackgroundColor = Color.Red; - await Task.Delay(2000); - }; - imageRed.GestureRecognizers.Add(tapGestureRecognizerRed); - - var tapGestureRecognizerGreen = new TapGestureRecognizer(); - tapGestureRecognizerGreen.Tapped += async (s, e) => - { - _timePicker5.BackgroundColor = Color.Green; - await Task.Delay(2000); - }; - imageGreen.GestureRecognizers.Add(tapGestureRecognizerGreen); - - var tapGestureRecognizerGray = new TapGestureRecognizer(); - tapGestureRecognizerGray.Tapped += async (s, e) => - { - _timePicker5.BackgroundColor = Color.Gray; - await Task.Delay(2000); - }; - imageGray.GestureRecognizers.Add(tapGestureRecognizerGray); - - var mainUI = new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.White, - - Children = - { - _timePicker5, - new StackLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 180, - Orientation = StackOrientation.Horizontal, - Spacing = 10, - Padding = new Thickness() - { - Left = 20, - Right = 20 - }, - Children = - { - imageRed, - imageGreen, - imageGray - } - } - } - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = mainUI, - Title = "BackgoundColor Test" - }); - await ManualTest.WaitForConfirm(); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSToolbarItem.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSToolbarItem.cs deleted file mode 100755 index ce4f6deda..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSToolbarItem.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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; -using System; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.ToolbarItem test")] - public class ToolbarItemTests - { - private static ToolbarItem _toolbarItem; - private static TestPage _testPage = TestPage.GetInstance(); - - [SetUp] - public void SetUp() - { - Console.WriteLine("ToolbarItemTests --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("ToolbarItemTests --------------- TearDown()"); - } - - private static void CreateToolbarItem(string toolbarItemText) - { - _toolbarItem = new ToolbarItem() - { - Name = toolbarItemText - }; - - var page = new ContentPage() - { - ToolbarItems = - { - _toolbarItem - }, - }; - _testPage.ExecuteTC(page); - } - - private static void OnActivated(object sender, EventArgs e) - { - // If your test is fail, you should set Assert.True(false , "msg"); - Assert.True(true); - // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code. - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether Activated event is invoked or not")] - [Property("SPEC", "Xamarin.Forms.ToolbarItem.Activated E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Precondition(1, "This test will be passed on TV and TV Emulator automatically. (Due to limitation on TV)")] - [Step(1, "Click the ToolbarItem")] - [Step(2, "Press backbutton")] - [Step(3, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Activated_EVENT() - { - if (Device.Idiom == TargetIdiom.Phone) - { - CreateToolbarItem("Click Me."); - _toolbarItem.Activated += OnActivated; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _toolbarItem.Activated -= OnActivated; - } - else - { - _testPage.UnlockUIButton(); - Assert.Pass("Not Supported"); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSViewCell.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSViewCell.cs deleted file mode 100755 index e3263803d..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSViewCell.cs +++ /dev/null @@ -1,310 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using XamarinApplication.Tizen; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ViewCellTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static ListView _listview; - private static ViewCell _viewCell1, _viewCell2; - private static TableView _tableView1; - private static Label _tappedText; - - class ControlTest - { - public ControlTest(string name) - { - this.Name = name; - } - - public string Name { private set; get; } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TimePicker CLASS: Teardown---------------------------------"); - _viewCell1 = null; - _viewCell2 = null; - _tableView1 = null; - } - - public void CreatePageTestToViewCell(String txtDisplay, String title, String[] dataTest) - { - Label viewCellLebel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - Text = "View Cell" - }; - - _viewCell2 = new ViewCell - { - View = new Button - { - Margin = new Thickness(100, 100, 100, 0), - Text = "click me" - } - }; - - _tableView1 = new TableView - { - Intent = TableIntent.Form, - Root = new TableRoot("Table View Form") { - new TableSection ("Table View - ViewCell") { - _viewCell2 - } - }, - Margin = new Thickness(0, 100, 0, 0), - HorizontalOptions = LayoutOptions.Center, - WidthRequest = 400, - HeightRequest = 200, - IsEnabled = true, - }; - - Label labelDisplay = new Label - { - Margin = new Thickness(0, 200, 0, 0), - Text = txtDisplay, - TextColor = Color.Red, - Font = Font.SystemFontOfSize(NamedSize.Large), - HorizontalOptions = LayoutOptions.Center - }; - - List controlTest = new List - { - new ControlTest(dataTest[0]), - new ControlTest(dataTest[1]) - }; - - _listview = new ListView - { - RowHeight = 100, - ItemsSource = controlTest, - ItemTemplate = new DataTemplate(() => - { - Label nameLabel = new Label() - { - Margin = new Thickness(300, 0, 0, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - }; - nameLabel.SetBinding(Label.TextProperty, "Name"); - return new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - nameLabel, - } - } - } - } - }; - }) - }; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _tableView1, - _tappedText, - labelDisplay, - _listview, - }, - BackgroundColor = Color.Blue, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Test: ViewCell Look")] - [Property("SPEC", "Xamarin.Forms.ViewCell")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if ViewCell is visible with text \"View Cell\".")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task ViewCell_LOOK_UILK() - { - /* TEST CODE */ - Label viewCellLebel = new Label() - { - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - Text = "View Cell" - }; - - _viewCell1 = new ViewCell - { - View = new StackLayout - { - Padding = new Thickness(0, 5), - Orientation = StackOrientation.Horizontal, - Children = - { - new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Spacing = 0, - Children = - { - viewCellLebel - } - } - } - }, - Height = 100, - IsEnabled = true - }; - _testPage.ExecuteTC(new ContentPage() - { - Title = "ViewCell Test", - Content = new StackLayout - { - Children = - { - _viewCell1.View - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets or sets the View representing the content of the ViewCell.")] - [Property("SPEC", "Xamarin.Forms.ViewCell View")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if slider view and 'Slider View Set' text are set to view cell.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task ViewCell_View_UILK() - { - /* TEST CODE */ - Label viewCellLebel = new Label() - { - Margin = new Thickness(100, 100, 100, 0), - TextColor = Color.Black, - HorizontalOptions = LayoutOptions.Center, - Text = "Slider View Set" - }; - _viewCell1 = new ViewCell(); - var viewSlider = new Slider - { - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand, - HeightRequest = 80, - WidthRequest = 320 - }; - _viewCell1.View = viewSlider; - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - viewCellLebel, - _viewCell1.View - }, - BackgroundColor = Color.White, - }, - }); - await ManualTest.WaitForConfirm(); - } - - // Need to FIX - // [Test] - [Category("P1")] - [Description("Test: IsEnabled UILK")] - [Property("SPEC", "Xamarin.Forms.ViewCell.IsEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click item of Listview")] - [Step(3, "Pass If IsEnabled of ViewCell changed otherwise False")] - [Postcondition(1, "NA")] - public async Task IsEnabled_ViewCell_UILK() - { - /*TEST CODE*/ - String[] dataTest = { "", "", "" }; - dataTest[0] = "Enable"; - dataTest[1] = "Disable"; - var text = "Select a IsEnabled test"; - var title = "IsEnabled Test"; - CreatePageTestToViewCell(text, title, dataTest); - _listview.ItemTapped += (o, e) => - { - ControlTest controlTest = (ControlTest)e.Item; - if (controlTest.Name.Equals(dataTest[1])) - { - _viewCell2.IsEnabled = false; - } - else - { - _viewCell2.IsEnabled = true; - } - }; - await ManualTest.WaitForConfirm(); - /* - * POSTCONDITION - * Remove event handler - */ - _listview.ItemTapped -= (o, e) => - { - }; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSVisualElement.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSVisualElement.cs deleted file mode 100755 index ebfba6e86..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSVisualElement.cs +++ /dev/null @@ -1,216 +0,0 @@ -/* - * 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 System; -using System.Threading.Tasks; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Xamarin.Forms; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.VisualElement test")] - public class VisualElementTests - { - private static TestPage _testPage = TestPage.GetInstance(); - private static subVisualElement _visualElement; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - _visualElement = new subVisualElement(); - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - _visualElement = null; - } - - private static void CreateButton(string buttonText) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); - - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - _visualElement = new subVisualElement() - { - Text = buttonText, - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - - layout.Children.Add(_visualElement); - _testPage.ExecuteTC(layout); - } - - private static void OnFocused(object sender, EventArgs e) - { - // If your test is fail, you should set Assert.True(false , "msg"); - Assert.True(true); - // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code. - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Check whether VisualElement is focus or not.")] - [Property("SPEC", "Xamarin.Forms.VisualElement.Focus M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button")] - [Step(3, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Focus_CHECK() - { - Button button = new Button(); - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - }; - - button.Text = "Click"; - layout.Children.Add(_visualElement); - layout.Children.Add(button); - _testPage.ExecuteTC(layout); - - button.Clicked += (o, i) => - { - _visualElement.Focus(); - }; - - _visualElement.Focused += OnFocused; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _visualElement.Focused -= OnFocused; - } - - [Test] - [Category("P1")] - [Description("Test: Handle event Focused to an object of VisualElement.")] - [Property("SPEC", "Xamarin.Forms.VisualElement.Focused E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click button")] - [Step(3, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Focused_CB() - { - CreateButton("Click"); - _visualElement.Focused += OnFocused; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _visualElement.Focused -= OnFocused; - } - - private static void Create2Button(string buttonText) - { - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); - - var layout = new StackLayout() - { - IsVisible = true, - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, - Orientation = StackOrientation.Horizontal - }; - - _visualElement = new subVisualElement() - { - Text = buttonText, - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - Button btn2 = new Button() - { - Text = "UnFocused", - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.FillAndExpand, - }; - layout.Children.Add(_visualElement); - layout.Children.Add(btn2); - _testPage.ExecuteTC(layout); - } - - private static void OnUnFocused(object sender, EventArgs e) - { - // If your test is fail, you should set Assert.True(false , "msg"); - Assert.True(true); - // ManualTest.Confirm() API will terminate WaitForConfirm() method, and will execute rest of the code. - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: Handle event UnFocused to an object of VisualElement.")] - [Property("SPEC", "Xamarin.Forms.VisualElement.Unfocused E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Pham Phuong Dong, dong.phuong@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click run TC")] - [Step(2, "Click First")] - [Step(3, "Click UnFocused")] - [Step(4, "Testcase result will show automatically")] - [Postcondition(1, "NA")] - public async Task Unfocused_CB() - { - Create2Button("First"); - _visualElement.Unfocused += OnUnFocused; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - - /* - * POSTCONDITION - * Remove event handler - */ - _visualElement.Unfocused -= OnUnFocused; - } - } - - public class subVisualElement : Button - { - public subVisualElement() : base() - { - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSWebView.cs b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSWebView.cs deleted file mode 100755 index ca241a092..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/testcase/TSWebView.cs +++ /dev/null @@ -1,637 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class WebViewTests - { - private static WebView _webView1, _webView2; - private static ListView _listView1; - private static Button _button1, _button2; - private static Label _label1, _label2; - private static TestPage _testPage = TestPage.GetInstance(); - - class customwebViewClass : WebView - { - protected override void OnBindingContextChanged() - { - Assert.IsTrue(true); - ManualTest.Confirm(); - } - - protected override void OnPropertyChanged(string propertyName) - { - Assert.IsTrue(true); - ManualTest.Confirm(); - base.OnPropertyChanged(propertyName); - } - }; - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WebView CLASS: Setup---------------------------------"); - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WebView CLASS: Teardown---------------------------------"); - _webView1 = null; - _webView2 = null; - _button1 = null; - _button2 = null; - _label1 = null; - _label2 = null; - } - - private static void OnNavigated(object sender, EventArgs e) - { - Assert.True(true); - _label1.HorizontalTextAlignment = TextAlignment.Center; - _label1.TextColor = Color.DarkBlue; - _label1.Text = "Navigated Event Called."; - ManualTest.Confirm(); - } - - private static void OnNavigationStart(object sender, EventArgs e) - { - Assert.True(true); - _label1.HorizontalTextAlignment = TextAlignment.Center; - _label1.TextColor = Color.DarkBlue; - _label1.Text = "Navigating Event Called."; - ManualTest.Confirm(); - } - - private static void CreateWebView(String title) - { - _webView1 = new WebView - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org/about/about-linux-foundation", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _webView1 - }, - }, - Title = title - }); - } - - [Test] - [Category("P1")] - [Description("Test: WebView look")] - [Property("SPEC", "Xamarin.Forms.WebView C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UILK")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "NA")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the WebView UI is visible.")] - [Step(3, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task WebView_LOOK_UILK() - { - /* TEST CODE */ - CreateWebView("Web View UI Test"); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Sets and gets the WebViewSource object that represents the location of WebView.")] - [Property("SPEC", "Xamarin.Forms.WebView.Source A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if the Web View UI is visible.")] - [Step(3, "Click the button to go to tizen official website.")] - [Step(4, "Confirm pass or fail")] - [Postcondition(1, "NA")] - public async Task Source_WebView_UILK() - { - _label1 = new Label - { - Text = "Source Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.Black - }; - - _webView2 = new WebView - { - Source = new UrlWebViewSource - { - Url = "http://blog.xamarin.com/", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "Click this button to go Tizen Official Site", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _webView2.Source = "https://www.tizen.org/"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label1,_button1,_webView2, - }, - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets a value that indicates whether the user can navigate to previous pages.")] - [Property("SPEC", "Xamarin.Forms.WebView.CanGoBack A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if tizen official page is visible.")] - [Step(3, "Click Menu -> ABOUT of the page.")] - [Step(4, "Click the button above the page.")] - [Step(5, "Check if button text is true.")] - [Step(6, "Press back button and Confirm pass or fail.")] - [Postcondition(1, "NA")] - public async Task CanGoBack_WebView_UIBH() - { - _webView2 = new WebView - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "Click this button to check CanGoBack.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _button1.Text = _webView2.CanGoBack.ToString(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button1,_webView2, - }, - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Gets a value that indicates whether the user can navigate forward.")] - [Property("SPEC", "Xamarin.Forms.WebView.CanGoForward A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if tizen official visible.")] - [Step(3, "Click Menu -> ABOUT of the page.")] - [Step(4, "Click Go Back Button.")] - [Step(5, "Click CanGoForward Button.")] - [Step(6, "Confirm PASS if the button text is changed to true otherwise FAIL.")] - [Postcondition(1, "NA")] - public async Task CanGoForward_WebView_UIBH() - { - _webView2 = new WebView - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "CanGoForward.", - }; - - _button2 = new Button() - { - Text = "Go Back.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _button1.Text = _webView2.CanGoForward.ToString(); - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _webView2.GoBack(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button1,_button2,_webView2, - } - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Navigates to the previous page.")] - [Property("SPEC", "Xamarin.Forms.WebView.GoBack M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if tizen official visible.")] - [Step(3, "Click Menu -> ABOUT of the page.")] - [Step(4, "Click Go Back Button.")] - [Step(5, "Confirm PASS if ABOUT page is changed to HOME page of tizen otherwise FAIL.")] - [Postcondition(1, "NA")] - public async Task GoBack_WebView_UIBH() - { - _webView2 = new WebView - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button2 = new Button() - { - Text = "Go Back.", - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _webView2.GoBack(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button2,_webView2, - }, - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Navigates to the next page in the list of visited pages.")] - [Property("SPEC", "Xamarin.Forms.WebView.GoForward M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if tizen official visible.")] - [Step(3, "Click Menu -> ABOUT of the page.")] - [Step(4, "Click Go Back Button.")] - [Step(4, "Click Go Forward Button.")] - [Step(5, "Confirm PASS if Home page is changed to ABOUT page of tizen otherwise FAIL.")] - [Postcondition(1, "NA")] - public async Task GoForward_WebView_UIBH() - { - _webView2 = new WebView - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "Go Forward.", - }; - - _button2 = new Button() - { - Text = "Go Back.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _webView2.GoForward(); - }; - - _button2.Clicked += (object sender, EventArgs e) => - { - _webView2.GoBack(); - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button1,_button2,_webView2, - } - } - }); - await ManualTest.WaitForConfirm(); - } - - // Need to TC logic - //[Test] - [Category("P1")] - [Description("The method is called when binding context is changed.")] - [Property("SPEC", "Xamarin.Forms.WebView.OnBindingContextChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if xamarin and tizen official site is visible respectively.")] - [Step(3, "Click the button to change binding context.")] - [Step(4, "Check if the button text is changed.")] - [Step(5, "TC will PASS automatically if binding context changed otherwise press FAIL.")] - [Postcondition(1, "NA")] - public async Task OnBindingContextChanged_WebView_UIBH() - { - _label2 = new Label - { - Text = "OnBindingContextChanged Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - customwebViewClass _customwebView1 = new customwebViewClass - { - Source = new UrlWebViewSource - { - Url = "https://www.xamarin.com/", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - customwebViewClass _customwebView2 = new customwebViewClass - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "Click to change binding context.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _customwebView1.BindingContext = _customwebView2; - _customwebView2.SetBinding(WebView.BindingContextProperty, "BindingContext"); - _button1.Text = "Binding Context Changed"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button1,_customwebView1,_customwebView2 - } - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Method is called when WebView Source is changed")] - [Property("SPEC", "Xamarin.Forms.WebView.OnPropertyChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "UIBH")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click Run TC")] - [Step(2, "Check if xamarin and tizen official site is visible respectively.")] - [Step(3, "Click the button to change source.")] - [Step(4, "Check if xamarin official site is visible in webview.")] - [Step(5, "TC will PASS automatically if source is changed otherwise press FAIL.")] - [Postcondition(1, "NA")] - public async Task OnPropertyChanged_WebView_UIBH() - { - _label2 = new Label - { - Text = "OnPropertyChanged Test.", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.White - }; - - customwebViewClass _customwebView3 = new customwebViewClass - { - Source = new UrlWebViewSource - { - Url = "https://www.tizen.org", - }, - VerticalOptions = LayoutOptions.FillAndExpand - }; - - _button1 = new Button() - { - Text = "Click to change source.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _customwebView3.Source = "https://www.xamarin.com/"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _button1,_customwebView3 - }, - } - }); - await ManualTest.WaitForConfirm(); - } - - [Test] - [Category("P1")] - [Description("Navigated is raised after navigation completes.")] - [Property("SPEC", "Xamarin.Forms.WebView.Navigated E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click run TC")] - [Step(2, "Click the button Click to start navigate.")] - [Step(3, "Check if tizen official site is visible after sometime.")] - [Step(4, "Check if the Text above the button is changed to Navigated Event Called.")] - [Step(5, "If navigated event raised then TC will PASS automatically otherwise press FAIL.")] - [Postcondition(1, "NA")] - public async Task Navigated_WebView_UIBH() - { - /* TEST CODE */ - _webView2 = new WebView - { - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - HeightRequest = 400, - WidthRequest = 500 - }; - - _label1 = new Label - { - Text = "Event not called", - HorizontalTextAlignment = TextAlignment.Center, - WidthRequest = 100, - HeightRequest = 40 - }; - _webView2.Navigated += OnNavigated; - - _button1 = new Button() - { - Text = "Click to start navigate.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _webView2.Source = "https://www.tizen.org"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label1,_button1,_webView2 - } - } - }); - await ManualTest.WaitForConfirm(); - _webView2.Navigated -= OnNavigated; - } - - [Test] - [Category("P1")] - [Description("Navigating is raised when navigation starts.")] - [Property("SPEC", "Xamarin.Forms.WebView.Navigating E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - [Precondition(1, "Must have functional internet connection in device or emulator.")] - [Step(1, "Click run TC")] - [Step(2, "Click the button Start Navigating.")] - [Step(3, "Check if xamarin official site is visible after sometime.")] - [Step(4, "Check if the Text above the button is changed to Navigating Event Called.")] - [Step(5, "If Navigating event raised then TC will PASS automatically otherwise press FAIL.")] - [Postcondition(1, "NA")] - public async Task Navigating_WebView_UIBH() - { - /* TEST CODE */ - _webView2 = new WebView - { - VerticalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = Color.Blue, - HeightRequest = 400, - WidthRequest = 500 - }; - - _label1 = new Label - { - Text = "Navigating Event not called", - HorizontalTextAlignment = TextAlignment.Center, - TextColor = Color.Black, - WidthRequest = 100, - HeightRequest = 40 - }; - _webView2.Navigating += OnNavigationStart; - - _button1 = new Button() - { - Text = "Start Navigating.", - }; - - _button1.Clicked += (object sender, EventArgs e) => - { - _webView2.Source = "https://www.xamarin.com/"; - }; - - _testPage.ExecuteTC(new ContentPage() - { - Content = new StackLayout - { - Children = - { - _label1,_button1,_webView2 - } - } - }); - await ManualTest.WaitForConfirm(); - _webView2.Navigating -= OnNavigationStart; - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/tizen-manifest.xml deleted file mode 100644 index 46c3ead79..000000000 --- a/tct-suite-vs/Tizen.XamarinForms.Manual.Tests/tizen-manifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Tizen.XamarinForms.Manual.Tests.png - - - - - http://tizen.org/privilege/appmanager.launch - http://tizen.org/privilege/internet - - diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/Program.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/Program.cs deleted file mode 100755 index aa1ff4c08..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/Program.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 System; -using NUnitLite.TUnit; -using AutoTemplate; - -namespace XamarinForTizen.Tizen -{ - - class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication - { - private static App _app; - protected override void OnCreate() - { - base.OnCreate(); - - Console.WriteLine("TCT : OnCreate()"); - _app = new App(); - LoadApplication(_app); - - TRunner t = new TRunner(); - t.LoadTestsuite(); - t.Execute(); - } - - public static App getApp() - { - return _app; - } - static void Main(string[] args) - { - Console.WriteLine("TCT : Main()"); - var app = new Program(); - global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); - app.Run(args); - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.csproj b/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.csproj deleted file mode 100644 index 1c4ad04fc..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Exe - tizen60 - - - - - true - - - - portable - - - None - - - - - - - - - - - Runtime - - - - - - - - - - diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.sln b/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.sln deleted file mode 100755 index afe845edc..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/Tizen.XamarinForms1.Tests.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.15 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.XamarinForms1.Tests", "Tizen.XamarinForms1.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU - {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU - {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU - {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.Build.0 = Debug|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680} - EndGlobalSection -EndGlobal diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/common/MockEffect.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/common/MockEffect.cs deleted file mode 100755 index 8f8e8b991..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/common/MockEffect.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xamarin.Forms; -using Xamarin.Forms.Platform.Tizen; -using XamarinForTizen.Tizen.common; - -[assembly: ResolutionGroupName("Samsung")] -[assembly: ExportEffect(typeof(MockEffect), "MockEffect")] -namespace XamarinForTizen.Tizen.common -{ - class MockEffect : PlatformEffect - { - - protected override void OnAttached() - { - Container.Color = ElmSharp.Color.Red; - } - - protected override void OnDetached() - { - - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/app_icn_ted.png b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/app_icn_ted.png deleted file mode 100755 index ab726c817..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/app_icn_ted.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/a.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/a.jpg deleted file mode 100755 index ff184399c..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/a.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/b.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/b.jpg deleted file mode 100755 index e34e60b53..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/b.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/c.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/c.jpg deleted file mode 100755 index ae2a56c11..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/c.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/d.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/d.jpg deleted file mode 100755 index bb7d72a94..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/d.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/e.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/e.jpg deleted file mode 100755 index d35a60dd6..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/e.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/f.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/f.jpg deleted file mode 100755 index 238d72222..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/f.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/g.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/g.jpg deleted file mode 100755 index 873c9f3fa..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/large/g.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/a.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/a.jpg deleted file mode 100755 index 4d1659444..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/a.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/b.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/b.jpg deleted file mode 100755 index f3dc3dd0d..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/b.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/c.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/c.jpg deleted file mode 100755 index a0a4c1a3b..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/c.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/d.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/d.jpg deleted file mode 100755 index 4dfda7cea..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/d.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/e.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/e.jpg deleted file mode 100755 index 0d4ded3d1..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/e.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/f.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/f.jpg deleted file mode 100755 index a3fc74442..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/f.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/g.jpg b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/g.jpg deleted file mode 100755 index 33c46c166..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/TED/thumbnail/g.jpg and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.gif b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.gif deleted file mode 100755 index 7522362aa..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.gif and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.png b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.png deleted file mode 100755 index 7522362aa..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/picture.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/testimage.gif b/tct-suite-vs/Tizen.XamarinForms1.Tests/res/testimage.gif deleted file mode 100755 index 9a68f8e61..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/res/testimage.gif and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/shared/res/Tizen.XamarinForms1.Tests.png b/tct-suite-vs/Tizen.XamarinForms1.Tests/shared/res/Tizen.XamarinForms1.Tests.png deleted file mode 100755 index 9765b1bda..000000000 Binary files a/tct-suite-vs/Tizen.XamarinForms1.Tests/shared/res/Tizen.XamarinForms1.Tests.png and /dev/null differ diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs deleted file mode 100755 index bf430af99..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAbsoluteLayout.cs +++ /dev/null @@ -1,532 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using XamarinForTizen.Tizen; -using System.Threading.Tasks; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class AbsoluteLayoutTests - { - private AbsoluteLayout _mAbsoluteLayout; - private static bool _flagLayoutChildren, _flagOnChildAdded, _flagOnChildRemoved, _flagOnSizeRequest; - internal class SubAbsoluteLayout : AbsoluteLayout - { - protected override void LayoutChildren(double x, double y, double width, double height) - { - _flagLayoutChildren = true; - base.LayoutChildren(x, y, width, height); - } - - protected override void OnChildAdded(Element child) - { - _flagOnChildAdded = true; - base.OnChildAdded(child); - } - - protected override void OnChildRemoved(Element child) - { - _flagOnChildRemoved = true; - base.OnChildRemoved(child); - } - - protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint) - { - _flagOnSizeRequest = true; - return base.OnSizeRequest(widthConstraint, heightConstraint); - } - } - - [SetUp] - public void SetUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Setup---------------------------------"); - _mAbsoluteLayout = new AbsoluteLayout(); - _flagLayoutChildren = _flagOnChildAdded = _flagOnChildRemoved = _flagOnSizeRequest = false; - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "AbsoluteLayout CLASS: Teardown---------------------------------"); - _mAbsoluteLayout = null; - } - - [Test] - [Category("P1")] - [Description("Create a AbsoluteLayout instance. Check whether object is successfully created or not.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AbsoluteLayout C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void AbsoluteLayout_CONST() - { - _mAbsoluteLayout = new AbsoluteLayout(); - Assert.IsNotNull(_mAbsoluteLayout, "Cannot successfully create AbsoluteLayout object"); - } - - [Test] - [Category("P1")] - [Description("Add child view object to Children property, and check returned collection.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.Children A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void Children_PROPERTY_GET() - { - /*PRECONDITION*/ - /* - * Create 2 instance label and button. They are children of AbsoluteLayout. - */ - Assert.AreEqual(0, _mAbsoluteLayout.Children.Count, "Children should be empty when no children added."); - var mColor = new Color(0.1, 0.2, 0); - var mLabel = new Label() - { - Text = "My Label", - FontSize = 20, - TextColor = mColor - }; - var mOpacity = 0.3; - var mButton = new Button() - { - Text = "My button", - Opacity = mOpacity - }; - /*TEST CODE*/ - _mAbsoluteLayout.Children.Add(mLabel); - Assert.AreEqual(1, _mAbsoluteLayout.Children.Count, "Children amount of AbsoluteLayout is different 1 value "); - Assert.AreEqual("My Label", ((Label)_mAbsoluteLayout.Children[0]).Text, "Text property of Label children instance is different from setup value"); - Assert.AreEqual(20, ((Label)_mAbsoluteLayout.Children[0]).FontSize, "FontSize property of Label children instance is different from setup value"); - Assert.AreEqual(mColor, ((Label)_mAbsoluteLayout.Children[0]).TextColor, "TextColor property of Label children instance is different from setup value"); - _mAbsoluteLayout.Children.Add(mButton); - Assert.AreEqual(2, _mAbsoluteLayout.Children.Count, "Children amount of AbsoluteLayout is different 2 value "); - Assert.AreEqual("My button", ((Button)_mAbsoluteLayout.Children[1]).Text, "Text property of Button children instance is different from setup value"); - Assert.AreEqual(mOpacity, ((Button)_mAbsoluteLayout.Children[1]).Opacity, "Opacity property of Button children instance is different from setup value"); - } - - [Test] - [Category("P1")] - [Description("Check whether GetLayoutBounds returns the Rectangle value set by SetLayoutBounds method.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.GetLayoutBounds M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void GetLayoutBounds_RECTANGE_VALUE() - { - /**PRECONDITION - * Create a label instance and Rectangle instance, they are prameter for SetLayoutBounds - **/ - var mColor = new Color(0.1, 0.3, 0.2); - var mLabel = new Label() - { - Text = "My Label", - FontSize = 20, - TextColor = mColor - }; - var mBeforeRectangle = new Rectangle(115, 159, 100, 100); - /*TEST CODE*/ - AbsoluteLayout.SetLayoutBounds(mLabel, mBeforeRectangle); - var mAfterRectangle = AbsoluteLayout.GetLayoutBounds(mLabel); - Assert.AreEqual(mBeforeRectangle, mAfterRectangle, " mBeforeRectangle value is not equal to mAfterRectangle value"); - } - - [Test] - [Category("P1")] - [Description("Set layout bounds and verify with GetLayoutBounds method.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutBounds M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void SetLayoutBounds_RECTANGE_VALUE() - { - /** PRECONDITION - * Create a editor instance and Rectangle instance, they are prameter for SetLayoutBounds - */ - var mThickness = new Thickness(0, 0, 2, 2); - var mEditor = new Editor() - { - Text = "My Editor", - Margin = mThickness - }; - var mBeforeRectangle = new Rectangle(115, 159, 100, 100); - /**TEST CODE*/ - AbsoluteLayout.SetLayoutBounds(mEditor, mBeforeRectangle); - var mAfterRectangle = AbsoluteLayout.GetLayoutBounds(mEditor); - Assert.AreEqual(mBeforeRectangle, mAfterRectangle, " mBeforeRectangle value is not equal to mAfterRectangle value "); - } - - [Test] - [Category("P1")] - [Description("SetLayoutFlag with all available enum types, and verify by getting its value.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.SetLayoutFlags M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MAE")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void SetLayoutFlags_FLAG_VALUE() - { - /**PRE CONDITION - * Create a Label instance . It's a prameter for using SetLayoutFlags - */ - var mLabel = new Label() - { - Text = "AbsoluteLayout" - }; - /*TEST CODE*/ - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.All); - Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag All is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.HeightProportional); - Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag HeightProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.None); - Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag None is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.PositionProportional); - Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag PositionProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.SizeProportional); - Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag SizeProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.WidthProportional); - Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag WidthProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.XProportional); - Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag XProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mLabel, AbsoluteLayoutFlags.YProportional); - Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(mLabel), "Set / get value of Flag YProportional is not correct."); - } - - [Test] - [Category("P1")] - [Description("Set layout flag, and check if it is correctly getable.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.GetLayoutFlags M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MAE")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void GetLayoutFlags_FLAG_VALUE() - { - /**PRE CONDITION - * Create a DatePicker instance . It's a prameter for using SetLayoutFlags - */ - var mDatePicker = new DatePicker() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - VerticalOptions = LayoutOptions.Center, - Date = new DateTime() - }; - /**TESTCODE*/ - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.All); - Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag All is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.HeightProportional); - Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag HeightProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.None); - Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag None is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.PositionProportional); - Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag PositionProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.SizeProportional); - Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag SizeProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.WidthProportional); - Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag WidthProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.XProportional); - Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag XProportional is not correct."); - AbsoluteLayout.SetLayoutFlags(mDatePicker, AbsoluteLayoutFlags.YProportional); - Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(mDatePicker), "Set / get value of Flag YProportional is not correct."); - } - - [Test] - [Category("P1")] - [Description("Check whether on method works properly or not.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.On M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void On_METHOD() - { - /**TEST CODE**/ - var mAbsoluteLayout = new SubAbsoluteLayout() - { - Children = - { - new Label() { - Text = "My Tex", - FontSize = 12 - }, - new Button() - { - Text = "My Button", - BorderColor = new Color(0,0,0,0) - } - } - }; - var config = mAbsoluteLayout.On(); - Assert.IsInstanceOf>(config, "config is not AbsoluteLayout"); - } - - [Test] - [Category("P1")] - [Description("Check override method OnChildAdded is invoked when its child is added.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnChildAdded M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnChildAdded_OVERRIDE_METHOD() - { - /*PRE CONDITION - * _flagOnChildAdded flag is initialize false value - * Create a instance SubAbsoluteLayout - */ - Assert.False(_flagOnChildAdded, "_flagOnChildAdded should false initial"); - /**TEST CODE**/ - var mAbsoluteLayout = new SubAbsoluteLayout() - { - Children = - { - new Label() { - Text = "My Tex", - FontSize = 12 - }, - new Button() - { - Text = "My Button", - BorderColor = new Color(0,0,0,0) - } - } - }; - Assert.True(_flagOnChildAdded, "OnChildAdded overrided method not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check override method OnChildRemoved is invoked when its child is removed.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnChildRemoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnChildRemoved_OVERRIDE_METHOD() - { - /*PRE CONDITION - * _flagOnChildRemoved flag is initialize false value - * Create a instance SubAbsoluteLayout - */ - Assert.False(_flagOnChildRemoved, "_flagOnChildRemoved should false initial"); - /**TEST CODE**/ - var mAbsoluteLayout = new SubAbsoluteLayout() - { - Children = - { - new Label() { - Text = "My Tex", - FontSize = 12 - }, - new Button() - { - Text = "My Button", - BorderColor = new Color(0,0,0,0) - } - } - }; - mAbsoluteLayout.Children.RemoveAt(0); - Assert.True(_flagOnChildRemoved, "OnChildAdded overrided method not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check override method OnSizeRequest is invoked when it is measured.")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.OnSizeRequest M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnSizeRequest_OVERRIDE_METHOD() - { - /*PRE CONDITION - * _flagOnSizeRequest flag is initialize false value - * Create a instance SubAbsoluteLayout - */ - Assert.False(_flagOnSizeRequest, "_flagOnSizeRequest should false initial"); - /**TEST CODE**/ - var mButton = new Button() - { - Text = "My Button", - BorderColor = new Color(0, 0, 0, 0) - }; - var mAbsoluteLayout = new SubAbsoluteLayout() - { - Children = - { - new Label() { - Text = "My Tex", - FontSize = 12 - }, - mButton - } - }; - mAbsoluteLayout.Measure(100, 200, MeasureFlags.None); - Assert.True(_flagOnSizeRequest, "OnSizeRequest overrided method not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check override method LayoutChildren is invoked when it's layout children is changed .")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutChildren M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public async Task LayoutChildren_OVERRIDE_METHOD() - { - //Assert.True(false, "[NA]Need to check how to use API."); - /*PRE CONDITION - * _flagLayoutChildren flag is initialize false value - * Create a instance SubAbsoluteLayout - */ - _flagLayoutChildren = false; - Assert.False(_flagLayoutChildren, "_flagLayoutChildren should false initial"); - /**TEST CODE**/ - Label topLeftLabel; - var simpleLayout = new SubAbsoluteLayout - { - BackgroundColor = Color.Blue.WithLuminosity(0.9), - VerticalOptions = LayoutOptions.Start, - HeightRequest = 100 - }; - - topLeftLabel = new Label - { - Text = "Top Left", - TextColor = Color.Black - }; - - SubAbsoluteLayout.SetLayoutBounds(topLeftLabel, - new Rectangle(0f, - 0f, SubAbsoluteLayout.AutoSize, SubAbsoluteLayout.AutoSize)); - simpleLayout.Children.Add(topLeftLabel); - var button = new Button() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - Text = "Click me", - VerticalOptions = LayoutOptions.FillAndExpand - }; - - var stack = new StackLayout - { - Children = { - simpleLayout - } - - }; - var page = new ContentPage() - { - Padding = - new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5), - Content = stack - }; - await Program.getApp().MainPage.Navigation.PushAsync(page); - await Task.Delay(1000); - simpleLayout.HeightRequest += 20; - Assert.True(_flagLayoutChildren, "LayoutChildren overrided method not invoked."); - - /*POST CONDITION*/ - await Program.getApp().MainPage.Navigation.PopToRootAsync(); - } - - [Test] - [Category("P1")] - [Description("Check whether property of LayoutBoundsProperty is correctly readable or not")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutBoundsProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void LayoutBoundsProperty_PROPERTY_READ_ONLY() - { - /*TEST CODE*/ - var mColor01 = Color.Black; - var mColor02 = Color.Blue; - _mAbsoluteLayout.BackgroundColor = mColor01; - var mAbsoluton = new AbsoluteLayout() - { - HorizontalOptions = LayoutOptions.FillAndExpand, - BackgroundColor = mColor02 - }; - var mRectangle01 = new Rectangle(115, 159, 100, 100); - var mRectangle02 = new Rectangle(0, 1, 50, 60); - AbsoluteLayout.SetLayoutBounds(_mAbsoluteLayout, mRectangle01); - AbsoluteLayout.SetLayoutBounds(mAbsoluton, mRectangle02); - Assert.AreNotEqual(AbsoluteLayout.GetLayoutBounds(_mAbsoluteLayout), AbsoluteLayout.GetLayoutBounds(mAbsoluton), "Rectangle of _mAbsoluteLayout value must be different form Rectangle of mAbsoluton value"); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutBoundsProperty, mRectangle02); - Assert.AreEqual(AbsoluteLayout.GetLayoutBounds(mAbsoluton), AbsoluteLayout.GetLayoutBounds(_mAbsoluteLayout), "Rectangle of mAbsoluton value & Rectangle of _mAbsoluteLayout value should be same"); - } - - [Test] - [Category("P1")] - [Description("Check whether property of LayoutFlagsProperty is correctly readable or not")] - [Property("SPEC", "Xamarin.Forms.AbsoluteLayout.LayoutFlagsProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void LayoutFlagsProperty_PROPERTY_READ_ONLY() - { - /*TEST CODE*/ - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.All); - Assert.AreEqual(AbsoluteLayoutFlags.All, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag All is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.HeightProportional); - Assert.AreEqual(AbsoluteLayoutFlags.HeightProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag HeightProportional is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.None); - Assert.AreEqual(AbsoluteLayoutFlags.None, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag None is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.PositionProportional); - Assert.AreEqual(AbsoluteLayoutFlags.PositionProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag PositionProportional is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.SizeProportional); - Assert.AreEqual(AbsoluteLayoutFlags.SizeProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag SizeProportional is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.WidthProportional); - Assert.AreEqual(AbsoluteLayoutFlags.WidthProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag WidthProportional is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.XProportional); - Assert.AreEqual(AbsoluteLayoutFlags.XProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag XProportional is not correct."); - _mAbsoluteLayout.SetValue(AbsoluteLayout.LayoutFlagsProperty, AbsoluteLayoutFlags.YProportional); - Assert.AreEqual(AbsoluteLayoutFlags.YProportional, AbsoluteLayout.GetLayoutFlags(_mAbsoluteLayout), "Set / get value of Flag YProportional is not correct."); - } - - //[Test] - //[Category("P1")] - //[Description("check whether AbsoluteLayout's able to auto size or not")] - //[Property("SPEC", "Xamarin.Forms.AbsoluteLayout.AutoSize A")] - //[Property("SPEC_URL", "-")] - //[Property("CRITERIA", "MR")] - //[Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - //public void AutoSize_PROPERTY_GET() - //{ - // //Assert.True(false, "[NA]Need to check how to use API."); - // /*PRE CONDITION - // * - // */ - // //TEST CODE - // AbsoluteLayout simpleLayout = new AbsoluteLayout - // { - // BackgroundColor = Color.Blue.WithLuminosity(0.9), - // VerticalOptions = LayoutOptions.FillAndExpand - // }; - - // var mBoxview = new BoxView - // { - // Color = Color.Red - // }; - // AbsoluteLayout.SetLayoutFlags(mBoxview, - // AbsoluteLayoutFlags.PositionProportional); - - // AbsoluteLayout.SetLayoutBounds(mBoxview, - // new Rectangle(0f, - // 0f,500, 500)); - // Assert.AreEqual(500, AbsoluteLayout.GetLayoutBounds(mBoxview).Height, "Set / get Height value of Bound is not correct."); - // Assert.AreEqual(500, AbsoluteLayout.GetLayoutBounds(mBoxview).Height, "Set / get Height value of Bound is not correct."); - //} - } - -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSActivityIndicator.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSActivityIndicator.cs deleted file mode 100755 index 6d95e849c..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSActivityIndicator.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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 System; -using Xamarin.Forms; -using NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.ActivityIndicator Tests")] - public class ActivityIndicatorTests - { - private ActivityIndicator _activityIndicator; - - [SetUp] - public void SetUp() - { - Console.WriteLine("ActivityIndicatorTests --------------- Setup()"); - _activityIndicator = new ActivityIndicator(); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("ActivityIndicatorTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Create an ActivityIndicator instance.")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.ActivityIndicator C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void ActivityIndicator_INIT() - { - /* TEST CODE */ - var activityIndicator = new ActivityIndicator(); - Assert.IsNotNull(activityIndicator, "Object is null after initialize"); - Assert.IsInstanceOf(activityIndicator); - } - - [Test] - [Category("P1")] - [Description("Check whether the property Color is readable and writable with valid values for color(r,g,b).")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.Color A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Color_READ_WRITE() - { - /* TEST CODE */ - _activityIndicator.Color = Color.Red; - Assert.IsInstanceOf(_activityIndicator.Color, "Should be instance of Color."); - Assert.AreEqual(Color.Red, _activityIndicator.Color, "Color doesn't set and get successfully."); - } - - [Test] - [Category("P1")] - [Description("Check whether the property IsRunning is readable and writable with valid values.")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunning A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void IsRunning_READ_WRITE() - { - /* TEST CODE */ - _activityIndicator.IsRunning = true; - Assert.IsTrue(_activityIndicator.IsRunning,"IsRunning property is not set true"); - _activityIndicator.IsRunning = false; - Assert.IsFalse(_activityIndicator.IsRunning, "IsRunning property is not set false"); - } - - [Test] - [Category("P1")] - [Description("Check whether ColorProperty property bound or not")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.ColorProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void ColorProperty_READ_ONLY() - { - /* TEST CODE */ - _activityIndicator.Color = Color.Green; - ActivityIndicator mActivityIndicator = new ActivityIndicator(); - mActivityIndicator.Color = Color.Gray; - Assert.AreNotEqual(mActivityIndicator.Color, _activityIndicator.Color, "ColorProperty value must be different."); - _activityIndicator.BindingContext = mActivityIndicator; - _activityIndicator.SetBinding(ActivityIndicator.ColorProperty, "Color"); - Assert.AreEqual(mActivityIndicator.Color, _activityIndicator.Color, "After binding, value should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether IsRunningProperty property bound or not")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.IsRunningProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void IsRunningProperty_READ_ONLY() - { - _activityIndicator.IsRunning = true; - ActivityIndicator mActivityIndicator = new ActivityIndicator(); - mActivityIndicator.IsRunning = false; - Assert.AreNotEqual(mActivityIndicator.IsRunning, _activityIndicator.IsRunning, "IsRunningProperty value must be different."); - _activityIndicator.BindingContext = mActivityIndicator; - _activityIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsRunning"); - Assert.AreEqual(mActivityIndicator.IsRunning, _activityIndicator.IsRunning, "After binding, value should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check return ActivityIndicator configuration")] - [Property("SPEC", "Xamarin.Forms.ActivityIndicator.On M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void On_CONFIGURATION_METHOD() - { - /*TEST CODE*/ - var mResouce = new ResourceDictionary(); - _activityIndicator.Resources = mResouce; - var myConfig = _activityIndicator.On(); - Assert.IsInstanceOf>(myConfig, "Should be an instance of IPlatformElementConfiguration"); - Assert.IsInstanceOf(myConfig.Element, "Should be an instance of ActivityIndicator"); - Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _activityIndicator should be to equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimation.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimation.cs deleted file mode 100755 index 33240edd9..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimation.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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 System; -using Xamarin.Forms; -using NUnit.Framework; -using System.Collections; - -namespace Xamarin.Forms.Core.UnitTests -{ - class FakeAnimatable : IAnimatable - { - public void BatchBegin() - { - } - - public void BatchCommit() - { - } - } - - [TestFixture] - [Description("Xamarin.Forms.Animation Tests")] - public class AnimationTests - { - private Animation animation; - - [SetUp] - public void SetUp() - { - animation = new Animation(); - Console.WriteLine("TSAnimationTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - animation = null; - Console.WriteLine("TSAnimationTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Create a Animation object")] - [Property("SPEC", "Xamarin.Forms.Animation.Animation C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Property("COVPARAM", "")] - public void Animation_INIT() - { - /*TEST CODE*/ - Assert.IsNotNull(animation, "Instance of Animation is null"); - Assert.IsInstanceOf(animation, "Is not an instance of Animation"); - } - - [Test] - [Category("P1")] - [Description("Create a Animation object")] - [Property("SPEC", "Xamarin.Forms.Animation.Animation C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Property("COVPARAM", "Action, Double, Double, Easing, Action")] - public void Animation_INIT_WITH_ACTION() - { - /*TEST CODE*/ - animation = new Animation(null, 0.3, 0.9, null, null); - Assert.IsNotNull(animation, "Instance of Animation is null"); - Assert.IsInstanceOf(animation, "Is not an instance of Animation"); - } - - [Test] - [Category("P1")] - [Description("Check whether animation is added or not")] - [Property("SPEC", "Xamarin.Forms.Animation.Add M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void Add_CHECK() - { - /*TEST CODE*/ - Animation animationNew = new Animation(null, 0.0, 0.7, null, null); - animation.Add(0.0, 0.7, animationNew); - IEnumerator enumerator = animation.GetEnumerator(); - enumerator.MoveNext(); - Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object."); - } - - [Test] - [Category("P1")] - [Description("Check whether runs animation with the supplied parameters")] - [Property("SPEC", "Xamarin.Forms.Animation.Commit M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void Commit_CHECK_RETURN_VALUE() - { - /*TEST CODE*/ - try - { - var animatable = new FakeAnimatable(); - animation.Commit(animatable, "Tizen", 12, 200, null, null); - } - catch(Exception ex) - { - Assert.IsTrue(false, "Exception thrown. Exception messeage: " + ex.Message); - } - } - - [Test] - [Category("P1")] - [Description("Check whether returns a callback")] - [Property("SPEC", "Xamarin.Forms.Animation.GetCallback M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void GetCallback_CHECK_RETURN_VALUE() - { - /*TEST CODE*/ - Image image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(new FakeAnimatable(), "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - Assert.IsInstanceOf>(animation.GetCallback(), "Is not an instance of Actione object"); - } - - [Test] - [Category("P1")] - [Description("Check whether returns an enumerator that can be used to iterate over the child Animation objects")] - [Property("SPEC", "Xamarin.Forms.Animation.GetEnumerator M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void GetEnumerator_CHECK_RETURN_VALUE() - { - /*TEST CODE*/ - Animation animationNew = new Animation(null, 0.0, 0.7, null, null); - animation.Add(0.0, 0.7, animationNew); - var enumerator = animation.GetEnumerator(); - Assert.IsInstanceOf(enumerator, "Is not an instance of IEnumerator object"); - enumerator.MoveNext(); - Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object."); - } - - [Test] - [Category("P1")] - [Description("Check whether adds an Animation object to this Animation")] - [Property("SPEC", "Xamarin.Forms.Animation.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void Insert_CHECK_RETURN_VALUE() - { - /*TEST CODE*/ - Animation animationNew = new Animation(null, 0.0, 0.7, null, null); - Assert.IsInstanceOf(animation.Insert(0.0, 0.7, animationNew), "Not returning an instance of Animation object"); - var enumerator = animation.GetEnumerator(); - enumerator.MoveNext(); - Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object."); - } - - [Test] - [Category("P1")] - [Description("Check whether adds animation to the children of this Animation object")] - [Property("SPEC", "Xamarin.Forms.Animation.WithConcurrent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.Animation, double, double")] - public void WithConcurrent_CHECK_RETURN_VALUE() - { - /*TEST CODE*/ - Animation animationNew = new Animation(null, 0.0, 0.7, null, null); - Assert.IsInstanceOf(animation.WithConcurrent(animationNew, 0.0, 0.9), "Not returning an instance of Animation object."); - var enumerator = animation.GetEnumerator(); - enumerator.MoveNext(); - Assert.IsTrue(enumerator.Current.Equals(animationNew), "Not returning expected Animation object."); - } - - [Test] - [Category("P1")] - [Description("Check whether creates a new Animation object with the specified parameters and adds it")] - [Property("SPEC", "Xamarin.Forms.Animation.WithConcurrent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - [Property("COVPARAM", "System.Action, double, double, Xamarin.Forms.Easing, double, double")] - public void WithConcurrent_CHECK_RETURN_VALUE_ACTION() - { - /*TEST CODE*/ - var animationNew = animation.WithConcurrent(null, 0.0, 0.7, null, 0.0, 0.7); - Assert.IsInstanceOf(animationNew, "Is not an instance of Animation object."); - Assert.IsTrue(animation.Equals(animationNew), "Not returning expected Animation object."); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimationExtensions.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimationExtensions.cs deleted file mode 100755 index 55db8c317..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAnimationExtensions.cs +++ /dev/null @@ -1,273 +0,0 @@ -/* - * 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 System; -using Xamarin.Forms; -using NUnit.Framework; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Threading; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.AnimationExtensions Tests")] - public class AnimationExtensionsTests - { - class MyTestIAnimatable : IAnimatable - { - public void BatchBegin() - { - } - public void BatchCommit() - { - } - } - - [SetUp] - public void SetUp() - { - Console.WriteLine("AnimationExtensionsTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("AnimationExtensionsTests --------------- TearDown()"); - } - - [Test] - [Category("P2")] - [Description("Check whether animate throws exception or not.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "IAnimatable, String, Animation, uint, uint, Easing, Action, Func")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_CHECK_EXCEPTION_WITH_ANIMATION() - { - /* TEST CODE */ - Assert.Throws(() => AnimationExtensions.Animate(null, "Foo", new Animation(), 12, 250, null, null, null)); - } - - [Test] - [Category("P2")] - [Description("Check whether animate throws exception or not.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "IAnimatable, String, Action, Double, Double, uint, uint, Easing, Action, Func")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_CHECK_EXCEPTION() - { - /* TEST CODE */ - Assert.Throws(() => AnimationExtensions.Animate(new MyTestIAnimatable(), "Foo", null, 1.0, 20.0, 12, 250, null, null, null)); - } - - //[Test] - [Category("P1")] - [Description("Check whether animation starts or not.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("COVPARAM", "IAnimatable, String, Action, Double, Double, uint, uint, Easing, Action, Func")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_WITH_ACTION_DOUBLE_PARAM() - { - /* TEST CODE */ - bool isRunning = false; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - String handle = "new handle"; - double a = 1.3; - AnimationExtensions.Animate(mMyTestIAnimatable, handle, v => a = v, 1.0, 20.0, 12, 250, Easing.BounceOut, null, null); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Thread.Sleep(5000); - Assert.IsTrue(isRunning, "Animation should starts properly."); - } - - [Test] - [Category("P1")] - [Description("Check whether animation starts or not.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("COVPARAM", "IAnimatable, String, Action, uint, uint, Easing, Action, Func")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_WITH_ACTION_PARAM() - { - /* TEST CODE */ - bool isRunning = false; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - String handle = "new handle"; - double a = 1.2; - AnimationExtensions.Animate(mMyTestIAnimatable, handle, v => a = v, 16, 200, Easing.BounceIn, (v, c) => image.Scale = 1, () => true); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Thread.Sleep(2000); - Assert.IsTrue(isRunning, "Animation should starts properly."); - //Assert.IsTrue(false, "[NA] Need to check."); - } - - [Test] - [Category("P1")] - [Description("Check whether animation starts or not.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("COVPARAM", "IAnimatable, String, Animation, uint, uint, Easing, Action, Func")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_WITH_ANIMATION_PARAM() - { - /* TEST CODE */ - bool isRunning = false; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - String handle = "new handle"; - AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 16, 200, Easing.BounceIn, (v, c) => image.Scale = 1, () => true); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Thread.Sleep(2000); - Assert.IsTrue(isRunning, "Animation should starts properly."); - //Assert.IsTrue(false, "[NA] Need to check."); - } - - [Test] - [Category("P1")] - [Description("Check whether AnimateKinetic sets the specified parameters.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AnimateKinetic M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void AnimateKinetic_CHECK_STATUS() - { - /* TEST CODE */ - var view = new WebView(); - var resultList = new List>(); - view.AnimateKinetic( - name: "Kinetics", - callback: (distance, velocity) => - { - resultList.Add(new Tuple(distance, velocity)); - return true; - }, - velocity: 100, - drag: 1, - finished: null); - - Assert.IsNotNull(resultList, "Object should not be null."); - int checkValue = 100; - int dragStep = 16; - - foreach (var item in resultList) - { - checkValue -= dragStep; - Assert.AreEqual(checkValue, item.Item2, "Values should be equal."); - Assert.AreEqual(checkValue * dragStep, item.Item1, "Values should be equal."); - } - } - - [Test] - [Category("P1")] - [Description("Check return value of AnimationIsRunning.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AnimationIsRunning M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void AnimationIsRunning_CHECK_RETURN() - { - /* TEST CODE */ - bool isRunning = false; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - String handle = "new handle"; - AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 16, 250, Easing.CubicIn, null, null); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Thread.Sleep(2000); - Assert.IsTrue(isRunning, "Return value should be true."); - } - - [Test] - [Category("P1")] - [Description("Check return value of AbortAnimation.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.AbortAnimation M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void AbortAnimation_CHECK_RETURN() - { - /* TEST CODE */ - bool isRunning = false; - bool abort = false; - String handle = "start"; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - abort = AnimationExtensions.AbortAnimation(mMyTestIAnimatable, handle); - Assert.IsFalse(abort, "abort should false'"); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - AnimationExtensions.Animate(mMyTestIAnimatable, handle, animation, 12, 250, null, null, null); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Assert.IsTrue(isRunning, "Animation should starts properly."); - abort = AnimationExtensions.AbortAnimation(mMyTestIAnimatable, handle); - Thread.Sleep(2000); - Assert.IsTrue(abort, "Animation should stops properly."); - } - - [Test] - [Category("P1")] - [Description("Check return type of Interpolate.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Interpolate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Interpolate_CHECK_RETURN() - { - /* TEST CODE */ - Assert.IsInstanceOf>(AnimationExtensions.Interpolate(0.1, 1.0, 0.0, false), "Should be instance of Func."); - } - - [Test] - [Category("P1")] - [Description("Check return type of Interpolate.")] - [Property("SPEC", "Xamarin.Forms.AnimationExtensions.Animate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void Animate_TEMPLATE() - { - /* TEST CODE */ - bool isRunning = false; - MyTestIAnimatable mMyTestIAnimatable = new MyTestIAnimatable(); - var image = new Image(); - var animation = new Animation(v => image.Scale = v, 1, 2); - animation.Commit(mMyTestIAnimatable, "SimpleAnimation", 16, 2000, Easing.Linear, (v, c) => image.Scale = 1, () => true); - String handle = "new handle"; - double a = 1.2; - AnimationExtensions.Animate(mMyTestIAnimatable, handle, v => image = image, v => a = image.Scale, 16, 255, Easing.Linear, null, null); - isRunning = AnimationExtensions.AnimationIsRunning(mMyTestIAnimatable, handle); - Thread.Sleep(2000); - Assert.IsTrue(isRunning, "Animation should starts properly."); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAppLinkEntry.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAppLinkEntry.cs deleted file mode 100755 index a44a30f47..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSAppLinkEntry.cs +++ /dev/null @@ -1,302 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using XamarinForTizen.Tizen; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class AppLinkEntryTests - { - private AppLinkEntry _appLinkEntry; - private string _appResourcePath = Program.Current.DirectoryInfo.Resource; - - [SetUp] - public void SetUp() - { - Console.WriteLine("T_appLinkEntry --------------- Setup()"); - _appLinkEntry = new AppLinkEntry(); - } - - [TearDown] - public void TearDown() - { - _appLinkEntry = null; - Console.WriteLine("TSAppLinkEntry --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Create an instance of AppLinkEntry.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkEntry C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void AppLinkEntry_INIT() - { - /*TEST CODE*/ - var appLinkEntry = new AppLinkEntry(); - Assert.IsNotNull(appLinkEntry, "AppLinkEntry should be not NULL"); - Assert.IsInstanceOf(appLinkEntry, "appLinkEntry is not instance of AppLinkEntry."); - } - - [Test] - [Category("P1")] - [Description("Check whether property AppLinkUri is readable and writable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkUri A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void AppLinkUri_READ_WRITE() - { - /*TEST CODE*/ - var uri = new Uri("http://foo.com"); - _appLinkEntry.AppLinkUri = uri; - Assert.AreEqual(_appLinkEntry.AppLinkUri, uri, "AppLinkUri property should be equal"); - } - - [Test] - [Category("P1")] - [Description("Check whether property Description is readable and writable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Description A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void Description_READ_WRITE() - { - /*TEST CODE*/ - string str = "razin"; - _appLinkEntry.Description = str; - Assert.AreEqual(_appLinkEntry.Description,str, "Description property should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether property IsLinkActive is readable and writable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.IsLinkActive A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void IsLinkActive_READ_WRITE() - { - /*TEST CODE*/ - _appLinkEntry.IsLinkActive = true; - Assert.IsTrue(_appLinkEntry.IsLinkActive, "IsLinkActive property should set true."); - - _appLinkEntry.IsLinkActive = false; - Assert.IsFalse(_appLinkEntry.IsLinkActive, "IsLinkActive property should set false."); - } - - [Test] - [Category("P1")] - [Description("Check whether property KeyValues is readable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.KeyValues A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void KeyValues_READ_ONLY() - { - /*TEST CODE*/ - var getProperty = _appLinkEntry.KeyValues; - Assert.IsNotNull(getProperty, "getProperty should be not NULL"); - Assert.IsInstanceOf(getProperty, "getProperty should be an instance of Size type."); - } - - - [Test] - [Category("P1")] - [Description("Check KeyValues property's behavior.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.KeyValues A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void KeyValues_CHECK_STATUS() - { - /*TEST CODE*/ - var getProperty = _appLinkEntry.KeyValues; - getProperty.Add("contentType", "GalleryPage"); - getProperty.Add("companyName", "Xamarin"); - Assert.AreEqual(getProperty.Count, 2, "KeyValues count should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether property Thumbnail is readable and writable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Thumbnail A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void Thumbnail_READ_WRITE() - { - /*TEST CODE*/ - ImageSource imgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/a.jpg"); - _appLinkEntry.Thumbnail = imgSource; - Assert.AreEqual(_appLinkEntry.Thumbnail, imgSource, "Thumbnail property should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether property Title is readable and writable.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.Title A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void Title_READ_WRITE() - { - /*TEST CODE*/ - string title ="SRBD" ; - _appLinkEntry.Title = title; - Assert.AreEqual(_appLinkEntry.Title, title, "Title property should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether AppLinkUriProperty is bound or not")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.AppLinkUriProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void AppLinkUriProperty_CHECK_BINDABLE() - { - /*TEST CODE*/ - var uri1 = new Uri("http://foo.com"); - var uri2 = new Uri("http://Roo.com"); - _appLinkEntry.AppLinkUri = uri1; - AppLinkEntry bindingObject = new AppLinkEntry(); - bindingObject.AppLinkUri = uri2; - Assert.AreNotEqual(_appLinkEntry.AppLinkUri, bindingObject.AppLinkUri, "AppLinkUri of AppLinkEntry value must be different from bindingObject value."); - _appLinkEntry.BindingContext = bindingObject; - _appLinkEntry.SetBinding(AppLinkEntry.AppLinkUriProperty, "AppLinkUri"); - Assert.AreEqual(_appLinkEntry.AppLinkUri, bindingObject.AppLinkUri, "AppLinkUri of bindingObject value & AppLinkUri of AppLinkEntry value should be same."); - } - - [Test] - [Category("P1")] - [Description("Check whether DescriptionProperty is bound or not.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.DescriptionProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void DescriptionProperty_CHECK_BINDABLE() - { - /*TEST CODE*/ - string strDescription1 = "String1"; - string strDescription2 = "String2"; - _appLinkEntry.Description = strDescription1; - AppLinkEntry bindingObject = new AppLinkEntry(); - bindingObject.Description = strDescription2; - Assert.AreNotEqual(_appLinkEntry.Description, bindingObject.Description, "Description of AppLinkEntry value must be different from bindingObject value."); - _appLinkEntry.BindingContext = bindingObject; - _appLinkEntry.SetBinding(AppLinkEntry.DescriptionProperty, "Description"); - Assert.AreEqual(_appLinkEntry.Description, bindingObject.Description, "Description of bindingObject value & Description of AppLinkEntry value should be same."); - } - - [Test] - [Category("P1")] - [Description("Check whether IsLinkActiveProperty is bound or not.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.IsLinkActiveProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void IsLinkActiveProperty_CHECK_BINDABLE() - { - /*TEST CODE*/ - bool firstIsLinkActive = false; - bool secondIsLinkActive = true; - _appLinkEntry.IsLinkActive = firstIsLinkActive; - AppLinkEntry bindingObject = new AppLinkEntry(); - bindingObject.IsLinkActive = secondIsLinkActive; - Assert.AreNotEqual(_appLinkEntry.IsLinkActive, bindingObject.IsLinkActive, "IsLinkActive of AppLinkEntry value must be different from bindingObject value."); - _appLinkEntry.BindingContext = bindingObject; - _appLinkEntry.SetBinding(AppLinkEntry.IsLinkActiveProperty, "IsLinkActive"); - Assert.AreEqual(_appLinkEntry.IsLinkActive, bindingObject.IsLinkActive, "IsLinkActive of bindingObject value & IsLinkActive of AppLinkEntry value should be same."); - } - - [Test] - [Category("P1")] - [Description("Check whether ThumbnailProperty is bound or not.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.ThumbnailProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void ThumbnailProperty_CHECK_BINDABLE() - { - /*TEST CODE*/ - ImageSource firstImgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/a.jpg"); - ImageSource secondImgSource = ImageSource.FromFile(_appResourcePath + "TED/thumbnail/b.jpg"); - _appLinkEntry.Thumbnail = firstImgSource; - AppLinkEntry bindingObject = new AppLinkEntry(); - bindingObject.Thumbnail = secondImgSource; - Assert.AreNotEqual(_appLinkEntry.Thumbnail, bindingObject.Thumbnail, "Thumbnail of AppLinkEntry value must be different from bindingObject value."); - _appLinkEntry.BindingContext = bindingObject; - _appLinkEntry.SetBinding(AppLinkEntry.ThumbnailProperty, "Thumbnail"); - Assert.AreEqual(_appLinkEntry.Thumbnail, bindingObject.Thumbnail, "Thumbnail of bindingObject value & Thumbnail of AppLinkEntry value should be same."); - } - - [Test] - [Category("P1")] - [Description("Check whether TitleProperty is bound or not")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.TitleProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PCST")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void TitleProperty_CHECK_BINDABLE() - { - /*TEST CODE*/ - string firstTitle = "FirstTitle"; - string secondTitle = "SecondTitle"; - _appLinkEntry.Title = firstTitle; - AppLinkEntry bindingObject = new AppLinkEntry(); - bindingObject.Title = secondTitle; - Assert.AreNotEqual(_appLinkEntry.Title, bindingObject.Title, "Title of AppLinkEntry value must be different from bindingObject value."); - _appLinkEntry.BindingContext = bindingObject; - _appLinkEntry.SetBinding(AppLinkEntry.TitleProperty, "Title"); - Assert.AreEqual(_appLinkEntry.Title, bindingObject.Title, "Title of bindingObject value & Title of AppLinkEntry value should be same."); - } - - [Test] - [Category("P1")] - [Description("Check return type of FromUri.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.FromUri M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void FromUri_CHECK_RETURN_TYPE() - { - var uri = new Uri("http://foo.com"); - var entry = AppLinkEntry.FromUri(uri); - Assert.IsInstanceOf(entry, "entry is not instance of AppLinkEntry."); - Assert.AreEqual(uri, entry.AppLinkUri, "FromUri method return type is not AppLinkEntry."); - } - - [Test] - [Category("P1")] - [Description("Check return type of ToString.")] - [Property("SPEC", "Xamarin.Forms.AppLinkEntry.ToString M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Razin Farhan Hussain, razin.fh@samsung.com")] - public void ToString_CHECK_RETURN_TYPE() - { - var str = "http://foo.com"; - var uri = new Uri(str); - var entry = new AppLinkEntry { AppLinkUri = uri }; - Assert.AreEqual(uri.ToString(), entry.ToString(), "ToString method return type is not String."); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSApplication.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSApplication.cs deleted file mode 100755 index 5f3098d21..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSApplication.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - class ApplicationTests - { - Application _application = null; - internal class subApplication : Application - { - protected override void OnStart() - { - base.OnStart(); - } - protected override void OnResume() - { - base.OnResume(); - } - - protected override void OnSleep() - { - base.OnSleep(); - } - } - - [SetUp] - public void setUp() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Application CLASS: Setup---------------------------------"); - _application = new subApplication(); - } - - [TearDown] - public void tearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Application CLASS: Teardown---------------------------------"); - _application = null; - } - - [Test] - [Category("P1")] - [Description("Create an Application instance. Check whether object is successfully created or not.")] - [Property("SPEC", "Xamarin.Forms.Application.Application C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void Application_CONST() - { - _application = new subApplication(); - Assert.IsInstanceOf(_application, "_application is an intance of Application"); - Assert.IsNotNull(_application, "Can't successfully create Application object."); - } - - [Test] - [Category("P1")] - [Description("Check whether current application same initialization application or not")] - [Property("SPEC", "Xamarin.Forms.Application.Current A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void Current_PROPERTY_GET() - { - /*TESTCODE*/ - Assert.AreEqual(_application, Application.Current, "Current application instance is not identical with newly created application instance."); - Assert.AreEqual(_application.Id, Application.Current.Id, "Id property of current application instance is different from initialization application"); - Assert.AreEqual(_application.StyleId, Application.Current.StyleId, "StyleId property of current application instance is different from initialization application"); - } - - [Test] - [Category("P1")] - [Description("Check whether set & get MainPage for application instance is correct or not")] - [Property("SPEC", "Xamarin.Forms.Application.MainPage A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void MainPage_PROPERTY_SET_GET() - { - /*PRECONDITION - * create a page instance and setup for application - */ - var mPage = new ContentPage() - { - BackgroundColor = new Color(0.1, 0.2, 0.3), - Opacity = 0.5 - }; - /*TEST CODE*/ - _application.MainPage = mPage; - Assert.AreEqual(mPage, _application.MainPage, "set/get MainPage value isn't same"); - Assert.AreEqual(mPage.BackgroundColor, _application.MainPage.BackgroundColor, "BackgroundColor property page is different"); - Assert.AreEqual(mPage.Opacity, _application.MainPage.Opacity, "Opcaity property page is different"); - } - - [Test] - [Category("P1")] - [Description("Check return Application configuration")] - [Property("SPEC", "Xamarin.Forms.Application.On M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void On_CONFIGURATION_METHOD() - { - /*TEST CODE*/ - var mResouce = new ResourceDictionary(); - _application.Resources = mResouce; - var myConfig = _application.On(); - Assert.IsInstanceOf>(myConfig, "myConfig should be a instance of IPlatformElementConfiguration"); - Assert.IsInstanceOf(myConfig.Element, "myConfig.Element should be a instance of Application"); - Assert.AreEqual(mResouce, myConfig.Element.Resources, "Resources of myConfig.Element value & Resources of _application should be to equal"); - } - - //[Test] - [Category("P1")] - [Description("Check whether get AppLinks property of application is correct or not")] - [Property("SPEC", "Xamarin.Forms.Application.AppLinks A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void AppLinks_PROPERTY_GET() - { - Assert.True(false, "[NA] Need to check how to use the API"); - /*TESTCODE*/ - //LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "*******TanTan ="+Program._myapp.AppLinks); - //Assert.IsInstanceOf(Application.Current.AppLinks, "AppLinks property of Current.AppLinks don't must a intance of IAppLinks"); - //Assert.AreEqual(_application.AppLinks, Application.Current.AppLinks, "AppLinks property of current application instance is different from initialization application"); - } - - [Test] - [Category("P1")] - [Description("Check whether get Properties of application is correct or not")] - [Property("SPEC", "Xamarin.Forms.Application.Properties A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void Properties_PROPERTY_GET() - { - /*PRECONDITION - */ - var mPage = new ContentPage() - { - BackgroundColor = new Color(0.1, 0.2, 0.3), - Opacity = 0.5 - }; - /*TEST CODE*/ - _application.MainPage = mPage; - Assert.AreEqual(_application.Properties, Application.Current.Properties, "Properties of current application instance is different from initialization application"); - Assert.AreEqual(_application.Properties.Count, Application.Current.Properties.Count, "Count property of Properties instance is different from initialization application"); - } - - [Test] - [Category("P1")] - [Description("Check whether set/get Resources of application is correct or not")] - [Property("SPEC", "Xamarin.Forms.Application.Resources A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void Resources_PROPERTY_SET_GET() - { - /*PRECONDITION - * create a resource for application - */ - - /*TEST CODE*/ - ResourceDictionary mResoure = new ResourceDictionary(); - mResoure.Add("Key", "Value"); - _application.Resources = mResoure; - Assert.AreEqual(mResoure, _application.Resources, "getting value of Resources property is different from setting value"); - Assert.AreEqual(mResoure.Keys, _application.Resources.Keys, "getting Keys value of Resources property is different from setting value"); - Assert.AreEqual(mResoure.Values, _application.Resources.Values, "getting Keys value of Resources property is different from setting value"); - } - - //[Test] - [Category("P1")] - [Description("Check asynchronously persists the Xamarin.Forms.Application.Properties dictionary for the application object")] - [Property("SPEC", "Xamarin.Forms.Application.SavePropertiesAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void SavePropertiesAsync_METHOD() - { - Assert.True(false, "[NA] Need to check how to use the API"); - } - - //[Test] - [Category("P1")] - [Description("Check whether ModalPopped events can be invoked or not when a view has been popped modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPopped E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void ModalPopped_CHECK_EVENT() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether ModalPopping events can be invoked or not when a view has been popping modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPopping E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void ModalPopping_CHECK_EVENT() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether ModalPushed events can be invoked or not when a view has been pushed modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPushed E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void ModalPushed_CHECK_EVENT() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether ModalPushing events can be invoked or not when a view has been pushing modally.")] - [Property("SPEC", "Xamarin.Forms.Application.ModalPushing E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void ModalPushing_CHECK_EVENT() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether OnAppLinkRequestReceived method can be invoked or not when a applink is requested")] - [Property("SPEC", "Xamarin.Forms.Application.OnAppLinkRequestReceived M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnAppLinkRequestReceived_OVERRIDE_METHOD() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether OnStart method can be invoked or not when a application is opened")] - [Property("SPEC", "Xamarin.Forms.Application.OnStart M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnStart_OVERRIDE_METHOD() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether OnResume method can be invoked or not when a application is resumed")] - [Property("SPEC", "Xamarin.Forms.Application.OnResume M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnResume_OVERRIDE_METHOD() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - //[Test] - [Category("P1")] - [Description("Check whether OnSleep method can be invoked or not when a application is sleeped")] - [Property("SPEC", "Xamarin.Forms.Application.OnSleep M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Nguyen Van Tan, nguyen.vtan@samsung.com")] - public void OnSleep_OVERRIDE_METHOD() - { - /*TEST CODE*/ - Assert.True(false, "[NA]Manual TC."); - } - - [Test] - [Category("P1")] - [Description("Check whether InvalidOperationException is thrown when parent is set.")] - [Property("SPEC", "Xamarin.Forms.Application.OnParentSet M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void OnParentSet_OVERRIDE_METHOD() - { - /*TEST CODE*/ - subApplication subApplication = new subApplication(); - try - { - var listView = new ListView(); - subApplication.Parent = listView; - Assert.IsTrue(false, "Expected InvalidOperationException but no exception was thrown."); - } - catch (Exception ex) - { - Assert.IsTrue(ex is InvalidOperationException, "Expected InvalidOperationException but returned some other exception."); - } - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBackButtonPressedEventArgs.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBackButtonPressedEventArgs.cs deleted file mode 100755 index e34f72c72..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBackButtonPressedEventArgs.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using NUnit.Framework.TUnit; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.BackButtonPressedEventArgs test")] - public class BackButtonPressedEventArgsTests - { - [SetUp] - public void Setup() - { - Console.WriteLine("BackButtonPressedEventArgsTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BackButtonPressedEventArgsTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Create an BackButtonPressedEventArgs object.")] - [Property("SPEC", "Xamarin.Forms.BackButtonPressedEventArgs.BackButtonPressedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void BackButtonPressedEventArgs_INIT() - { - /* TEST CODE */ - BackButtonPressedEventArgs backButtonPressedEventArgs = new BackButtonPressedEventArgs(); - Assert.IsNotNull(backButtonPressedEventArgs, "BackButtonPressedEventArgs Instance is null"); - Assert.IsInstanceOf(backButtonPressedEventArgs, "Should be an instance of BackButtonPressedEventArgs type."); - } - - [Test] - [Category("P1")] - [Description("Check whether Handled Property is writeable and readable.")] - [Property("SPEC", "Xamarin.Forms.BackButtonPressedEventArgs.Handled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void Handled_READ_WRITE() - { - /* TEST CODE */ - BackButtonPressedEventArgs backButtonPressedEventArgs = new BackButtonPressedEventArgs(); - backButtonPressedEventArgs.Handled = true; - Assert.IsTrue(backButtonPressedEventArgs.Handled, "Expected true but returned false."); - - backButtonPressedEventArgs.Handled = false; - Assert.IsFalse(backButtonPressedEventArgs.Handled, "Expected false but returned true."); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBaseMenuItem.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBaseMenuItem.cs deleted file mode 100755 index a36a305a8..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBaseMenuItem.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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; -using System; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class BaseMenuItemTests - { - [SetUp] - public void SetUp() - { - Console.WriteLine("BaseMenuItem --------------- SetUp()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BaseMenuItem --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Create a BaseMenuItem instance. Check whether object is successfully created or not")] - [Property("SPEC", "Xamarin.Forms.BaseMenuItem.BaseMenuItem C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Vu Nhu Anh, anh.vn@samsung.com")] - public void BaseMenuItem_INIT() - { - /* TEST CODE */ - var baseMenuItem = new MenuItem(); - Assert.IsNotNull(baseMenuItem, "Creating a BaseMenuItem object failed. It is set to null"); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehavior.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehavior.cs deleted file mode 100755 index 1020663ef..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehavior.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using Xamarin.Forms; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Behavior test")] - public class BehaviorTests - { - internal class MockBehavior : Behavior where T : BindableObject - { - public bool attached; - public bool detached; - - protected override void OnAttachedTo(BindableObject bindable) - { - base.OnAttachedTo(bindable); - attached = true; - AssociatedObject = bindable; - } - - protected override void OnDetachingFrom(BindableObject bindable) - { - detached = true; - base.OnDetachingFrom(bindable); - AssociatedObject = null; - } - - public BindableObject AssociatedObject { get; set; } - } - - [SetUp] - public void Setup() - { - Console.WriteLine("BehaviorTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BehaviorTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Check the value for AssociatedType.")] - [Property("SPEC", "Xamarin.Forms.Behavior.AssociatedType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void AssociatedType_READ_ONLY() - { - var behavior = new MockBehavior(); - var style = new Style(typeof(Entry)) - { - Setters = { - new Setter {Property = Entry.TextProperty, Value = "foo"}, - }, - Triggers = { - new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = { - new Setter {Property = VisualElement.ScaleProperty, Value = 2d}, - }} - }, - Behaviors = { - behavior, - } - }; - - var entry = new Entry { Style = style }; - Assert.IsInstanceOf(behavior.AssociatedObject, "AssociatedObject not returning Entry type."); - } - - [Test] - [Category("P1")] - [Description("Check if overriding this method to implement the behaviors is possible.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnAttachedTo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void OnAttachedTo_CHECK() - { - var behavior = new MockBehavior(); - var style = new Style(typeof(Entry)) - { - Setters = { - new Setter {Property = Entry.TextProperty, Value = "foo"}, - }, - Triggers = { - new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = { - new Setter {Property = VisualElement.ScaleProperty, Value = 2d}, - }} - }, - Behaviors = { - behavior, - } - }; - - var entry = new Entry { Style = style }; - Assert.IsTrue(behavior.attached,"Expected true but returning false."); - } - - [Test] - [Category("P1")] - [Description("Create if overriding this method to remove the behaviors from bindable is possible.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnDetachingFrom M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void OnDetachingFrom_CHECK() - { - var behavior = new MockBehavior(); - var style = new Style(typeof(Entry)) - { - Setters = { - new Setter {Property = Entry.TextProperty, Value = "foo"}, - }, - Triggers = { - new Trigger (typeof (VisualElement)) {Property = Entry.IsPasswordProperty, Value=true, Setters = { - new Setter {Property = VisualElement.ScaleProperty, Value = 2d}, - }} - }, - Behaviors = { - behavior, - } - }; - - var entry = new Entry { Style = style }; - Assert.IsTrue(behavior.attached, "Expected true but returning false."); - entry.Style = null; - Assert.IsTrue(behavior.detached, "Expected true but returning false."); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehaviorTemplate.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehaviorTemplate.cs deleted file mode 100755 index cc1f530b7..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBehaviorTemplate.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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; -using NUnit.Framework.TUnit; -using System.Collections.Generic; -using System; - - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - [Description("Xamarin.Forms.Behavior test")] - public class BehaviorTemplateTest - { - private static bool _flagOnAttachedTo, _flagOnDetachingFrom, _flagOnAttachedToT, _flagOnDetachingFromT; - private static Entry _flagEntry; - internal class SubBehavior: Behavior - { - public SubBehavior() : base() - { - - } - protected override void OnAttachedTo(BindableObject bindable) - { - _flagOnAttachedTo = true; - base.OnAttachedTo(bindable); - } - protected override void OnDetachingFrom(BindableObject bindable) - { - base.OnDetachingFrom(bindable); - _flagOnDetachingFrom = true; - } - protected override void OnAttachedTo(Entry bindable) - { - base.OnAttachedTo(bindable); - _flagOnAttachedToT = true; - _flagEntry = bindable; - } - protected override void OnDetachingFrom(Entry bindable) - { - base.OnDetachingFrom(bindable); - _flagOnDetachingFromT = true; - _flagEntry = bindable; - } - - } - - private static SubBehavior _behavior; - - [SetUp] - public void Setup() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Behavior: Setup---------------------------------"); - _flagOnAttachedToT= _flagOnDetachingFromT=_flagOnAttachedTo = _flagOnDetachingFrom = false; - _behavior = new SubBehavior(); - _flagEntry = null; - } - - [TearDown] - public void TearDown() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Behavior: Teardown------------------------------"); - } - - [Test] - [Category("P1")] - [Description("Create a Behavior<> instance. Check whether object is successfully created or not.")] - [Property("SPEC", "Xamarin.Forms.Behavior.Behavior C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - public void Behavior_INIT() - { - /*TEST CODE*/ - SubBehavior behavior = new SubBehavior(); - Assert.NotNull(behavior, "create a Behavior<> is fail"); - } - - [Test] - [Category("P1")] - [Description("Invoke Attached behavior. Check whether _flagOnAttachedTo value changed to true.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnAttachedTo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindableObject")] - public void OnAttachedTo_METHOD() - { - /*TEST CODE*/ - var entry = new Entry() - { - Placeholder = "Test OnAttachedTo" - }; - entry.Behaviors.Add(_behavior); - Assert.IsTrue(_flagOnAttachedTo, "_flagOnAttachedTo should be return true after Attached behavior"); - } - - [Test] - [Category("P1")] - [Description("Invoke Attached behavior. Check whether _flagOnAttachedToT value changed to true.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnAttachedTo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Property("COVPARAM", "T")] - public void OnAttachedTo_METHOD_T() - { - /*TEST CODE*/ - var entry = new Entry() - { - Placeholder = "Test OnAttachedTo Entry" - }; - entry.Behaviors.Add(_behavior); - Assert.IsTrue(_flagOnAttachedToT, "_flagOnAttachedToT should be return true after Attached behavior"); - Assert.AreEqual(entry,_flagEntry); - } - - [Test] - [Category("P1")] - [Description("Invoke Detaching behavior. Check whether _flagOnDetachingFrom value changed to true.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnDetachingFrom M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindableObject")] - public void OnDetachingFrom_METHOD() - { - /*TEST CODE*/ - var entry = new Entry() - { - Placeholder = "Test OnDetachingFrom" - }; - entry.Behaviors.Add(_behavior); - entry.Behaviors.Remove(_behavior); - Assert.IsTrue(_flagOnDetachingFrom, "_flagOnDetachingFrom should be return true after Detaching behavior"); - } - - [Test] - [Category("P1")] - [Description("Invoke Detaching behavior. Check whether _flagOnDetachingFrom value changed to true.")] - [Property("SPEC", "Xamarin.Forms.Behavior.OnDetachingFrom M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ngo Van Hai, hai.nv3@samsung.com")] - [Property("COVPARAM", "T")] - public void OnDetachingFrom_METHOD_T() - { - /*TEST CODE*/ - var entry = new Entry() - { - Placeholder = "Test OnDetachingFrom Entry" - }; - entry.Behaviors.Add(_behavior); - entry.Behaviors.Remove(_behavior); - Assert.IsTrue(_flagOnDetachingFromT, "_flagOnDetachingFromT should be return true after Detaching behavior"); - Assert.AreEqual(entry,_flagEntry); - } - - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObject.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObject.cs deleted file mode 100755 index c953f20f5..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObject.cs +++ /dev/null @@ -1,619 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; -using System.Runtime.CompilerServices; - -namespace Xamarin.Forms.Core.UnitTests -{ - public class CustomBindableObject : BindableObject - { - public bool _flagOnBindingContextChanged { get; set; } - public bool _flagOnPropertyChanged { get; set; } - public bool _flagOnPropertyChanging { get; set; } - - public static readonly BindableProperty TextProperty = BindableProperty.Create( - b => b.Text, "default", BindingMode.TwoWay); - - public string Text - { - get { return (string)GetValue(TextProperty); } - set { SetValue(TextProperty, value); } - } - - public CustomBindableObject() : base() - { - ; - } - - protected override void OnBindingContextChanged() - { - base.OnBindingContextChanged(); - _flagOnBindingContextChanged = true; - } - - protected override void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - base.OnPropertyChanged(propertyName); - _flagOnPropertyChanged = true; - } - - protected override void OnPropertyChanging([CallerMemberName] string propertyName = null) - { - base.OnPropertyChanging(propertyName); - _flagOnPropertyChanging = true; - - } - } - - [TypeConverter(typeof(ToBarConverter))] - internal class Bar - { - - } - - internal class Baz - { - - } - - internal class MockBindable : StackLayout - { - public static readonly BindableProperty TextProperty = BindableProperty.Create( - b => b.Text, "default", BindingMode.TwoWay); - - public string Text - { - get { return (string)GetValue(TextProperty); } - set { SetValue(TextProperty, value); } - } - - public string Foo { get; set; } - - public int TargetInt { get; set; } - - public readonly BindableProperty BarProperty = - BindableProperty.Create(w => w.Bar, default(Bar)); - - public Bar Bar - { - get { return (Bar)GetValue(BarProperty); } - set { SetValue(BarProperty, value); } - } - - public readonly BindableProperty BazProperty = - BindableProperty.Create(w => w.Baz, default(Baz)); - - [TypeConverter(typeof(ToBazConverter))] - public Baz Baz - { - get { return (Baz)GetValue(BazProperty); } - set { SetValue(BazProperty, value); } - } - - public readonly BindableProperty QuxProperty = - BindableProperty.Create(w => w.Qux, default(Baz)); - - public Baz Qux - { - get { return (Baz)GetValue(QuxProperty); } - set { SetValue(QuxProperty, value); } - } - - public void ApplyBindings() - { - base.ApplyBindings(); - } - - public void UnapplyBindings() - { - - base.UnapplyBindings(); - } - } - - internal class ToBarConverter : TypeConverter - { - public override object ConvertFrom(System.Globalization.CultureInfo culture, object value) - { - return new Bar(); - } - } - - internal class ToBazConverter : TypeConverter - { - public override object ConvertFrom(System.Globalization.CultureInfo culture, object value) - { - return new Baz(); - } - } - - [TestFixture] - [Description("Xamarin.Forms.BindableObject Tests")] - public class BindableObjectTests - { - public CustomBindableObject _customBindableObject; - - [SetUp] - public void SetUp() - { - Console.WriteLine("BindableObjectTests --------------- Setup()"); - _customBindableObject = new CustomBindableObject(); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BindableObjectTests --------------- TearDown()"); - } - - private void TestGetValueDefault(BindableProperty property) - { - var mock = new MockBindable(); - object value = mock.GetValue(property); - Assert.AreEqual(property.DefaultValue, value, "Should be equal."); - } - - [Test] - [Category("P1")] - [Description("Create a new BindableObject instance.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.BindableObject C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void BindableObject_INIT() - { - /* TEST CODE */ - CustomBindableObject bindableObject = new CustomBindableObject(); - - Assert.IsNotNull(bindableObject, "Object should be not null after initialize"); - Assert.IsInstanceOf(bindableObject, "Should be an instance of BindableObject."); - } - - [Test] - [Category("P1")] - [Description("Check whether the BindingContextProperty property is readable.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContextProperty A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void BindingContextProperty_READ() - { - /* TEST CODE */ - var label = new Label(); - var view = new StackLayout { Children = { label } }; - - view.BindingContext = new { item0 = "Foo", item1 = "Bar" }; - label.SetBinding(BindableObject.BindingContextProperty, "item0"); - label.SetBinding(Label.TextProperty, new Binding(".")); - - Assert.AreEqual(label.BindingContext, label.GetValue(BindableObject.BindingContextProperty), "Should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether BindingContext property is biandable or not.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContext A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void BindingContext_READ_WRITE() - { - /* TEST CODE */ - var mock = new MockBindable(); - Assert.IsNull(mock.BindingContext, "Should be null."); - - object obj = new object(); - mock.BindingContext = obj; - Assert.AreSame(obj, mock.BindingContext, "Should be same."); - } - - [Test] - [Category("P1")] - [Description("Check the return value of ClearValue.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.ClearValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindableProperty")] - public void ClearValue_CHECK_RETURN() - { - /* TEST CODE */ - const string value = "foo"; - var mock = new MockBindable(); - mock.SetValue(MockBindable.TextProperty, value); - Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty), "Set and Get doesn't work successfully."); - - mock.ClearValue(MockBindable.TextProperty); - TestGetValueDefault(MockBindable.TextProperty); - } - - [Test] - [Category("P1")] - [Description("Check the return value of ClearValue.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.ClearValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindablePropertyKey")] - public void ClearValue_PROPERTYKEY_CHECK_RETURN() - { - /* TEST CODE */ - var bindablePropertyKey = BindableProperty.CreateReadOnly(w => w.Foo, "DefaultValue"); - var bindableProperty = bindablePropertyKey.BindableProperty; - var bindable = new MockBindable(); - Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be equal."); - - bindable.SetValue(bindablePropertyKey, "Bar"); - Assert.AreEqual("Bar", bindable.GetValue(bindableProperty), "Should be equal."); - - bindable.ClearValue(bindablePropertyKey); - Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be DefaultValue, after ClearValue."); - } - - [Test] - [Category("P1")] - [Description("Check the return value of GetValue.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.GetValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void GetValue_CHECK_RETURN() - { - /* TEST CODE */ - var nulldefault = BindableProperty.Create(w => w.Foo, null); - TestGetValueDefault(nulldefault); - - var foodefault = BindableProperty.Create(w => w.Foo, "Foo"); - TestGetValueDefault(foodefault); - } - - [Test] - [Category("P1")] - [Description("Check the return value of RemoveBinding.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.RemoveBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void RemoveBinding_CHECK_RETURN() - { - /* TEST CODE */ - var label = new Label(); - label.BindingContext = new { foo = "Foo", bar = "Bar" }; - label.SetBinding(Label.TextProperty, new Binding("foo")); - Assert.AreEqual("Foo", label.Text, "After Binding, Value should be equal."); - - try - { - label.RemoveBinding(Label.TextProperty); - } - catch (Exception ex) - { - Assert.True(false, "Should not throw any exception while RemoveBinding, but has thrown with the message : " + ex.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Check the return value of SetBinding.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void SetBinding_CHECK_RETURN() - { - /* TEST CODE */ - var label = new Label(); - label.BindingContext = new { foo = "Foo", bar = "Bar" }; - label.SetBinding(Label.TextProperty, new Binding("foo")); - - Assert.AreEqual("Foo", label.Text, "After Binding, Value should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check the return value of SetValue.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.SetValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindableProperty, object")] - public void SetValue_CHECK_RETURN() - { - /* TEST CODE */ - const string value = "foo"; - var mock = new MockBindable(); - mock.SetValue(MockBindable.TextProperty, value); - - Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty), "Set and Get doesn't work successfully."); - } - - [Test] - [Category("P1")] - [Description("Check the return value of SetValue.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.SetValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - [Property("COVPARAM", "Xamarin.Forms.BindablePropertyKey, object")] - public void SetValue_PROPERTYKEY_CHECK_RETURN() - { - /* TEST CODE */ - var bindablePropertyKey = BindableProperty.CreateReadOnly(w => w.Foo, "DefaultValue"); - var bindableProperty = bindablePropertyKey.BindableProperty; - var bindable = new MockBindable(); - Assert.AreEqual("DefaultValue", bindable.GetValue(bindableProperty), "Should be equal."); - - bindable.SetValue(bindablePropertyKey, "Bar"); - - Assert.AreEqual("Bar", bindable.GetValue(bindableProperty), "Should be equal."); - } - - [Test] - [Category("P1")] - [Description("Check whether BindingContextChanged Event is raised when a property is changed.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.BindingContextChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void BindingContextChanged_EVENT() - { - /* TEST CODE */ - bool flagBindingContextChanged = false; - var mock = new MockBindable(); - mock.BindingContextChanged += (sender, args) => flagBindingContextChanged = true; - - mock.BindingContext = new object(); - - Assert.IsTrue(flagBindingContextChanged, "Event value changed should be handled."); - } - - [Test] - [Category("P1")] - [Description("Check whether PropertyChanged Event is raised when a property is changed.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.PropertyChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void PropertyChanged_EVENT() - { - /* TEST CODE */ - const string value = "foo"; - bool flagPropertyChanged = false; - - var mock = new MockBindable(); - mock.PropertyChanged += (sender, args) => - { - Assert.AreEqual(MockBindable.TextProperty.PropertyName, args.PropertyName); - Assert.AreEqual(value, mock.GetValue(MockBindable.TextProperty)); - flagPropertyChanged = true; - }; - - mock.SetValue(MockBindable.TextProperty, value); - - Assert.IsTrue(flagPropertyChanged, "Event value changed should be handled."); - } - - [Test] - [Category("P1")] - [Description("Check whether PropertyChanging Event is raised when a property is changed.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.PropertyChanging E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void PropertyChanging_EVENT() - { - /* TEST CODE */ - var mock = new MockBindable(); - bool flagPropertyChanging = false; - - mock.PropertyChanging += (sender, args) => - { - Assert.AreEqual(MockBindable.TextProperty.PropertyName, args.PropertyName); - Assert.AreEqual(MockBindable.TextProperty.DefaultValue, mock.GetValue(MockBindable.TextProperty)); - flagPropertyChanging = true; - }; - - mock.SetValue(MockBindable.TextProperty, "foo"); - - Assert.IsTrue(flagPropertyChanging, "Event value changed should be handled."); - } - - [Test] - [Category("P1")] - [Description("Check whether OnBindingContextChanged Invoke or not.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.OnBindingContextChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void OnBindingContextChanged_INVOKE_CHECK() - { - /* TEST CODE */ - var customBindableObject = new CustomBindableObject(); - customBindableObject._flagOnBindingContextChanged = false; - customBindableObject.BindingContext = new object(); - Assert.IsTrue(customBindableObject._flagOnBindingContextChanged, "OnBindingContextChanged does not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check whether OnPropertyChanged Invoke or not.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.OnPropertyChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void OnPropertyChanged_INVOKE_CHECK() - { - /* TEST CODE */ - var customBindableObject = new CustomBindableObject(); - customBindableObject._flagOnPropertyChanged = false; - - const string value = "foo"; - customBindableObject.SetValue(CustomBindableObject.TextProperty, value); - - Assert.IsTrue(customBindableObject._flagOnPropertyChanged, "OnPropertyChanged does not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check whether OnPropertyChanging Invoke or not.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.OnPropertyChanging M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void OnPropertyChanging_INVOKE_CHECK() - { - /* TEST CODE */ - var customBindableObject = new CustomBindableObject(); - customBindableObject._flagOnPropertyChanging = false; - - const string value = "foo"; - customBindableObject.SetValue(CustomBindableObject.TextProperty, value); - - Assert.IsTrue(customBindableObject._flagOnPropertyChanging, "OnPropertyChanging does not invoked."); - } - - [Test] - [Category("P1")] - [Description("Check ApplyBindings return value.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.ApplyBindings M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - public void ApplyBindings_CHECK_RETURN() - { - /* TEST CODE */ - - var mock = new MockBindable(); - bool isCalled = false; - mock.BindingContext = new { foo = "Foo", bar = "Bar" }; - Binding binding = new Binding("foo"); // Binding is an inherited class of BindingBase class. - mock.SetBinding(MockBindable.TextProperty, binding); - - /* - * ApplyBindings Set the IsApplied as true. - * IsApplied is an internal property of BindingBase class. - */ - - mock.ApplyBindings(); - try - { - /* - * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode. - * ThrowIfApplied check that is the IsApplied property is true or false. - * If IsApplied property is false then do nothing. just return. - * If IsApplied property is true then it throw InvalidOperationException. - */ - binding.Mode = BindingMode.OneWayToSource; - } - catch(InvalidOperationException IOEx) - { - /* - * If InvalidOperationException raises then ApplyBindings Pass. - */ - isCalled = true; - } - - Assert.True(isCalled, "ApplyBindings is not successfully called."); - } - - [Test] - [Category("P1")] - [Description("Check UnapplyBindings return value.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.UnapplyBindings M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Md.Elme Focruzzaman Razi, ef.razi@samsung.com")] - public void UnapplyBindings_CHECK_RETURN() - { - /* TEST CODE */ - var mock = new MockBindable(); - bool isCalledApplyBindings = false; - bool isCalledUnapplyBindings = false; - mock.BindingContext = new { foo = "Foo", bar = "Bar" }; - Binding binding = new Binding("foo"); // Binding is an inherited class of BindingBase class. - mock.SetBinding(MockBindable.TextProperty, binding); - - /* - * ApplyBindings Set the IsApplied as true. - * IsApplied is an internal property of BindingBase class. - */ - - mock.ApplyBindings(); - try - { - /* - * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode. - * ThrowIfApplied check that is the IsApplied property is true or false. - * If IsApplied property is false then do nothing. just return. - * If IsApplied property is true then it throw InvalidOperationException. - */ - binding.Mode = BindingMode.OneWayToSource; - } - catch (InvalidOperationException IOEx) - { - /* - * If InvalidOperationException raises then ApplyBindings successfully set the IsApplied as true. - */ - isCalledApplyBindings = true; - } - - /* - * UnapplyBindings Set the IsApplied as false. - * IsApplied is an internal property of BindingBase class. - */ - - mock.UnapplyBindings(); - try - { - /* - * Mode property of BindingBase first called ThrowIfApplied method before the set the Mode. - * ThrowIfApplied check that is the IsApplied property is true or false. - * If IsApplied property is false then do nothing. just return. - * If IsApplied property is true then it throw InvalidOperationException. - */ - binding.Mode = BindingMode.OneWayToSource; - /* - * If this line execute then no InvalidOperationException has been raised. - * Which means UnapplyBindings successfully set the IsApplied property as false. - * So UnapplyBindings pass. - */ - isCalledUnapplyBindings = true; - } - catch (InvalidOperationException IOEx) - { - isCalledUnapplyBindings = false; - } - - Assert.True(isCalledApplyBindings, "ApplyBindings is not successfully called."); - Assert.True(isCalledUnapplyBindings, "UnapplyBindings is not successfully called."); - } - - //[Test] - [Category("P1")] - [Description("Check SetInheritedBindingContext return value.")] - [Property("SPEC", "Xamarin.Forms.BindableObject.SetInheritedBindingContext M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Abu Sina Md. Raju Chowdhury, asm.raju@samsung.com")] - public void SetInheritedBindingContext_CHECK_RETURN() - { - /* TEST CODE */ - Assert.True(false, "[NA] Need to check API behavior"); - } - } -} diff --git a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObjectExtensions.cs b/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObjectExtensions.cs deleted file mode 100755 index e7bacf13a..000000000 --- a/tct-suite-vs/Tizen.XamarinForms1.Tests/testcase/TSBindableObjectExtensions.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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 System; -using NUnit.Framework; - -namespace Xamarin.Forms.Core.UnitTests -{ - [TestFixture] - public class BindableObjectExtensionsTests - { - [SetUp] - public void Setup() - { - Console.WriteLine("BindableObjectExtensionsTests --------------- Setup()"); - } - - [TearDown] - public void TearDown() - { - Console.WriteLine("BindableObjectExtensionsTests --------------- TearDown()"); - } - - [Test] - [Category("P1")] - [Description("Creates and applies a binding to a property")] - [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void SetBinding_CHECK_NO_EXCEPTION() - { - /* TEST CODE */ - Label label = new Label() - { - Text = "BindableObjectExtensions" - }; - VisualElement visualElement = new ContentPage(); - var mFirstHeightRequestProperty = 22.00; - visualElement.HeightRequest = mFirstHeightRequestProperty; - - try - { - BindableObjectExtensions.SetBinding(label, VisualElement.HeightRequestProperty, "Tizen"); - Assert.IsTrue(true, "Set Binding shoud not throw exception."); - } - catch (Exception ex) - { - Assert.IsTrue(false, "Set Binding shoud not throw exception. Exception: " + ex.Message); - } - } - - [Test] - [Category("P1")] - [Description("Creates and applies a binding to a property")] - [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void SetBinding_CHECK_EXCEPTION_WITH_NULL_PARAM() - { - /* TEST CODE */ - VisualElement visualElement = new ContentPage(); - var mFirstHeightRequestProperty = 22.00; - visualElement.HeightRequest = mFirstHeightRequestProperty; - - try - { - BindableObjectExtensions.SetBinding(null, VisualElement.HeightRequestProperty, "Tizen"); - } - catch (Exception ex) - { - Assert.IsInstanceOf(ex, "ArgumentNullException should be thrown."); - } - } - - [Test] - [Category("P1")] - [Description("Creates and applies a binding to a property")] - [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void SetBinding_CHECK_NO_EXCEPTION_WITH_BINDINGMODE() - { - /* TEST CODE */ - Label label = new Label() - { - Text = "BindableObjectExtensions" - }; - VisualElement visualElement = new ContentPage(); - var mFirstHeightRequestProperty = 22.00; - visualElement.HeightRequest = mFirstHeightRequestProperty; - - try - { - BindableObjectExtensions.SetBinding(label, VisualElement.HeightRequestProperty, "Tizen", BindingMode.Default, null, null); - } - catch (Exception ex) - { - Assert.IsTrue(false, "SetBinding shoud not throw exception. Exception: " + ex.Message); - } - } - - [Test] - [Category("P1")] - [Description("Creates and applies a binding to a property")] - [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void SetBinding_CHECK_EXCEPTION_WITH_NULL_PARAM_WITH_BINDINGMODE() - { - /* TEST CODE */ - VisualElement visualElement = new ContentPage(); - var mFirstHeightRequestProperty = 22.00; - visualElement.HeightRequest = mFirstHeightRequestProperty; - - try - { - BindableObjectExtensions.SetBinding(null, VisualElement.HeightRequestProperty, "Tizen", BindingMode.Default, null, null); - } - catch (Exception ex) - { - Assert.IsInstanceOf(ex, "ArgumentNullException should be thrown."); - } - } - - [Test] - [Category("P1")] - [Description("Creates and applies a binding from an expression.")] - [Property("SPEC", "Xamarin.Forms.BindableObjectExtensions.SetBinding M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Arindom Kumar Chanda Sajal, arindom.ch@samsung.com")] - public void SetBinding_CHECK_NO_EXCEPTION_WITH_EXPRESSION() - { - /* TEST CODE */ - Label label = new Label() - { - Text = "BindableObjectExtensions" - }; - VisualElement visualElement = new ContentPage(); - var mFirstHeightRequestProperty = 22.00; - visualElement.HeightRequest = mFirstHeightRequestProperty; - - try - { - BindableObjectExtensions.SetBinding