Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: device.generateViewHierarchyXml support WebViews #4585

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
try to replace files
  • Loading branch information
gosha212 committed Sep 18, 2024
commit a162d6f3b39bb7c131ffdbabadfafa6b5fbfc226
52 changes: 52 additions & 0 deletions detox/test/e2e/assets/view-hierarchy-web-view.73.android.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version='1.0' encoding='UTF_8' standalone='yes' ?>
<ViewHierarchy>
<DecorView class="com.android.internal.policy.DecorView" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" x="<number>" y="<number>">
<LinearLayout class="android.widget.LinearLayout" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" x="<number>" y="<number>">
<ViewStub class="android.view.ViewStub" width="<number>" height="<number>" visibility="gone" alpha="1.0" focused="false" id="android:id/action_mode_bar_stub" x="<number>" y="<number>" />
<FrameLayout class="android.widget.FrameLayout" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" x="<number>" y="<number>">
<FitWindowsLinearLayout class="androidx.appcompat.widget.FitWindowsLinearLayout" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="com.wix.detox.test:id/action_bar_root" x="<number>" y="<number>">
<ViewStubCompat class="androidx.appcompat.widget.ViewStubCompat" width="<number>" height="<number>" visibility="gone" alpha="1.0" focused="false" id="com.wix.detox.test:id/action_mode_bar_stub" x="<number>" y="<number>" />
<ContentFrameLayout class="androidx.appcompat.widget.ContentFrameLayout" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="android:id/content" x="<number>" y="<number>">
<ReactRootView class="com.facebook.react.ReactRootView" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW" id="<number>" x="<number>" y="<number>">
<ReactViewGroup class="com.facebook.react.views.view.ReactViewGroup" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 2ND WEBVIEW SHOW 3RD WEBVIEW" id="<number>" x="<number>" y="<number>">
<ReactViewGroup class="com.facebook.react.views.view.ReactViewGroup" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 2ND WEBVIEW" id="<number>" x="<number>" y="<number>" testID="toggle2ndWebviewButton">
<ReactTextView class="com.facebook.react.views.text.ReactTextView" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 2ND WEBVIEW" id="<number>" x="<number>" y="<number>" text="SHOW 2ND WEBVIEW" />
</ReactViewGroup>
<ReactViewGroup class="com.facebook.react.views.view.ReactViewGroup" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 3RD WEBVIEW" id="<number>" x="<number>" y="<number>" testID="toggle3rdWebviewButton">
<ReactTextView class="com.facebook.react.views.text.ReactTextView" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" label="SHOW 3RD WEBVIEW" id="<number>" x="<number>" y="<number>" text="SHOW 3RD WEBVIEW" />
</ReactViewGroup>
</ReactViewGroup>
<ReactViewGroup class="com.facebook.react.views.view.ReactViewGroup" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="<number>" x="<number>" y="<number>">
<RNCWebView class="com.reactnativecommunity.webview.RNCWebViewManager$RNCWebView" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="<number>" x="<number>" y="<number>" testID="webViewFormWithScrolling"><![CDATA["<html xmlns=\"http://www.w3.org/1999/xhtml\">
<body>
<h1 id=\"pageHeadline\" aria-label=\"first-webview\">First Webview</h1>
<h2>Form</h2>
<form>
<label for=\"fname\">Your name:</label><br />
<input type=\"text\" id=\"fname\" name=\"fname\" maxlength=\"10\" /><br />
<input type=\"submit\" id=\"submit\" value=\"Submit\" onclick=\"document.getElementById('resultFname').innerHTML = document.getElementById('fname').value; return false;\" />
</form>

<h2>Form Results</h2>
<p>Your first name is: <span id=\"resultFname\">No input yet</span></p>

<h2>Content Editable</h2>
<div id=\"contentEditable\" class=\"contentEditable\" contenteditable=\"true\">Name: </div>

<h2>Text and link</h2>
<p>Some text and a <a id=\"w3link\" href=\"https://www.w3schools.com\">link</a>.</p>
<p id=\"bottomParagraph\" class=\"specialParagraph\">This is a bottom paragraph with class.</p>


</body></html>"]]>
</RNCWebView>
</ReactViewGroup>
</ReactRootView>
</ContentFrameLayout>
</FitWindowsLinearLayout>
</FrameLayout>
</LinearLayout>
<View class="android.view.View" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="android:id/navigationBarBackground" x="<number>" y="<number>" />
<View class="android.view.View" width="<number>" height="<number>" visibility="visible" alpha="1.0" focused="false" id="android:id/statusBarBackground" x="<number>" y="<number>" />
</DecorView>
</ViewHierarchy>