Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,37 @@ public void VerifyInitialStateParentTopChildBottom()
// 2. Bottom indicator is inset from screen bottom by safe area (child handles bottom)
// 3. Both work independently without conflict

// Get screen dimensions
var parentGridRect = App.WaitForElement("ParentGrid").GetRect();
var screenTop = parentGridRect.Y;
var screenBottom = parentGridRect.Y + parentGridRect.Height;

// Verify initial status
WaitForText("StatusLabel", "Parent: Top=Container, Bottom=None | Child: Bottom=Container");

// Measure top indicator position
var topIndicatorRect = App.WaitForElement("TopIndicator").GetRect();
var topIndicatorTop = topIndicatorRect.Y;

// Top indicator should be below the screen top (safe area applied)
var topInsetFromScreenTop = topIndicatorTop - screenTop;
Assert.That(topInsetFromScreenTop, Is.GreaterThan(5),
$"Top indicator should be inset from screen top by safe area. " +
$"Current inset: {topInsetFromScreenTop}pt (expected >5pt)");

// Measure bottom indicator position
var bottomIndicatorRect = App.WaitForElement("BottomIndicator").GetRect();
var bottomIndicatorBottom = bottomIndicatorRect.Y + bottomIndicatorRect.Height;

// Bottom indicator should be above the screen bottom (safe area applied)
var bottomInsetFromScreenBottom = screenBottom - bottomIndicatorBottom;
// On devices with bottom safe area (iOS home indicator, Android nav bar), verify meaningful inset.
// On gesture-nav Android devices, bottom safe area is correctly 0.
if (HasBottomSafeArea(bottomInsetFromScreenBottom))
{
Assert.That(bottomInsetFromScreenBottom, Is.GreaterThan(5),
$"Bottom indicator should be inset from screen bottom by safe area. " +
$"Current inset: {bottomInsetFromScreenBottom}pt (expected >5pt)");
}
else
App.RetryAssert(() =>
{
Assert.That(bottomInsetFromScreenBottom, Is.GreaterThanOrEqualTo(0),
$"Bottom indicator should not extend below screen bottom. Inset: {bottomInsetFromScreenBottom}pt");
}
var parentGridRect = App.FindElement("ParentGrid").GetRect();
var screenTop = parentGridRect.Y;
var screenBottom = parentGridRect.Y + parentGridRect.Height;

var topIndicatorRect = App.FindElement("TopIndicator").GetRect();
var topInsetFromScreenTop = topIndicatorRect.Y - screenTop;
Assert.That(topInsetFromScreenTop, Is.GreaterThan(5),
$"Top indicator should be inset from screen top by safe area. " +
$"Current inset: {topInsetFromScreenTop}pt (expected >5pt)");

var bottomIndicatorRect = App.FindElement("BottomIndicator").GetRect();
var bottomIndicatorBottom = bottomIndicatorRect.Y + bottomIndicatorRect.Height;
var bottomInsetFromScreenBottom = screenBottom - bottomIndicatorBottom;

if (HasBottomSafeArea(bottomInsetFromScreenBottom))
{
Assert.That(bottomInsetFromScreenBottom, Is.GreaterThan(5),
$"Bottom indicator should be inset from screen bottom by safe area. " +
$"Current inset: {bottomInsetFromScreenBottom}pt (expected >5pt)");
}
else
{
Assert.That(bottomInsetFromScreenBottom, Is.GreaterThanOrEqualTo(0),
$"Bottom indicator should not extend below screen bottom. Inset: {bottomInsetFromScreenBottom}pt");
}
Comment thread
kubaflo marked this conversation as resolved.
Resolved
});
}

[Test, Order(2)]
Expand Down
Loading