mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 07:04:10 +00:00
* test cases for workspace import and validation TC-969, jira: https://usebruno.atlassian.net/browse/BRU-3575 * incorporated comments, moved findWorkspaceDirByName function to helpers.ts, fixed all the comments * modified as per comment provided , removed css locators , used playwright inbuilt methods , handled timeout * Created file structure as per comment provided, added tc-id , resolved code-rabbit review * incorporated comments removed commented line, removed timeouts, modified package.json added package in dev dependencies * changed const l to locators for better readbility * - Reorganized test helpers: split title-bar locators into title-bar.ts and import-workspace flow into workspace/import-workspace.ts for reuse - Replaced brittle .bruno-modal-card/CSS locators with stable role/testid/label based locators - Added a data-testid for the Import Workspace modal and removed the redundant one - Cleaned up unnecessary comments - Updated package-lock.json * minor changes * minor changes * addressed comments * addressed comments for variable naming * minor changes
16 lines
630 B
TypeScript
16 lines
630 B
TypeScript
import { Page, test } from '../../../playwright';
|
|
|
|
export const buildTitleBarLocators = (page: Page) => ({
|
|
workspaceMenuTrigger: () => page.getByTestId('workspace-menu'),
|
|
activeWorkspaceName: () => page.getByTestId('workspace-name'),
|
|
importWorkspaceOption: () => page.getByTestId('workspace-menu-import-workspace')
|
|
});
|
|
|
|
export const clickImportWorkspace = async (page: Page) => {
|
|
const titleBar = buildTitleBarLocators(page);
|
|
await test.step('Open workspace menu and click "Import workspace"', async () => {
|
|
await titleBar.workspaceMenuTrigger().click();
|
|
await titleBar.importWorkspaceOption().click();
|
|
});
|
|
};
|