feat: add copy and paste functionality for requests (#5907)

This commit is contained in:
Pooja
2025-10-29 17:24:09 +05:30
committed by GitHub
parent 6e8cd55b76
commit cc7f1ea58f
11 changed files with 278 additions and 19 deletions

View File

@@ -45,4 +45,16 @@ const openCollectionAndAcceptSandbox = async (page, collectionName: string, sand
});
};
export { closeAllCollections, openCollectionAndAcceptSandbox };
const createCollection = async (page, collectionName: string, createDir: (tag?: string | undefined) => Promise<string>) => {
await page.locator('.dropdown-icon').click();
await page.locator('.dropdown-item').filter({ hasText: 'Create Collection' }).click();
await page.getByLabel('Name').fill(collectionName);
await page.getByLabel('Location').fill(await createDir(collectionName));
await page.getByRole('button', { name: 'Create', exact: true }).click();
await expect(page.locator('#sidebar-collection-name').filter({ hasText: collectionName })).toBeVisible();
await page.locator('#sidebar-collection-name').filter({ hasText: collectionName }).click();
await page.getByLabel('Safe Mode').check();
await page.getByRole('button', { name: 'Save' }).click();
};
export { closeAllCollections, openCollectionAndAcceptSandbox, createCollection };