diff --git a/eslint.config.mjs b/eslint.config.mjs index 772e5011cd..013f581d47 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -41,6 +41,7 @@ export default tseslint.config( rules: { 'no-unused-vars': 'off', // we have @typescript-eslint/no-unused-vars enabled below 'no-else-return': 'error', + 'preserve-caught-error': 'off', '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-explicit-any': 'off', diff --git a/github/actions/generate-publish-test-report/action.yml b/github/actions/generate-publish-test-report/action.yml index f23f1379b5..05bed59dec 100644 --- a/github/actions/generate-publish-test-report/action.yml +++ b/github/actions/generate-publish-test-report/action.yml @@ -22,7 +22,7 @@ runs: - name: Generate Allure report shell: bash run: | - npx ts-node run/test/specs/utils/allure/closeRun.ts + npx ts-node run/test/utils/allure/closeRun.ts env: PLATFORM: ${{ inputs.PLATFORM }} BUILD_NUMBER: ${{ inputs.BUILD_NUMBER }} @@ -37,7 +37,7 @@ runs: id: publish shell: bash run: | - npx ts-node run/test/specs/utils/allure/publishReport.ts + npx ts-node run/test/utils/allure/publishReport.ts env: PLATFORM: ${{ inputs.PLATFORM }} BUILD_NUMBER: ${{ inputs.BUILD_NUMBER }} diff --git a/run/types/DeviceWrapper.ts b/run/types/DeviceWrapper.ts index c806b7c96c..7c9f0fca26 100644 --- a/run/types/DeviceWrapper.ts +++ b/run/types/DeviceWrapper.ts @@ -1070,7 +1070,10 @@ export class DeviceWrapper { ); // Load the reference image buffer from disk - const referencePath = path.join('run', 'test', 'specs', 'media', referenceImageName); + const referencePath = path.join('run', 'test', 'media', referenceImageName); + await fs.access(referencePath).catch(() => { + throw new Error(`Reference image not found: ${referencePath}`); + }); const referenceBuffer = await fs.readFile(referencePath); let bestMatch: { @@ -1861,7 +1864,10 @@ export class DeviceWrapper { public async pushMediaToDevice( mediaFileName: 'profile_picture.jpg' | 'test_file.pdf' | 'test_image.jpg' | 'test_video.mp4' ) { - const filePath = path.join('run', 'test', 'specs', 'media', mediaFileName); + const filePath = path.join('run', 'test', 'media', mediaFileName); + await fs.access(filePath).catch(() => { + throw new Error(`Media file not found: ${filePath}`); + }); if (this.isIOS()) { // Push file to simulator await runScriptAndLog(`xcrun simctl addmedia ${this.udid} ${filePath}`, true); diff --git a/scripts/create_ios_simulators.ts b/scripts/create_ios_simulators.ts index 5073b2323f..79a008534d 100644 --- a/scripts/create_ios_simulators.ts +++ b/scripts/create_ios_simulators.ts @@ -42,7 +42,7 @@ const DEVICE_CONFIG = { runtime: 'com.apple.CoreSimulator.SimRuntime.iOS-26-2', // xcrun simctl list runtimes }; -const MEDIA_ROOT = path.join('run', 'test', 'specs', 'media'); +const MEDIA_ROOT = path.join('run', 'test', 'media'); const MEDIA_FILES = { images: ['profile_picture.jpg', 'test_image.jpg'], videos: ['test_video.mp4'],