scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS
MIT License
5.6k stars 509 forks source link

Had problem of dismiss floatingpanel controller in UITesting #535

Open oddukgi opened 2 years ago

oddukgi commented 2 years ago

Description

I just show on bottom sheet using XCUIApplication. When bottomsheet show on, scrolling little. And then i want to touch on view, view can't detect. Is there any way to detect view for hiding bottom sheet?

Expected behavior

Actual behavior

Steps to reproduce

Code example that reproduces the issue

    func test_TermsAndService() {

       let app = XCUIApplication()
        let mainElement = app.windows.children(matching: .other).element.children(matching: .other).element
        let childElement = mainElement.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element

//  touch right arrow button and show bottomsheet
        let termsAndServiceBtn = childElement.children(matching: .other).element.children(matching: .other).element(boundBy: 3).children(matching: .other).element(boundBy: 0).buttons["ic caretGrey"]
        termsAndServiceBtn.tap()
//        let webViewsQuery = app.webViews.webViews.webViews

        // Scroll view on half
        let relativeTouchPoint = app.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5))
        let relativeOffset = app.coordinate(withNormalizedOffset: CGVector(dx: 0, dy: -1))
        relativeTouchPoint.press(forDuration: 0, thenDragTo: relativeOffset)

      // TODO: when touch view, hide bottom sheet

    }

How do you display panel(s)? Present modally

How many panels do you displays? 1

Environment

Library version 2.5.2

Installation method

iOS version(s) 15.2

Xcode version 13.2.1

scenee commented 2 years ago

Which view are not able to detect a touch?

oddukgi commented 2 years ago

Touch area is outside of bottomsheet.

main