mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-27 14:57:21 +02:00
Some checks are pending
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (22.x) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.14.1) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (25.x) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { BasePage } from './BasePage';
|
|
|
|
export class WorkflowSharingModal extends BasePage {
|
|
get container() {
|
|
return this.page.getByTestId('workflowShare-modal');
|
|
}
|
|
|
|
getUsersSelect() {
|
|
return this.container.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.container.waitFor({ state: 'hidden' });
|
|
}
|
|
}
|