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

34 lines
1.1 KiB
TypeScript

import { BasePage } from './BasePage';
export class WorkflowSharingModal extends BasePage {
getModal() {
return this.page.getByTestId('workflowShare-modal');
}
getUsersSelect() {
return this.page.getByTestId('project-sharing-select').filter({ visible: true });
}
async addUser(emailOrName: string) {
await this.clickByTestId('project-sharing-select');
// Try to find by email or name (personal projects now show "Personal space" instead of email)
const dropdown = this.page.locator('.el-select-dropdown__item');
const byEmail = dropdown.filter({ hasText: emailOrName.toLowerCase() });
if ((await byEmail.count()) > 0) {
await byEmail.click();
} else {
// For personal projects, the email is not shown, so try matching by name part of email
const namePart = emailOrName.split('@')[0].replace(/[.-]/g, ' ');
await dropdown
.filter({ hasText: new RegExp(namePart, 'i') })
.first()
.click();
}
}
async save() {
await this.clickByTestId('workflow-sharing-modal-save-button');
await this.getModal().waitFor({ state: 'hidden' });
}
}