diff --git a/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature new file mode 100644 index 00000000..941f0975 --- /dev/null +++ b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature @@ -0,0 +1,68 @@ +@background @login @toolbar @profile @shared @transactions @shared +Feature: HardwarePageNavigation + +@PRTest +Scenario: Back Button from Login Screen + Given I am on the Login Screen + When I click on the device back button + Then The application closes + +# Home Page Back Button Tests +@PRTest +Scenario: Device Back Button from Home Page Screen - user wants to log out + Given I am on the Login Screen + And the application is in training mode + When I enter 'merchantuser@testmerchant1.co.uk' as the Email Address + And I enter '123456' as the Password + And I tap on Login + Then the Merchant Home Page is displayed + When I click on the device back button + Then A message is displayed confirming I want to log out + When I click yes + Then the Login Page is displayed + +@PRTest +Scenario: Device Back Button from Home Page Screen - user does not want to log out + Given I am on the Login Screen + And the application is in training mode + When I enter 'merchantuser@testmerchant1.co.uk' as the Email Address + And I enter '123456' as the Password + And I tap on Login + Then the Merchant Home Page is displayed + When I click on the device back button + Then A message is displayed confirming I want to log out + When I click no + Then the Merchant Home Page is displayed + +# Transaction Page Back Button Tests +@PRTest +Scenario: Back Button from Transaction Page Screen + Given I am on the Login Screen + And the application is in training mode + When I enter 'merchantuser@testmerchant1.co.uk' as the Email Address + And I enter '123456' as the Password + And I tap on Login + Then the Merchant Home Page is displayed + When I tap on Transactions + Then the Transaction Page is displayed + When I click on the device back button + Then the Merchant Home Page is displayed + +@PRTest +Scenario: Back Button from Transaction Select Operator Screen + Given I am on the Login Screen + And the application is in training mode + When I enter 'merchantuser@testmerchant1.co.uk' as the Email Address + And I enter '123456' as the Password + And I tap on Login + Then the Merchant Home Page is displayed + When I tap on Transactions + Then the Transaction Page is displayed + When I tap on the Mobile Topup button + Then the Transaction Select Mobile Topup Operator Page is displayed + When I click on the device back button + Then the Transaction Page is displayed + +# Reports Page Back Button Tests +# My Account Page Back Button Tests +# Support Page Back Button Tests diff --git a/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature.cs b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature.cs new file mode 100644 index 00000000..0f817ceb --- /dev/null +++ b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigation.feature.cs @@ -0,0 +1,342 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (https://www.specflow.org/). +// SpecFlow Version:3.9.0.0 +// SpecFlow Generator Version:3.9.0.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace TransactionMobile.Maui.UiTests.Features +{ + using TechTalk.SpecFlow; + using System; + using System.Linq; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("HardwarePageNavigation")] + [NUnit.Framework.CategoryAttribute("background")] + [NUnit.Framework.CategoryAttribute("login")] + [NUnit.Framework.CategoryAttribute("toolbar")] + [NUnit.Framework.CategoryAttribute("profile")] + [NUnit.Framework.CategoryAttribute("shared")] + [NUnit.Framework.CategoryAttribute("transactions")] + [NUnit.Framework.CategoryAttribute("shared")] + public partial class HardwarePageNavigationFeature + { + + private TechTalk.SpecFlow.ITestRunner testRunner; + + private static string[] featureTags = new string[] { + "background", + "login", + "toolbar", + "profile", + "shared", + "transactions", + "shared"}; + +#line 1 "HardwarePageNavigation.feature" +#line hidden + + [NUnit.Framework.OneTimeSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "HardwarePageNavigation", null, ProgrammingLanguage.CSharp, featureTags); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.OneTimeTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public void TestTearDown() + { + testRunner.OnScenarioEnd(); + } + + public void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioInitialize(scenarioInfo); + testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext); + } + + public void ScenarioStart() + { + testRunner.OnScenarioStart(); + } + + public void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Back Button from Login Screen")] + [NUnit.Framework.CategoryAttribute("PRTest")] + public void BackButtonFromLoginScreen() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Login Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 5 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 6 + testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line hidden +#line 7 + testRunner.When("I click on the device back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 8 + testRunner.Then("The application closes", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Device Back Button from Home Page Screen - user wants to log out")] + [NUnit.Framework.CategoryAttribute("PRTest")] + public void DeviceBackButtonFromHomePageScreen_UserWantsToLogOut() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Device Back Button from Home Page Screen - user wants to log out", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 12 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 13 + testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line hidden +#line 14 + testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 15 + testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 16 + testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 17 + testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 18 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 19 + testRunner.When("I click on the device back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 20 + testRunner.Then("A message is displayed confirming I want to log out", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 21 + testRunner.When("I click yes", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 22 + testRunner.Then("the Login Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Device Back Button from Home Page Screen - user does not want to log out")] + [NUnit.Framework.CategoryAttribute("PRTest")] + public void DeviceBackButtonFromHomePageScreen_UserDoesNotWantToLogOut() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Device Back Button from Home Page Screen - user does not want to log out", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 25 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 26 + testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line hidden +#line 27 + testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 28 + testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 29 + testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 30 + testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 31 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 32 + testRunner.When("I click on the device back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 33 + testRunner.Then("A message is displayed confirming I want to log out", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 34 + testRunner.When("I click no", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 35 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Back Button from Transaction Page Screen")] + [NUnit.Framework.CategoryAttribute("PRTest")] + public void BackButtonFromTransactionPageScreen() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Transaction Page Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 39 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 40 + testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line hidden +#line 41 + testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 42 + testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 43 + testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 44 + testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 45 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 46 + testRunner.When("I tap on Transactions", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 47 + testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 48 + testRunner.When("I click on the device back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 49 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Back Button from Transaction Select Operator Screen")] + [NUnit.Framework.CategoryAttribute("PRTest")] + public void BackButtonFromTransactionSelectOperatorScreen() + { + string[] tagsOfScenario = new string[] { + "PRTest"}; + System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Transaction Select Operator Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); +#line 52 +this.ScenarioInitialize(scenarioInfo); +#line hidden + if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) + { + testRunner.SkipScenario(); + } + else + { + this.ScenarioStart(); +#line 53 + testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line hidden +#line 54 + testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 55 + testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 56 + testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 57 + testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden +#line 58 + testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 59 + testRunner.When("I tap on Transactions", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 60 + testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 61 + testRunner.When("I tap on the Mobile Topup button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 62 + testRunner.Then("the Transaction Select Mobile Topup Operator Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden +#line 63 + testRunner.When("I click on the device back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden +#line 64 + testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + } + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigationFeature.cs b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigationFeature.cs new file mode 100644 index 00000000..0ce9ee4e --- /dev/null +++ b/TransactionMobile.Maui.UiTests/Features/HardwarePageNavigationFeature.cs @@ -0,0 +1,17 @@ +namespace TransactionMobile.Maui.UiTests.Features; + +using Drivers; +using NUnit.Framework; +using UITests.Common; + +[TestFixture(MobileTestPlatform.Android, Category = "Android")] +[NonParallelizable] +public partial class HardwarePageNavigationFeature : BaseTestFixture +{ + #region Constructors + + public HardwarePageNavigationFeature(MobileTestPlatform mobileTestPlatform) : base(mobileTestPlatform) { + } + + #endregion +} \ No newline at end of file diff --git a/TransactionMobile.Maui.UiTests/Features/LoginFeature.cs b/TransactionMobile.Maui.UiTests/Features/LoginFeature.cs index 2d758c2a..a3a1a9bb 100644 --- a/TransactionMobile.Maui.UiTests/Features/LoginFeature.cs +++ b/TransactionMobile.Maui.UiTests/Features/LoginFeature.cs @@ -1,39 +1,18 @@ -using TransactionMobile.Maui.UITests.Common; -using TransactionMobile.Maui.UiTests.Drivers; - -namespace TransactionMobile.Maui.UiTests.Features; +namespace TransactionMobile.Maui.UiTests.Features; +using Drivers; using NUnit.Framework; +using UITests.Common; [TestFixture(MobileTestPlatform.Android, Category = "Android")] [TestFixture(MobileTestPlatform.iOS, Category = "iOS")] [NonParallelizable] public partial class LoginFeature : BaseTestFixture { - public LoginFeature(MobileTestPlatform mobileTestPlatform) - : base(mobileTestPlatform) - { - } -} + #region Constructors -[TestFixture(MobileTestPlatform.Android, Category = "Android")] -[TestFixture(MobileTestPlatform.iOS, Category = "iOS")] -[NonParallelizable] -public partial class ProfileFeature : BaseTestFixture -{ - public ProfileFeature(MobileTestPlatform mobileTestPlatform) - : base(mobileTestPlatform) - { + public LoginFeature(MobileTestPlatform mobileTestPlatform) : base(mobileTestPlatform) { } -} -[TestFixture(MobileTestPlatform.Android, Category = "Android")] -//[TestFixture(MobileTestPlatform.iOS, Category = "iOS")] -[NonParallelizable] -public partial class PageNavigationFeature : BaseTestFixture -{ - public PageNavigationFeature(MobileTestPlatform mobileTestPlatform) - : base(mobileTestPlatform) - { - } + #endregion } \ No newline at end of file diff --git a/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature b/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature index fdb29c63..795f9fb4 100644 --- a/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature +++ b/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature @@ -1,12 +1,6 @@ @background @login @toolbar @profile @shared @transactions @shared Feature: PageNavigation -@PRTest -Scenario: Back Button from Login Screen - Given I am on the Login Screen - When I click on the back button - Then The application closes - # Home Page Back Button Tests @PRTest Scenario: Back Button from Home Page Screen - user wants to log out diff --git a/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature.cs b/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature.cs index 6b3f0cf0..548d9850 100644 --- a/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature.cs +++ b/TransactionMobile.Maui.UiTests/Features/PageNavigation.feature.cs @@ -87,38 +87,6 @@ public void ScenarioCleanup() testRunner.CollectScenarioErrors(); } - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Back Button from Login Screen")] - [NUnit.Framework.CategoryAttribute("PRTest")] - public void BackButtonFromLoginScreen() - { - string[] tagsOfScenario = new string[] { - "PRTest"}; - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Login Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 5 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 6 - testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line hidden -#line 7 - testRunner.When("I click on the back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden -#line 8 - testRunner.Then("The application closes", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - [NUnit.Framework.TestAttribute()] [NUnit.Framework.DescriptionAttribute("Back Button from Home Page Screen - user wants to log out")] [NUnit.Framework.CategoryAttribute("PRTest")] @@ -128,7 +96,7 @@ public void BackButtonFromHomePageScreen_UserWantsToLogOut() "PRTest"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Home Page Screen - user wants to log out", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 12 +#line 6 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -138,34 +106,34 @@ public void BackButtonFromHomePageScreen_UserWantsToLogOut() else { this.ScenarioStart(); -#line 13 +#line 7 testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 14 +#line 8 testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 15 +#line 9 testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 16 +#line 10 testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 17 +#line 11 testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 18 +#line 12 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 19 +#line 13 testRunner.When("I click on the back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 20 +#line 14 testRunner.Then("A message is displayed confirming I want to log out", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 21 +#line 15 testRunner.When("I click yes", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 22 +#line 16 testRunner.Then("the Login Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden } @@ -181,7 +149,7 @@ public void BackButtonFromHomePageScreen_UserDoesNotWantToLogOut() "PRTest"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Home Page Screen - user does not want to log out", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 25 +#line 19 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -191,34 +159,34 @@ public void BackButtonFromHomePageScreen_UserDoesNotWantToLogOut() else { this.ScenarioStart(); -#line 26 +#line 20 testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 27 +#line 21 testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 28 +#line 22 testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 29 +#line 23 testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 30 +#line 24 testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 31 +#line 25 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 32 +#line 26 testRunner.When("I click on the back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 33 +#line 27 testRunner.Then("A message is displayed confirming I want to log out", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 34 +#line 28 testRunner.When("I click no", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 35 +#line 29 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden } @@ -234,7 +202,7 @@ public void BackButtonFromTransactionPageScreen() "PRTest"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Transaction Page Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 39 +#line 33 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -244,34 +212,34 @@ public void BackButtonFromTransactionPageScreen() else { this.ScenarioStart(); -#line 40 +#line 34 testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 41 +#line 35 testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 42 +#line 36 testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 43 +#line 37 testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 44 +#line 38 testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 45 +#line 39 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 46 +#line 40 testRunner.When("I tap on Transactions", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 47 +#line 41 testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 48 +#line 42 testRunner.When("I click on the back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 49 +#line 43 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden } @@ -287,7 +255,7 @@ public void BackButtonFromTransactionSelectOperatorScreen() "PRTest"}; System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Back Button from Transaction Select Operator Screen", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 52 +#line 46 this.ScenarioInitialize(scenarioInfo); #line hidden if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) @@ -297,40 +265,40 @@ public void BackButtonFromTransactionSelectOperatorScreen() else { this.ScenarioStart(); -#line 53 +#line 47 testRunner.Given("I am on the Login Screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden -#line 54 +#line 48 testRunner.And("the application is in training mode", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 55 +#line 49 testRunner.When("I enter \'merchantuser@testmerchant1.co.uk\' as the Email Address", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 56 +#line 50 testRunner.And("I enter \'123456\' as the Password", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 57 +#line 51 testRunner.And("I tap on Login", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); #line hidden -#line 58 +#line 52 testRunner.Then("the Merchant Home Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 59 +#line 53 testRunner.When("I tap on Transactions", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 60 +#line 54 testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 61 +#line 55 testRunner.When("I tap on the Mobile Topup button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 62 +#line 56 testRunner.Then("the Transaction Select Mobile Topup Operator Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden -#line 63 +#line 57 testRunner.When("I click on the back button", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden -#line 64 +#line 58 testRunner.Then("the Transaction Page is displayed", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); #line hidden } diff --git a/TransactionMobile.Maui.UiTests/Features/PageNavigationFeature.cs b/TransactionMobile.Maui.UiTests/Features/PageNavigationFeature.cs new file mode 100644 index 00000000..77503e11 --- /dev/null +++ b/TransactionMobile.Maui.UiTests/Features/PageNavigationFeature.cs @@ -0,0 +1,18 @@ +namespace TransactionMobile.Maui.UiTests.Features; + +using Drivers; +using NUnit.Framework; +using UITests.Common; + +[TestFixture(MobileTestPlatform.Android, Category = "Android")] +[TestFixture(MobileTestPlatform.iOS, Category = "iOS")] +[NonParallelizable] +public partial class PageNavigationFeature : BaseTestFixture +{ + #region Constructors + + public PageNavigationFeature(MobileTestPlatform mobileTestPlatform) : base(mobileTestPlatform) { + } + + #endregion +} \ No newline at end of file diff --git a/TransactionMobile.Maui.UiTests/Features/ProfileFeature.cs b/TransactionMobile.Maui.UiTests/Features/ProfileFeature.cs new file mode 100644 index 00000000..24a5c00a --- /dev/null +++ b/TransactionMobile.Maui.UiTests/Features/ProfileFeature.cs @@ -0,0 +1,18 @@ +namespace TransactionMobile.Maui.UiTests.Features; + +using Drivers; +using NUnit.Framework; +using UITests.Common; + +[TestFixture(MobileTestPlatform.Android, Category = "Android")] +[TestFixture(MobileTestPlatform.iOS, Category = "iOS")] +[NonParallelizable] +public partial class ProfileFeature : BaseTestFixture +{ + #region Constructors + + public ProfileFeature(MobileTestPlatform mobileTestPlatform) : base(mobileTestPlatform) { + } + + #endregion +} \ No newline at end of file diff --git a/TransactionMobile.Maui.UiTests/Pages/SharedPage.cs b/TransactionMobile.Maui.UiTests/Pages/SharedPage.cs index 8eb714eb..ea289610 100644 --- a/TransactionMobile.Maui.UiTests/Pages/SharedPage.cs +++ b/TransactionMobile.Maui.UiTests/Pages/SharedPage.cs @@ -14,12 +14,21 @@ namespace TransactionMobile.Maui.UiTests.Pages public class SharedPage : BasePage { - protected override String Trait { get; } - + protected override String Trait => String.Empty; + private readonly String BackButton; + + public SharedPage() { + this.BackButton = "BackButton"; + } public void LogoutMessageIsDisplayed(String logoutAlertTitle, String logoutAlertMessage) { IAlert a = this.SwitchToAlert(); a.Text.ShouldBe($"{logoutAlertTitle}{Environment.NewLine}{logoutAlertMessage}"); } + + public async Task ClickBackButton() { + IWebElement element = await this.WaitForElementByAccessibilityId(this.BackButton); + element.Click(); + } } } diff --git a/TransactionMobile.Maui.UiTests/Steps/SharedSteps.cs b/TransactionMobile.Maui.UiTests/Steps/SharedSteps.cs index d92a165e..97af8cd6 100644 --- a/TransactionMobile.Maui.UiTests/Steps/SharedSteps.cs +++ b/TransactionMobile.Maui.UiTests/Steps/SharedSteps.cs @@ -21,12 +21,17 @@ public class SharedSteps { private SharedPage sharedPage = new SharedPage(); - [When(@"I click on the back button")] - public void WhenIClickOnTheBackButton() + [When(@"I click on the device back button")] + public void WhenIClickOnTheDeviceBackButton() { this.sharedPage.NavigateBack(); } + [When(@"I click on the back button")] + public async Task WhenIClickOnTheBackButton() { + await this.sharedPage.ClickBackButton(); + } + [Then(@"The application closes")] public void ThenTheApplicationCloses() { AppState state = AppiumDriverWrapper.Driver.GetAppState("com.transactionprocessing.pos"); diff --git a/TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj b/TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj index c0245224..51e0a3f2 100644 --- a/TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj +++ b/TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj @@ -7,6 +7,10 @@ false + + + + @@ -23,4 +27,17 @@ + + + PageNavigation.feature + + + + + + $(UsingMicrosoftNETSdk) + %(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension) + + + diff --git a/TransactionMobile.Maui/Pages/AppHome/HomePage.xaml b/TransactionMobile.Maui/Pages/AppHome/HomePage.xaml index 8132ddd6..5b3e58e3 100644 --- a/TransactionMobile.Maui/Pages/AppHome/HomePage.xaml +++ b/TransactionMobile.Maui/Pages/AppHome/HomePage.xaml @@ -10,6 +10,6 @@