Skip to content

Commit

Permalink
Fix failing case
Browse files Browse the repository at this point in the history
  • Loading branch information
mrruby committed Jun 30, 2024
1 parent c42e24a commit a16b612
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ export const clickButtonAndWaitForNewPage = async (
button: Locator<Element>,
downloadPath: string
): Promise<Page> => {
await button?.click();
await button.click();
const newPage = await waitForNewPage(browser);
await newPage.waitForNavigation();

const session = await newPage.createCDPSession();
await session.send('Page.setDownloadBehavior', {
Expand Down Expand Up @@ -57,7 +56,7 @@ export const fileExists = (filePath: string): Promise<boolean> => {

const findElementByText = (context: Page, selector: string) => async (text: string) => {
const locator = context.locator(`${selector}::-p-text(${text})`);
await locator.wait();
await locator.waitHandle();
return locator;
};

Expand Down

0 comments on commit a16b612

Please sign in to comment.