Skip to content

Commit

Permalink
Merge pull request #5211 from hallieswan/SWC-6556
Browse files Browse the repository at this point in the history
SWC-6556: when file upload fails, include error text in report to support debugging
  • Loading branch information
hallieswan committed Oct 24, 2023
2 parents e2c13ee + 11922d9 commit 58a53ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions e2e/files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ const uploadFile = async (
})

await testAuth.step('ensure there was not an upload error', async () => {
await expect(
page.getByRole('heading', { name: 'Upload Error' }),
).not.toBeVisible()
const uploadError = page.getByRole('heading', { name: 'Upload Error' })
if (await uploadError.isVisible()) {
const uploadErrorText = await page
.getByRole('dialog')
.getByText('Unable to upload the file')
.textContent()
throw new Error(`Upload Error: ${uploadErrorText}`)
}
})
}

Expand Down

0 comments on commit 58a53ed

Please sign in to comment.