Skip to content

Commit

Permalink
PR for Offer selector Tool test cases which cover given use cases (#214)
Browse files Browse the repository at this point in the history
* config, env, folder structure setup for CC

config, env, folder structure setup for CC onboarding

* PR 126 - Review comments changes

PR 126 - Review comments changes

* PR 126 asked changes

PR 126 asked changes

* Update febpub.sanity.js

* Update fedpub.sanity.js

* Update febpub.selectors.js

* Update febpub.test.js

* Text block legal, link-farm variations automation

Text block legal, link-farm variations automation

* removed unwanted comma as per comments

removed unwanted comma as per comments

* moved the new case details to new line as per review comments

moved the new case details to new line as per review comments

* Jarvis feature Automated test cases

MWPW-122175 : jarvis feature automation test cases

* OST Price formats (single license, month/year subscriptions, strikethrough preice, student license, Ucv3 checkout cases automation

OST Price formats (single license, month/year subscriptions, strikethrough price, student license, Ucv3 (email, segmentation, upsell etc) checkout flows automation.

Jira: https://jira.corp.adobe.com/browse/MWPW-135460

* javis feature file removed

* spec javis removed

* test javis removed

* Update ostprices.spec.js

* Update ostprices.page.js

updated file with given changes

* Update ostprices.test.js

added required changes

---------

Co-authored-by: Dan Chivescu <[email protected]>
Co-authored-by: Santoshkumar Nateekar <[email protected]>
Co-authored-by: Aaron Mauchley <[email protected]>
  • Loading branch information
4 people authored Dec 1, 2023
1 parent 8e01f49 commit 1eb7132
Show file tree
Hide file tree
Showing 3 changed files with 340 additions and 0 deletions.
65 changes: 65 additions & 0 deletions features/cc/ostprices.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module.exports = {
name: 'ostprices',
features: [
{
tcid: '0',
name: '@ost-currencyformat-price-buyemailcta',
path: '/drafts/Automation-PW/OST-prices/marquee-price?georouting=off',
tags: '@cc @cc-ost @cc-pricewithcta',
},
{
tcid: '1',
name: '@ost-ccallapps-price-buysegmentcta',
path: '/drafts/Automation-PW/OST-prices/cc-monty-year-ucv3?georouting=off',
tags: '@cc @cc-ost @cc-allappswithcta',
},
{
tcid: '2',
name: '@ost-student-price-buycta',
path: '/drafts/Automation-PW/OST-prices/ste-prices?georouting=off',
tags: '@cc @cc-ost @cc-steprices',
},
{
tcid: '3',
name: '@ost-strike-throughprice-buycta',
path: '/drafts/Automation-PW/OST-prices/strike-through-prices?georouting=off',
tags: '@cc @cc-ost @cc-strikethroughprice',
},
{
tcid: '4',
name: '@ost-month-year-prices-buycta',
path: '/drafts/Automation-PW/OST-prices/photoshop-prices?georouting=off',
tags: '@cc @cc-ost @cc-montandyearprices',
},
{
tcid: '5',
name: '@ost-jp-currencyformat-price-buyemailcta',
path: '/jp/drafts/Automation-PW/OST-prices/marquee-price?georouting=off',
tags: '@cc @cc-ost @cc-jp-pricewithcta',
},
{
tcid: '6',
name: '@ost-jp-ccallapps-price-buysegmentcta',
path: '/jp/drafts/Automation-PW/OST-prices/cc-monty-year-ucv3?georouting=off',
tags: '@cc @cc-ost @cc-jp-allappswithcta',
},
{
tcid: '7',
name: '@ost-jp-student-price-buycta',
path: '/jp/drafts/Automation-PW/OST-prices/ste-prices?georouting=off',
tags: '@cc @cc-ost @cc-jp-steprices',
},
{
tcid: '8',
name: '@ost-jp-strike-throughprice-buycta',
path: '/jp/drafts/Automation-PW/OST-prices/strike-through-prices?georouting=off',
tags: '@cc @cc-ost @cc-jp-strikethroughprice',
},
{
tcid: '9',
name: '@ost-jp-month-year-prices-buycta',
path: '/jp/drafts/Automation-PW/OST-prices/photoshop-prices?georouting=off',
tags: '@cc @cc-ost @cc-jp-monthyearprices',
},
],
};
55 changes: 55 additions & 0 deletions selectors/cc/ostprices.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { expect } from '@playwright/test';
import { WebUtil } from '../../libs/webutil.js';

export default class ostprices {
constructor(page) {
this.page = page;
// ccsubsciton currency format, price and buynow email CTA check out flows in US and Jp pages
this.productname = page.locator('//em[contains(text(),"Creative cloud all apps :")]');
this.uscountrycurrencysymbol = page.locator('.price-currency-symbol');
this.pricebeforedelimiter = page.locator('.price-integer');
this.priceafterdelimiter = page.locator('.price-decimals');
this.licensecommitment = page.locator('.price-recurrence');
this.numberoflicenses = page.locator('.price-unit-type');
this.buynowcta = page.locator('//a[@daa-ll="Buy now-1|Make Create Amazing"]');
this.price = page.locator('//span[@class="price"]');
this.jpproductprice = page.locator('//span[@aria-label="10,280 &#20870; 毎月 ライセンスごと"]');
this.jpcountrycurrencysymbol = page.locator('.price-currency-symbol');
// cc all apps price with segment CTA checkout
this.productname_1 = page.locator('//p[contains(text(),"CC Starting from(month) : ")]');
this.cc_pricebeforedelimiter = page.locator('.price-integer').first();
this.cc_priceafterdelimiter = page.locator('.price-decimals').first();
this.cc_licensecommitment = page.locator('.price-recurrence').first();
this.cc_numberoflicenses = page.locator('.price-unit-type').first();
this.productname_2 = page.locator('//p[contains(text(),"PS Purchase (year) : ")]');
this.ps_pricebeforedelimiter = page.locator('.price-integer').last();
this.ps_priceafterdelimiter = page.locator('.price-decimals').last();
this.ps_licensecommitment = page.locator('.price-recurrence').last();
this.ps_numberoflicenses = page.locator('.price-unit-type').last();
this.cc_buynowcta = page.locator('//a[@daa-ll="Buy now-1|Generative AI.This c"]');
this.cc_pricemonth_jp = page.locator('//span[@aria-label="5,891 &#20870; 毎月 ライセンスごと"]');
this.ps_priceyear_jp = page.locator('//span[@aria-label="28,776 &#20870; 毎年 ライセンスごと"]');
// Student teacher edition price checks
this.STEProductname = page.locator('h2#adobe-light-room');
this.STE_LR_price = page.locator('//span[@aria-label="US$4.44 per month per license"]');
this.STE_LR_JP_price = page.locator('//span[@aria-label="980 &#20870; 毎月 ライセンスごと"]');
this.STEgetstarted_CTA = page.locator('//a[@daa-ll="Get started-1|Adobe Light room"]');
// display of strike through prince, slection of bundle price for commerce store
this.producatname_3 = page.locator('h3#creative-cloud');
this.pricelabel_actual = page.locator('//p[contains(text(),"Actual price : ")]');
this.strikethroughproperty = page.locator('//span[@data-template="priceStrikethrough"]');
this.strikethrouthprice = page.locator('//span[@aria-label="US$89.99 per month per license"]').first();
this.strikethroughprice_jp_1 = page.locator('//span[@aria-label="9,346 &#20870; 毎月 ライセンスごと"]').first();
this.pricelabel_now = page.locator('//p[contains(text(),"Now its: ")]');
this.purchaseCTAbandle = page.locator('//a[@daa-ll="choose a plan-1|Actual price"]');
this.strikethroughproductprice_jp = page.locator('//span[@aria-label="9,346 &#20870; per month per license"]');
// page has card layout with month , year prices and CTAs
this.headingdiscription = page.locator('//h3[@slot="heading-xs"]').first();
this.headingdiscription2 = page.locator('//h3[@slot="heading-xs"]').last();
this.firstcardheading = page.locator('//h3[contains(text(),"Individuals PS year subscription")]');
this.individualPSpricemonth = page.locator('//span[@aria-label="US$22.99 per month per license"]');
this.individualPSpriceyear = page.locator('//span[@aria-label="US$263.88 per year per license"]');
this.individualPSpricemonth_jp = page.locator('//span[@aria-label="2,480 &#20870; 毎月 ライセンスごと"]');
this.individualPSpriceyear_jp = page.locator('//span[@aria-label="26,160 &#20870; 毎年 ライセンスごと"]');
}
};
220 changes: 220 additions & 0 deletions tests/cc/ostprices.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
import { expect, test } from '@playwright/test';
import { features } from '../../features/cc/ostprices.spec.js';
import Ostprices from '../../selectors/cc/ostprices.page.js';

let ost;
test.describe('test Offer selector tool price formats and checkout flows in US & Jp locale pages' , () => {
test.beforeEach(async ({ page }) => {
ost = new Ostprices(page);
});

test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[0].path}`);
await test.step('page marquee shows the CC price and CTA US locale', async () => {
await page.goto(`${baseURL}${features[0].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[0].path}`);
});

await test.step('Test CC all apps price and UCv3 email checkout, buy button checks in marquee', async () => {
await page.waitForLoadState();
await expect(await ost.productname).toBeTruthy();
await expect(ost.uscountrycurrencysymbol).toBeTruthy();
await expect(ost.price).toBeVisible();
await expect(ost.buynowcta).toBeVisible();
await expect(ost.pricebeforedelimiter).toBeVisible();
await page.locator('//a[@daa-ll="Buy now-1|Make Create Amazing"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/'));
});
});

test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[1].path}`);
await test.step('page checks with month and year CC subscription, checkout', async () => {
await page.goto(`${baseURL}${features[1].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[1].path}`);
});

await test.step('Verify the month and year price display , CTA for UCv3 segment checkout destination', async () => {
await page.waitForLoadState();
await expect(ost.productname_1).toBeTruthy();
await expect(ost.uscountrycurrencysymbol).toBeTruthy();
await expect(ost.cc_pricebeforedelimiter).toBeVisible();
await expect(ost.cc_priceafterdelimiter).toBeVisible();
await expect(ost.cc_licensecommitment).toBeVisible();
await expect(ost.cc_numberoflicenses).toBeVisible();
await expect(ost.productname_2).toBeTruthy();
await expect(ost.uscountrycurrencysymbol).toBeTruthy();
await expect(ost.ps_pricebeforedelimiter).toBeVisible();
await expect(ost.ps_priceafterdelimiter).toBeVisible();
await expect(ost.ps_licensecommitment).toBeVisible();
await expect(ost.ps_numberoflicenses).toBeVisible();
await page.locator('//a[@daa-ll="Buy now-1|Generative AI.This c"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/segmentation'));
});
});

