1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-19 20:31:46 +02:00

Chore: Desktop: Retry creating new notes in automated tests (#11378)

This commit is contained in:
Henry Heino 2024-11-13 02:07:02 -08:00 committed by GitHub
parent 0fadf1b0be
commit e4c6b9c2b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,9 +33,14 @@ export default class MainScreen {
public async createNewNote(title: string) {
await this.waitFor();
await this.newNoteButton.click();
await expect(this.noteEditor.noteTitleInput).toHaveValue('');
await expect(this.noteEditor.noteTitleInput).toHaveJSProperty('placeholder', 'Creating new note...');
// Create the new note. Retry this -- creating new notes can sometimes fail if done just after
// application startup.
await expect.poll(async () => {
await this.newNoteButton.click();
await expect(this.noteEditor.noteTitleInput).toHaveValue('', { timeout: 4_000 });
await expect(this.noteEditor.noteTitleInput).toHaveJSProperty('placeholder', 'Creating new note...', { timeout: 4_000 });
return true;
}, { timeout: 10_000 }).toBe(true);
// Fill the title
await this.noteEditor.noteTitleInput.click();