eg: wait for "Place Order" button to not be loading, fixes #84

This commit is contained in:
Ralf Vogler 2023-03-17 20:59:55 +01:00
parent b75f538d8a
commit b7d5d43078

View file

@ -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")');