Skip to content

Commit 434dece

Browse files
Modified test case
1 parent a75ccde commit 434dece

File tree

2 files changed

+39
-38
lines changed

2 files changed

+39
-38
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issue7144.cs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace Controls.TestCases.HostApp.Issues;
55
[Issue(IssueTracker.Github, 7144, "IndicatorView using templated icons not working", PlatformAffected.UWP)]
66
public class Issue7144 : ContentPage
77
{
8-
public ObservableCollection<Issue7144Monkey> Monkeys { get; set; } = new ObservableCollection<Issue7144Monkey>();
8+
public ObservableCollection<string> Items { get; set; } = new ObservableCollection<string>() { "Items1", "Items2" };
99

1010
public Issue7144()
1111
{
12-
CreateMonkeyCollection();
12+
// CreateMonkeyCollection();
1313

1414
Grid grid = new Grid();
1515
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Star });
@@ -35,78 +35,79 @@ public Issue7144()
3535
return image;
3636
});
3737

38-
CarouselView carouselViewWithIndicatorView = new CarouselView
38+
CarouselView carouselView = new CarouselView
3939
{
40-
ItemsSource = Monkeys,
40+
ItemsSource = Items,
4141
Loop = false,
4242
IndicatorView = indicatorViewWithDataTemplate,
4343
ItemTemplate = new DataTemplate(() =>
4444
{
4545
StackLayout stackLayout = new StackLayout();
4646

47-
Label nameLabel = new Label
47+
Label label = new Label
4848
{
4949
FontAttributes = FontAttributes.Bold,
5050
FontSize = 24,
5151
HorizontalOptions = LayoutOptions.Center,
5252
VerticalOptions = LayoutOptions.Center
5353
};
54-
nameLabel.SetBinding(Label.TextProperty, "Name");
54+
label.SetBinding(Label.TextProperty, ".");
5555

56-
Image image = new Image
57-
{
58-
Aspect = Aspect.Fill,
59-
HeightRequest = 150,
60-
WidthRequest = 150,
61-
HorizontalOptions = LayoutOptions.Center
62-
};
63-
image.SetBinding(Image.SourceProperty, "Image");
56+
// Image image = new Image
57+
// {
58+
// Aspect = Aspect.Fill,
59+
// HeightRequest = 150,
60+
// WidthRequest = 150,
61+
// HorizontalOptions = LayoutOptions.Center
62+
// };
63+
// image.SetBinding(Image.SourceProperty, "Image");
6464

65-
stackLayout.Children.Add(nameLabel);
66-
stackLayout.Children.Add(image);
65+
stackLayout.Children.Add(label);
66+
// stackLayout.Children.Add(image);
6767

6868
return stackLayout;
69+
6970
})
7071
};
7172

7273
Label label = new Label
7374
{
74-
AutomationId = "IndicatorViewWithDataTemplate",
75+
AutomationId = "descriptionLabel",
7576
Text = "The test case fails if the IndicatorView DataTemplate is not displayed",
7677
FontAttributes = FontAttributes.Bold,
7778
FontSize = 24,
7879
HorizontalOptions = LayoutOptions.Center,
7980
VerticalOptions = LayoutOptions.Center
8081
};
8182

82-
grid.Add(carouselViewWithIndicatorView, 0, 0);
83+
grid.Add(carouselView, 0, 0);
8384
grid.Add(indicatorViewWithDataTemplate, 0, 1);
8485
grid.Add(label, 0, 2);
8586

8687
Content = grid;
8788
}
8889

89-
void CreateMonkeyCollection()
90-
{
91-
Monkeys.Add(new Issue7144Monkey
92-
{
93-
Name = "Baboon",
94-
Image = "dotnet_bot.png"
95-
});
96-
97-
Monkeys.Add(new Issue7144Monkey
98-
{
99-
Name = "Capuchin Monkey",
100-
Image = "dotnet_bot.png"
101-
});
102-
}
90+
// void CreateMonkeyCollection()
91+
// {
92+
// Monkeys.Add(new Issue7144Monkey
93+
// {
94+
// Name = "Baboon",
95+
// Image = "dotnet_bot.png"
96+
// });
97+
98+
// Monkeys.Add(new Issue7144Monkey
99+
// {
100+
// Name = "Capuchin Monkey",
101+
// Image = "dotnet_bot.png"
102+
// });
103+
// }
103104
}
104105

105-
public class Issue7144Monkey
106-
{
107-
public string Name { get; set; }
106+
// public class Issue7144Monkey
107+
// {
108+
// public string Name { get; set; }
108109

109-
public string Image { get; set; }
110-
}
110+
// public string Image { get; set; }
111+
// }
111112

112113

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7144.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public Issue7144(TestDevice device) : base(device)
1616
[Category(UITestCategories.IndicatorView)]
1717
public void IndicatorViewWithTemplatedIcon()
1818
{
19-
App.WaitForElement("IndicatorViewWithDataTemplate");
19+
App.WaitForElement("descriptionLabel");
2020
VerifyScreenshot();
2121
}
2222
}

0 commit comments

Comments
 (0)