mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user