diff --git a/.github/workflows/android_e2e_tests.yml b/.github/workflows/android_e2e_tests.yml index 7c7327dde..22de3114d 100644 --- a/.github/workflows/android_e2e_tests.yml +++ b/.github/workflows/android_e2e_tests.yml @@ -155,7 +155,7 @@ jobs: run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net10.0-android -c Release --no-restore - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRTest)&(Category=Android)" --no-restore + run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "FullyQualifiedName~EndToEndTestsFeature&Category=Android|FullyQualifiedName~ReportingFeature" --no-restore - name: Upload Logs on Failure if: always() diff --git a/.github/workflows/android_navigation_tests.yml b/.github/workflows/android_navigation_tests.yml index cdf470f3a..82be6004b 100644 --- a/.github/workflows/android_navigation_tests.yml +++ b/.github/workflows/android_navigation_tests.yml @@ -142,7 +142,7 @@ jobs: run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net10.0-android -c Release --no-restore - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRNavTest)&(Category=Android)" --no-restore + run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "FullyQualifiedName~PageNavigationFeature&Category=Android" --no-restore - name: Upload Appium Logs on Failure if: always() @@ -287,7 +287,7 @@ jobs: run: dotnet build TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj -f net10.0-android -c Release --no-restore - name: Run Android Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "(Category=PRHWNavTest)&(Category=Android)" --no-restore + run: dotnet test TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj --filter "FullyQualifiedName~HardwarePageNavigationFeature&Category=Android" --no-restore - name: Upload Appium Logs on Failure if: always() diff --git a/.github/workflows/windows_e2e_tests.yml b/.github/workflows/windows_e2e_tests.yml index 44379f3e1..06f95d514 100644 --- a/.github/workflows/windows_e2e_tests.yml +++ b/.github/workflows/windows_e2e_tests.yml @@ -72,7 +72,7 @@ jobs: } - name: Run Windows End To End Tests - run: dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "Category=PRTest&Category=Windows" --no-restore + run: dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "FullyQualifiedName~EndToEndTestsFeature&Category=Windows|FullyQualifiedName~ReportingFeature" --no-restore #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 eece68666..653971551 100644 --- a/.github/workflows/windows_navigation_tests.yml +++ b/.github/workflows/windows_navigation_tests.yml @@ -87,7 +87,7 @@ jobs: } - name: Run Windows Navigation Tests - run: dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "(Category=PRNavTest)&(Category=Windows)" --no-restore + run: dotnet test TransactionProcessor.Mobile.UiTests/TransactionProcessor.Mobile.UiTests.csproj --filter "FullyQualifiedName~PageNavigationFeature&Category=Windows" --no-restore - name: Upload Appium Logs on Failure if: always() diff --git a/Directory.Packages.props b/Directory.Packages.props index fc5b05730..3d599a954 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/ModelTests/AutomationIdHelperTests.cs b/TransactionProcessor.Mobile.BusinessLogic.Tests/ModelTests/AutomationIdHelperTests.cs new file mode 100644 index 000000000..3f98f612a --- /dev/null +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/ModelTests/AutomationIdHelperTests.cs @@ -0,0 +1,28 @@ +using Shouldly; +using TransactionProcessor.Mobile.BusinessLogic.Models; + +namespace TransactionProcessor.Mobile.BusinessLogic.Tests.ModelTests; + +public class AutomationIdHelperTests +{ + [Fact] + public void Create_ReplacesUnsupportedCharactersWithUnderscores() + { + AutomationIdHelper.Create("RecentActivityResult", "TXN-10001") + .ShouldBe("RecentActivityResult_TXN_10001"); + } + + [Fact] + public void Create_TrimsAndCollapsesSeparators() + { + AutomationIdHelper.Create("TransactionMixItem", " bill-pay-post ") + .ShouldBe("TransactionMixItem_bill_pay_post"); + } + + [Fact] + public void Create_ReturnsPrefixForEmptyValues() + { + AutomationIdHelper.Create("TransactionMixItem", " ") + .ShouldBe("TransactionMixItem"); + } +} diff --git a/TransactionProcessor.Mobile.BusinessLogic/Models/AutomationIdHelper.cs b/TransactionProcessor.Mobile.BusinessLogic/Models/AutomationIdHelper.cs new file mode 100644 index 000000000..17da49f47 --- /dev/null +++ b/TransactionProcessor.Mobile.BusinessLogic/Models/AutomationIdHelper.cs @@ -0,0 +1,53 @@ +namespace TransactionProcessor.Mobile.BusinessLogic.Models; + +public static class AutomationIdHelper +{ + public static string Create(string prefix, string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return prefix; + } + + var builder = new System.Text.StringBuilder(prefix.Length + value.Length + 1); + builder.Append(prefix); + builder.Append('_'); + + bool appendedCharacter = false; + bool lastWasSeparator = false; + + foreach (char character in value.Trim()) + { + char sanitized = char.IsLetterOrDigit(character) ? character : '_'; + + if (sanitized == '_') + { + if (lastWasSeparator) + { + continue; + } + + lastWasSeparator = true; + } + else + { + lastWasSeparator = false; + } + + builder.Append(sanitized); + appendedCharacter = true; + } + + if (appendedCharacter == false) + { + return prefix; + } + + if (builder.Length > 0 && builder[^1] == '_') + { + builder.Length--; + } + + return builder.ToString(); + } +} diff --git a/TransactionProcessor.Mobile.BusinessLogic/Models/RecentActivityReceiptReportModel.cs b/TransactionProcessor.Mobile.BusinessLogic/Models/RecentActivityReceiptReportModel.cs index 324d7fe4d..ebe6cb5ed 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/Models/RecentActivityReceiptReportModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/Models/RecentActivityReceiptReportModel.cs @@ -69,6 +69,8 @@ public sealed record RecentActivityReceiptItemModel(string Reference, DateTime TransactionDateTime, string ReceiptReference) { + public string AutomationId => AutomationIdHelper.Create("RecentActivityResult", this.Reference); + public bool Matches(string searchText) { return this.Reference.Contains(searchText, StringComparison.OrdinalIgnoreCase) diff --git a/TransactionProcessor.Mobile.BusinessLogic/Models/TransactionMixSummaryModel.cs b/TransactionProcessor.Mobile.BusinessLogic/Models/TransactionMixSummaryModel.cs index 769e10256..31ff2ef97 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/Models/TransactionMixSummaryModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/Models/TransactionMixSummaryModel.cs @@ -75,7 +75,10 @@ public static TransactionMixSummaryModel CreateMock(int merchantReportingId, public sealed record TransactionMixSummaryItemModel(string Key, string Label, decimal Count, - decimal Value); + decimal Value) +{ + public string AutomationId => AutomationIdHelper.Create("TransactionMixItem", this.Key); +} public sealed record TransactionMixDrillDownTransactionModel(string Reference, string TransactionType, diff --git a/TransactionProcessor.Mobile.UITests/Common/DockerHelper.cs b/TransactionProcessor.Mobile.UITests/Common/DockerHelper.cs index 1143277cc..112ccaaf7 100644 --- a/TransactionProcessor.Mobile.UITests/Common/DockerHelper.cs +++ b/TransactionProcessor.Mobile.UITests/Common/DockerHelper.cs @@ -12,6 +12,7 @@ using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; +using TestHosts.Clients; using TransactionProcessor.Client; using TransactionProcessor.DataTransferObjects.Responses.Contract; using TransactionProcessor.IntegrationTesting.Helpers; @@ -42,6 +43,8 @@ public class DockerHelper : global::Shared.IntegrationTesting.TestContainers.Doc private readonly TestingContext TestingContext; + public IAgencyBankingClient AgencyBankingClient; + #endregion public EventStoreProjectionManagementClient ProjectionManagementClient; @@ -119,6 +122,16 @@ Object Deserialise(String arg, Type type) return StringSerialiser.DeserializeObject(arg, type, new SerialiserOptions(SerialiserPropertyFormat.SnakeCase)); } + String Serialise_CamelCase(Object arg) + { + return StringSerialiser.Serialise(arg, new SerialiserOptions(SerialiserPropertyFormat.CamelCase)); + } + + Object Deserialise_CamelCase(String arg, Type type) + { + return StringSerialiser.DeserializeObject(arg, type, new SerialiserOptions(SerialiserPropertyFormat.CamelCase)); + } + /// /// Starts the containers for scenario run. /// @@ -164,7 +177,8 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do this.TestHostHttpClient = new HttpClient(clientHandler); this.TestHostHttpClient.BaseAddress = new Uri($"http://127.0.0.1:{this.TestHostServicePort}"); - + this.AgencyBankingClient = new AgencyBankingClient(TestHostServiceBaseAddressResolver, httpClient, Serialise_CamelCase, this.Deserialise_CamelCase); + this.ProjectionManagementClient = new EventStoreProjectionManagementClient(this.ConfigureEventStoreSettings()); } @@ -173,7 +187,9 @@ public override async Task StartContainersForScenarioRun(String scenarioName, Do public String TransactionProcessorAclBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TransactionProcessorAclPort}"; public String SecurityServiceBaseAddressResolver(String api) => $"https://127.0.0.1:{this.SecurityServicePort}"; - + + public String TestHostServiceBaseAddressResolver(String api) => $"http://127.0.0.1:{this.TestHostServicePort}"; + public const int ConfigHostDockerPort = 9200; public String ConfigHostContainerName; diff --git a/TransactionProcessor.Mobile.UITests/Drivers/AppiumDriver.cs b/TransactionProcessor.Mobile.UITests/Drivers/AppiumDriver.cs index 51ade1ef8..4adda387d 100644 --- a/TransactionProcessor.Mobile.UITests/Drivers/AppiumDriver.cs +++ b/TransactionProcessor.Mobile.UITests/Drivers/AppiumDriver.cs @@ -1,6 +1,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.Reflection; +using System.Net.Sockets; using OpenQA.Selenium; using OpenQA.Selenium.Appium; using OpenQA.Selenium.Appium.Enums; @@ -17,15 +18,20 @@ public enum MobileTestPlatform public class AppiumDriverWrapper { + private const int AppiumPort = 4723; + private static readonly Uri AppiumServerUri = new($"http://127.0.0.1:{AppiumPort}/"); + public static MobileTestPlatform MobileTestPlatform; public static AppiumDriver Driver; public void StartApp() { - AppiumLocalService appiumService = new AppiumServiceBuilder().UsingPort(4723).Build(); + bool appiumAlreadyRunning = this.IsPortOpen("127.0.0.1", AppiumPort); + AppiumLocalService appiumService = null; - if (appiumService.IsRunning == false) + if (appiumAlreadyRunning == false) { + appiumService = new AppiumServiceBuilder().UsingPort(AppiumPort).Build(); appiumService.OutputDataReceived += (sender, args) => { Console.WriteLine(args.Data); @@ -44,7 +50,7 @@ public void StartApp() } } - private static void SetupWindowsDriver(AppiumLocalService appiumService) + private static void SetupWindowsDriver(AppiumLocalService? appiumService) { var driverOptions = new AppiumOptions(); driverOptions.AutomationName = "windows"; @@ -56,10 +62,12 @@ private static void SetupWindowsDriver(AppiumLocalService appiumService) driverOptions.AddAdditionalAppiumOption("ms:waitForAppLaunch", "50"); //driverOptions.AddAdditionalAppiumOption("appium:createSessionTimeout", "100000"); driverOptions.App = "TransactionMobile_zct748q4xfh0m!App"; - AppiumDriverWrapper.Driver = new WindowsDriver(appiumService, driverOptions, TimeSpan.FromMinutes(10)); + AppiumDriverWrapper.Driver = appiumService == null + ? new WindowsDriver(AppiumServerUri, driverOptions, TimeSpan.FromMinutes(10)) + : new WindowsDriver(appiumService, driverOptions, TimeSpan.FromMinutes(10)); } - private static void SetupAndroidDriver(AppiumLocalService appiumService) + private static void SetupAndroidDriver(AppiumLocalService? appiumService) { var driverOptions = new AppiumOptions(); driverOptions.AddAdditionalAppiumOption("adbExecTimeout", TimeSpan.FromMinutes(5).TotalMilliseconds); @@ -82,7 +90,9 @@ private static void SetupAndroidDriver(AppiumLocalService appiumService) driverOptions.App = apkPath; - AppiumDriverWrapper.Driver = new OpenQA.Selenium.Appium.Android.AndroidDriver(appiumService, driverOptions, TimeSpan.FromMinutes(5)); + AppiumDriverWrapper.Driver = appiumService == null + ? new OpenQA.Selenium.Appium.Android.AndroidDriver(AppiumServerUri, driverOptions, TimeSpan.FromMinutes(5)) + : new OpenQA.Selenium.Appium.Android.AndroidDriver(appiumService, driverOptions, TimeSpan.FromMinutes(5)); } public List GetLogs() @@ -112,5 +122,27 @@ public void StopApp() Console.WriteLine(e.Message); } } + + private bool IsPortOpen(string host, int port) + { + try + { + using TcpClient client = new TcpClient(); + IAsyncResult result = client.BeginConnect(host, port, null, null); + bool completed = result.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(1)); + if (completed == false) + { + client.Close(); + return false; + } + + client.EndConnect(result); + return client.Connected; + } + catch + { + return false; + } + } } } diff --git a/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature b/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature index 20f2fe07f..a9c2647b0 100644 --- a/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature +++ b/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature @@ -116,6 +116,7 @@ Background: @PRTest Scenario: EndToEnd Given I am on the Login Screen + And the application is in training mode And my device is registered When I enter 'user1' as the Email Address And I enter '123456' as the Password diff --git a/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature.cs b/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature.cs index f520849fd..89488ab80 100644 --- a/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature.cs +++ b/TransactionProcessor.Mobile.UITests/Features/EndToEndTests.feature.cs @@ -561,30 +561,33 @@ await testRunner.GivenAsync("I have a token to access the estate management and await testRunner.GivenAsync("I am on the Login Screen", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden #line 119 - await testRunner.AndAsync("my device is registered", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.AndAsync("the application is in training mode", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 120 - await testRunner.WhenAsync("I enter \'user1\' as the Email Address", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.AndAsync("my device is registered", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 121 - await testRunner.AndAsync("I enter \'123456\' as the Password", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.WhenAsync("I enter \'user1\' as the Email Address", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 122 - await testRunner.AndAsync("I tap on Login", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.AndAsync("I enter \'123456\' as the Password", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 123 - await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.AndAsync("I tap on Login", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 124 - await testRunner.WhenAsync("I tap on Profile", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 125 - await testRunner.ThenAsync("the My Profile Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on Profile", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 126 - await testRunner.WhenAsync("I tap on the Addresses button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the My Profile Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 127 + await testRunner.WhenAsync("I tap on the Addresses button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); +#line hidden +#line 128 await testRunner.ThenAsync("the Address List Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden global::Reqnroll.Table table21 = new global::Reqnroll.Table(new string[] { @@ -593,19 +596,19 @@ await testRunner.GivenAsync("I have a token to access the estate management and table21.AddRow(new string[] { "test address line 1", "TestTown"}); -#line 128 +#line 129 await testRunner.AndAsync("the Primary Address is displayed", ((string)(null)), table21, "And "); #line hidden -#line 131 +#line 132 await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 132 +#line 133 await testRunner.ThenAsync("the My Profile Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 133 +#line 134 await testRunner.WhenAsync("I tap on the Account Info button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 134 +#line 135 await testRunner.ThenAsync("the Account Info Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden global::Reqnroll.Table table22 = new global::Reqnroll.Table(new string[] { @@ -616,121 +619,121 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Merchant 1", "0", "0"}); -#line 135 +#line 136 await testRunner.AndAsync("the Account Info is displayed", ((string)(null)), table22, "And "); #line hidden -#line 138 +#line 139 await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 139 +#line 140 await testRunner.ThenAsync("the My Profile Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 140 +#line 141 await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 141 +#line 142 await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 142 +#line 143 await testRunner.WhenAsync("I tap on Transactions", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 143 +#line 144 await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 144 +#line 145 await testRunner.WhenAsync("I tap on the Mobile Topup button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 145 +#line 146 await testRunner.ThenAsync("the Transaction Select Mobile Topup Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 146 +#line 147 await testRunner.WhenAsync("I tap on the \'Safaricom\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 147 +#line 148 await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 148 +#line 149 await testRunner.WhenAsync("I tap on the \'Custom\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 149 +#line 150 await testRunner.ThenAsync("the Enter Topup Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 150 +#line 151 await testRunner.WhenAsync("I enter \'07777777775\' as the Customer Mobile Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 151 +#line 152 await testRunner.AndAsync("I enter 10.00 as the Topup Amount", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 152 +#line 153 await testRunner.AndAsync("I tap on Perform Topup", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 153 +#line 154 await testRunner.ThenAsync("the Mobile Topup Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 154 +#line 155 await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 155 +#line 156 await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 156 +#line 157 await testRunner.WhenAsync("I tap on the Voucher button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 157 +#line 158 await testRunner.ThenAsync("the Transaction Select Voucher Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 158 +#line 159 await testRunner.WhenAsync("I tap on the \'Hospital 1 Contract\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 159 +#line 160 await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 160 +#line 161 await testRunner.WhenAsync("I tap on the \'10 KES\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 161 +#line 162 await testRunner.ThenAsync("the Enter Voucher Issue Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 162 +#line 163 await testRunner.WhenAsync("I enter \'07777777775\' as the Recipient Mobile Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 163 +#line 164 await testRunner.AndAsync("I tap on Issue Voucher", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 164 +#line 165 await testRunner.ThenAsync("the Voucher Issue Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 165 +#line 166 await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 166 +#line 167 await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 167 +#line 168 await testRunner.WhenAsync("I tap on the Bill Payment button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 168 +#line 169 await testRunner.ThenAsync("the Transaction Select Bill Payment Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 169 +#line 170 await testRunner.WhenAsync("I tap on the \'PataPawa PostPay\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 170 +#line 171 await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 171 +#line 172 await testRunner.WhenAsync("I tap on the \'Bill Pay (Post)\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 172 +#line 173 await testRunner.ThenAsync("the Enter Account Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 173 +#line 174 await testRunner.WhenAsync("I enter \'12345678\' as the Account Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 174 +#line 175 await testRunner.AndAsync("I tap on the Get Account Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 175 +#line 176 await testRunner.ThenAsync("the Make Bill Payment page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden global::Reqnroll.Table table23 = new global::Reqnroll.Table(new string[] { @@ -743,92 +746,92 @@ await testRunner.GivenAsync("I have a token to access the estate management and "Test Account 1", "Today", "100.00"}); -#line 176 +#line 177 await testRunner.AndAsync("the following Bill Details are displayed", ((string)(null)), table23, "And "); #line hidden -#line 179 +#line 180 await testRunner.WhenAsync("I enter \'07777777775\' as the Customer Mobile Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 180 +#line 181 await testRunner.AndAsync("I enter 10.00 as the Payment Amount", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 181 +#line 182 await testRunner.AndAsync("I tap on the Make Payment Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 182 +#line 183 await testRunner.ThenAsync("the Bill Payment Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 183 +#line 184 await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 184 +#line 185 await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 185 +#line 186 await testRunner.WhenAsync("I tap on the Bill Payment button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 186 +#line 187 await testRunner.ThenAsync("the Transaction Select Bill Payment Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 187 +#line 188 await testRunner.WhenAsync("I tap on the \'PataPawa PrePay\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 188 +#line 189 await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 189 +#line 190 await testRunner.WhenAsync("I tap on the \'Bill Pay (Pre)\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 190 +#line 191 await testRunner.ThenAsync("the Enter Meter Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 191 +#line 192 await testRunner.WhenAsync("I enter \'00000001\' as the Meter Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 192 +#line 193 await testRunner.AndAsync("I tap on the Get Meter Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 193 +#line 194 await testRunner.ThenAsync("the Make Bill Payment page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden global::Reqnroll.Table table24 = new global::Reqnroll.Table(new string[] { "MeterNumber"}); table24.AddRow(new string[] { "00000001"}); -#line 194 +#line 195 await testRunner.AndAsync("the following Meter Details are displayed", ((string)(null)), table24, "And "); #line hidden -#line 197 +#line 198 await testRunner.WhenAsync("I enter 10.00 as the Payment Amount", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 198 +#line 199 await testRunner.AndAsync("I tap on the Make Payment Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 199 +#line 200 await testRunner.ThenAsync("the Bill Payment Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 200 +#line 201 await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden -#line 201 +#line 202 await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 202 +#line 203 await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 203 +#line 204 await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 204 +#line 205 await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 205 +#line 206 await testRunner.ThenAsync("A message is displayed confirming I want to log out", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden -#line 206 +#line 207 await testRunner.WhenAsync("I click yes", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 207 +#line 208 await testRunner.ThenAsync("the Login Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden } diff --git a/TransactionProcessor.Mobile.UITests/Features/Reporting.feature b/TransactionProcessor.Mobile.UITests/Features/Reporting.feature index 89a5f9a15..2378f88be 100644 --- a/TransactionProcessor.Mobile.UITests/Features/Reporting.feature +++ b/TransactionProcessor.Mobile.UITests/Features/Reporting.feature @@ -75,6 +75,7 @@ Background: @PRTest Scenario: View Transaction Mix Report Given I am on the Login Screen + And the application is in training mode And my device is registered When I enter 'user1' as the Email Address And I enter '123456' as the Password diff --git a/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs b/TransactionProcessor.Mobile.UITests/Features/Reporting.feature.cs index 24b3f8954..ed5a48eb5 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,7 +354,7 @@ 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 "); @@ -395,81 +395,84 @@ await testRunner.GivenAsync("I have a token to access the estate management and await testRunner.GivenAsync("I am on the Login Screen", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden #line 78 - await testRunner.AndAsync("my device is registered", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.AndAsync("the application is in training mode", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 79 - await testRunner.WhenAsync("I enter \'user1\' as the Email Address", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.AndAsync("my device is registered", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 80 - await testRunner.AndAsync("I enter \'123456\' as the Password", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.WhenAsync("I enter \'user1\' as the Email Address", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 81 - await testRunner.AndAsync("I tap on Login", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.AndAsync("I enter \'123456\' as the Password", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 82 - await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.AndAsync("I tap on Login", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 83 - await testRunner.WhenAsync("I tap on Transactions", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 84 - await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on Transactions", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 85 - await testRunner.WhenAsync("I tap on the Mobile Topup button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 86 - await testRunner.ThenAsync("the Transaction Select Mobile Topup Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on the Mobile Topup button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 87 - await testRunner.WhenAsync("I tap on the \'Safaricom\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Transaction Select Mobile Topup Operator Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 88 - await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on the \'Safaricom\' button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 89 - await testRunner.WhenAsync("I tap on the \'Custom\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Select Product Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 90 - await testRunner.ThenAsync("the Enter Topup Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on the \'Custom\' product button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 91 - await testRunner.WhenAsync("I enter \'07777777775\' as the Customer Mobile Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Enter Topup Details Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 92 - await testRunner.AndAsync("I enter 10.00 as the Topup Amount", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.WhenAsync("I enter \'07777777775\' as the Customer Mobile Number", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 93 - await testRunner.AndAsync("I tap on Perform Topup", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.AndAsync("I enter 10.00 as the Topup Amount", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 94 - await testRunner.ThenAsync("the Mobile Topup Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.AndAsync("I tap on Perform Topup", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 95 - await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); + await testRunner.ThenAsync("the Mobile Topup Successful Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 96 - await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.AndAsync("I tap on Complete", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 97 - await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Transaction Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 98 - await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I click on the back button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 99 - await testRunner.WhenAsync("I tap on Reports", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Merchant Home Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 100 - await testRunner.ThenAsync("the Reports Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on Reports", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 101 - await testRunner.WhenAsync("I tap on the Transaction Mix Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); + await testRunner.ThenAsync("the Reports Page is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 102 - await testRunner.ThenAsync("the Transaction Mix Report is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); + await testRunner.WhenAsync("I tap on the Transaction Mix Button", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 103 + await testRunner.ThenAsync("the Transaction Mix Report is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); +#line hidden +#line 104 await testRunner.AndAsync("the Transaction Mix Chart is displayed", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden } diff --git a/TransactionProcessor.Mobile.UITests/Pages/BasePage.cs b/TransactionProcessor.Mobile.UITests/Pages/BasePage.cs index 9620f2c80..043076a06 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/BasePage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/BasePage.cs @@ -97,7 +97,7 @@ public async Task GetLabelValue(String labelAutomationId) internal async Task WaitForElementByAccessibilityId(String accessibilityId, TimeSpan? timeout = null, Int32 i = 0) { - return await AppiumDriverWrapper.Driver.GetElement(accessibilityId); + return await AppiumDriverWrapper.Driver.GetElement(accessibilityId, timeout); } //internal async Task WaitForNoElementByAccessibilityId(String accessibilityId, TimeSpan? timeout = null) diff --git a/TransactionProcessor.Mobile.UITests/Pages/Extenstions.cs b/TransactionProcessor.Mobile.UITests/Pages/Extenstions.cs index 7754fb0e8..95d4388bd 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/Extenstions.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/Extenstions.cs @@ -105,10 +105,11 @@ await Retry.For(async () => { // return element; //} public static async Task GetElement(this AppiumDriver driver, - string automationId, - string androidPackage = "com.transactionprocessor.mobile") + string automationId, + TimeSpan? timeout = null, + string androidPackage = "com.transactionprocessor.mobile") { - TimeSpan retryFor = TimeSpan.FromSeconds(60); + TimeSpan retryFor = timeout ?? TimeSpan.FromSeconds(60); IWebElement element = null; diff --git a/TransactionProcessor.Mobile.UITests/Pages/LoginPage.cs b/TransactionProcessor.Mobile.UITests/Pages/LoginPage.cs index bc77fe223..d001d50a8 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/LoginPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/LoginPage.cs @@ -27,6 +27,12 @@ public LoginPage(TestingContext testingContext) : base(testingContext) } public async Task GetDeviceSerial() { + if (AppiumDriverWrapper.MobileTestPlatform == MobileTestPlatform.Android) + { + // Android returns a fixed test identifier from the app's device service. + return "stagingmerchant1device"; + } + IWebElement element = await this.WaitForElementByAccessibilityId(this.DeviceSerial); return element.Text; } @@ -107,4 +113,4 @@ await Retry.For(async () => { }); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/MainPage.cs b/TransactionProcessor.Mobile.UITests/Pages/MainPage.cs index 578ec5ab2..d6b0ec466 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/MainPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/MainPage.cs @@ -65,4 +65,4 @@ public async Task ClickSupportButton() //return balanceValue; return 0; } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/ProfileAccountInfoPage.cs b/TransactionProcessor.Mobile.UITests/Pages/ProfileAccountInfoPage.cs index ae72bf251..c21d23cc8 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ProfileAccountInfoPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ProfileAccountInfoPage.cs @@ -36,7 +36,7 @@ public ProfileAccountInfoPage(TestingContext testingContext) : base(testingConte #region Properties - protected override String Trait => "MyDetails"; + protected override String Trait => "MerchantNameLabel"; #endregion @@ -67,4 +67,4 @@ public async Task GetSettlementScheduleValue() { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/ProfileAddressesPage.cs b/TransactionProcessor.Mobile.UITests/Pages/ProfileAddressesPage.cs index 7f54d3410..9ccb156df 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ProfileAddressesPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ProfileAddressesPage.cs @@ -43,7 +43,7 @@ public ProfileAddressesPage(TestingContext testingContext) : base(testingContext #region Properties - protected override String Trait => "MyAddresses"; + protected override String Trait => "PrimaryAddressLabel"; #endregion @@ -75,4 +75,4 @@ public async Task IsPrimaryAddressShown() { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/ProfileContactsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/ProfileContactsPage.cs index 2cbb8c3f5..20828546b 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ProfileContactsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ProfileContactsPage.cs @@ -32,7 +32,7 @@ public ProfileContactsPage(TestingContext testingContext) : base(testingContext) #region Properties //protected override String Trait => "MyContacts"; - protected override String Trait => "MyContacts"; + protected override String Trait => "PrimaryContactLabel"; #endregion @@ -55,4 +55,4 @@ public async Task IsPrimaryContactShown() { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/ProfilePage.cs b/TransactionProcessor.Mobile.UITests/Pages/ProfilePage.cs index 1e205f7ad..eeecd27ee 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ProfilePage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ProfilePage.cs @@ -32,7 +32,7 @@ public ProfilePage(TestingContext testingContext) : base(testingContext) #region Properties - protected override String Trait => "My Account"; + protected override String Trait => "MerchantNameLabel"; #endregion @@ -62,4 +62,4 @@ public async Task ClickLogoutButton() { #endregion } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/RecentActivityReportPage.cs b/TransactionProcessor.Mobile.UITests/Pages/RecentActivityReportPage.cs index a52336c74..8b40a8957 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/RecentActivityReportPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/RecentActivityReportPage.cs @@ -6,6 +6,7 @@ namespace TransactionProcessor.Mobile.UITests.Pages; public class RecentActivityReportPage : BasePage2 { protected override string Trait => "RecentActivityReport"; + private const string ResultAutomationIdPrefix = "RecentActivityResult"; public RecentActivityReportPage(TestingContext testingContext) : base(testingContext) { @@ -26,7 +27,56 @@ public async Task ClickSearchButton() public async Task ClickResult(string reference) { - IWebElement element = await this.WaitForElementByAccessibilityId(reference); + IWebElement element = await this.WaitForElementByAccessibilityId(BuildAutomationId(reference)); element.Click(); } + + private static string BuildAutomationId(string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return ResultAutomationIdPrefix; + } + + var builder = new System.Text.StringBuilder(ResultAutomationIdPrefix.Length + value.Length + 1); + builder.Append(ResultAutomationIdPrefix); + builder.Append('_'); + + bool appendedCharacter = false; + bool lastWasSeparator = false; + + foreach (char character in value.Trim()) + { + char sanitized = char.IsLetterOrDigit(character) ? character : '_'; + + if (sanitized == '_') + { + if (lastWasSeparator) + { + continue; + } + + lastWasSeparator = true; + } + else + { + lastWasSeparator = false; + } + + builder.Append(sanitized); + appendedCharacter = true; + } + + if (appendedCharacter == false) + { + return ResultAutomationIdPrefix; + } + + if (builder.Length > 0 && builder[^1] == '_') + { + builder.Length--; + } + + return builder.ToString(); + } } diff --git a/TransactionProcessor.Mobile.UITests/Pages/ReportsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/ReportsPage.cs index df0ebfdd0..c3302126b 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ReportsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ReportsPage.cs @@ -6,17 +6,7 @@ namespace TransactionProcessor.Mobile.UITests.Pages; public class ReportsPage : BasePage2 { - protected override String Trait - { - get - { - if (AppiumDriverWrapper.MobileTestPlatform == MobileTestPlatform.Windows) - { - return "Reports"; - } - return "Reports"; - } - } + protected override String Trait => "ReportsPageHeader"; private readonly String DailyPerformanceSummaryButton; private readonly String TransactionMixButton; @@ -52,15 +42,7 @@ public async Task ClickRecentActivityAndReceiptReportButton() } public class SupportPage : BasePage2{ - protected override String Trait{ - get{ - if (AppiumDriverWrapper.MobileTestPlatform == MobileTestPlatform.Windows){ - return "Support"; - } - - return "Support"; - } - } + protected override String Trait => "SupportPageHeader"; private readonly String UploadLogsButton; private readonly String ViewLogsButton; diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsBillPaymentSelectOperatorPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsBillPaymentSelectOperatorPage.cs index 3564fefa7..3c65dde78 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsBillPaymentSelectOperatorPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsBillPaymentSelectOperatorPage.cs @@ -14,7 +14,7 @@ public TransactionsBillPaymentSelectOperatorPage(TestingContext testingContext) #region Properties - protected override String Trait => "SelectanOperator"; + protected override String Trait => "BillPaymentSelectOperatorPageHeader"; #endregion @@ -29,7 +29,7 @@ public class TransactionsBillPaymentSelectProductPage : BasePage2{ public TransactionsBillPaymentSelectProductPage(TestingContext testingContext) : base(testingContext){ } - protected override String Trait{ get; } + protected override String Trait => "BillPaymentSelectProductPageHeader"; public async Task ClickProductButton(String productText) { @@ -50,7 +50,7 @@ public TransactionsBillPaymentEnterAccountDetailsPage(TestingContext testingCont this.GetAccountButton = "GetAccountButton"; } - protected override String Trait => "GetCustomerAccount"; + protected override String Trait => "CustomerAccountNumberEntry"; public async Task EnterCustomerAccountNumber(String customerAccountNumber) { @@ -81,7 +81,7 @@ public TransactionsBillPaymentEnterMeterDetailsPage(TestingContext testingContex this.GetMeterButton = "GetMeterButton"; } - protected override String Trait => "GetMeter"; + protected override String Trait => "MeterNumberEntry"; public async Task EnterMeterNumber(String meterNumber) { @@ -123,7 +123,7 @@ public TransactionsBillPaymentMakeAPaymentPage(TestingContext testingContext) : } - protected override String Trait => "MakeBillPayment"; + protected override String Trait => "MakePaymentButton"; public async Task EnterCustomerMobileNumber(String customerMobileNumber) { @@ -196,7 +196,7 @@ public TransactionsBillPaymentSuccessfulPaymentPage(TestingContext testingContex #region Properties - protected override String Trait => "BillPaymentSuccessful"; + protected override String Trait => "BillPaymentSuccessPageHeader"; public async Task ClickCompleteButton() { @@ -208,4 +208,4 @@ await Retry.For(async () => { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupEnterTopupDetailsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupEnterTopupDetailsPage.cs index 19e332a33..7e008e5fa 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupEnterTopupDetailsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupEnterTopupDetailsPage.cs @@ -21,7 +21,7 @@ public TransactionsMobileTopupEnterTopupDetailsPage(TestingContext testingContex #region Properties - protected override String Trait => "EnterTopupDetails"; + protected override String Trait => "CustomerMobileNumberEntry"; public async Task EnterCustomerMobileNumber(String customerMobileNumber) { IWebElement element = await this.WaitForElementByAccessibilityId(this.CustomerMobileNumberEntry); @@ -50,4 +50,4 @@ await Retry.For(async () => { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectOperatorPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectOperatorPage.cs index 4a846671b..9407d2769 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectOperatorPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectOperatorPage.cs @@ -12,7 +12,7 @@ public TransactionsMobileTopupSelectOperatorPage(TestingContext testingContext) } #region Properties - protected override String Trait => "SelectanOperator"; + protected override String Trait => "MobileTopupSelectOperatorPageHeader"; #endregion @@ -20,4 +20,4 @@ public async Task ClickOperatorButton(String operatorName) { IWebElement element = await this.WaitForElementByAccessibilityId(operatorName); element.Click(); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectProductPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectProductPage.cs index 2dbf8e908..bea57a8b7 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectProductPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSelectProductPage.cs @@ -11,7 +11,7 @@ public TransactionsMobileTopupSelectProductPage(TestingContext testingContext) : #region Properties - protected override String Trait => "SelectaProduct"; + protected override String Trait => "MobileTopupSelectProductPageHeader"; #endregion @@ -19,4 +19,4 @@ public async Task ClickProductButton(String productText) { IWebElement element = await this.WaitForElementByAccessibilityId(productText); element.Click(); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSuccessfulTopupPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSuccessfulTopupPage.cs index 5b7583555..279555e8a 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSuccessfulTopupPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsMobileTopupSuccessfulTopupPage.cs @@ -15,7 +15,7 @@ public TransactionsMobileTopupSuccessfulTopupPage(TestingContext testingContext) #region Properties - protected override String Trait => "MobileTopupSuccessful"; + protected override String Trait => "MobileTopupSuccessPageHeader"; public async Task ClickCompleteButton() { await Retry.For(async () => { @@ -26,4 +26,4 @@ await Retry.For(async () => { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsPage.cs index 76b3afd82..94abb098e 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsPage.cs @@ -6,14 +6,7 @@ namespace TransactionProcessor.Mobile.UITests.Pages; public class TransactionsPage : BasePage2 { - protected override String Trait{ - get{ - if (AppiumDriverWrapper.MobileTestPlatform == MobileTestPlatform.Windows){ - return "SelectTransactionType"; - } - return "Transactions"; - } - } + protected override String Trait => "TransactionsPageHeader"; private readonly String MobileTopupButton; private readonly String VoucherButton; @@ -42,4 +35,4 @@ public async Task ClickBillPaymentButton() IWebElement element = await this.WaitForElementByAccessibilityId(this.BillPaymentButton); element.Click(); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherEnterVoucherIssueDetailsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherEnterVoucherIssueDetailsPage.cs index 62eebaf89..46bf95a25 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherEnterVoucherIssueDetailsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherEnterVoucherIssueDetailsPage.cs @@ -25,7 +25,7 @@ public TransactionsVoucherEnterVoucherIssueDetailsPage(TestingContext testingCon #region Properties - protected override String Trait => "EnterVoucherIssueDetails"; + protected override String Trait => "RecipientMobileNumberEntry"; public async Task EnterRecipientMobileNumber(String recipientMobileNumber) { @@ -65,4 +65,4 @@ await Retry.For(async () => { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherIssueSuccessfulTopupPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherIssueSuccessfulTopupPage.cs index db3842533..48245207e 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherIssueSuccessfulTopupPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherIssueSuccessfulTopupPage.cs @@ -17,7 +17,7 @@ public TransactionsVoucherIssueSuccessfulTopupPage(TestingContext testingContext #region Properties - protected override String Trait => "VoucherIssueSuccessful"; + protected override String Trait => "VoucherIssueSuccessPageHeader"; public async Task ClickCompleteButton() { @@ -29,4 +29,4 @@ await Retry.For(async () => { } #endregion -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectOperatorPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectOperatorPage.cs index 7ee98a834..e0d44544e 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectOperatorPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectOperatorPage.cs @@ -12,7 +12,7 @@ public TransactionsVoucherSelectOperatorPage(TestingContext testingContext) : ba } #region Properties - protected override String Trait => "SelectanOperator"; + protected override String Trait => "VoucherSelectOperatorPageHeader"; #endregion public async Task ClickOperatorButton(String operatorName) @@ -20,4 +20,4 @@ public async Task ClickOperatorButton(String operatorName) IWebElement element = await this.WaitForElementByAccessibilityId(operatorName); element.Click(); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectProductPage.cs b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectProductPage.cs index b5f00bed6..52280b092 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectProductPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/TransactionsVoucherSelectProductPage.cs @@ -13,7 +13,7 @@ public TransactionsVoucherSelectProductPage(TestingContext testingContext) : bas #region Properties - protected override String Trait => "SelectaProduct"; + protected override String Trait => "VoucherSelectProductPageHeader"; #endregion @@ -22,4 +22,4 @@ public async Task ClickProductButton(String productText) IWebElement element = await this.WaitForElementByAccessibilityId(productText); element.Click(); } -} \ No newline at end of file +} diff --git a/TransactionProcessor.Mobile.UITests/Pages/ViewLogsPage.cs b/TransactionProcessor.Mobile.UITests/Pages/ViewLogsPage.cs index 615a09552..0b04ae051 100644 --- a/TransactionProcessor.Mobile.UITests/Pages/ViewLogsPage.cs +++ b/TransactionProcessor.Mobile.UITests/Pages/ViewLogsPage.cs @@ -8,5 +8,5 @@ public ViewLogsPage(TestingContext testingContext) : base(testingContext){ } - protected override String Trait => "ViewLogs"; -} \ No newline at end of file + protected override String Trait => "ViewLogsPageHeader"; +} diff --git a/TransactionProcessor.Mobile.UITests/Steps/SharedSteps.cs b/TransactionProcessor.Mobile.UITests/Steps/SharedSteps.cs index 1f2da0874..7889c1463 100644 --- a/TransactionProcessor.Mobile.UITests/Steps/SharedSteps.cs +++ b/TransactionProcessor.Mobile.UITests/Steps/SharedSteps.cs @@ -46,7 +46,8 @@ public SharedSteps(TestingContext testingContext) { this.loginPage = new LoginPage(testingContext); this.SecurityServiceSteps = new SecurityServiceSteps(testingContext.DockerHelper.SecurityServiceClient); this.TransactionProcessorSteps = new TransactionProcessorSteps(this.TestingContext.DockerHelper.TransactionProcessorClient, this.TestingContext.DockerHelper.TestHostHttpClient, - this.TestingContext.DockerHelper.ProjectionManagementClient); + this.TestingContext.DockerHelper.ProjectionManagementClient, + this.TestingContext.DockerHelper.AgencyBankingClient); } [Given(@"the following security roles exist")] @@ -168,7 +169,7 @@ public async Task WhenIAddTheFollowingTransactionFees(DataTable table) public async Task GivenICreateTheFollowingMerchants(DataTable table) { var estates = this.TestingContext.Estates.Select(e => e).ToList(); - List<(EstateDetails estate, CreateMerchantRequest)> requests = table.Rows.ToCreateMerchantRequests(estates); + var requests = table.Rows.ToCreateMerchantRequests(estates); List verifiedMerchants = await this.TransactionProcessorSteps.WhenICreateTheFollowingMerchants(this.TestingContext.AccessToken, requests); diff --git a/TransactionProcessor.Mobile.UITests/Steps/TransactionsSteps.cs b/TransactionProcessor.Mobile.UITests/Steps/TransactionsSteps.cs index 514992d42..586fca767 100644 --- a/TransactionProcessor.Mobile.UITests/Steps/TransactionsSteps.cs +++ b/TransactionProcessor.Mobile.UITests/Steps/TransactionsSteps.cs @@ -109,7 +109,7 @@ public async Task WhenITapOnIssueVoucher(){ [Then(@"the Voucher Issue Successful Page is displayed")] public async Task ThenTheVoucherIssueSuccessfulPageIsDisplayed() { - await this.transactionsVoucherIssueSuccessfulTopupPage.AssertOnPage(); + await this.transactionsVoucherIssueSuccessfulTopupPage.AssertOnPage(TimeSpan.FromMinutes(2)); } [Then(@"the Transaction Select Mobile Topup Operator Page is displayed")] @@ -142,7 +142,13 @@ public async Task WhenITapOnTheButton(String operatorName) { [Then(@"the Select Product Page is displayed")] public async Task ThenTheSelectProductPageIsDisplayed() { - await this.transactionsMobileTopupSelectProductPage.AssertOnPage(); + Task t = this.operatorType switch { + OperatorType.MobileTopup => this.transactionsMobileTopupSelectProductPage.AssertOnPage(), + OperatorType.Voucher => this.transactionsVoucherSelectProductPage.AssertOnPage(), + OperatorType.BillPayment => this.transactionsBillPaymentSelectProductPage.AssertOnPage() + }; + + await t; } [When(@"I tap on the '([^']*)' product button")] @@ -180,7 +186,7 @@ public async Task WhenITapOnPerformTopup(){ [Then(@"the Mobile Topup Successful Page is displayed")] public async Task ThenTheMobileTopupSuccessfulPageIsDisplayed() { - await this.transactionsMobileTopupSuccessfulTopupPage.AssertOnPage(); + await this.transactionsMobileTopupSuccessfulTopupPage.AssertOnPage(TimeSpan.FromMinutes(2)); } [Then(@"I tap on Complete")] @@ -254,7 +260,7 @@ public async Task WhenITapOnTheMakePaymentButton(){ [Then(@"the Bill Payment Successful Page is displayed")] public async Task ThenTheBillPaymentSuccessfulPageIsDisplayed(){ - await this.transactionsBillPaymentSuccessfulPaymentPage.AssertOnPage(); + await this.transactionsBillPaymentSuccessfulPaymentPage.AssertOnPage(TimeSpan.FromMinutes(2)); } [Then(@"the Enter Meter Details Page is displayed")] diff --git a/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj b/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj index 2ef862ac3..ce8c15383 100644 --- a/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj +++ b/TransactionProcessor.Mobile.UITests/TransactionProcessor.Mobile.UITests.csproj @@ -6,6 +6,8 @@ enable enable false + true + Exe diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml index bb4c2fffe..c45b0b499 100644 --- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml +++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml @@ -17,7 +17,7 @@