mirror of
https://github.com/Kong/insomnia.git
synced 2026-05-24 08:37:35 -04:00
chore: pdf preview frame regression tests (#9922)
This commit is contained in:
Binary file not shown.
@@ -91,6 +91,25 @@ test('can send requests', async ({ page, insomnia }) => {
|
||||
.toBeVisible();
|
||||
await page.getByTestId('request-pane').getByRole('button', { name: 'Send' }).click();
|
||||
await expect.soft(statusTag).toContainText('200 OK');
|
||||
|
||||
const pdfIframe = page.getByTestId('ResponsePDFView');
|
||||
await expect.soft(pdfIframe).toBeVisible();
|
||||
await expect.soft(pdfIframe).toHaveAttribute('src', /^blob:/);
|
||||
|
||||
// find Electron/Chromium's built-in PDF viewer extension
|
||||
await expect
|
||||
.poll(() => page.frames().some(f => f.url().startsWith('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai')), {
|
||||
timeout: 5000,
|
||||
message: 'Expected Chromium built-in PDF viewer extension frame to mount inside the PDF preview iframe',
|
||||
})
|
||||
.toBe(true);
|
||||
|
||||
await expect.soft(pdfIframe).toHaveScreenshot('dummy-pdf-preview.png', {
|
||||
animations: 'disabled',
|
||||
maxDiffPixelRatio: 0.15, // 15% discrepancy allowed for CI/environment differences
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByRole('tab', { name: 'Console' }).click();
|
||||
await page.locator('pre').filter({ hasText: '< Content-Type: application/pdf' }).click();
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
Reference in New Issue
Block a user