Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9321163
WIP
StuartFergusonVme Apr 20, 2022
26bb295
First UI Test
StuartFergusonVme May 17, 2022
6d8ab57
Merge branch 'main' into testing/#5_initialuitests
StuartFerguson May 17, 2022
7957cc2
workflow updates
StuartFergusonVme May 17, 2022
170c89b
Merge branch 'testing/#5_initialuitests' of ssh://github.com/Transact…
StuartFergusonVme May 17, 2022
3ed4c59
...
StuartFergusonVme May 17, 2022
50fae74
..
StuartFergusonVme May 17, 2022
0a9343c
:|
StuartFergusonVme May 17, 2022
8404250
..
StuartFergusonVme May 18, 2022
d24e5ae
Added iOS UI Tests
StuartFergusonVme May 18, 2022
20c5297
:|
StuartFergusonVme May 18, 2022
17e64b2
removed hardcoding to android :|
StuartFergusonVme May 18, 2022
7856979
tweaks
StuartFergusonVme May 18, 2022
ecb2648
:|
StuartFergusonVme May 18, 2022
23da2b8
:|
StuartFergusonVme May 18, 2022
730c3dc
.
StuartFergusonVme May 18, 2022
5f033aa
..
StuartFergusonVme May 18, 2022
863c29a
..
StuartFergusonVme May 18, 2022
4f0e528
..
StuartFergusonVme May 18, 2022
7bf81ee
increase ios timeout
StuartFergusonVme May 18, 2022
8ab7ba9
...
StuartFergusonVme May 18, 2022
bb321a7
keyboard issue
StuartFergusonVme May 18, 2022
a8b4c64
switch hack for iOS
StuartFergusonVme May 18, 2022
1d518e2
adding debug
StuartFergusonVme May 18, 2022
16715fe
..
StuartFergusonVme May 18, 2022
e60ecd7
:|
StuartFergusonVme May 18, 2022
529bb85
more debug
StuartFergusonVme May 18, 2022
667da8a
:|
StuartFergusonVme May 18, 2022
d4df7d0
tweaks to login flow
StuartFergusonVme May 20, 2022
89171e2
:|
StuartFergusonVme May 20, 2022
14cd046
..
StuartFergusonVme May 24, 2022
baddbc2
.
StuartFergusonVme May 24, 2022
34a721f
Fix iOS Test
StuartFergusonVme May 25, 2022
11aa0b2
move maccatalyst to macos12
StuartFergusonVme May 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .github/workflows/pullrequest_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@ env:
jobs:
# MAUI Android Build
build-android:
runs-on: windows-2022
#runs-on: windows-2022
runs-on: macos-12
name: Android Build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- uses: malinskiy/action-android/install-sdk@release/0.1.1
- run: sdkmanager "platform-tools" "platforms;android-31"
- run: sdkmanager "build-tools;30.0.2"
- run: adb devices

- name: Set up Node.js
uses: actions/setup-node@v1
with:
vs-prerelease: true
msbuild-architecture: x64
node-version: '12.12.0'

- name: Set up Appium
run: |
npm install -g appium --unsafe-perm=true --allow-root

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
Expand All @@ -49,6 +58,15 @@ jobs:

- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

- name: Run Integration Tests - Android
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.1
with:
cmd: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRTest)&(Category=Android)
api: 28
tag: default
abi: x86
verbose: true

#- name: Upload Android Artifact
# uses: actions/upload-artifact@v2.3.1
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pullrequest_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ jobs:
with:
xcode-version: '13.3'

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '12.12.0'

- name: Set up Appium
run: |
npm install -g appium --unsafe-perm=true --allow-root

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
Expand All @@ -43,6 +52,9 @@ jobs:
- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

- name: Run Integration Tests - iOS
run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "Category=PRTest&Category=iOS"

#- name: Upload iOS Artifact
# uses: actions/upload-artifact@v2.3.1
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest_maccatalyst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
# MAUI MacCatalyst Build
build-mac:
runs-on: macos-11
runs-on: macos-12
name: MacCatalyst Build
steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<PackageReference Include="SecurityService.Client" Version="1.1.0" />
<PackageReference Include="TransactionProcessorACL.DataTransferObjects" Version="1.1.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.0-pre20220318192836" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.0-pre20220207221914" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.0-pre20220318192836" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.0-pre20220318192836" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.0-pre20220427180151" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.0-pre20220427180151" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.0-pre20220427180151" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.0-pre20220427180151" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ Task GoToVoucherIssueVoucherPage(String operatorIdentifier,
Guid productId,
Decimal voucherAmount);


#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ private async Task LoginCommandExecute()

// TODO: Need to set the application as in training mode somehow

this.MemoryCacheService.Set("IsLoggedIn", true);

