-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2695 from unoplatform/dev/erli/2449-pass-data-tab…
…bar-navview
- Loading branch information
Showing
25 changed files
with
396 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
testing/TestHarness/TestHarness.UITest/Ext/Navigation/Apps/Regions/Given_Apps_Regions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
namespace TestHarness.UITest; | ||
|
||
public class Given_Apps_Regions : NavigationTestBase | ||
{ | ||
[Test] | ||
public async Task When_Regions_Send_Data_NavView() | ||
{ | ||
InitTestSection(TestSections.Apps_Regions); | ||
|
||
App.WaitThenTap("ShowAppButton"); | ||
|
||
App.WaitElement("RegionsHomePageTextBox"); | ||
|
||
var textToSet = "Hello, World!"; | ||
|
||
App.SetText("RegionsHomePageTextBox", textToSet); | ||
|
||
App.WaitThenTap("RegionsHomePageThirdPage"); | ||
|
||
App.WaitElement("RegionsThirdPageTextBock"); | ||
|
||
var textFromTb = App.GetText("RegionsThirdPageTextBock"); | ||
|
||
Assert.AreEqual(textToSet, textFromTb); | ||
} | ||
|
||
[Test] | ||
public async Task When_Regions_Send_Data_TabBar() | ||
{ | ||
InitTestSection(TestSections.Apps_Regions); | ||
|
||
App.WaitThenTap("ShowAppButton"); | ||
|
||
App.WaitThenTap("RegionsHomePageRegionsTbData"); | ||
|
||
App.WaitThenTap("RegionsTbDataPageTabOne"); | ||
|
||
var textToSet = "Hello, World!"; | ||
|
||
App.SetText("RegionsFirstTbiDataPageTextBox", textToSet); | ||
|
||
App.WaitThenTap("RegionsTbDataPageTabTwo"); | ||
|
||
var textFromTb = App.GetText("RegionsSecondTbiDataPageTextBox"); | ||
|
||
Assert.AreEqual(textToSet, textFromTb); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...Ext/Navigation/Apps/Regions/FourthData.cs → ...vigation/Apps/Regions/RegionEntityData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
namespace TestHarness.Ext.Navigation.Apps.Regions; | ||
|
||
public class FourthData | ||
public class RegionEntityData | ||
{ | ||
public string Name { get; set; } | ||
|
||
public RegionEntityData(string name) | ||
{ | ||
Name = name; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
testing/TestHarness/TestHarness/Ext/Navigation/Apps/Regions/RegionsFirstTbiDataPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<Page x:Class="TestHarness.Ext.Navigation.Apps.Regions.RegionsFirstTbiDataPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:TestHarness.Ext.Navigation.Apps.Regions" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:uen="using:Uno.Extensions.Navigation.UI" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<TextBlock HorizontalAlignment="Center" | ||
Style="{StaticResource TitleLarge}" | ||
Text="First Tab" /> | ||
<TextBlock Margin="40" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Text="Data persists between both the tabs." /> | ||
<StackPanel Grid.Row="1" | ||
HorizontalAlignment="Center" | ||
Orientation="Horizontal" | ||
Spacing="4"> | ||
<TextBlock HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontSize="24" | ||
Text="Entity name:" /> | ||
<TextBox Width="400" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontSize="24" | ||
Header="First Tab" | ||
AutomationProperties.AutomationId="RegionsFirstTbiDataPageTextBox" | ||
Style="{StaticResource FilledTextBoxStyle}" | ||
Text="{Binding Entity.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
9 changes: 9 additions & 0 deletions
9
testing/TestHarness/TestHarness/Ext/Navigation/Apps/Regions/RegionsFirstTbiDataPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace TestHarness.Ext.Navigation.Apps.Regions; | ||
|
||
public sealed partial class RegionsFirstTbiDataPage : Page | ||
{ | ||
public RegionsFirstTbiDataPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
testing/TestHarness/TestHarness/Ext/Navigation/Apps/Regions/RegionsFirstTbiDataViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace TestHarness.Ext.Navigation.Apps.Regions; | ||
|
||
public record RegionsFirstTbiDataViewModel | ||
{ | ||
public RegionEntityData? Entity { get; set; } | ||
|
||
public RegionsFirstTbiDataViewModel(RegionEntityData? entity) | ||
{ | ||
Entity = entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
testing/TestHarness/TestHarness/Ext/Navigation/Apps/Regions/RegionsFourthViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace TestHarness.Ext.Navigation.Apps.Regions; | ||
|
||
public class RegionsFourthViewModel (FourthData fourthData) | ||
public class RegionsFourthViewModel (RegionEntityData fourthData) | ||
{ | ||
public FourthData FourthData { get; set; } = fourthData; | ||
public RegionEntityData FourthData { get; set; } = fourthData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
testing/TestHarness/TestHarness/Ext/Navigation/Apps/Regions/RegionsHomeViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.ComponentModel; | ||
|
||
namespace TestHarness.Ext.Navigation.Apps.Regions; | ||
|
||
public class RegionsHomeViewModel : INotifyPropertyChanged | ||
{ | ||
private string _myText = "Type Something and go to Third Page"; | ||
|
||
public string MyText | ||
{ | ||
get => _myText; | ||
set | ||
{ | ||
if (_myText != value) | ||
{ | ||
_myText = value; | ||
OnPropertyChanged(nameof(MyText)); | ||
} | ||
} | ||
} | ||
|
||
public event PropertyChangedEventHandler? PropertyChanged; | ||
protected void OnPropertyChanged(string propertyName) => | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} |
Oops, something went wrong.