|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | +using NUnit.Framework; |
| 7 | +using Uno.Toolkit.UITest.Extensions; |
| 8 | +using Uno.Toolkit.UITest.Framework; |
| 9 | +using Uno.UITest; |
| 10 | +using Uno.UITest.Helpers; |
| 11 | +using Uno.UITest.Helpers.Queries; |
| 12 | +using Uno.UITests.Helpers; |
| 13 | + |
| 14 | +namespace Uno.Toolkit.UITest.Controls.NavigationBar |
| 15 | +{ |
| 16 | + [ActivePlatforms(Platform.Android, Platform.iOS)] |
| 17 | + [TestFixture] |
| 18 | + public class Given_NavigationBar_Fluent : TestBase |
| 19 | + { |
| 20 | + protected override string SampleName => "NavigationBar-Fluent"; |
| 21 | + |
| 22 | + [Test] |
| 23 | + [AutoRetry] |
| 24 | + public void NavBar_AppBarButton_With_Icon_Click() |
| 25 | + { |
| 26 | + NavigateToNestedSample("FluentNavigationBarSampleNestedPage"); |
| 27 | + |
| 28 | + PlatformHelpers.On( |
| 29 | + iOS: () => App.FastTap("FluentPage1NavBarPrimaryCommand3"), |
| 30 | + Android: () => App.FastTap("FluentPage1NavBarPrimaryCommand3") |
| 31 | + ); |
| 32 | + |
| 33 | + App.WaitForElement("FluentPage2NavBar", "Timed out waiting for Page 2 Nav Bar"); |
| 34 | + } |
| 35 | + |
| 36 | + [Test] |
| 37 | + [AutoRetry] |
| 38 | + public void NavBar_Can_Close_Flyout_With_MainCommand() |
| 39 | + { |
| 40 | + NavigateToNestedSample("FluentNavigationBarSampleNestedPage"); |
| 41 | + App.FastTap("OpenPage2FlyoutButton"); |
| 42 | + App.WaitForElement("FluentPage2NavBar", "Timed out waiting for Page 2 Nav Bar"); |
| 43 | + App.FastTap("NavigateToThirdButton"); |
| 44 | + App.WaitForElement("FluentPage3NavBar", "Timed out waiting for Page 3 Nav Bar"); |
| 45 | + |
| 46 | + PlatformHelpers.On( |
| 47 | + iOS: () => App.FastTap("BackButton"), |
| 48 | + Android: () => App.FastTap(q => q.Marked("FluentPage3NavBar").Descendant("AppCompatImageButton")) |
| 49 | + ); |
| 50 | + |
| 51 | + App.WaitForElement("FluentPage2NavBar", "Timed out waiting for Page 2 Nav Bar"); |
| 52 | + |
| 53 | + PlatformHelpers.On( |
| 54 | + iOS: () => App.FastTap("FluentPage2NavBarMainCommand"), |
| 55 | + Android: () => App.FastTap(q => q.Marked("FluentPage2NavBar").Descendant("AppCompatImageButton")) |
| 56 | + ); |
| 57 | + |
| 58 | + App.WaitForElement("FluentPage1NavBar", "Timed out waiting for Page 1 Nav Bar"); |
| 59 | + } |
| 60 | + } |
| 61 | +} |
0 commit comments