Skip to content

Commit

Permalink
Make XCUIElement.isWithinVisibleArea handle Navigation bar not being …
Browse files Browse the repository at this point in the history
…displayed
  • Loading branch information
tiagomar authored and hassaanelgarem committed Dec 18, 2023
1 parent 11440a5 commit 860bda0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion WordPress/UITestsFoundation/XCUIElement+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ public extension XCUIElement {

let deviceScreenFrame = app.windows.element(boundBy: 0).frame
let deviceScreenWidth = deviceScreenFrame.size.width
let visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height
let visibleAreaTop: CGFloat

if topElement.exists {
visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height
} else {
visibleAreaTop = deviceScreenFrame.origin.y
}

let visibleAreaHeight = bottomElement.frame.origin.y - visibleAreaTop
let visibleAreaFrame = CGRect(x: 0, y: visibleAreaTop, width: deviceScreenWidth, height: visibleAreaHeight)

Expand Down

0 comments on commit 860bda0

Please sign in to comment.