diff --git a/.github/workflows/functional-test.yml b/.github/workflows/functional-test.yml index e188842..4839f9b 100644 --- a/.github/workflows/functional-test.yml +++ b/.github/workflows/functional-test.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: include: - - os: macos-13 + - os: macos-14 xcode: '15.2' ios: '17.2' device: iPhone 15 @@ -20,6 +20,8 @@ jobs: PLATFORM_VERSION: ${{ matrix.ios }} XCODE_VERSION: ${{ matrix.xcode }} DEVICE_NAME: ${{ matrix.device }} + _LOG_TIMESTAMP: 1 + _FORCE_LOGS: 1 CI: true steps: - uses: actions/checkout@v3 @@ -39,6 +41,4 @@ jobs: xcrun simctl bootstatus $udid -b xcrun simctl openurl $udid "https://google.com" & - run: npm install - - run: | - export PATH="${PATH}:$(python -c 'import site; print(site.USER_BASE)')/bin" - _FORCE_LOGS=1 npm run e2e-test + - run: npm run e2e-test diff --git a/test/functional/safari-e2e-specs.js b/test/functional/safari-e2e-specs.js index a82c88d..6984338 100644 --- a/test/functional/safari-e2e-specs.js +++ b/test/functional/safari-e2e-specs.js @@ -32,7 +32,7 @@ async function deleteDeviceWithRetry (udid) { } describe('Safari remote debugger', function () { - this.timeout(480000); + this.timeout(610000); this.retries(2); let chai; @@ -42,6 +42,8 @@ describe('Safari remote debugger', function () { /** @type {string} */ let address; before(async function () { + const portPromise = startHttpServer(); + chai = await import('chai'); const chaiAsPromised = await import('chai-as-promised'); chai.should(); @@ -53,20 +55,10 @@ describe('Safari remote debugger', function () { sim = await getSimulator(udid); simCreated = true; } - // on certain system, particularly Xcode 11 on Travis, starting the sim fails - await retry(4, async function () { - try { - await sim.run({ - startupTimeout: 60000, - }); - } catch (err) { - await sim.shutdown(); - throw err; - } + await sim.run({ + startupTimeout: process.env.CI ? 600000 : 120000, }); - - const port = await startHttpServer(); - address = `http://localhost:${port}`; + address = `http://localhost:${await portPromise}`; }); after(async function () { await sim.shutdown(); @@ -92,12 +84,15 @@ describe('Safari remote debugger', function () { logAllCommunicationHexDump: false, }, false); - await sim.openUrl(address); - - await rd.connect(process.env.CI ? 180000 : 5000); - if (_.isEmpty(rd.appDict)) { - throw new Error('The remote debugger did not return any connected applications'); - } + const maxRetries = process.env.CI ? 10 : 2; + await retry(maxRetries, async () => await sim.openUrl(address)); + await retry(maxRetries, async () => { + await rd.connect(60000); + if (_.isEmpty(rd.appDict)) { + await rd.disconnect(); + throw new Error('The remote debugger did not return any connected applications'); + } + }); }); afterEach(async function () { await rd?.disconnect();