facebook / screenshot-tests-for-android

Generate fast deterministic screenshots during Android instrumentation tests
http://facebook.github.io/screenshot-tests-for-android
Apache License 2.0
1.74k stars 229 forks source link

Screenshot record fails because of --> "Accessibility content change on non-UI thread" #311

Open findjigar opened 2 years ago

findjigar commented 2 years ago

Espresso version: 3.5.0-alpha07 Material version: 1.5.0

E/ViewRootImpl: Accessibility content change on non-UI thread. Future Android versions will throw an exception.
    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
        at android.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(ViewRootImpl.java:8882)
        at android.view.ViewRootImpl.postSendWindowContentChangedCallback(ViewRootImpl.java:7928)
        at android.view.ViewRootImpl.notifySubtreeAccessibilityStateChanged(ViewRootImpl.java:8108)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.ViewGroup.notifySubtreeAccessibilityStateChanged(ViewGroup.java:3705)
        at android.view.View.notifyViewAccessibilityStateChangedIfNeeded(View.java:12837)
        at android.view.View.setLabelFor(View.java:9953)
        at com.google.android.material.textfield.TextInputLayout$AccessibilityDelegate.onInitializeAccessibilityNodeInfo(TextInputLayout.java:4458)
        at androidx.core.view.AccessibilityDelegateCompat$AccessibilityDelegateAdapter.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompat.java:87)
        at android.view.View.onInitializeAccessibilityNodeInfo(View.java:8255)
        at com.google.android.material.textfield.TextInputEditText.onInitializeAccessibilityNodeInfo(TextInputEditText.java:194)
        at androidx.core.view.ViewCompat.onInitializeAccessibilityNodeInfo(ViewCompat.java:698)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.createNodeInfoFromView(AccessibilityUtil.java:179)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.createNodeInfoFromView(AccessibilityUtil.java:156)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.access$000(AccessibilityUtil.java:41)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil$AXTreeNode.<init>(AccessibilityUtil.java:602)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:581)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
E/ViewRootImpl:     at com.facebook.testing.screenshot.layouthierarchy.AccessibilityUtil.generateAccessibilityTree(AccessibilityUtil.java:586)
        at com.facebook.testing.screenshot.internal.ScreenshotImpl.record(ScreenshotImpl.java:280)
        at com.facebook.testing.screenshot.internal.RecordBuilderImpl.record(RecordBuilderImpl.java:154)