Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.webkit.WebView
import android.widget.TextView
import com.wix.detox.espresso.DeviceDisplay
import com.wix.detox.reactnative.ui.getAccessibilityLabel
import com.wix.detox.inquiry.ViewLifecycleRegistry
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.suspendCancellableCoroutine
Expand Down Expand Up @@ -170,6 +171,20 @@ object ViewHierarchyGenerator {
attributes["text"] = view.text.toString()
}

// Inject animation metadata
val animationMetadata = ViewLifecycleRegistry.getAnimationMetadata(view)
if (animationMetadata != null) {
animationMetadata.animated?.let {
attributes["lastAnimated"] = animationMetadata.getAnimationDurationMs()?.toString() ?: "0"
}
animationMetadata.updated?.let {
attributes["lastUpdated"] = animationMetadata.getUpdateDurationMs()?.toString() ?: "0"
}
if (ViewLifecycleRegistry.isAnimating(view)) {
attributes["animating"] = "true"
}
}

val currentTestId = view.tag?.toString() ?: ""

val injectedPrefix = "detox_temp_"
Expand Down
Loading
Loading