From 2ac80f2ff0700ce671b8d0768c3c975b7c512bdf Mon Sep 17 00:00:00 2001 From: Guillaume Egret Date: Mon, 7 Aug 2023 14:17:18 +0200 Subject: [PATCH] feat(CI): use bam version of maestro --- .github/workflows/ios_e2e.sh | 13 +++++++++++-- packages/ios-poc/src/launchIOS.ts | 17 +++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ios_e2e.sh b/.github/workflows/ios_e2e.sh index 5ebc0dda..a74bd1ad 100755 --- a/.github/workflows/ios_e2e.sh +++ b/.github/workflows/ios_e2e.sh @@ -1,10 +1,17 @@ #!/bin/bash -curl -Ls "https://get.maestro.mobile.dev" | bash -export PATH="$PATH":"$HOME/.maestro/bin" brew tap facebook/fb brew install facebook/fb/idb-companion +git clone https://github.com/bamlab/maestro.git +cd maestro +git checkout feat/prevent-driver-uninstall-ios +git submodule update --init +./gradlew distZip && unzip -o maestro-cli/build/distributions/maestro.zip -d dist +cd .. + +export PATH=$PATH:$(pwd)/maestro/dist/maestro/bin + yarn tsc --build && yarn workspace @perf-profiler/web-reporter build npx link-lerna-package-binaries @@ -22,6 +29,8 @@ echo $UDID # Install the app xcrun simctl install $UDID ./.github/workflows/fakeStore.app +(maestro initDriver && sleep 50) || maestro initDriver + # Launch the app # xcrun simctl launch $UDID $APPID diff --git a/packages/ios-poc/src/launchIOS.ts b/packages/ios-poc/src/launchIOS.ts index 5b360ac0..8d1ccb27 100644 --- a/packages/ios-poc/src/launchIOS.ts +++ b/packages/ios-poc/src/launchIOS.ts @@ -80,21 +80,14 @@ const launchTest = async ({ - launchApp ` ); - try { - execSync(`maestro test ${lauchAppFile} --no-ansi`, { - stdio: "inherit", - }); - } catch (e) { - console.log("Error while launching app: ", e); - execSync(`maestro test ${lauchAppFile} --no-ansi`, { - stdio: "inherit", - }); - } + execSync(`maestro test ${lauchAppFile} --no-ansi --skipDriverSetup`, { + stdio: "inherit", + }); const recordingPromise = startRecord(simulatorId, traceFile); execSync(`sleep 2`, { stdio: "inherit", }); - execSync(`${testCommand} --no-ansi`, { + execSync(`${testCommand} --no-ansi --skipDriverSetup`, { stdio: "inherit", }); const stopAppFile = writeTmpFile( @@ -104,7 +97,7 @@ const launchTest = async ({ - stopApp ` ); - execSync(`maestro test ${stopAppFile} --no-ansi`, { + execSync(`maestro test ${stopAppFile} --no-ansi --skipDriverSetup`, { stdio: "inherit", }); try {