From fc4d127e8fd08d6e60cc5d9cb49d3839f5be6808 Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Thu, 3 Oct 2024 23:11:11 +0200 Subject: [PATCH] Fix functional test race condition --- frontend/tests/utils/page-content.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/tests/utils/page-content.ts b/frontend/tests/utils/page-content.ts index a9b6e2018..90a34a935 100644 --- a/frontend/tests/utils/page-content.ts +++ b/frontend/tests/utils/page-content.ts @@ -66,7 +66,7 @@ export class PageContent extends BasePage { } async importLibrary(name: string, urn?: string, language = 'English') { - this.page.getByTestId('search-input').fill(name); + await this.page.getByTestId('search-input').fill(name); if ( (await this.tab('Loaded libraries').isVisible()) && (await this.tab('Loaded libraries').getAttribute('aria-selected')) === 'true' @@ -83,7 +83,7 @@ export class PageContent extends BasePage { if (await this.tab('Loaded libraries').isVisible()) { await this.tab('Loaded libraries').click(); expect(this.tab('Loaded libraries').getAttribute('aria-selected')).toBeTruthy(); - this.page.getByTestId('search-input').fill(name); + await this.page.getByTestId('search-input').fill(name); } await expect(this.getRow(name)).toBeVisible(); return; @@ -94,7 +94,7 @@ export class PageContent extends BasePage { }); await this.tab('Loaded libraries').click(); expect(this.tab('Loaded libraries').getAttribute('aria-selected')).toBeTruthy(); - this.page.getByTestId('search-input').fill(name); + await this.page.getByTestId('search-input').fill(name); await expect(this.getRow(name)).toBeVisible(); }