From 8f0c8db8e193cc1dd893bec4b9f0f02b16ccf905 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Fri, 21 Aug 2026 12:55:09 +0100 Subject: [PATCH] chore: migrate tests to MTP --- .github/workflows/android_e2e_tests.yml | 7 +- .../workflows/android_navigation_tests.yml | 14 ++- .github/workflows/unit_tests.yml | 2 +- .github/workflows/windows_e2e_tests.yml | 9 +- .../workflows/windows_navigation_tests.yml | 7 +- Directory.Packages.props | 60 +++++----- ...rocessor.Mobile.BusinessLogic.Tests.csproj | 1 + .../Features/Reporting.feature.cs | 112 +++++++++--------- ...TransactionProcessor.Mobile.UITests.csproj | 2 + global.json | 9 ++ 10 files changed, 130 insertions(+), 93 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/android_e2e_tests.yml b/.github/workflows/android_e2e_tests.yml index 2f6730acf..381a59f92 100644 --- a/.github/workflows/android_e2e_tests.yml +++ b/.github/workflows/android_e2e_tests.yml @@ -18,6 +18,11 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + - name: Enable KVM group perms run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -185,7 +190,7 @@ jobs: echo "runsettings_path=$settings_path" >> "$GITHUB_OUTPUT" - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" + run: dotnet test --project TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" - name: Upload Logs on Failure if: always() diff --git a/.github/workflows/android_navigation_tests.yml b/.github/workflows/android_navigation_tests.yml index f53c1a9c9..a9b1d932d 100644 --- a/.github/workflows/android_navigation_tests.yml +++ b/.github/workflows/android_navigation_tests.yml @@ -18,6 +18,11 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + - name: Enable KVM group perms run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -185,7 +190,7 @@ jobs: echo "runsettings_path=$settings_path" >> "$GITHUB_OUTPUT" - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRNavTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" + run: dotnet test --project TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRNavTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" - name: Upload Appium Logs on Failure if: always() @@ -206,6 +211,11 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + - name: Enable KVM group perms run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules @@ -373,7 +383,7 @@ jobs: echo "runsettings_path=$settings_path" >> "$GITHUB_OUTPUT" - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRHWNavTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" + run: dotnet test --project TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRHWNavTest)&(Category=Android)" --no-restore --settings "${{ steps.android_settings.outputs.runsettings_path }}" - name: Upload Appium Logs on Failure if: always() diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 71f8463e8..40bfc961b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -52,4 +52,4 @@ jobs: run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json -f net10.0-android -c Release #--no-restore - name: Run unit tests - run: dotnet test TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj --configuration Release + run: dotnet test --project TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj --configuration Release diff --git a/.github/workflows/windows_e2e_tests.yml b/.github/workflows/windows_e2e_tests.yml index 87d85c0f7..b98454f16 100644 --- a/.github/workflows/windows_e2e_tests.yml +++ b/.github/workflows/windows_e2e_tests.yml @@ -12,10 +12,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 with: - vs-prerelease: true + vs-prerelease: true - name: Install MAUI workloads run: | @@ -118,7 +123,7 @@ jobs: "runsettings_path=$settingsPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - name: Run Windows End To End Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "Category=PRTest&Category=Windows" --no-restore --settings "${{ steps.windows_settings.outputs.runsettings_path }}" + run: dotnet test --project TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "Category=PRTest&Category=Windows" --no-restore --settings "${{ steps.windows_settings.outputs.runsettings_path }}" #run: dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --list-tests -v:d - name: Upload Logs on Failure diff --git a/.github/workflows/windows_navigation_tests.yml b/.github/workflows/windows_navigation_tests.yml index 7c6162ccc..0a7be0240 100644 --- a/.github/workflows/windows_navigation_tests.yml +++ b/.github/workflows/windows_navigation_tests.yml @@ -12,6 +12,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 with: @@ -133,7 +138,7 @@ jobs: "runsettings_path=$settingsPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - name: Run Windows Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRNavTest)&(Category=Windows)" --no-restore --settings "${{ steps.windows_settings.outputs.runsettings_path }}" + run: dotnet test --project TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRNavTest)&(Category=Windows)" --no-restore --settings "${{ steps.windows_settings.outputs.runsettings_path }}" - name: Upload Appium Logs on Failure if: always() diff --git a/Directory.Packages.props b/Directory.Packages.props index fc5b05730..375cf5f3e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,23 +3,23 @@ true - + - - + + - - - - - - - - - - + + + + + + + + + + @@ -28,24 +28,24 @@ - - - - - + + + + + - - - + + + - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj b/TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj index b8eb45e59..436ad75b5 100644 --- a/TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/TransactionProcessor.Mobile.BusinessLogic.Tests.csproj @@ -6,6 +6,7 @@ enable false true + Exe diff --git a/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs b/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs index fd05b8533..1a541b3ac 100644 --- a/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs +++ b/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs @@ -125,119 +125,119 @@ public void ScenarioInitialize(global::Reqnroll.ScenarioInfo scenarioInfo, globa { #line 4 #line hidden - global::Reqnroll.Table table1 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table25 = new global::Reqnroll.Table(new string[] { "Role Name"}); - table1.AddRow(new string[] { + table25.AddRow(new string[] { "Merchant"}); #line 6 - await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table1, "Given "); + await testRunner.GivenAsync("the following security roles exist", ((string)(null)), table25, "Given "); #line hidden - global::Reqnroll.Table table2 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table26 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Description"}); - table2.AddRow(new string[] { + table26.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST Scope", "A scope for Transaction Processor REST"}); - table2.AddRow(new string[] { + table26.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST Scope", "A scope for Transaction Processor ACL REST"}); #line 10 - await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table2, "Given "); + await testRunner.GivenAsync("I create the following api scopes", ((string)(null)), table26, "Given "); #line hidden - global::Reqnroll.Table table3 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table27 = new global::Reqnroll.Table(new string[] { "Name", "DisplayName", "Secret", "Scopes", "UserClaims"}); - table3.AddRow(new string[] { + table27.AddRow(new string[] { "transactionProcessor", "Transaction Processor REST", "Secret1", "transactionProcessor", "merchantId, estateId, role"}); - table3.AddRow(new string[] { + table27.AddRow(new string[] { "transactionProcessorACL", "Transaction Processor ACL REST", "Secret1", "transactionProcessorACL", "merchantId, estateId, role"}); #line 15 - await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table3, "Given "); + await testRunner.GivenAsync("the following api resources exist", ((string)(null)), table27, "Given "); #line hidden - global::Reqnroll.Table table4 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table28 = new global::Reqnroll.Table(new string[] { "ClientId", "ClientName", "Secret", "Scopes", "GrantTypes"}); - table4.AddRow(new string[] { + table28.AddRow(new string[] { "serviceClient", "Service Client", "Secret1", "transactionProcessor,transactionProcessorACL", "client_credentials"}); - table4.AddRow(new string[] { + table28.AddRow(new string[] { "mobileAppClient", "Mobile App Client", "Secret1", "transactionProcessorACL,transactionProcessor", "password"}); #line 20 - await testRunner.GivenAsync("the following clients exist", ((string)(null)), table4, "Given "); + await testRunner.GivenAsync("the following clients exist", ((string)(null)), table28, "Given "); #line hidden - global::Reqnroll.Table table5 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table29 = new global::Reqnroll.Table(new string[] { "ClientId"}); - table5.AddRow(new string[] { + table29.AddRow(new string[] { "serviceClient"}); #line 25 await testRunner.GivenAsync("I have a token to access the estate management and transaction processor acl reso" + - "urces", ((string)(null)), table5, "Given "); + "urces", ((string)(null)), table29, "Given "); #line hidden - global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table30 = new global::Reqnroll.Table(new string[] { "EstateName"}); - table6.AddRow(new string[] { + table30.AddRow(new string[] { "Test Estate 1"}); #line 29 - await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table6, "Given "); + await testRunner.GivenAsync("I have created the following estates", ((string)(null)), table30, "Given "); #line hidden - global::Reqnroll.Table table7 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table31 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "RequireCustomMerchantNumber", "RequireCustomTerminalNumber"}); - table7.AddRow(new string[] { + table31.AddRow(new string[] { "Test Estate 1", "Safaricom", "True", "True"}); #line 33 - await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table7, "Given "); + await testRunner.GivenAsync("I have created the following operators", ((string)(null)), table31, "Given "); #line hidden - global::Reqnroll.Table table8 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table32 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName"}); - table8.AddRow(new string[] { + table32.AddRow(new string[] { "Test Estate 1", "Safaricom"}); #line 37 - await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table8, "And "); + await testRunner.AndAsync("I have assigned the following operators to the estates", ((string)(null)), table32, "And "); #line hidden - global::Reqnroll.Table table9 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table33 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription"}); - table9.AddRow(new string[] { + table33.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract"}); #line 41 - await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table9, "Given "); + await testRunner.GivenAsync("I create a contract with the following values", ((string)(null)), table33, "Given "); #line hidden - global::Reqnroll.Table table10 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table34 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -245,7 +245,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "DisplayText", "Value", "ProductType"}); - table10.AddRow(new string[] { + table34.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -254,9 +254,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "", "MobileTopup"}); #line 45 - await testRunner.WhenAsync("I create the following Products", ((string)(null)), table10, "When "); + await testRunner.WhenAsync("I create the following Products", ((string)(null)), table34, "When "); #line hidden - global::Reqnroll.Table table11 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table35 = new global::Reqnroll.Table(new string[] { "EstateName", "OperatorName", "ContractDescription", @@ -264,7 +264,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "CalculationType", "FeeDescription", "Value"}); - table11.AddRow(new string[] { + table35.AddRow(new string[] { "Test Estate 1", "Safaricom", "Safaricom Contract", @@ -273,9 +273,9 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Merchant Commission", "2.50"}); #line 49 - await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table11, "When "); + await testRunner.WhenAsync("I add the following Transaction Fees", ((string)(null)), table35, "When "); #line hidden - global::Reqnroll.Table table12 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table36 = new global::Reqnroll.Table(new string[] { "MerchantName", "AddressLine1", "AddressLine2", @@ -288,7 +288,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "ContactName", "EmailAddress", "EstateName"}); - table12.AddRow(new string[] { + table36.AddRow(new string[] { "Test Merchant 1", "test address line 1", "test address line 2", @@ -302,51 +302,51 @@ await testRunner.GivenAsync("I have a token to access the estate management and "testcontact1@merchant1.co.uk", "Test Estate 1"}); #line 53 - await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table12, "Given "); + await testRunner.GivenAsync("I create the following merchants", ((string)(null)), table36, "Given "); #line hidden - global::Reqnroll.Table table13 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table37 = new global::Reqnroll.Table(new string[] { "OperatorName", "MerchantName", "MerchantNumber", "TerminalNumber", "EstateName"}); - table13.AddRow(new string[] { + table37.AddRow(new string[] { "Safaricom", "Test Merchant 1", "00000001", "10000001", "Test Estate 1"}); #line 57 - await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table13, "Given "); + await testRunner.GivenAsync("I have assigned the following operator to the merchants", ((string)(null)), table37, "Given "); #line hidden - global::Reqnroll.Table table14 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table38 = new global::Reqnroll.Table(new string[] { "MerchantName", "EstateName"}); - table14.AddRow(new string[] { + table38.AddRow(new string[] { "Test Merchant 1", "Test Estate 1"}); #line 61 - await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table14, "Given "); + await testRunner.GivenAsync("I have assigned the following devices to the merchants", ((string)(null)), table38, "Given "); #line hidden - global::Reqnroll.Table table15 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table39 = new global::Reqnroll.Table(new string[] { "EstateName", "MerchantName", "ContractDescription"}); - table15.AddRow(new string[] { + table39.AddRow(new string[] { "Test Estate 1", "Test Merchant 1", "Safaricom Contract"}); #line 65 - await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table15, "When "); + await testRunner.WhenAsync("I add the following contracts to the following merchants", ((string)(null)), table39, "When "); #line hidden - global::Reqnroll.Table table16 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table40 = new global::Reqnroll.Table(new string[] { "EmailAddress", "Password", "GivenName", "FamilyName", "EstateName", "MerchantName"}); - table16.AddRow(new string[] { + table40.AddRow(new string[] { "user1", "123456", "TestMerchant", @@ -354,12 +354,12 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Estate 1", "Test Merchant 1"}); #line 69 - await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table16, "Given "); + await testRunner.GivenAsync("I have created the following security users", ((string)(null)), table40, "Given "); #line hidden #line 73 await testRunner.GivenAsync("I have created a config for my device", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden - global::Reqnroll.Table table17 = new global::Reqnroll.Table(new string[] { + global::Reqnroll.Table table41 = new global::Reqnroll.Table(new string[] { "Reference", "TransactionType", "Product", @@ -367,7 +367,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Status", "Amount", "TransactionDateTime"}); - table17.AddRow(new string[] { + table41.AddRow(new string[] { "TXN-10001", "Mobile Topup", "Custom", @@ -375,7 +375,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Success", "100.00", "Today"}); - table17.AddRow(new string[] { + table41.AddRow(new string[] { "TXN-10002", "Bill Payment", "Bill Pay (Post)", @@ -383,7 +383,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Success", "250.00", "Today"}); - table17.AddRow(new string[] { + table41.AddRow(new string[] { "TXN-10003", "Voucher Issue", "10 KES", @@ -392,7 +392,7 @@ await testRunner.GivenAsync("I have a token to access the estate management and "0.00", "Today"}); #line 75 - await testRunner.GivenAsync("the following transaction mix report transactions exist", ((string)(null)), table17, "Given "); + await testRunner.GivenAsync("the following transaction mix report transactions exist", ((string)(null)), table41, "Given "); #line hidden } diff --git a/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj b/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj index 9011b9c4d..bd7215347 100644 --- a/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj +++ b/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj @@ -6,6 +6,8 @@ enable enable false + Exe + true diff --git a/global.json b/global.json new file mode 100644 index 000000000..1d364c6a6 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "latestFeature" + }, + "test": { + "runner": "Microsoft.Testing.Platform" + } +}