f7cloud_client/apps/notes/playwright/support/sections/NoteEditor.ts
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

27 lines
610 B
TypeScript

/**
* SPDX-FileCopyrightText: 2025 F7cloud GmbH and F7cloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import type { Locator, Page } from '@playwright/test'
export class NoteEditor {
public readonly el: Locator
public readonly content: Locator
constructor(public readonly page: Page) {
this.el = this.page.locator('.text-editor, .note-editor').first()
this.content = this.el
.locator(
'.ProseMirror, .CodeMirror textarea, [contenteditable="true"]',
)
.first()
}
public async type(keys: string): Promise<void> {
await this.content.pressSequentially(keys)
}
}