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
/// without penetrating the shadow DOM. In the latter case, if the application
/// creates platform views, this will also find platform view elements.
List<Node> findElements(String selector) {
final Element? glassPane = document.querySelector('flt-glass-pane');
if (glassPane == null) {
final Element? flutterView = document.querySelector('flutter-view');
if (flutterView == null) {
fail(
'Failed to locate <flt-glass-pane>. Possible reasons:\n'
'Failed to locate <flutter-view>. Possible reasons:\n'
' - The application failed to start'
' - `findElements` was called before the application started'
);
}
// TODO(htoor3): Remove shadowRoot selectors once DOM structure PR is merged.
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);
return flutterView.querySelectorAll(selector);
}
......@@ -43,6 +43,6 @@ void main() {
<dynamic>[],
) as WebElement?;
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