test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[2].path}`);
await test.step('Light room STE edition price display with email checkout cta destination', async () => {
await page.goto(`${baseURL}${features[2].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[2].path}`);
});

await test.step('step-2: verify LR STU price and email CTA', async () => {
await page.waitForLoadState();
await expect(ost.STEProductname).toBeTruthy();
await expect(ost.uscountrycurrencysymbol).toBeTruthy();
await expect(ost.STE_LR_price).toBeVisible();
await page.locator('//a[@daa-ll="Get started-1|Adobe Light room"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/email'));
});
});

test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[3].path}`);
await test.step('page authored with CC product strike through price', async () => {
await page.goto(`${baseURL}${features[3].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[3].path}`);
});

await test.step('step-2: verify CC strike through prices are showup correctly with valid store bundle CTA destination', async () => {
await page.waitForLoadState();
await expect(ost.producatname_3).toBeVisible();
await expect(ost.uscountrycurrencysymbol).toBeTruthy();
await expect(ost.pricelabel_actual).toBeVisible();
await expect(ost.strikethroughproperty).toBeTruthy();
await expect(ost.strikethrouthprice).toBeVisible();
await expect(ost.pricelabel_now).toBeVisible();
await expect(ost.purchaseCTAbandle).toBeVisible();
await page.locator('//a[@daa-ll="choose a plan-1|Actual price"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/bundle'));
});
});

