test(server/e2e): flaky test

This commit is contained in:
Elian Doran 2025-07-30 10:34:38 +03:00
parent aefa2315b7
commit a3ba5ca109
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View File

@ -72,6 +72,7 @@ test("Tabs are restored in right order", async ({ page, context }) => {
// Select the mid one.
await app.getTab(1).click();
await expect(app.noteTreeActiveNote).toContainText("Text notes");
// Refresh the page and check the order.
await app.goto( { preserveTabs: true });

View File

@ -65,9 +65,12 @@ export default class App {
async goToNoteInNewTab(noteTitle: string) {
const autocomplete = this.currentNoteSplit.locator(".note-autocomplete");
await autocomplete.fill(noteTitle);
await expect(this.currentNoteSplit.locator(".note-detail-empty-results")).toContainText(noteTitle);
await autocomplete.press("ArrowDown");
await autocomplete.press("Enter");
const resultsSelector = this.currentNoteSplit.locator(".note-detail-empty-results");
await expect(resultsSelector).toContainText(noteTitle);
await resultsSelector.locator(".aa-suggestion", { hasText: noteTitle })
.nth(1) // Select the second one, as the first one is "Create a new note"
.click();
}
async goToSettings() {