mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 16:44:16 +00:00
feat(import): set yml as a default file format across all types of imports (#8363)
* feat(import): set yml as a default file formal accross all type of imports * addressed review comments * addressed review comments * set DEFAULT_COLLECTION_FORMAT as the default for collection format options
This commit is contained in:
@@ -524,6 +524,26 @@ const importCollection = async (
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Open the Bulk Import modal by importing multiple files at once.
|
||||
* Selecting more than one file routes the import flow to the Bulk Import modal
|
||||
* (instead of the single-collection location modal).
|
||||
* @param page - The page object
|
||||
* @param filePaths - Absolute paths of the files to import (must be 2 or more)
|
||||
*/
|
||||
const openBulkImportModal = async (page: Page, filePaths: string[]) => {
|
||||
await test.step('Open the Bulk Import modal', async () => {
|
||||
const locators = buildCommonLocators(page);
|
||||
|
||||
await locators.plusMenu.button().click();
|
||||
await locators.plusMenu.importCollection().click();
|
||||
await expect(locators.import.modal()).toBeVisible();
|
||||
|
||||
await locators.import.fileInput().setInputFiles(filePaths);
|
||||
await expect(locators.import.bulkModal()).toBeVisible();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove a specific collection from the sidebar
|
||||
* @param page - The page object
|
||||
@@ -2220,6 +2240,7 @@ export {
|
||||
deleteRequest,
|
||||
deleteCollectionFromOverview,
|
||||
importCollection,
|
||||
openBulkImportModal,
|
||||
removeCollection,
|
||||
createFolder,
|
||||
openEnvironmentSelector,
|
||||
|
||||
@@ -240,6 +240,10 @@ export const buildCommonLocators = (page: Page) => ({
|
||||
locationModal: () => page.locator('[data-testid="import-collection-location-modal"]'),
|
||||
locationInput: () => page.locator('#collection-location'),
|
||||
fileInput: () => page.locator('input[type="file"]'),
|
||||
bulkModal: () => page.getByTestId('bulk-import-collection-location-modal'),
|
||||
bulkFormatSelect: () => page.getByTestId('bulk-import-collection-location-modal').getByTestId('bulk-import-collection-format-selector'),
|
||||
bulkLocationInput: () => page.getByTestId('bulk-import-collection-location-modal').getByTestId('bulk-import-collection-location-input'),
|
||||
bulkSubmitButton: () => page.getByTestId('bulk-import-collection-location-modal-submit-btn'),
|
||||
envOption: (name: string) => page.locator('.dropdown-item').getByText(name, { exact: true }),
|
||||
parsingError: () => page.getByTestId('import-error-message'),
|
||||
browseLink: (root?: Locator) => (root ?? page).getByTestId('import-collection-browse-link'),
|
||||
|
||||
Reference in New Issue
Block a user