test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[4].path}`);
await test.step('Product - photoshop month, year price with CTAs', async () => {
await page.goto(`${baseURL}${features[4].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[4].path}`);
});

await test.step('step-2: Photoshop product month, year price with CTAs', async () => {
await page.waitForLoadState();
await expect(ost.headingdiscription).toBeTruthy();
await expect(ost.headingdiscription2).toBeTruthy();
await expect(ost.firstcardheading).toBeVisible();
await expect(ost.individualPSpricemonth).toBeVisible();
await expect(ost.individualPSpriceyear).toBeVisible();
await page.locator('//a[@class="con-button placeholder-resolved"]').first().click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/'));
});
});

test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[5].path}`);
await test.step('page marquee shows the CC price and CTA for JP', async () => {
await page.goto(`${baseURL}${features[5].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[5].path}`);
});

await test.step('Test CC all apps price and UCv3 email checkout, buy button checks in marquee for JP', async () => {
await page.waitForLoadState();
await expect(ost.productname).toBeVisible();
await expect(ost.jpcountrycurrencysymbol).toBeVisible();
await expect(ost.jpproductprice).toBeVisible();
await page.locator('//a[@daa-ll="Buy now-1|Make Create Amazing"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/'));
await expect(page).toHaveURL(new RegExp('co=JP&lang=ja'));
});
});

