init: workspaces (#6264)

* init: workspaces
This commit is contained in:
naman-bruno
2025-12-04 04:56:43 +05:30
committed by GitHub
parent 6786f19d04
commit ebe0203415
108 changed files with 7315 additions and 908 deletions

View File

@@ -18,11 +18,15 @@ test.describe('Code Generation URL Encoding', () => {
page,
createTmpDir
}) => {
await page.locator('.dropdown-icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'Create Collection' }).click();
// Use plus icon button in new workspace UI
await page.locator('.plus-icon-button').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click();
await page.getByLabel('Name').fill('unencoded-test-collection');
await page.getByLabel('Location').fill(await createTmpDir('unencoded-test-collection'));
await page.getByRole('button', { name: 'Create', exact: true }).click();
const locationInput = page.getByLabel('Location');
if (await locationInput.isVisible()) {
await locationInput.fill(await createTmpDir('unencoded-test-collection'));
}
await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click();
await expect(page.locator('#sidebar-collection-name').filter({ hasText: 'unencoded-test-collection' })).toBeVisible();
await page.locator('#sidebar-collection-name').filter({ hasText: 'unencoded-test-collection' }).click();
@@ -60,11 +64,15 @@ test.describe('Code Generation URL Encoding', () => {
page,
createTmpDir
}) => {
await page.locator('.dropdown-icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'Create Collection' }).click();
// Use plus icon button in new workspace UI
await page.locator('.plus-icon-button').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click();
await page.getByLabel('Name').fill('encoded-test-collection');
await page.getByLabel('Location').fill(await createTmpDir('encoded-test-collection'));
await page.getByRole('button', { name: 'Create', exact: true }).click();
const locationInput = page.getByLabel('Location');
if (await locationInput.isVisible()) {
await locationInput.fill(await createTmpDir('encoded-test-collection'));
}
await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click();
await expect(page.locator('#sidebar-collection-name').filter({ hasText: 'encoded-test-collection' })).toBeVisible();
await page.locator('#sidebar-collection-name').filter({ hasText: 'encoded-test-collection' }).click();

View File

@@ -10,20 +10,20 @@ test('should persist request with newlines across app restarts', async ({ create
const app1 = await launchElectronApp({ userDataPath });
const page = await app1.firstWindow();
await page.locator('.dropdown-icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'Create Collection' }).click();
await page.getByLabel('Name').fill('newlines-persistence');
await page.getByLabel('Location').fill(collectionPath);
await page.getByRole('button', { name: 'Create', exact: true }).click();
await page.locator('.plus-icon-button').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click();
await page.locator('.bruno-modal').getByLabel('Name').fill('newlines-persistence');
await page.locator('.bruno-modal').getByLabel('Location').fill(collectionPath);
await page.locator('.bruno-modal').getByRole('button', { name: 'Create' }).click();
const collection = page.locator('.collection-name').filter({ hasText: 'newlines-persistence' });
const collection = page.getByTestId('collections').locator('.collection-name').filter({ hasText: 'newlines-persistence' });
await collection.locator('.collection-actions').hover();
await collection.locator('.collection-actions .icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'New Request' }).click();
await page.getByPlaceholder('Request Name').fill('persistence-test');
await page.locator('#new-request-url').locator('.CodeMirror').click();
await page.locator('#new-request-url').locator('textarea').fill('https://httpbin.org/get');
await page.getByRole('button', { name: 'Create', exact: true }).click();
await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click();
await openCollectionAndAcceptSandbox(page, 'newlines-persistence', 'safe');
await page.locator('.collection-item-name').filter({ hasText: 'persistence-test' }).dblclick();
@@ -60,7 +60,7 @@ test('should persist request with newlines across app restarts', async ({ create
const app2 = await launchElectronApp({ userDataPath });
const page2 = await app2.firstWindow();
await page2.locator('.collection-name').filter({ hasText: 'newlines-persistence' }).click();
await page2.getByTestId('collections').locator('.collection-name').filter({ hasText: 'newlines-persistence' }).click();
await page2.locator('.collection-item-name').filter({ hasText: 'persistence-test' }).dblclick();
// Verify params persisted

View File

@@ -9,11 +9,14 @@ const isRequestSaved = async (saveButton: Locator) => {
};
const setup = async (page: Page, createTmpDir: (tag?: string | undefined) => Promise<string>) => {
await page.locator('.dropdown-icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'Create Collection' }).click();
await page.locator('.plus-icon-button').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click();
await page.getByLabel('Name').fill('source-collection');
await page.getByLabel('Location').fill(await createTmpDir('source-collection'));
await page.getByRole('button', { name: 'Create', exact: true }).click();
const locationInput = page.getByLabel('Location');
if (await locationInput.isVisible()) {
await locationInput.fill(await createTmpDir('source-collection'));
}
await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click();
await expect(page.locator('#sidebar-collection-name').filter({ hasText: 'source-collection' })).toBeVisible();
await page.locator('#sidebar-collection-name').filter({ hasText: 'source-collection' }).click();
await page.getByLabel('Safe Mode').check();

View File

@@ -2,7 +2,7 @@ import { test, expect } from '../../../../playwright';
test.describe('Custom Search Functionality in Scripts Tab', () => {
test('should open search box when Cmd+F or Ctrl+F is pressed in scripts tab', async ({ pageWithUserData: page }) => {
await page.getByTitle('custom-search').click();
await page.getByTestId('collections').locator('#sidebar-collection-name').filter({ hasText: 'custom-search' }).click();
await page.getByText('search-test-request').click();
@@ -62,7 +62,7 @@ test.describe('Custom Search Functionality in Scripts Tab', () => {
});
test('should handle search in different script editors independently', async ({ pageWithUserData: page }) => {
await page.getByTitle('custom-search').click();
await page.getByTestId('collections').locator('#sidebar-collection-name').filter({ hasText: 'custom-search' }).click();
await page.getByText('search-test-request').click();
@@ -96,7 +96,7 @@ test.describe('Custom Search Functionality in Scripts Tab', () => {
});
test('should maintain search state when switching between tabs', async ({ pageWithUserData: page }) => {
await page.getByTitle('custom-search').click();
await page.getByTestId('collections').locator('#sidebar-collection-name').filter({ hasText: 'custom-search' }).click();
await page.getByText('search-test-request').click();