1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Fixes #9304: Fix HTML resource links lost when editing notes in the rich text editor (#9435)

This commit is contained in:
Henry Heino
2023-12-06 11:17:16 -08:00
committed by GitHub
parent c0c32a7ac1
commit 92a0964a8d
14 changed files with 125 additions and 17 deletions

View File

@ -3,13 +3,19 @@ import { Locator, Page } from '@playwright/test';
export default class NoteEditorPage {
public readonly codeMirrorEditor: Locator;
public readonly richTextEditor: Locator;
public readonly noteTitleInput: Locator;
public readonly attachFileButton: Locator;
public readonly toggleEditorsButton: Locator;
private readonly containerLocator: Locator;
public constructor(private readonly page: Page) {
this.containerLocator = page.locator('.rli-editor');
this.codeMirrorEditor = this.containerLocator.locator('.codeMirrorEditor');
this.richTextEditor = this.containerLocator.locator('iframe[title="Rich Text Area"]');
this.noteTitleInput = this.containerLocator.locator('.title-input');
this.attachFileButton = this.containerLocator.locator('[title^="Attach file"]');
this.toggleEditorsButton = this.containerLocator.locator('[title^="Toggle editors"]');
}
public getNoteViewerIframe() {
@ -19,8 +25,15 @@ export default class NoteEditorPage {
return this.page.frame({ url: /.*note-viewer[/\\]index.html.*/ });
}
public getTinyMCEFrameLocator() {
// We use frameLocator(':scope') to convert the richTextEditor Locator into
// a FrameLocator. (:scope selects the locator itself).
// https://playwright.dev/docs/api/class-framelocator
return this.richTextEditor.frameLocator(':scope');
}
public async waitFor() {
await this.codeMirrorEditor.waitFor();
await this.noteTitleInput.waitFor();
await this.toggleEditorsButton.waitFor();
}
}