From: hyunho Date: Tue, 10 Sep 2019 10:25:26 +0000 (+0900) Subject: [Tizen.Applications.ComponentBased][TCSACR-265][Add TC for ComponentBased] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F13%2F213713%2F15;p=test%2Ftct%2Fcsharp%2Fapi.git [Tizen.Applications.ComponentBased][TCSACR-265][Add TC for ComponentBased] Change-Id: I561b0cc3c8f6a31e3a3d7f5991e7423c50be81d0 Signed-off-by: hyunho --- diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/ComponentBasedTest.tar b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/ComponentBasedTest.tar new file mode 100644 index 000000000..0a15c06c8 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/ComponentBasedTest.tar differ diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/EFLComponentBasedTest.tar b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/EFLComponentBasedTest.tar new file mode 100644 index 000000000..3a426ef7f Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/EFLComponentBasedTest.tar differ diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/GroupTestApp.tar b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/GroupTestApp.tar new file mode 100644 index 000000000..e331498b9 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/GroupTestApp.tar differ diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.ComponentBasedTest-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.ComponentBasedTest-1.0.0.tpk new file mode 100644 index 000000000..f95d906fb Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.ComponentBasedTest-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.EFLComponentBasedTest-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.EFLComponentBasedTest-1.0.0.tpk new file mode 100644 index 000000000..40ebb919a Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.EFLComponentBasedTest-1.0.0.tpk differ diff --git a/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.GroupTestApp-1.0.0.tpk b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.GroupTestApp-1.0.0.tpk new file mode 100644 index 000000000..4ca493c89 Binary files /dev/null and b/tct-suite-vs/Resource/Tizen.ComponentBased.Manual.Tests/org.tizen.example.GroupTestApp-1.0.0.tpk differ diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Program.cs b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Program.cs new file mode 100644 index 000000000..722d7b8e9 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Program.cs @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 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 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); + } + + 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.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.csproj b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.csproj new file mode 100644 index 000000000..97666f135 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.csproj @@ -0,0 +1,44 @@ + + + + + Exe + tizen60 + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + + ..\..\..\TizenFX\src\Tizen.Applications.ComponentBased.Default\bin\Debug\netstandard2.0\Tizen.Applications.ComponentBased.dll + + + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.sln b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.sln new file mode 100644 index 000000000..8ccd04449 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/Tizen.ComponentBased.Manual.Tests.sln @@ -0,0 +1,92 @@ +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.ComponentBased.Manual.Tests", "Tizen.ComponentBased.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 + {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}.Debug|x64.ActiveCfg = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.Build.0 = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.ActiveCfg = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.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 + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.ActiveCfg = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.Build.0 = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.ActiveCfg = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.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}.Debug|x64.ActiveCfg = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.Build.0 = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.ActiveCfg = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.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 + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.ActiveCfg = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.Build.0 = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.ActiveCfg = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.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.ComponentBased.Manual.Tests/shared/res/Tizen.ComponentBased.Manual.Tests.png b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/shared/res/Tizen.ComponentBased.Manual.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/shared/res/Tizen.ComponentBased.Manual.Tests.png differ diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSBaseComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSBaseComponent.cs new file mode 100644 index 000000000..0e9113a61 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSBaseComponent.cs @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2019 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 Tizen.Applications; +using Xamarin.Forms; + +namespace Tizen.ComponentBasedApplication.Tests +{ + [TestFixture] + [Description("Tizen.Applications.ComponentBasedApplication base component test")] + public class BaseComponentTests + { + private TestPage _testPage = TestPage.GetInstance(); + private Button _comp_button; + private string _testAppId = "org.tizen.example.ComponentBasedTest"; + private bool _isMobile = false; + private bool _isWearable = false; + private bool _isEmulator = false; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); + _isMobile = ManualTest.IsMobile(); + _isWearable = ManualTest.IsWearable(); + _isEmulator = ManualTest.IsEmulator(); + _comp_button = new Button(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); + _comp_button = null; + } + + private void CreateCompButton(string btnText) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); + var layout = new StackLayout() + { + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + }; + + _comp_button = new Button() + { + Text = btnText, + FontSize = 20, + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.FillAndExpand, + }; + + layout.Children.Add(_comp_button); + _testPage.ExecuteTC(layout); + } + + private void OnClick(object sender, EventArgs e) + { + AppControl control = new AppControl(); + control.ApplicationId = _testAppId; + control.Operation = AppControlOperations.Default; + AppControl.SendLaunchRequest(control); + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnDestroy() should be called after Finish method call")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.Finish M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Finish' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnDestroy\".")] + [Postcondition(1, "Close the terminal")] + public async Task Finish_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnRestoreContents() should be called after OnCreate() function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.OnRestoreContents M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnRestoreContents\" after \"ComponentBasedTest: OnCreate\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnRestoreContents_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnSaveContent() should be called before OnDestroy function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.OnSaveContent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Exit' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnSaveContent\" before \"ComponentBasedTest: OnDestroy\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnSaveContent_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : Launch application using group mode")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.SendLaunchRequestAsync M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Group Launch' button")] + [Step(4, "Check wether New UI application is launched or not")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task SendLaunchRequestAsync_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("Test : Gets ComponentId of the running component")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.ComponentId A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: ComponentId(test_csharp_frame)\"")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task ComponentId_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("Test : Gets the Id of the running component")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.Id A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: id(random string)\". The Id will be generated randomly")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task Id_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("Test : Gets the running component's parent application information")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.Parent A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: Parent(org.tizen.example.ComponentBasedTest)\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task Parent_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The LowMemory event should be caught when a device memory is low")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.LowMemory E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "This test can be tested only in mobile emulator now.")] + [Precondition(2, "Open terminal to view logs.")] + [Precondition(3, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(4, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Precondition(5, "Right click on the mobile emulator and Click ControlPanel")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Find and click Memory button in Emulator Control Panel")] + [Step(4, "Select Soft Warning button")] + [Step(5, "Check if log show \"FrameComp_LowMemory > Low Memory Frame: SoftWarning\".")] + [Step(6, "Select Hard Warning button")] + [Step(7, "Check if log show \"FrameComp_LowMemory > Low Memory Frame: HardWarning\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task LowMemory_MANUAL_TEST() + { + if (!_isMobile || !_isEmulator) + { + ManualTest.Confirm(); + return; + } + else + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The LowBattery event should be caught when a device battery status is low")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.LowBattery E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "This test can be tested only in mobile emulator now.")] + [Precondition(2, "Open terminal to view logs.")] + [Precondition(3, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(4, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Precondition(5, "Right click on the mobile emulator and Click ControlPanel")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Find and click Battery button in Emulator Control Panel")] + [Step(4, "Click level bar to make it under 5%")] + [Step(5, "Check if log show \"FrameComp_LowBattery > Low Battery\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task LowBattery_MANUAL_TEST() + { + if (!_isMobile || !_isEmulator) + { + ManualTest.Confirm(); + return; + } + else + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The DeviceOrientationChanged event should be caught when a device orientation is changed")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.DeviceOrientationChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "This test can be tested only in devices which provide auto rotate option. (For now only mobile provide this option)")] + [Precondition(2, "Open terminal to view logs.")] + [Precondition(3, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(4, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Precondition(5, "(emulator only) Right click on the mobile emulator and Click ControlPanel")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Rotate the device or find 3-Axis in Emulator Control Panel and change device orientation")] + [Step(4, "Check if log show \"FrameComp_DeviceOrientationChanged > Device Orientation Changed\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task DeviceOrientationChanged_MANUAL_TEST() + { + if (!_isMobile || !_isEmulator) + { + ManualTest.Confirm(); + return; + } + else + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The LocaleChanged Event should be caught after change Language of device")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.LocaleChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Open terminal to view logs.")] + [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(3, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "[Common] if you cannot change a language in a setting app, this test can not be tested. Please click \"Pass\" button.")] + [Step(4, "Press Home hardkey -> Setting app -> change language -> return to app test")] + [Step(5, "Check if log show \"FrameComp_LocaleChanged > Locale Changed\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task LocaleChanged_EVENT_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The RegionFormatChanged Event should be caught after change Language of device")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.RegionFormatChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Open terminal to view logs.")] + [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "[mobile] Press Home hardkey -> Setting app -> change language -> return to app test")] + [Step(4, "[TV profile] Press Home key -> Settings -> System -> Location -> change location -> return to app test")] + [Step(5, "[TV profile] if there is no \"Location\" menu, this test can not be tested. Please click \"Pass\" button if \"Location\" menu doesn't exist.")] + [Step(6, "[Wearable profile] if there is no \"Location\" menu, this test can not be tested. Please click \"Pass\" button if the \"Location\" menu doesn't exist.")] + [Step(7, "Check if log show \"FrameComp_RegionFormatChanged > Region Format Changed\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task RegionFormatChanged_EVENT_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The SuspendedStateChanged Event should be caught after application is suspended")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.SuspendedStateChanged E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Open terminal to view logs.")] + [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(3, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press Home hardkey")] + [Step(4, "Check if log show \"FrameComp_SuspendedStateChanged > SuspendedState Changed\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task SuspendedStateChanged_EVENT_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P2")] + [Description("Test : SendLaunchRequest with not installed application ID should throw the app not found exception")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.SendLaunchRequestAsync M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Open terminal to view logs.")] + [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(3, "Enter command \"sdb dlog | grep ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Launch Not Exist App' button")] + [Step(4, "Check if log show \"OnLaunchNotExistClick > Async result : AppNotFound\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task SendLaunchRequestAsync_AppNotFoundException() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } +} + + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSComponentBasedApplication.cs b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSComponentBasedApplication.cs new file mode 100644 index 000000000..4aec8302c --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSComponentBasedApplication.cs @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2019 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 Tizen.Applications; +using Xamarin.Forms; + +namespace Tizen.ComponentBasedApplication.Tests +{ + [TestFixture] + [Description("Tizen.Applications.ComponentBasedApplication test")] + public class ComponentBasedApplicationTests + { + private TestPage _testPage = TestPage.GetInstance(); + private Button _comp_button; + private string _testAppId = "org.tizen.example.ComponentBasedTest"; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); + _comp_button = new Button(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); + _comp_button = null; + } + + private void CreateCompButton(string btnText) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); + var layout = new StackLayout() + { + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + }; + + _comp_button = new Button() + { + Text = btnText, + FontSize = 20, + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.FillAndExpand, + }; + + layout.Children.Add(_comp_button); + _testPage.ExecuteTC(layout); + } + + private void OnClick(object sender, EventArgs e) + { + AppControl control = new AppControl(); + control.ApplicationId = _testAppId; + control.Operation = AppControlOperations.Default; + AppControl.SendLaunchRequest(control); + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : Run() method call should start component-based application lifecycle")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.Run M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnRun\".")] + [Step(4, "Check component-based application is displayed.")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task Run_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnInit() should be called after launch component-based application")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.OnInit M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnInit\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnInit_MANUAL_TEST() + { + //await TermiatePreviousApp(); + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnRun() should be called after component-based application is launched")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.OnRun M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnRun\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnRun_MANUAL_TEST() + { + //await TermiatePreviousApp(); + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnExit() should be called after component-based application is terminated")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.OnExit M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Exit' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnExit\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnExit_MANUAL_TEST() + { + //await TermiatePreviousApp(); + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnFinished() should be called after OnExit")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.OnFinished M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Exit' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnFinished\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnFinished_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : The component-based application should be dead after the Exit method is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.Exit M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Exit' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnFinished\".")] + [Postcondition(1, "Close the terminal")] + public async Task Exit_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Check whether ComponentBased Application is successfully terminated or not"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSFrameComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSFrameComponent.cs new file mode 100644 index 000000000..9f6bae8c3 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSFrameComponent.cs @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2019 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 Tizen.Applications; +using Xamarin.Forms; + +namespace Tizen.ComponentBasedApplication.Tests +{ + [TestFixture] + [Description("Tizen.Applications.ComponentBasedApplication frame component test")] + public class FrameComponentTests + { + private TestPage _testPage = TestPage.GetInstance(); + private Button _comp_button; + private string _testAppId = "org.tizen.example.ComponentBasedTest"; + private bool _isMobile = false; + private bool _isWearable = false; + private bool _isEmulator = false; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); + _isMobile = ManualTest.IsMobile(); + _isWearable = ManualTest.IsWearable(); + _isEmulator = ManualTest.IsEmulator(); + _comp_button = new Button(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); + _comp_button = null; + } + + private void CreateCompButton(string btnText) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); + var layout = new StackLayout() + { + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + }; + + _comp_button = new Button() + { + Text = btnText, + FontSize = 20, + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.FillAndExpand, + }; + + layout.Children.Add(_comp_button); + _testPage.ExecuteTC(layout); + } + + private void OnClick(object sender, EventArgs e) + { + AppControl control = new AppControl(); + control.ApplicationId = _testAppId; + control.Operation = AppControlOperations.Default; + AppControl.SendLaunchRequest(control); + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : CreateWindowInfo() should be called before OnCreate function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.CreateWindowInfo M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: CreateWindowInfo success\" before \"ComponentBasedTest: OnCreate\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task CreateWindowInfo_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnCreate() should be called after CreateWindowInfo function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnCreate M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnCreate\" after \"ComponentBasedTest: CreateWindowInfo success\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnCreate_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnDestroy() should be called after Finish function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnDestroy M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Finish' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnDestroy\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnDestroy_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnPause() should be called when the application is not visible")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnPause M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press Home button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnPause\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnPause_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnResume() should be called after launch")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnResume M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Precondition(3, "The device LCD should be on")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnResume\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnResume_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnStart() should be called after launch")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnStart M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnStart\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task OnStart_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnStop() should be called when the application is terminated")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.OnStop M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Press launched application's 'Exit' button")] + [Step(4, "Check if log show \"ComponentBasedTest: OnStop\" after \"ComponentBasedTest: OnPause\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnStop_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("Test : Gets display status of the current device")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.DisplayStatus A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog ComponentBasedTest\" to terminal")] + [Precondition(3, "The device LCD should be on")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"ComponentBasedTest: OnResume > DisplayStatus(On)\".")] + [Postcondition(1, "Close the terminal")] + [Postcondition(2, "Press launched application's 'Exit' button")] + public async Task DisplayStatus_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } +} + + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSServiceComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSServiceComponent.cs new file mode 100644 index 000000000..dc4ee1658 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/testcase/TSServiceComponent.cs @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2019 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 Tizen.Applications; +using Xamarin.Forms; + +namespace Tizen.ComponentBasedApplication.Tests +{ + [TestFixture] + [Description("Tizen.Applications.ComponentBasedApplication service component test")] + public class ServiceComponentTests + { + private TestPage _testPage = TestPage.GetInstance(); + private Button _comp_button; + private string _testAppId = "org.tizen.example.EFLComponentBasedTest"; + private bool _isMobile = false; + private bool _isWearable = false; + private bool _isEmulator = false; + + [SetUp] + public void Init() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); + _isMobile = ManualTest.IsMobile(); + _isWearable = ManualTest.IsWearable(); + _isEmulator = ManualTest.IsEmulator(); + _comp_button = new Button(); + } + + [TearDown] + public void Destroy() + { + LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); + _comp_button = null; + } + + private void CreateCompButton(string btnText) + { + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "CreateButton"); + var layout = new StackLayout() + { + IsVisible = true, + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + }; + + _comp_button = new Button() + { + Text = btnText, + FontSize = 20, + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.FillAndExpand, + }; + + layout.Children.Add(_comp_button); + _testPage.ExecuteTC(layout); + } + + private void OnClick(object sender, EventArgs e) + { + AppControl control = new AppControl(); + control.ApplicationId = _testAppId; + control.Operation = AppControlOperations.Default; + AppControl.SendLaunchRequest(control); + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnCreate() should be called after the application is launched")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ServiceComponent.OnCreate M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog EFLComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"EFLComponentBasedTest: OnCreate\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnCreate_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnDestroy() should be called before OnFinished function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ServiceComponent.OnDestroy M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog EFLComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"EFLComponentBasedTest: OnDestroy\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnDestroy_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + + [Test] + [Category("P1")] + [Description("MANUAL TEST : OnStartCommand() should be called after the OnRestoreContents function is called")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ServiceComponent.OnStartCommand M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Precondition(1, "Enter command \"sdb dlog -c\" to clear log")] + [Precondition(2, "Enter command \"sdb dlog EFLComponentBasedTest\" to terminal")] + [Step(1, "Click run TC")] + [Step(2, "Press 'Click me' button")] + [Step(3, "Check if log show \"EFLComponentBasedTest: OnStartCommand\" after \"EFLComponentBasedTest: OnRestoreContents\".")] + [Postcondition(1, "Close the terminal")] + public async Task OnStartCommand_MANUAL_TEST() + { + CreateCompButton("Click me!! Test: Launch ComponentBased Application"); + _comp_button.Clicked += OnClick; + + /* TEST CODE */ + await ManualTest.WaitForConfirm(); + _comp_button.Clicked -= OnClick; + } + } +} + + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/tizen-manifest.xml new file mode 100644 index 000000000..764339e4e --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Manual.Tests/tizen-manifest.xml @@ -0,0 +1,21 @@ + + + + + Tizen.ComponentBased.Manual.Tests.png + + + + + + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/Program.cs b/tct-suite-vs/Tizen.ComponentBased.Tests/Program.cs new file mode 100644 index 000000000..e0f15ebe5 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/Program.cs @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2019 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); + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.csproj b/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.csproj new file mode 100644 index 000000000..f64ebdd51 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.csproj @@ -0,0 +1,44 @@ + + + + + Exe + tizen60 + + + + + true + + + + portable + + + None + + + + + + + + + + + Runtime + + + + + + + + + + + ..\..\..\source\TizenFX\src\Tizen.Applications.ComponentBased.Default\bin\Debug\netstandard2.0\Tizen.Applications.ComponentBased.dll + + + + diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.sln b/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.sln new file mode 100644 index 000000000..1d6f2c39a --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/Tizen.ComponentBased.Tests.sln @@ -0,0 +1,78 @@ +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.ComponentBased.Tests", "Tizen.ComponentBased.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}.Debug|x64.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.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 + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU + {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.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.ComponentBased.Tests/shared/res/Tizen.ComponentBased.Tests.png b/tct-suite-vs/Tizen.ComponentBased.Tests/shared/res/Tizen.ComponentBased.Tests.png new file mode 100755 index 000000000..9765b1bda Binary files /dev/null and b/tct-suite-vs/Tizen.ComponentBased.Tests/shared/res/Tizen.ComponentBased.Tests.png differ diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSBaseComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSBaseComponent.cs new file mode 100644 index 000000000..2be8bf200 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSBaseComponent.cs @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2019 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; +using System.Threading.Tasks; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.ComponentBased.Common; + +namespace Tizen.ComponentBased.Tests { + + public class BaseComp : BaseComponent + { + } + + [TestFixture] + [Description("BaseComponent Class Tests")] + public class BaseComponentTests { + + [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"); + } + + private void ReplyReceivedCallback(AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result) + { + } + + [Test] + [Category("P2")] + [Description("Test : SendLaunchRequest with null parameter should throw the argument exception")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.SendLaunchRequestAsync M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Property("COVPARAM", "System.Type, string")] + public void SendLaunchRequestAsync_ArgumentException() + { + FrameComp comp = new FrameComp(); + Assert.Throws(() => comp.SendLaunchRequestAsync(null, ReplyReceivedCallback)); + } + + + [Test] + [Category("P1")] + [Description("Create a base component which will be used by component-based applications")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.BaseComponent.BaseComponent C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + public void BaseComponent_INIT() + { + var comp = new BaseComp(); + Assert.NotNull(comp, "Should not return NULL"); + Assert.IsInstanceOf(comp, "Should return BaseComponent."); + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSComponentBasedApplication.cs b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSComponentBasedApplication.cs new file mode 100644 index 000000000..3baa64789 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSComponentBasedApplication.cs @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2019 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; +using System.Threading.Tasks; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.ComponentBased.Common; + +namespace Tizen.ComponentBased.Tests { + + public class FrameComp : FrameComponent + { + class TWindowInfo : IWindowInfo + { + public int ResourceId + { + get + { + return 1; + } + } + } + + public override IWindowInfo CreateWindowInfo() + { + return new TWindowInfo(); + } + + public override bool OnCreate() + { + return true; + } + } + + public class ServiceComp : ServiceComponent + { + public override bool OnCreate() + { + return true; + } + } + + public class TestApp : ComponentBasedApplication + { + public TestApp(IDictionary typeInfo) : base(typeInfo) + { + } + protected override void OnRun() + { + + } + } + + [TestFixture] + [Description("ComponentBasedApplication Class Tests")] + public class ComponentBasedTests { + + [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("Create a component-based application with a frame-component")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.ComponentBasedApplication C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Property("COVPARAM", "Dictionary")] + public void ComponentBasedApplication_INIT() + { + IDictionary typeInfo = new Dictionary(); + typeInfo.Add(typeof(FrameComp), "csharp_frame"); + TestApp app = new TestApp(typeInfo); + Assert.NotNull(app, "Should not return NULL"); + Assert.IsInstanceOf(app, "Should return ComponentBasedApplication."); + } + + [Test] + [Category("P1")] + [Description("Test : Adds type to the component-based application should not throw exceptions")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.RegisterComponent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Property("COVPARAM", "System.Type, string")] + public void RegisterComponent_Add_Value() + { + IDictionary typeInfo = new Dictionary(); + typeInfo.Add(typeof(FrameComp), "csharp_frame"); + TestApp app = new TestApp(typeInfo); + Assert.IsInstanceOf(app, "Should return ComponentBasedApplication."); + + try + { + app.RegisterComponent(typeof(ServiceComp), "Service-comp"); + } + catch (Exception e) + { + Assert.Fail(e.ToString()); + } + } + + [Test] + [Category("P2")] + [Description("Test : Adds already exist type to the component-based application should throw the Argument exception")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ComponentBasedApplication.RegisterComponent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Property("COVPARAM", "System.Type, string")] + public void RegisterComponent_ArgumentException() + { + IDictionary typeInfo = new Dictionary(); + typeInfo.Add(typeof(FrameComp), "csharp_frame"); + TestApp app = new TestApp(typeInfo); + Assert.IsInstanceOf(app, "Should return ComponentBasedApplication."); + Assert.Throws(() => app.RegisterComponent(typeof(FrameComp), "test")); + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSFrameComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSFrameComponent.cs new file mode 100644 index 000000000..09027c8a8 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSFrameComponent.cs @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2019 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; +using System.Threading.Tasks; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.ComponentBased.Common; + +namespace Tizen.ComponentBased.Tests { + + [TestFixture] + [Description("FrameComponent Class Tests")] + public class FrameComponentTests { + + [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"); + } + + private void ReplyReceivedCallback(AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result) + { + } + + [Test] + [Category("P2")] + [Description("Test : DisplayStatus throw exception when invalid component requests display status")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.DisplayStatus A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + public void DisplayStatus_InvalidOperationException() + { + FrameComp comp = new FrameComp(); + DisplayStatus dis; + Assert.Throws(() => dis = comp.DisplayStatus); + } + + [Test] + [Category("P1")] + [Description("Create a frame component which will be used by component-based applications")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.FrameComponent.FrameComponent C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + public void FrameComponent_INIT() + { + var comp = new FrameComp(); + Assert.NotNull(comp, "Should not return NULL"); + Assert.IsInstanceOf(comp, "Should return FrameComp."); + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSServiceComponent.cs b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSServiceComponent.cs new file mode 100644 index 000000000..3c012cbfd --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/testcase/TSServiceComponent.cs @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2019 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; +using System.Threading.Tasks; +using Tizen; +using Tizen.Applications; +using Tizen.Applications.ComponentBased.Common; + +namespace Tizen.ComponentBased.Tests { + + [TestFixture] + [Description("ServiceComponent Class Tests")] + public class ServiceComponentTests { + + [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"); + } + + private void ReplyReceivedCallback(AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result) + { + } + + public class ServiceComp : ServiceComponent + { + public override bool OnCreate() + { + return true; + } + } + + [Test] + [Category("P1")] + [Description("Create a service component which will be used by component-based applications")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Common.ServiceComponent.ServiceComponent C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + public void ServiceComponent_INIT() + { + var comp = new ServiceComp(); + Assert.NotNull(comp, "Should not return NULL"); + Assert.IsInstanceOf(comp, "Should return ServiceComp."); + } + } +} diff --git a/tct-suite-vs/Tizen.ComponentBased.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.ComponentBased.Tests/tizen-manifest.xml new file mode 100644 index 000000000..d204d1362 --- /dev/null +++ b/tct-suite-vs/Tizen.ComponentBased.Tests/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + Tizen.ComponentBased.Tests.png + + + + http://tizen.org/privilege/appmanager.launch + + diff --git a/tct-suite-vs/Tizen.WatchApplication.Manual.Tests/Tizen.WatchApplication.Manual.Tests.sln b/tct-suite-vs/Tizen.WatchApplication.Manual.Tests/Tizen.WatchApplication.Manual.Tests.sln old mode 100755 new mode 100644 index f43755c6b..fbea02938 --- a/tct-suite-vs/Tizen.WatchApplication.Manual.Tests/Tizen.WatchApplication.Manual.Tests.sln +++ b/tct-suite-vs/Tizen.WatchApplication.Manual.Tests/Tizen.WatchApplication.Manual.Tests.sln @@ -58,18 +58,30 @@ Global {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}.Debug|x64.ActiveCfg = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.Build.0 = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.ActiveCfg = Debug|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.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 + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.ActiveCfg = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.Build.0 = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.ActiveCfg = Release|Any CPU + {269F89A7-E648-4811-8421-844E00ACF5F0}.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}.Debug|x64.ActiveCfg = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.Build.0 = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.ActiveCfg = Debug|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.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 + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.ActiveCfg = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.Build.0 = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.ActiveCfg = Release|Any CPU + {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE