Fix resume upload targeting wrong file input on Ashby

Prefer resume-specific file inputs (#resume, #_systemfield_resume)
over autofill inputs. Skip autofill class inputs in fallback.
Also fix Ashby beforeSubmit to target #_systemfield_resume directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 21:15:16 -08:00
parent 0118254046
commit fa6efc3775
2 changed files with 13 additions and 9 deletions

View File

@@ -15,15 +15,14 @@ export async function apply(page, job, formFiller) {
verifySelector: '#_systemfield_name',
beforeSubmit: async (page, formFiller) => {
if (!formFiller.profile.resume_path) return;
// Ashby wraps resume upload in a custom component — find the actual file input
const fileInput = await page.$('#_systemfield_resume input[type="file"]') ||
await page.$('input[type="file"][name*="resume"]') ||
// #_systemfield_resume IS the file input (not a container)
const fileInput = await page.$('input[type="file"]#_systemfield_resume') ||
await page.$('input[type="file"]');
if (fileInput) {
const hasFile = await fileInput.evaluate(el => !!el.value);
if (!hasFile) {
await fileInput.setInputFiles(formFiller.profile.resume_path).catch(() => {});
await page.waitForTimeout(1500);
await page.waitForTimeout(2000);
}
}
},