Skip to content

Commit

Permalink
Improve util
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvarela committed Sep 2, 2024
1 parent 8f9485d commit f490ce6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions site/gatsby-site/playwright/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export async function fillAutoComplete(page: Page, selector: string, sequence: s
await expect(async () => {
await page.locator(selector).clear();
await page.waitForTimeout(1000);
await page.locator(selector).pressSequentially(sequence, { delay: 500 });
await page.getByText(target).click({ timeout: 1000 });
await page.locator(selector).pressSequentially(sequence.substring(0, Math.floor(Math.random() * sequence.length) + 1), { delay: 500 });
await page.getByText(target).first().click({ timeout: 1000 });
}).toPass();
}
}

0 comments on commit f490ce6

Please sign in to comment.