Detox-getprops (v0.1.2) is a utility for Detox that enables fetching text and properties from React Native elements on both iOS and Android, overcoming the limitation of Detox's 'getAttributes' which is iOS-only. It uses a hack involving forced test failure messages to extract element properties. The package is stable but simple, with no recent updates. Alternatives include Detox's built-in getAttributes (iOS only) and the future resolution of Detox issue #2083. It is intended for use in Detox E2E test suites.
npm install detox-getpropsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates getting text from a Text element and getting all props from an element, using async/await.
Use only as a temporary workaround until Detox #2083 is resolved.
Use getProps instead for non-<Text> elements.
Do not rely on platform-specific properties in cross-platform tests.
Monitor https://github.com/wix/Detox/issues/2083 and migrate to official solution when available.
Use ES import syntax: import { getText } from 'detox-getprops'.npm install --save-dev detox-getprops
npm install --save-dev detox, and ensure Detox is initialized in test.
Use named import: import { getText } from 'detox-getprops'Update Detox to a supported version or check if the hack still works.