This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add appium auto test for CircularShell (#242)
* Add appium test for CircularShell (#241) * Add Appium unit testcase * Update Shell UI Tests (#236) Co-authored-by: shmin <[email protected]> * Update Icon Images (#245) * Update WearableUIGallery to use Shell (#252) Co-authored-by: shmin <[email protected]>
- Loading branch information
1 parent
3b17ae0
commit 680a2c9
Showing
49 changed files
with
789 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+199 Bytes
(110%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+436 Bytes
(120%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/bear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+379 Bytes
(110%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/elephant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+304 Bytes
(110%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+227 Bytes
(110%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+540 Bytes
(120%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/monkey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+477 Bytes
(110%)
sample/ShellExamples/Xaminals/Xaminals.Tizen/res/random.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Appium.CircularShell.Tests | ||
{ | ||
public class AppInitializer | ||
{ | ||
static TizenDriverApp s_instance; | ||
public static TizenDriverApp GetDriver() | ||
{ | ||
if (s_instance == null) | ||
{ | ||
//string address = "http://10.113.165.80:4723/wd/hub"; | ||
string address = "http://127.0.0.1:4723/wd/hub"; | ||
s_instance = TizenDriverApp.CreateDriver(address, "emulator-26101", "org.tizen.example.CircularShellGallery"); | ||
} | ||
return s_instance; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
test/Appium.CircularShell.Tests/Appium.CircularShell.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Appium.WebDriver" Version="4.0.0.5-beta" /> | ||
<PackageReference Include="nunit" Version="3.10.1" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
25 changes: 25 additions & 0 deletions
25
test/Appium.CircularShell.Tests/Appium.CircularShell.Tests.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.1000 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Appium.CircularShell.Tests", "Appium.CircularShell.Tests.csproj", "{C102CAD4-0841-4CB3-BB6E-BE29619B5FD4}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C102CAD4-0841-4CB3-BB6E-BE29619B5FD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C102CAD4-0841-4CB3-BB6E-BE29619B5FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C102CAD4-0841-4CB3-BB6E-BE29619B5FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C102CAD4-0841-4CB3-BB6E-BE29619B5FD4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {1E919302-4E35-4EC8-A32A-45D4BA8B9229} | ||
EndGlobalSection | ||
EndGlobal |
42 changes: 42 additions & 0 deletions
42
test/Appium.CircularShell.Tests/TC/TCFlyoutBackgroundColor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using NUnit.Framework; | ||
using System.Threading; | ||
|
||
|
||
namespace Appium.CircularShell.Tests | ||
{ | ||
[TestFixture] | ||
public class TCFlyoutBackgroundColor : TestCaseBase | ||
{ | ||
public TCFlyoutBackgroundColor() : base("FlyoutBackgroundColor") | ||
{ | ||
} | ||
|
||
[Test] | ||
public void SetBlueViolet() | ||
{ | ||
FindAndClick("BlueViolet"); | ||
FindAndClick("Open"); | ||
GoBack(); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetBrown() | ||
{ | ||
FindAndClick("Brown"); | ||
FindAndClick("Open"); | ||
GoBack(); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetFuchsia() | ||
{ | ||
FindAndClick("Fuchsia"); | ||
FindAndClick("Open"); | ||
GoBack(); | ||
FindAndClick("default"); | ||
} | ||
|
||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
test/Appium.CircularShell.Tests/TC/TCFlyoutForegroundColor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using NUnit.Framework; | ||
using System.Threading; | ||
|
||
namespace Appium.CircularShell.Tests | ||
{ | ||
[TestFixture] | ||
public class TCFlyoutForeBackgroundColor : TestCaseBase | ||
{ | ||
public TCFlyoutForeBackgroundColor() : base("FlyoutForegroundColor") { } | ||
|
||
[Test] | ||
public void SetBlueViolet() | ||
{ | ||
FindAndClick("BlueViolet"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetBrown() | ||
{ | ||
FindAndClick("Brown"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetFuchsia() | ||
{ | ||
FindAndClick("Fuchsia"); | ||
FindAndClick("default"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
|
||
namespace Appium.CircularShell.Tests | ||
{ | ||
[TestFixture] | ||
public class TCFlyoutIcon : TestCaseBase | ||
{ | ||
public TCFlyoutIcon() : base("FlyoutIcon") { } | ||
|
||
[Test] | ||
public void SetIcon1() | ||
{ | ||
FindAndClick("icon1"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetIcon2() | ||
{ | ||
FindAndClick("icon2"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetIcon3() | ||
{ | ||
FindAndClick("icon3"); | ||
FindAndClick("default"); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
test/Appium.CircularShell.Tests/TC/TCFlyoutIconBackgroudColor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using NUnit.Framework; | ||
using System.Threading; | ||
|
||
namespace Appium.CircularShell.Tests | ||
{ | ||
[TestFixture] | ||
public class TCFlyoutIconBackgroundColor : TestCaseBase | ||
{ | ||
public TCFlyoutIconBackgroundColor() : base("FlyoutIconBackgroundColor") { } | ||
|
||
[Test] | ||
public void SetBlueViolet() | ||
{ | ||
FindAndClick("BlueViolet"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetBrown() | ||
{ | ||
FindAndClick("Brown"); | ||
FindAndClick("default"); | ||
} | ||
|
||
[Test] | ||
public void SetFuchsia() | ||
{ | ||
FindAndClick("Fuchsia"); | ||
FindAndClick("default"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using NUnit.Framework; | ||
|
||
namespace Appium.CircularShell.Tests | ||
{ | ||
public abstract class TestCaseBase | ||
{ | ||
readonly int _screenHeight = 360; | ||
|
||
protected TestCaseBase(string tcName) | ||
{ | ||
TCName = tcName; | ||
} | ||
|
||
public string TCName { get; } | ||
|
||
public TizenDriverApp Driver { get; set; } | ||
|
||
|
||
[OneTimeSetUp] | ||
public void Init() | ||
{ | ||
Driver = AppInitializer.GetDriver(); | ||
} | ||
|
||
[SetUp] | ||
public void TestSetUp() | ||
{ | ||
Driver.SetText("TCName", TCName); | ||
FindAndClick("Go"); | ||
} | ||
|
||
[TearDown] | ||
public void TestCleanUp() | ||
{ | ||
FindAndClick("Back"); | ||
} | ||
|
||
public void GoBack() | ||
{ | ||
Driver.Navigate().Back(); | ||
Thread.Sleep(1000); | ||
} | ||
|
||
public void FindAndClick(string automationId) | ||
{ | ||
var element = Driver.FindElementByAccessibilityId(automationId); | ||
var y = element.Location.Y; | ||
var height = element.Size.Height; | ||
var retry = 10; | ||
|
||
if ((y < 0)) | ||
{ | ||
while ((y < 0) && (retry > 0)) | ||
{ | ||
Driver.Flick(0, 100); | ||
Thread.Sleep(1000); | ||
y = element.Location.Y; | ||
retry--; | ||
} | ||
} | ||
else if ((y + height) > _screenHeight) | ||
{ | ||
while (((y + height) > _screenHeight) && (retry > 0)) | ||
{ | ||
Driver.Flick(0, -100); | ||
Thread.Sleep(1000); | ||
y = element.Location.Y; | ||
height = element.Size.Height; | ||
retry--; | ||
} | ||
} | ||
element.Click(); | ||
Thread.Sleep(1000); | ||
} | ||
} | ||
} |
Oops, something went wrong.