Find a way for the EG tests to access the webviews owned by NativeContentViews |
|||||
Issue descriptionContext: I want to check using Earl Grey that an offline page (which contains distilled content from the Reading List) has specific content. Earl Grey usually finds the webview by asking the CRWWebController for its webview_. In the case of offline pages, the CRWWebController doesn't have any webview_ (which would have been initialized in loadCurrentURLInWebView). Instead, the CRWWebController has a nativeController, (aka nativeContent, in this case a OfflinePageNativeContent) which is initialized in loadCurrentURLInNativeView.
,
Mar 7 2017
Note that Native content will be deprecated. Adding a temporary access to nativeContent may be acceptable in these conditions.
,
Mar 7 2017
I don't think that EG asks CRWWebController for its webview_. But we can add API like StaticHtmlNativeContentContainingText.
,
Mar 7 2017
My wording was indeed incorrect. What I meant to say was that EG ends up calling CRWWebController's executeJavaScript, which itself uses |webview_|. Could we modify CRWWebController's executeJavaScript so that if its |webview_| is nil, it tries to execute JS with the nativeController?
,
Mar 7 2017
>>> Could we modify CRWWebController's executeJavaScript so that if its |webview_| is nil, it tries to execute JS with the nativeController? This can break many things and given that we want to deprecate NativeContent for the new architecture, I would choose not to risk :)
,
Mar 7 2017
Where would you imagine adding StaticHtmlNativeContentContainingText? And what do you think about adding a EG helper that simply searches for a WKWebview the view hierarchy?
,
Mar 7 2017
>>> Where would you imagine adding StaticHtmlNativeContentContainingText? I was thinking about chrome_macthers.h/m, which turns out already has StaticHtmlViewContainingText metcher. Does existing method work for you? >>> And what do you think about adding a EG helper that simply searches for a WKWebview the view hierarchy? I would be strongly against that :). We spend many months rewriting KIF tests during UIWebView -> WKWebView transitioning, because KIF tests used UIWebView directly. EG tests should not operate on low-level concepts like WKWebView.
,
Jun 22 2018
jif@ is no longer on the team. Releasing his bugs for triage.
,
Jun 27 2018
eugenebut@ do you think we can close this?
,
Jun 28 2018
I think that -[ChromeEarlGrey waitForStaticHTMLViewContainingText] addresses the issue. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by olivierrobin@chromium.org
, Mar 7 2017