await this.NavigationService.GoToHome();
}

Expand Down
16 changes: 16 additions & 0 deletions TransactionMobile.Maui.UITests - Copy/Common/BaseTestFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace TransactionMobile.Maui.UITests.Common
{
using Drivers;

public abstract class BaseTestFixture
{
#region Constructors

protected BaseTestFixture(MobileTestPlatform mobileTestPlatform)
{
AppiumDriver.MobileTestPlatform = mobileTestPlatform;
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TransactionMobile.Maui.UITests.Common;

public enum MobileTestPlatform
{
iOS,
Android,
Windows,
MacCatalyst
}
68 changes: 68 additions & 0 deletions TransactionMobile.Maui.UITests - Copy/Common/Retry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
namespace TransactionMobile.Maui.UITests.Common;

using System;
using System.Threading;
using System.Threading.Tasks;

public static class Retry
{
#region Fields

/// <summary>
/// The default retry for
/// </summary>
private static readonly TimeSpan DefaultRetryFor = TimeSpan.FromSeconds(60);

/// <summary>
/// The default retry interval
/// </summary>
private static readonly TimeSpan DefaultRetryInterval = TimeSpan.FromSeconds(5);

#endregion

#region Methods

/// <summary>
/// Fors the specified action.
/// </summary>
/// <param name="action">The action.</param>
/// <param name="retryFor">The retry for.</param>
/// <param name="retryInterval">The retry interval.</param>
/// <returns></returns>
public static async Task For(Func<Task> action,
TimeSpan? retryFor = null,
TimeSpan? retryInterval = null)
{
DateTime startTime = DateTime.Now;
Exception lastException = null;

if (retryFor == null)
{
retryFor = Retry.DefaultRetryFor;
}

while (DateTime.Now.Subtract(startTime).TotalMilliseconds < retryFor.Value.TotalMilliseconds)
{
try
{
await action().ConfigureAwait(false);
lastException = null;
break;
}
catch (Exception e)
{
lastException = e;

// wait before retrying
Thread.Sleep(retryInterval ?? Retry.DefaultRetryInterval);
}
}

if (lastException != null)
{
throw lastException;
}
}

#endregion
}
135 changes: 135 additions & 0 deletions TransactionMobile.Maui.UITests - Copy/Common/SpecflowTableHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TransactionMobile.Maui.UITests.Common
{
using TechTalk.SpecFlow;

public static class SpecflowTableHelper
{
#region Methods

/// <summary>
/// Gets the enum value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static T GetEnumValue<T>(TableRow row,
String key) where T : struct
{
String field = SpecflowTableHelper.GetStringRowValue(row, key);

Enum.TryParse(field, out T myEnum);

return myEnum;
}

/// <summary>
/// Gets the boolean value.
/// </summary>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static Boolean GetBooleanValue(TableRow row,
String key)
{
String field = SpecflowTableHelper.GetStringRowValue(row, key);

return bool.TryParse(field, out Boolean value) && value;
}

/// <summary>
/// Gets the date for date string.
/// </summary>
/// <param name="dateString">The date string.</param>
/// <param name="today">The today.</param>
/// <returns></returns>
public static DateTime GetDateForDateString(String dateString,
DateTime today)
{
switch (dateString.ToUpper())
{
case "TODAY":
return today.Date;
case "YESTERDAY":
return today.AddDays(-1).Date;
case "LASTWEEK":
return today.AddDays(-7).Date;
case "LASTMONTH":
return today.AddMonths(-1).Date;
case "LASTYEAR":
return today.AddYears(-1).Date;
case "TOMORROW":
return today.AddDays(1).Date;
default:
return DateTime.Parse(dateString);
}
}

/// <summary>
/// Gets the decimal value.
/// </summary>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static Decimal GetDecimalValue(TableRow row,
String key)
{
String field = SpecflowTableHelper.GetStringRowValue(row, key);

return decimal.TryParse(field, out Decimal value) ? value : 0;
}

/// <summary>
/// Gets the int value.
/// </summary>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static Int32 GetIntValue(TableRow row,
String key)
{
String field = SpecflowTableHelper.GetStringRowValue(row, key);

return int.TryParse(field, out Int32 value) ? value : -1;
}

/// <summary>
/// Gets the short value.
/// </summary>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static Int16 GetShortValue(TableRow row,
String key)
{
String field = SpecflowTableHelper.GetStringRowValue(row, key);

if (short.TryParse(field, out Int16 value))
{
return value;
}

return -1;
}

/// <summary>
/// Gets the string row value.
/// </summary>
/// <param name="row">The row.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static String GetStringRowValue(TableRow row,
String key)
{
return row.TryGetValue(key, out String value) ? value : "";
}

#endregion
}
}
Loading