mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { test, expect } from '../../../playwright';
|
|
import * as path from 'path';
|
|
|
|
test.describe('Import Insomnia Collection v4', () => {
|
|
const testDataDir = path.join(__dirname, '../test-data');
|
|
|
|
test('Import Insomnia Collection v4 successfully', async ({ page }) => {
|
|
const insomniaFile = path.join(testDataDir, 'insomnia-v4.json');
|
|
|
|
await page.getByRole('button', { name: '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);
|
|
|
|
// Wait for the loader to disappear
|
|
await page.locator('#import-collection-loader').waitFor({ state: 'hidden' });
|
|
|
|
// Verify that the Import Collection modal is displayed (for location selection)
|
|
const locationModal = page.getByRole('dialog');
|
|
await expect(locationModal.locator('.bruno-modal-header-title')).toContainText('Import Collection');
|
|
|
|
// Wait for collection to appear in the location modal
|
|
await expect(locationModal.getByText('Test API Collection v4')).toBeVisible();
|
|
|
|
// Cleanup: close any open modals
|
|
await page.locator('[data-test-id="modal-close-button"]').click();
|
|
});
|
|
});
|