From bf0cc09351db8c465c2648d68df5fa2bb43f9938 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Fri, 24 Oct 2025 12:09:01 +0200 Subject: [PATCH] fix: add wait for upload input before setInputFiles --- package.json | 2 +- tests/e2e/support/objects/app-files/resource/actions.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7b352ecbe1..313c3d940b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test:e2e:cucumber:webkit": "BROWSER=webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}", "test:e2e:mobile-parallel": "bash -c 'FORCE_COLOR=1 pnpm run test:e2e:mobile-chromium > mobile-chromium.log 2>&1 & pid1=$!; FORCE_COLOR=1 pnpm run test:e2e:mobile-webkit > mobile-webkit.log 2>&1 & pid2=$!; FORCE_COLOR=1 pnpm run test:e2e:ipad-chromium > ipad-chromium.log 2>&1 & pid3=$!; FORCE_COLOR=1 pnpm run test:e2e:ipad-safari > ipad-safari.log 2>&1 & pid4=$!; wait $pid1; ec1=$?; wait $pid2; ec2=$?; wait $pid3; ec3=$?; wait $pid4; ec4=$?; echo \"=== LOG FILES ===\"; for log in *.log; do echo \"--- $log ---\"; cat $log; echo; done; echo \"=== RESULTS ===\"; echo \"Mobile Chromium: $([ $ec1 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"Mobile WebKit: $([ $ec2 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"iPad Chromium: $([ $ec3 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"iPad Safari: $([ $ec4 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; if [ $ec1 -ne 0 ] || [ $ec2 -ne 0 ] || [ $ec3 -ne 0 ] || [ $ec4 -ne 0 ]; then exit 1; fi'", "test:e2e:mobile-chromium": "BROWSER=mobile-chromium NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view", - "test:e2e:mobile-webkit": "BROWSER=mobile-webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view", + "test:e2e:mobile-webkit": "FAIL_ON_UNCAUGHT_CONSOLE_ERR=false BROWSER=mobile-webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view", "test:e2e:ipad-chromium": "BROWSER=ipad-chromium NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view", "test:e2e:ipad-safari": "BROWSER=ipad-landscape-webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view", "test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest --config ./tests/unit/config/vitest.config.ts", diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 5de23a1b42..13ae1797f2 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -599,8 +599,11 @@ const performUpload = async (args: uploadResourceArgs): Promise => { } await page.locator(resourceUploadButton).click() + const inputSelector = type === 'folder' ? folderUploadInput : fileUploadInput + await page.locator(inputSelector).waitFor({ state: 'visible' }) + let uploadAction: Promise = page - .locator(type === 'folder' ? folderUploadInput : fileUploadInput) + .locator(inputSelector) .setInputFiles(resources.map((file) => file.path)) if (option) {