Skip to content

Commit

Permalink
Merge pull request #1865 from oasisprotocol/lw/e2e-fatal-recover
Browse files Browse the repository at this point in the history
E2E test recovering from fatal errors in extension
  • Loading branch information
lukaw3d authored Apr 2, 2024
2 parents ddb89e1 + 8c53fd8 commit d091cdc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/1865.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
E2E test recovering from fatal errors in extension
38 changes: 38 additions & 0 deletions playwright/tests/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,42 @@ test.describe('The extension popup should load', () => {
await page.frameLocator('iframe')!.getByText('Buy now').click()
await expect(page.frameLocator('iframe')!.getByText('Please Enter Your Email')).toBeVisible()
})

test('recover from fatal errors', async ({ extensionPopupURL, context }) => {
{
const page = await context.newPage()
await page.goto(`${extensionPopupURL}/e2e`)
await page.getByRole('button', { name: 'Trigger fatal saga error' }).click()
await expect(page.getByTestId('fatalerror-stacktrace')).toBeVisible()
await page.close()
}

{
// Gets stuck on error despite reloading or reopening the popup
const page = await context.newPage()
await page.goto(`${extensionPopupURL}/`)
await expect(page.getByTestId('fatalerror-stacktrace')).toBeVisible()
await page.reload()
await expect(page.getByTestId('fatalerror-stacktrace')).toBeVisible()
await page.close()
}

{
// Gets unstuck with a button
const page = await context.newPage()
await page.goto(`${extensionPopupURL}/`)
await page.getByRole('button', { name: 'Reload extension' }).click()
await page.close()
}

{
const page = await context.newPage()
await page.waitForTimeout(1000)
await page.goto(`${extensionPopupURL}/`)
await expect(page.getByTestId('fatalerror-stacktrace')).toBeHidden()
await page.reload()
await expect(page.getByTestId('fatalerror-stacktrace')).toBeHidden()
await page.close()
}
})
})

0 comments on commit d091cdc

Please sign in to comment.