feat: improve Get button locator

This commit is contained in:
Trung Le 2022-05-27 11:17:32 +07:00
parent 335c4b0292
commit 43c2df7e4a

View file

@ -67,7 +67,7 @@ for (let i = 1; i <= n; i++) {
console.log('This game contains mature content recommended only for ages 18+'); console.log('This game contains mature content recommended only for ages 18+');
await page.click('button:has-text("Continue")'); await page.click('button:has-text("Continue")');
} }
const btnText = await page.locator('[data-testid="purchase-cta-button"]').first().innerText(); const btnText = await page.locator('//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))]').first().innerText();
if (btnText.toLowerCase() == 'in library') { if (btnText.toLowerCase() == 'in library') {
console.log('Already in library! Nothing to claim.'); console.log('Already in library! Nothing to claim.');
} else { } else {