Files
alighasami 3d5eaf9445
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
first commit
2026-03-17 16:22:57 +03:30

53 lines
1.5 KiB
TypeScript

import type { Locator, Page } from '@playwright/test';
/**
* Page object for interacting with move resource modals (MoveToFolderModal for workflows, ProjectMoveResourceModal for credentials).
*/
export class ResourceMoveModal {
constructor(private page: Page) {}
getProjectSelect(): Locator {
return this.page.getByTestId('project-sharing-select');
}
getProjectSelectCredential(): Locator {
return this.page.getByTestId('project-move-resource-modal-select');
}
getMoveConfirmButton(): Locator {
return this.page.getByTestId('confirm-move-folder-button');
}
getMoveCredentialButton(): Locator {
return this.page.getByRole('button', { name: 'Move credential' });
}
getFolderSelect(): Locator {
return this.page.getByTestId('move-to-folder-dropdown');
}
async selectProjectOption(projectNameOrEmail: string): Promise<void> {
const options = this.page.getByRole('option');
// Try to find by exact text (project name or email)
const byExact = options.filter({ hasText: projectNameOrEmail });
if ((await byExact.count()) > 0) {
await byExact.click();
} else {
// For personal projects, the email is not shown, so try matching by name part of email
const namePart = projectNameOrEmail.split('@')[0].replace(/[.-]/g, ' ');
await options
.filter({ hasText: new RegExp(namePart, 'i') })
.first()
.click();
}
}
async clickMoveCredentialButton(): Promise<void> {
await this.getMoveCredentialButton().click();
}
async clickConfirmMoveButton(): Promise<void> {
await this.getMoveConfirmButton().click();
}
}