-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Issue11224.xaml.cs
79 lines (69 loc) · 1.74 KB
/
Issue11224.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using Microsoft.Maui.Controls.CustomAttributes;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Xaml;
#if UITEST
using Xamarin.UITest;
using Xamarin.UITest.Queries;
using NUnit.Framework;
using Microsoft.Maui.Controls.Compatibility.UITests;
#endif
namespace Microsoft.Maui.Controls.ControlGallery.Issues
{
#if UITEST
[Category(UITestCategories.CarouselView)]
[Category(UITestCategories.UwpIgnore)]
#endif
#if APP
[XamlCompilation(XamlCompilationOptions.Compile)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11224, "[Bug] CarouselView Position property fails to update visual while control isn't visible", PlatformAffected.Android)]
public partial class Issue11224 : TestContentPage
{
public Issue11224()
{
#if APP
Title = "Issue 11224";
InitializeComponent();
carousel.Scrolled += (sender, args) =>
{
if (args.CenterItemIndex == 3)
ResultLabel.Text = "The test has passed";
else
ResultLabel.Text = "The test has failed";
};
carousel.PropertyChanged += (sender, args) =>
{
if (args.PropertyName == CarouselView.IsVisibleProperty.PropertyName)
{
if (carousel.IsVisible && carousel.Position == 3)
{
ResultLabel.Text = "The test has passed";
}
}
};
#endif
}
protected override void Init()
{
}
#if APP
void Button_Clicked(object sender, EventArgs e)
{
carousel.IsVisible = true;
}
#endif
#if UITEST
[Test]
[Compatibility.UITests.FailsOnMauiIOS]
public void CarouselViewPositionFromVisibilityChangeTest()
{
RunningApp.WaitForElement(q => q.Marked("AppearButton"));
RunningApp.Tap(q => q.Marked("AppearButton"));
RunningApp.WaitForElement("Item 4");
RunningApp.Screenshot("Success");
}
#endif
}
}