From 742bf90dec2456153ec0a90d5150a4c4ec4cb07b Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Mon, 5 Aug 2024 13:48:29 +0200 Subject: [PATCH] Preboot simulator --- .github/workflows/functional-test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index 90bacdc9a..cf951a0ad 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -34,15 +34,15 @@ jobs: mkdir -p ./Resources/WebDriverAgent.bundle name: Install dev dependencies - - uses: futureware-tech/simulator-action@v3 - with: - model: ${{matrix.test_targets.IOS_MODEL}} - os: iOS - os_version: ${{matrix.test_targets.IOS_VERSION}} - erase_before_boot: true - # to prevent unexpected shutdown failure error - shutdown_after_job: false - name: Preboot Simulator + - name: Prepare iOS simulator + env: + DEVICE_NAME: ${{matrix.test_targets.IOS_MODEL}} + PLATFORM_VERSION: ${{matrix.test_targets.IOS_VERSION}} + run: | + open -Fn "$(xcode-select -p)/Applications/Simulator.app" + udid=$(xcrun simctl list devices available -j | \ + node -p "Object.entries(JSON.parse(fs.readFileSync(0)).devices).filter((x) => x[0].includes('$PLATFORM_VERSION'.replace('.', '-'))).reduce((acc, x) => [...acc, ...x[1]], []).find(({name}) => name === '$DEVICE_NAME').udid") + xcrun simctl bootstatus $udid -b - run: npm run e2e-test name: Run functional tests