Skip to content

Commit abe8c22

Browse files
Tamilarasan-ParanthamanPureWeen
authored andcommitted
test script changes
1 parent 14f6161 commit abe8c22

File tree

1 file changed

+22
-21
lines changed
  • src/Controls/tests/TestCases.Shared.Tests/Tests/Issues

1 file changed

+22
-21
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,47 @@
66

77
namespace Microsoft.Maui.TestCases.Tests.Issues
88
{
9-
public class Issue17022 : _IssuesUITest
10-
{
11-
public Issue17022(TestDevice device)
12-
: base(device)
13-
{ }
9+
public class Issue17022 : _IssuesUITest
10+
{
11+
public Issue17022(TestDevice device)
12+
: base(device)
13+
{ }
1414

15-
public override string Issue => "UINavigationBar is Translucent";
15+
public override string Issue => "UINavigationBar is Translucent";
1616

17-
// TODO: Add shell navigation bar tests when we can call shell in UITest
18-
[Test]
19-
[Category(UITestCategories.Navigation)]
20-
[TestCase("NewNavigationPageButton", false)]
17+
// TODO: Add shell navigation bar tests when we can call shell in UITest
18+
[Test]
19+
[Category(UITestCategories.Navigation)]
20+
[TestCase("NewNavigationPageButton", false)]
2121
[TestCase("NewNavigationPageTransparentButton", false)]
2222
[TestCase("NewNavigationPageTranslucentButton", false)]
2323
[TestCase("NewNavigationPageTransparentTranslucentButton", false)]
2424
[TestCase("NewNavigationPageGridButton", false)]
25-
[TestCase("NewNavigationPageGridTransparentButton", false)]
25+
[TestCase("NewNavigationPageGridTransparentButton", true)] // if we set BarBackgroundColor to transparent, the boxview should be at the top.
2626
[TestCase("NewNavigationPageGridTranslucentButton", false, true)] // this test thinks the boxview is at the top of the screen, but it's not. Test this case manually for now.
2727
[TestCase("NewNavigationPageGridTransparentTranslucentButton", true)]
2828
[TestCase("NewFlyoutPageButton", false)]
2929
[TestCase("NewFlyoutPageTransparentButton", false)]
3030
[TestCase("NewFlyoutPageTranslucentButton", false)]
3131
[TestCase("NewFlyoutPageTransparentTranslucentButton", false)]
3232
[TestCase("NewFlyoutPageGridButton", false)]
33-
[TestCase("NewFlyoutPageGridTransparentButton", false)]
33+
[TestCase("NewFlyoutPageGridTransparentButton", true)] // if we set BarBackgroundColor to transparent, the boxview should be at the top.
3434
[TestCase("NewFlyoutPageGridTranslucentButton", false, true)] // this test thinks the boxview is at the top of the screen, but it's not. Test this case manually for now.
3535
[TestCase("NewFlyoutPageGridTransparentTranslucentButton", true)]
3636
[TestCase("SemiTransparentNavigationPageBackgroundColor", true, true)]
3737
[TestCase("SemiTransparentNavigationPageBrush", true, true)]
3838
[TestCase("SemiTransparentFlyoutPageBackgroundColor", true, true)]
3939
[TestCase("SemiTransparentFlyoutPageBrush", true, true)]
4040

41-
public void Issue17022Test(string testButtonID, bool isTopOfScreen, bool requiresScreenshot = false)
42-
{
41+
public void Issue17022Test(string testButtonID, bool isTopOfScreen, bool requiresScreenshot = false)
42+
{
4343
App.WaitForElement(testButtonID).Click();
4444
var boxView = App.WaitForElement("TopBoxView");
4545
ClassicAssert.NotNull(boxView);
46-
var rect = boxView.GetRect();
46+
var rect = boxView.GetRect();
4747

48-
try {
48+
try
49+
{
4950
if (requiresScreenshot)
5051
{
5152
VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + testButtonID);
@@ -58,19 +59,19 @@ public void Issue17022Test(string testButtonID, bool isTopOfScreen, bool require
5859
}
5960
else
6061
{
61-
ClassicAssert.AreNotEqual(rect.Y, 0);
62+
ClassicAssert.AreNotEqual(rect.Y, 0);
6263
}
6364
}
6465
}
65-
catch
66-
{
66+
catch
67+
{
6768
Assert.Fail("Failed with exception");
6869
}
6970
finally
7071
{
7172
App.WaitForElement("PopPageButton").Click();
7273
}
73-
}
74-
}
74+
}
75+
}
7576
}
7677
#endif

0 commit comments

Comments
 (0)