セットアップdetoxエムaplica
10934 ワード
エムSETTERBOは、Anao PassadoをRocketSeat LANを見ます.porは、o o o oチュートリアルqueを好みます.por isso decidir Documento O Passo Passo Passo Para que voc - se consiga de maneira f rel cil , rodar testes e 2 e tanto no android - quinto no - iosボラ?
リポジット・アンド・リオ・コムA APLICA遺言no no github:Code/drops#101
na raizはseu端末を起動します.
デモンストレーションデリポジトリ、adicione oブロッキング
ノヴァとしてのadicioneは、ncias - necessに乗ります
アゴラ、Vamos Criar um Arquivo chamadoデトックステスト.ジャワのseguinte caminho
<井上>
コムデトックス
Coco Vocは、tenha umの問題を構築します.
メニューはXcode Acesseファイルです.
リポジット・アンド・リオ・コムA APLICA遺言no no github:Code/drops#101
Codedrop - tete 2 e アンビエン
na raizはseu端末を起動します.
npm install -g detox-cli
na raiz do seu projeto、insto o detox e o jest como yarn add detox jest -D
アンドロイド
1 . NAパスタアンドロイドビルド。グラグラ
デモンストレーションデリポジトリ、adicione oブロッキング
maven
.allprojects {
repositories {
...
// adicione apenas o bloco maven abaixo
maven {
// Add to detox
url "$rootDir/../node_modules/detox/Detox-android"
}
}
}
2 .パスタパスタアンドロイドアプリ。グラグラ
ノヴァとしてのadicioneは、ncias - necessに乗ります
android {
defaultConfig {
...
// Novas dependencias para rodar os testes.
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
}
mesmo arquivo,adicione:dependencies {
// Novas dependencias para rodar os testes.
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'
}
アンドロイドのセットアップ
アゴラ、Vamos Criar um Arquivo chamadoデトックステスト.ジャワのseguinte caminho
android/app/src/androidTest/java/com/[nome_do_package]/DetoxTest.java
package com.package; // Trocar pelo no do Projeto.
import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DetoxTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
@Test
public void runDetoxTests() {
DetoxConfig detoxConfig = new DetoxConfig();
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
detoxConfig.rnContextLoadTimeoutSec = (com.package.BuildConfig.DEBUG ? 180 : 60);
Detox.runTests(mActivityRule, detoxConfig);
}
}
IOS
<井上>
brew tap wix/brew
brew install applesimutils
セットアップデトックス
コムデトックス
yarn detox init -r jest
アトリザドO Arquivo.デトックスJSON{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"type": "android.emulator",
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"device": {
"avdName": "Pixel_5_API_31" // your avd-name here
}
},
"ios.sim.debug": {
"type": "ios.simulator",
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/yourProject.app",
"build": "xcodebuild -workspace ios/yourProject.xcworkspace -scheme yourProject -sdk iphonesimulator -derivedDataPath ios/Build",
"device": {
"type": "iPhone 11"
}
}
},
}
Gerando Aビルド
No Android:
yarn detox build -c android.emu.debug
No iOS:
yarn detox build -c ios.sim.debug
コムデトックス
No Android:
yarn detox test -c android.emu.debug
No iOS:
yarn detox test -c ios.sim.debug
🚨 Xcode問題🚨
Coco Vocは、tenha umの問題を構築します.
メニューはXcode Acesseファイルです.
Reference
この問題について(セットアップdetoxエムaplica), 我々は、より多くの情報をここで見つけました https://dev.to/devborges/setup-detox-em-aplicacoes-react-native-7mkテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol