mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
Chore: Disable flaky test: Disable Rich Text Editor case of the editor.setText
command test (#11311)
This commit is contained in:
parent
ce26e085ff
commit
9b9bb6eb49
@ -3,31 +3,24 @@ import { test } from './util/test';
|
||||
import MainScreen from './models/MainScreen';
|
||||
|
||||
test.describe('pluginApi', () => {
|
||||
for (const richTextEditor of [false, true]) {
|
||||
test(`the editor.setText command should update the current note (use RTE: ${richTextEditor})`, async ({ startAppWithPlugins }) => {
|
||||
const { app, mainWindow } = await startAppWithPlugins(['resources/test-plugins/execCommand.js']);
|
||||
const mainScreen = new MainScreen(mainWindow);
|
||||
await mainScreen.createNewNote('First note');
|
||||
const editor = mainScreen.noteEditor;
|
||||
test('the editor.setText command should update the current note (use RTE: false)', async ({ startAppWithPlugins }) => {
|
||||
const { app, mainWindow } = await startAppWithPlugins(['resources/test-plugins/execCommand.js']);
|
||||
const mainScreen = new MainScreen(mainWindow);
|
||||
await mainScreen.createNewNote('First note');
|
||||
const editor = mainScreen.noteEditor;
|
||||
|
||||
await editor.focusCodeMirrorEditor();
|
||||
await mainWindow.keyboard.type('This content should be overwritten.');
|
||||
await editor.focusCodeMirrorEditor();
|
||||
await mainWindow.keyboard.type('This content should be overwritten.');
|
||||
|
||||
if (richTextEditor) {
|
||||
await editor.toggleEditorsButton.click();
|
||||
await editor.richTextEditor.click();
|
||||
}
|
||||
await editor.expectToHaveText('This content should be overwritten.');
|
||||
await mainScreen.goToAnything.runCommand(app, 'testUpdateEditorText');
|
||||
await editor.expectToHaveText('PASS');
|
||||
|
||||
await editor.expectToHaveText('This content should be overwritten.');
|
||||
await mainScreen.goToAnything.runCommand(app, 'testUpdateEditorText');
|
||||
await editor.expectToHaveText('PASS');
|
||||
// Should still have the same text after switching notes:
|
||||
await mainScreen.createNewNote('Second note');
|
||||
await editor.goBack();
|
||||
|
||||
// Should still have the same text after switching notes:
|
||||
await mainScreen.createNewNote('Second note');
|
||||
await editor.goBack();
|
||||
|
||||
await editor.expectToHaveText('PASS');
|
||||
});
|
||||
}
|
||||
await editor.expectToHaveText('PASS');
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user