Files
bruno/tests/import/insomnia/invalid-missing-collection.spec.ts
Abhishek S Lal 0197ae37c8 refactor: update AppTitleBar and SidebarHeader components (#6341)
* refactor: update AppTitleBar and SidebarHeader components to use MenuDropdown and ActionIcon for improved UI consistency

* refactor: update button locators in tests to use data-testid for consistency and improved readability
2025-12-08 22:06:24 +05:30

25 lines
1.1 KiB
TypeScript

import { test, expect } from '../../../playwright';
import * as path from 'path';
test.describe('Invalid Insomnia Collection - Missing Collection Array', () => {
test('Handle Insomnia v5 collection missing collection array', async ({ page }) => {
const insomniaFile = path.resolve(__dirname, 'fixtures', 'insomnia-v5-invalid-missing-collection.yaml');
await page.getByTestId('collections-header-add-menu').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Import collection' }).click();
// Wait for import collection modal to be ready
const importModal = page.getByRole('dialog');
await importModal.waitFor({ state: 'visible' });
await expect(importModal.locator('.bruno-modal-header-title')).toContainText('Import Collection');
await page.setInputFiles('input[type="file"]', insomniaFile);
const errorLocator = page.getByText('Unsupported collection format').first();
await expect(errorLocator).toBeVisible({ timeout: 10000 });
// Cleanup: close any open modals
await page.getByTestId('modal-close-button').click();
});
});