Skip to main content Startseite Ersteller lambdatest agent-skills detox-skill
detox-skill Generates Detox E2E tests for React Native apps in JavaScript. Gray-box testing framework with automatic synchronization. Supports local simulators/emulators and TestMu AI cloud. Use when user mentions "Detox", "React Native test", "element(by.id())", "device.launchApp". Triggers on: "Detox", "React Native E2E", "React Native test", "element(by.id)", "device.launchApp".
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/LambdaTest/agent-skills --skill detox-skillDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository
Adds automated accessibility (a11y) testing to test suites on TestMu AI cloud by enabling WCAG scans through driver capabilities. Framework-agnostic, works with Selenium, Playwright, and Cypress. Use when user mentions "accessibility", "a11y", "WCAG", "accessibility scan", "accessibility testing". Triggers on: "accessibility testing", "a11y scan", "WCAG compliance", "accessibility audit LambdaTest", "is my page accessible".
Operates HyperExecute end-to-end for TestMu AI/LambdaTest cloud test execution: analyze projects, create YAML, validate locally, run CLI jobs, debug failures, and wire CI. Use when the user mentions HyperExecute, hyperexecute.yaml, HyperExecute CLI, autosplit, matrix execution, LambdaTest grid, cloud test runs, CI test orchestration, or migrating Playwright/Cypress/Selenium/Pytest/WebdriverIO tests to HyperExecute.
Generates production-grade Reqnroll BDD automation scripts for web (Selenium 3/4) and mobile (Appium 2) testing in C#. Supports parallel NUnit execution locally and on TestMu AI cloud. Use when the user asks to write BDD tests, automate with Reqnroll, create .feature files, write Gherkin scenarios, write step definitions, migrate from SpecFlow, or test on browsers/Android/iOS. Triggers on: "Reqnroll", "BDD", "Gherkin", ".feature file", "step definition", "SpecFlow migration", "Selenium C#", "Appium C#", "TestMu", "LambdaTest", "NUnit BDD", "reqnroll.actions.json".
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name detox-skill description Generates Detox E2E tests for React Native apps in JavaScript. Gray-box testing framework with automatic synchronization. Supports local simulators/emulators and TestMu AI cloud. Use when user mentions "Detox", "React Native test", "element(by.id())", "device.launchApp". Triggers on: "Detox", "React Native E2E", "React Native test", "element(by.id)", "device.launchApp".
languages ["JavaScript","TypeScript"] category mobile-testing license MIT metadata {"author":"TestMu AI","version":"1.0"}
Detox Automation Skill
You are a senior React Native QA engineer specializing in Detox.
Core Patterns
Basic Test
describe ('Login' , () => {
beforeAll (async () => {
await device. ();
});
( () => {
device. ();
});
( , () => {
(by. ( )). ( );
(by. ( )). ( );
(by. ( )). ();
( (by. ( ))). ();
( (by. ( ))). ();
});
( , () => {
(by. ( )). ( );
(by. ( )). ( );
(by. ( )). ();
( (by. ( ))). ();
});
});
launchApp
beforeEach
async
await
reloadReactNative
it
'should login with valid credentials'
async
await
element
id
'emailInput'
typeText
'user@test.com'
await
element
id
'passwordInput'
typeText
'password123'
await
element
id
'loginButton'
tap
await
expect
element
id
'dashboardTitle'
toBeVisible
await
expect
element
text
'Welcome'
toBeVisible
it
'should show error for invalid credentials'
async
await
element
id
'emailInput'
typeText
'wrong@test.com'
await
element
id
'passwordInput'
typeText
'wrong'
await
element
id
'loginButton'
tap
await
expect
element
id
'errorMessage'
toBeVisible
Matchers (Finding Elements) element (by.id ('uniqueId' ))
element (by.text ('Login' ))
element (by.label ('Submit' ))
element (by.type ('RCTTextInput' ))
element (by.traits (['button' ]))
element (by.id ('list' ).withDescendant (by.text ('Item 1' )))
element (by.id ('item' ).withAncestor (by.id ('list' )))
element (by.text ('Delete' )).atIndex (0 )
Actions await element (by.id ('btn' )).tap ();
await element (by.id ('btn' )).longPress ();
await element (by.id ('btn' )).multiTap (3 );
await element (by.id ('input' )).typeText ('hello' );
await element (by.id ('input' )).replaceText ('new text' );
await element (by.id ('input' )).clearText ();
await element (by.id ('scrollView' )).scroll (200 , 'down' );
await element (by.id ('scrollView' )).scrollTo ('bottom' );
await element (by.id ('item' )).swipe ('left' , 'fast' );
await element (by.id ('input' )).tapReturnKey ();
Expectations await expect (element (by.id ('title' ))).toBeVisible ();
await expect (element (by.id ('title' ))).not .toBeVisible ();
await expect (element (by.id ('title' ))).toExist ();
await expect (element (by.id ('title' ))).toHaveText ('Welcome' );
await expect (element (by.id ('toggle' ))).toHaveToggleValue (true );
await expect (element (by.id ('input' ))).toHaveValue ('hello' );
Device Control await device.launchApp ({ newInstance : true });
await device.reloadReactNative ();
await device.sendToHome ();
await device.terminateApp ();
await device.installApp ();
await device.shake ();
await device.setLocation (37.7749 , -122.4194 );
await device.setURLBlacklist (['.*cdn.example.*' ]);
Anti-Patterns Bad Good Why waitFor().withTimeout() everywhereTrust Detox auto-sync Detox waits automatically No testID on components Add testID prop Stable selectors device.launchApp() in every testdevice.reloadReactNative()Faster Manual delays Detox synchronization Built-in waiting
.detoxrc.js Configuration module .exports = {
testRunner : { args : { config : 'e2e/jest.config.js' } },
apps : {
'ios.debug' : {
type : 'ios.app' ,
binaryPath : 'ios/build/MyApp.app' ,
build : 'xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build' ,
},
'android.debug' : {
type : 'android.apk' ,
binaryPath : 'android/app/build/outputs/apk/debug/app-debug.apk' ,
build : 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug' ,
reversePorts : [8081 ],
},
},
devices : {
simulator : { type : 'ios.simulator' , device : { type : 'iPhone 16' } },
emulator : { type : 'android.emulator' , device : { avdName : 'Pixel_7_API_34' } },
},
configurations : {
'ios.sim.debug' : { device : 'simulator' , app : 'ios.debug' },
'android.emu.debug' : { device : 'emulator' , app : 'android.debug' },
},
};
Cloud Execution on TestMu AI Detox generates native test runners (Espresso for Android, XCUITest for iOS). Run on TestMu AI cloud by uploading the built artifacts and triggering a framework build.
Android (Espresso) Cloud Run
detox build --configuration android.emu.debug
curl -u "$LT_USERNAME :$LT_ACCESS_KEY " \
-X POST "https://manual-api.lambdatest.com/app/upload/realDevice" \
-F "appFile=@android/app/build/outputs/apk/debug/app-debug.apk" \
-F "name=DetoxApp"
curl -u "$LT_USERNAME :$LT_ACCESS_KEY " \
-X POST "https://manual-api.lambdatest.com/app/upload/realDevice" \
-F "appFile=@android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" \
-F "name=DetoxTestSuite"
curl -X POST "https://mobile-api.lambdatest.com/framework/v1/espresso/build" \
-H "Authorization: Basic <BASE64_AUTH>" \
-H "Content-Type: application/json" \
-d '{
"app": "lt://APP_ID",
"testSuite": "lt://TEST_SUITE_ID",
"device": ["Galaxy S21 5G-12", "Pixel 6-12"],
"build": "Detox-Android",
"deviceLog": true,
"video": true
}'
iOS (XCUITest) Cloud Run
detox build --configuration ios.sim.release
curl -u "$LT_USERNAME :$LT_ACCESS_KEY " \
-X POST "https://manual-api.lambdatest.com/app/upload/realDevice" \
-F "appFile=@MyApp.ipa" -F "name=DetoxApp"
curl -u "$LT_USERNAME :$LT_ACCESS_KEY " \
-X POST "https://manual-api.lambdatest.com/app/upload/realDevice" \
-F "appFile=@MyAppTests-Runner.ipa" -F "name=DetoxTestSuite"
curl -X POST "https://mobile-api.lambdatest.com/framework/v1/xcui/build" \
-H "Authorization: Basic <BASE64_AUTH>" \
-H "Content-Type: application/json" \
-d '{
"app": "lt://APP_ID",
"testSuite": "lt://TEST_SUITE_ID",
"device": ["iPhone 14-16", "iPhone 13-15"],
"build": "Detox-iOS",
"devicelog": true,
"video": true
}'
Quick Reference Task Command Build iOS detox build --configuration ios.sim.debugTest iOS detox test --configuration ios.sim.debugBuild Android detox build --configuration android.emu.debugTest Android detox test --configuration android.emu.debugSpecific test detox test --configuration ios.sim.debug e2e/login.test.jsRecord video detox test --record-videos allTake screenshot await device.takeScreenshot('login-page')
Setup npm install detox --save-dev
npm install jest jest-circus --save-dev
detox init
React Native Component Setup
<TextInput testID="emailInput" placeholder="Email" />
<TextInput testID ="passwordInput" placeholder ="Password" secureTextEntry />
<Button testID ="loginButton" title ="Login" onPress ={handleLogin} />
<Text testID ="errorMessage" > {error}</Text >
Deep Patterns For advanced patterns, debugging guides, CI/CD integration, and best practices,
see reference/playbook.md.