Unverified Commit cb90ae4d authored by htoor3's avatar htoor3 Committed by GitHub
parent ad784bf8
...@@ -16,24 +16,15 @@ bool get isFirefox => window.navigator.userAgent.toLowerCase().contains('firefox ...@@ -16,24 +16,15 @@ bool get isFirefox => window.navigator.userAgent.toLowerCase().contains('firefox
/// without penetrating the shadow DOM. In the latter case, if the application /// without penetrating the shadow DOM. In the latter case, if the application
/// creates platform views, this will also find platform view elements. /// creates platform views, this will also find platform view elements.
List<Node> findElements(String selector) { List<Node> findElements(String selector) {
final Element? glassPane = document.querySelector('flt-glass-pane'); final Element? flutterView = document.querySelector('flutter-view');
if (glassPane == null) {
if (flutterView == null) {
fail( fail(
'Failed to locate <flt-glass-pane>. Possible reasons:\n' 'Failed to locate <flutter-view>. Possible reasons:\n'
' - The application failed to start' ' - The application failed to start'
' - `findElements` was called before the application started' ' - `findElements` was called before the application started'
); );
} }
// TODO(htoor3): Remove shadowRoot selectors once DOM structure PR is merged. return flutterView.querySelectorAll(selector);
final Element? flutterView = document.querySelector('flutter-view');
if(flutterView != null){
return flutterView.querySelectorAll(selector);
}
final ShadowRoot? shadowRoot = glassPane.shadowRoot;
return shadowRoot != null
? shadowRoot.querySelectorAll(selector)
: glassPane.querySelectorAll(selector);
} }
...@@ -43,6 +43,6 @@ void main() { ...@@ -43,6 +43,6 @@ void main() {
<dynamic>[], <dynamic>[],
) as WebElement?; ) as WebElement?;
expect(fltSemantics, isNotNull); expect(fltSemantics, isNotNull);
}, skip: true); // https://github.com/flutter/flutter/issues/124174 });
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment