diff --git a/selectors/acom/entitlement.commerce.page.js b/selectors/acom/entitlement.commerce.page.js index c9e685ec..d6d243ff 100644 --- a/selectors/acom/entitlement.commerce.page.js +++ b/selectors/acom/entitlement.commerce.page.js @@ -7,6 +7,6 @@ export default class EntitlementCommerce { this.ccAllAppsCTA = page.locator('//*[contains(@daa-ll,"CC All Apps")]'); this.photoshopBuyCTA = page.locator('//*[contains(@daa-ll,"Buy now-1--Photoshop")]'); this.photoshopFreeCTA = page.locator('//*[contains(@daa-ll,"Free trial-2--Photoshop")]'); - this.switchModalIframe = page.locator('#upgrade-modal > iframe'); + this.switchModalIframe = page.locator('#switch-modal > div > iframe'); } } diff --git a/tests/acom/entitlement.commerce.test.js b/tests/acom/entitlement.commerce.test.js index 43db5008..cbc81a75 100644 --- a/tests/acom/entitlement.commerce.test.js +++ b/tests/acom/entitlement.commerce.test.js @@ -23,9 +23,11 @@ test.describe('Acom Loggedin Entitlements test suite', () => { await test.step('Login with a valid Adobe account', async () => { await Header.signInButton.waitFor({ state: 'visible', timeout: 5000 }); await Header.signInButton.click(); - await entitlementCommerce.loginType.waitFor({ state: 'visible', timeout: 5000 }); - await entitlementCommerce.loginType.click(); - await Login.loginOnAppForm(process.env.IMS_EMAIL, process.env.IMS_PASS); + if (entitlementCommerce.loginType.isVisible()) { + await entitlementCommerce.loginType.waitFor({ state: 'visible', timeout: 5000 }); + await entitlementCommerce.loginType.click(); + } + await Login.loginOnAppForm(process.env.IMS_EMAIL_PAID_PS, process.env.IMS_PASS_PAID_PS); }); // Validate Upgrade eligibility check w.r.t Buy CTA @@ -38,7 +40,7 @@ test.describe('Acom Loggedin Entitlements test suite', () => { // Validate Upgrade eligibility check w.r.t Switch modal await test.step('Verify Switch modal launch for Upgrade', async () => { await entitlementCommerce.ccAllAppsCTA.click(); - await entitlementCommerce.switchModalIframe.waitFor({ state: 'visible', timeout: 9000 }); + await entitlementCommerce.switchModalIframe.waitFor({ state: 'visible', timeout: 30000 }); await expect(entitlementCommerce.switchModalIframe).toBeVisible(); }); }); @@ -61,21 +63,23 @@ test.describe('Acom Loggedin Entitlements test suite', () => { await test.step('Login with a valid Adobe account', async () => { await Header.signInButton.waitFor({ state: 'visible', timeout: 5000 }); await Header.signInButton.click(); - await entitlementCommerce.loginType.waitFor({ state: 'visible', timeout: 5000 }); - await entitlementCommerce.loginType.click(); - await Login.loginOnAppForm(process.env.IMS_EMAIL, process.env.IMS_PASS); + if (entitlementCommerce.loginType.isVisible()) { + await entitlementCommerce.loginType.waitFor({ state: 'visible', timeout: 5000 }); + await entitlementCommerce.loginType.click(); + } + await Login.loginOnAppForm(process.env.IMS_EMAIL_PAID_PS, process.env.IMS_PASS_PAID_PS); }); // Validate Download eligibility check w.r.t Buy CTA - await test.step('Verify cc all apps card cta title', async () => { + await test.step('Verify photoshop card cta title', async () => { await page.waitForLoadState('domcontentloaded'); await entitlementCommerce.photoshopBuyCTA.waitFor({ state: 'visible', timeout: 5000 }); await expect(entitlementCommerce.photoshopBuyCTA).toHaveText(data.DownloadCTATitle); await expect(entitlementCommerce.photoshopFreeCTA).toHaveText(data.TrialCTATitle); }); - // Validate Download eligibility check w.r.t Switch modal - await test.step('Verify Switch modal launch for Upgrade', async () => { + // Validate Download eligibility check w.r.t download link + await test.step('Verify download link for download', async () => { await entitlementCommerce.photoshopBuyCTA.click(); await page.waitForLoadState('domcontentloaded'); await expect(page.url()).toContain(data.DownloadUrl);