test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[6].path}`);
await test.step('product with month, year subscriptions in JP', async () => {
await page.goto(`${baseURL}${features[6].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[6].path}`);
});

await test.step('JP locale monthly, year subscriptions', async () => {
await page.waitForLoadState();
await expect(ost.productname_1).toBeVisible();
await expect(ost.productname_2).toBeVisible();
await expect(ost.cc_pricemonth_jp).toBeVisible();
await expect(ost.ps_priceyear_jp).toBeVisible();
await expect(ost.jpcountrycurrencysymbol).toBeTruthy();
await page.locator('//a[@daa-ll="Buy now-1|Generative AI.This c"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/'));
await expect(page).toHaveURL(new RegExp('co=JP&lang=ja'));
});
});

test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[7].path}`);
await test.step('page has JP STE prices for LR product', async () => {
await page.goto(`${baseURL}${features[7].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[7].path}`);
});

await test.step('step-2: Verify STE price for Lighthouse in JP currency', async () => {
await page.waitForLoadState();
await expect(ost.STEProductname).toBeTruthy();
await expect(ost.jpcountrycurrencysymbol).toBeTruthy();
await expect(ost.STE_LR_JP_price).toBeVisible();
await page.locator('//a[@daa-ll="Get started-1|Adobe Light room"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/email'));
await expect(page).toHaveURL(new RegExp('co=JP&lang=ja'));
});
});

test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[8].path}`);
await test.step('product with month, year subscriptions in JP', async () => {
await page.goto(`${baseURL}${features[8].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[8].path}`);
});

await test.step('JP locale monthly, year subscriptions', async () => {
await page.waitForLoadState();
await expect(ost.producatname_3).toBeVisible();
await expect(ost.jpcountrycurrencysymbol).toBeTruthy();
await expect(ost.pricelabel_actual).toBeVisible();
await expect(ost.strikethroughproperty).toBeTruthy();
await expect(ost.strikethroughprice_jp_1).toBeVisible();
await expect(ost.pricelabel_now).toBeVisible();
await expect(ost.purchaseCTAbandle).toBeVisible();
await page.locator('//a[@daa-ll="choose a plan-1|Actual price"]').click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/bundle'));
await expect(page).toHaveURL(new RegExp('co=JP&lang=ja'));
});
});

test(`${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[9].path}`);
await test.step('product with month, year subscriptions in JP', async () => {
await page.goto(`${baseURL}${features[9].path}`);
await page.waitForLoadState('domcontentloaded');
await expect(page).toHaveURL(`${baseURL}${features[9].path}`);
});

await test.step('JP locale monthly, year subscriptions', async () => {
await page.waitForLoadState();
await expect(ost.headingdiscription).toBeTruthy();
await expect(ost.headingdiscription2).toBeTruthy();
await expect(ost.firstcardheading).toBeVisible();
await expect(ost.individualPSpricemonth_jp).toBeVisible();
await expect(ost.individualPSpriceyear_jp).toBeVisible();
await page.locator('//a[@class="con-button placeholder-resolved"]').first().click();
await expect(page).toHaveURL(new RegExp('^https://commerce.adobe.com/store/'));
await expect(page).toHaveURL(new RegExp('co=JP&lang=ja'));
});
});
});

0 comments on commit 1eb7132

Please sign in to comment.