-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move 10234 to Appium #21471
Merged
Merged
Move 10234 to Appium #21471
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
be4c6b1
Move 10234 to Appium
PureWeen f78d63b
- fix scroll direction
PureWeen 3ea979a
- increase timeout and remove WinUI test completely
PureWeen 58cccc9
- add logging
PureWeen d4831a5
Update Issue17347.cs
PureWeen 1ee1b8f
- add more data
PureWeen File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
157 changes: 157 additions & 0 deletions
157
src/Controls/samples/Controls.Sample.UITests/Issues/Issue10234.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,157 @@ | ||
| ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.Maui.Controls; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.None, 10234, "CarouselView disposed on iOS when navigating back in Shell", PlatformAffected.iOS)] | ||
public class Issue10234Test : ContentPage | ||
{ | ||
public Issue10234Test() | ||
{ | ||
Content = new VerticalStackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Button() | ||
{ | ||
Text = "Go To Test", | ||
AutomationId = "GoToTest", | ||
Command = new Command(() => Application.Current.MainPage = new Issue10234()) | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
|
||
public class Issue10234 : Shell | ||
{ | ||
public Issue10234() | ||
{ | ||
TabBar tabBar = new TabBar | ||
{ | ||
Title = "Main", | ||
Route = "main", | ||
Items = | ||
{ | ||
new Tab | ||
{ | ||
Route = "tab1", | ||
Title = "Tab 1", | ||
Items = | ||
{ | ||
new ShellContent() | ||
{ | ||
ContentTemplate = new DataTemplate(() => new ContentPage | ||
{ | ||
Content = new StackLayout | ||
{ | ||
Children = | ||
{ | ||
new Label { Text = "Hej" }, | ||
new Button { | ||
AutomationId = "goToShow", | ||
Text = "Show", | ||
Command = new Command(async () => await GoToAsync("//photos?id=1")) | ||
} | ||
} | ||
} | ||
}), | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
TabBar photosTab = new TabBar() | ||
{ | ||
Title = "Photos", | ||
Route = "photos", | ||
Items = | ||
{ | ||
new ShellSection() | ||
{ | ||
Items = | ||
{ | ||
new ShellContent() | ||
{ | ||
ContentTemplate = new DataTemplate(() => new PhotosPage()), | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
Items.Add(tabBar); | ||
Items.Add(photosTab); | ||
} | ||
|
||
class PhotosPage : ContentPage | ||
{ | ||
|
||
CarouselView Photos; | ||
public PhotosPage() | ||
{ | ||
Photos = new CarouselView | ||
{ | ||
AutomationId = "carouselView", | ||
ItemTemplate = new DataTemplate( | ||
() => | ||
{ | ||
var image = new Image(); | ||
image.SetBinding(Image.SourceProperty, new Binding(".")); | ||
return image; | ||
} | ||
) | ||
}; | ||
|
||
var grid = new Grid(); | ||
grid.RowDefinitions.Add(new RowDefinition()); | ||
grid.RowDefinitions.Add(new RowDefinition()); | ||
var btn = new Button | ||
{ | ||
Text = "Go back", | ||
AutomationId = "goToBack", | ||
Command = new Command(async () => await Shell.Current.GoToAsync("//main")) | ||
}; | ||
Grid.SetRow(Photos, 0); | ||
Grid.SetRow(btn, 1); | ||
grid.Children.Add(Photos); | ||
grid.Children.Add(btn); | ||
Content = grid; | ||
} | ||
|
||
public ObservableCollection<string> Items { get; set; } | ||
|
||
public void LoadData() | ||
{ | ||
var images = new List<string>(); | ||
|
||
images.Add("oasis.jpg"); | ||
images.Add("dotnet_bot.jpg"); | ||
images.Add("shopping_cart.jpg"); | ||
images.Add("groceries.png"); | ||
|
||
|
||
Items = new ObservableCollection<string>(images); | ||
Photos.ItemsSource = Items; | ||
} | ||
|
||
protected override void OnAppearing() | ||
{ | ||
base.OnAppearing(); | ||
|
||
LoadData(); | ||
} | ||
|
||
public int PageId | ||
{ | ||
get; set; | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue10234 : _IssuesUITest | ||
{ | ||
public override string Issue => "CarouselView disposed on iOS when navigating back in Shell"; | ||
|
||
public Issue10234(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
[Test] | ||
public void ScrollCarouselViewAfterDispose() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows }); | ||
|
||
try | ||
{ | ||
_ = App.WaitForElement("GoToTest"); | ||
App.Click("GoToTest"); | ||
App.WaitForElement("goToShow"); | ||
App.Click("goToShow"); | ||
App.WaitForElement("goToBack"); | ||
ScrollNextItem(); | ||
App.Click("goToBack"); | ||
App.WaitForElement("goToShow"); | ||
App.Click("goToShow"); | ||
ScrollNextItem(); | ||
App.WaitForElement("goToBack"); | ||
App.Click("goToBack"); | ||
App.WaitForElement("goToShow"); | ||
} | ||
finally{ | ||
Reset(); | ||
} | ||
} | ||
|
||
void ScrollNextItem() | ||
{ | ||
App.ScrollRight("carouselView"); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runners don't really work with Shell right now so I changed this one to swap in the main page as part of the test