From b7d5d43078cb8b4122d235d56348a92302774e72 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 17 Mar 2023 20:59:55 +0100 Subject: [PATCH] eg: wait for "Place Order" button to not be loading, fixes #84 --- epic-games.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epic-games.js b/epic-games.js index cccb083..366bc67 100644 --- a/epic-games.js +++ b/epic-games.js @@ -168,8 +168,8 @@ try { if (cfg.debug) await page.pause(); if (cfg.dryrun) continue; - await page.waitForTimeout(2000); - await iframe.locator('button:has-text("Place Order")').click({ delay: 11 }); + // Playwright clicked before button was ready to handle event, https://github.com/vogler/free-games-claimer/issues/84#issuecomment-1474346591 + await iframe.locator('button:has-text("Place Order"):not(:has(.payment-loading--loading))').click({ delay: 11 }); // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 const btnAgree = iframe.locator('button:has-text("I Agree")');