:has-text("Continue") -> button:has-text("Continue")

This commit is contained in:
Ralf Vogler 2022-05-06 00:07:48 +02:00
parent 59450ed05c
commit a0de165e6f

View file

@ -74,8 +74,8 @@ for (let i = 1; i <= n; i++) {
console.log('Not in library yet! Click GET.')
await page.click('[data-testid="purchase-cta-button"]');
// click Continue if 'Device not supported. This product is not compatible with your current device.'
await Promise.any([':has-text("Continue")', '#webPurchaseContainer iframe'].map(s => page.waitForSelector(s))); // wait for Continue xor iframe
if (await page.locator(':has-text("Continue")').count() > 0) {
await Promise.any(['button:has-text("Continue")', '#webPurchaseContainer iframe'].map(s => page.waitForSelector(s))); // wait for Continue xor iframe
if (await page.locator('button:has-text("Continue")').count() > 0) {
// console.log('Device not supported. This product is not compatible with your current device.');
await page.click('button:has-text("Continue")');
}