Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-130540: add commerce OST UI tests #265

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ba9a8cb
warriors: update acom hompegae jarvis test
afmicka Oct 16, 2023
721aa57
warriors: update comment
afmicka Oct 16, 2023
bd7ac22
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Nov 14, 2023
58d8480
warriors: add OST test
afmicka Nov 21, 2023
1a92621
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Nov 21, 2023
51d246c
MWPW-130540 - add commerce feature and OST UI tests
afmicka Dec 22, 2023
3791ac1
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Dec 22, 2023
fbdba1a
remove comments
afmicka Dec 22, 2023
9ea1a93
add empty line
afmicka Dec 22, 2023
c8fc7bc
Merge branch 'main' into warriors-automation
amauch-adobe Jan 9, 2024
da455df
add promo old price test
afmicka Jan 24, 2024
30f05fb
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Jan 24, 2024
aeefbf2
Merge branch 'warriors-automation' of github.com:afmicka/nala into wa…
afmicka Jan 24, 2024
731cea3
removing OST tests from PR (login issue)
afmicka Jan 24, 2024
2bea99f
remove test for non-public page
afmicka Jan 24, 2024
e62d2f6
warriors: add milolibs to test urls
afmicka Feb 8, 2024
89714f1
MWPW-130540: add commerce OST UI tests
afmicka Feb 13, 2024
a492532
remove envs
afmicka Feb 13, 2024
d11ecd5
remove envs
afmicka Feb 13, 2024
140b0a0
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Feb 13, 2024
4e0979e
add back skip commerce tests
afmicka Feb 13, 2024
6c8a663
remove debug line
afmicka Feb 13, 2024
339a6d1
add temporary debug line for git run
afmicka Feb 13, 2024
e2565f1
add temporary debug line for git run
afmicka Feb 13, 2024
7ef5710
remove debug line for git run
afmicka Feb 13, 2024
5910eb5
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Feb 27, 2024
f99c13d
fix statements
afmicka Mar 22, 2024
c75a91d
Merge remote-tracking branch 'upstream/main' into warriors-automation
afmicka Mar 22, 2024
01a435b
warriors: MWPW-145186 - add promotions tests cases
afmicka Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion features/acom/homepage.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module.exports = {

Check failure on line 1 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":1,"column":19,"nodeType":"Program","messageId":"expectedLF","endLine":2,"endColumn":1,"fix":{"range":[18,20],"text":"\n"}}
FeatureName: 'Acom Home Page',

Check failure on line 2 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":2,"column":33,"nodeType":"Program","messageId":"expectedLF","endLine":3,"endColumn":1,"fix":{"range":[52,54],"text":"\n"}}
features: [

Check failure on line 3 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":3,"column":14,"nodeType":"Program","messageId":"expectedLF","endLine":4,"endColumn":1,"fix":{"range":[67,69],"text":"\n"}}
{

Check failure on line 4 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":4,"column":6,"nodeType":"Program","messageId":"expectedLF","endLine":5,"endColumn":1,"fix":{"range":[74,76],"text":"\n"}}
name: '@Acom-Homepage-Jarvis',

Check failure on line 5 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":5,"column":37,"nodeType":"Program","messageId":"expectedLF","endLine":6,"endColumn":1,"fix":{"range":[112,114],"text":"\n"}}
path: '',

Check failure on line 6 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":6,"column":16,"nodeType":"Program","messageId":"expectedLF","endLine":7,"endColumn":1,"fix":{"range":[129,131],"text":"\n"}}
envs: '@adobe_prod @adobe_stage',
tags: '@homepage @smoke @regression @acom',

Check failure on line 7 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":7,"column":50,"nodeType":"Program","messageId":"expectedLF","endLine":8,"endColumn":1,"fix":{"range":[180,182],"text":"\n"}}
},

Check failure on line 8 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":8,"column":7,"nodeType":"Program","messageId":"expectedLF","endLine":9,"endColumn":1,"fix":{"range":[188,190],"text":"\n"}}
],

Check failure on line 9 in features/acom/homepage.spec.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 Expected linebreaks to be 'LF' but found 'CRLF'. Raw Output: {"ruleId":"linebreak-style","severity":2,"message":"Expected linebreaks to be 'LF' but found 'CRLF'.","line":9,"column":5,"nodeType":"Program","messageId":"expectedLF","endLine":10,"endColumn":1,"fix":{"range":[194,196],"text":"\n"}}
};
4 changes: 0 additions & 4 deletions features/milo/commerce.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ module.exports = {
tcid: '0',
name: '@Commerce-Price-Term',
path: '/drafts/nala/features/commerce/prices-with-term',
envs: '@milo_live',
tags: '@commerce',
},
{
tcid: '1',
name: '@Commerce-Price-Unit-Term',
path: '/drafts/nala/features/commerce/prices-with-term-unit',
envs: '@milo_live',
tags: '@commerce',

},
{
tcid: '2',
name: '@Commerce-Price-Taxlabel-Unit-Term',
path: '/drafts/nala/features/commerce/prices-with-term-unit-taxlabel',
envs: '@milo_live',
tags: '@commerce',
},
{
Expand All @@ -30,7 +27,6 @@ module.exports = {
data: {
promo: 'nicopromo',
},
envs: '@milo_live',
tags: '@commerce',
},
],
Expand Down
123 changes: 123 additions & 0 deletions features/milo/ost.tools.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
module.exports = {
name: 'Offer Selector Tool',
features: [
{
tcid: '0',
name: '@OST-Search-OfferID',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
productName: 'Photoshop',
productNameShort: 'phsp',
planType: 'PUF',
offerType: 'TRIAL',
price: 'US$263.88',
opticalPrice: 'US$21.99',
term: '/yr',
opticalTerm: '/mo',
unit: 'per license',
taxLabel: 'excl. tax',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '1',
name: '@OST-Offer-Entitlements',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
planType: 'PUF',
offerType: 'TRIAL',
},
browserParams: '?token=',
tags: '@ost @commerce',

},
{
tcid: '2',
name: '@OST-Offer-Price',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
price: 'US$263.88',
opticalPrice: 'US$21.99',
term: '/yr',
opticalTerm: '/mo',
unit: 'per license',
taxLabel: 'excl. tax',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '3',
name: '@OST-Term',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
term: '/yr',
opticalTerm: '/mo',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '4',
name: '@OST-Unit',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
unit: 'per license',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '5',
name: '@OST-TaxLabel',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
taxLabel: 'excl. tax',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '6',
name: '@OST-TaxInclusivity',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '7',
name: '@OST-Price-Promo',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
promo: 'testpromo',
},
browserParams: '?token=',
tags: '@ost @commerce',
},
{
tcid: '8',
name: '@OST-Checkout-Link',
path: '/tools/ost',
data: {
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A',
workflowStep_1: 'email',
workflowStep_2: 'recommendation',
promo: 'testpromo',
},
browserParams: '?token=',
tags: '@ost @commerce',
},

],
};
114 changes: 114 additions & 0 deletions features/milo/promotions.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
module.exports = {
name: 'Promotions',
features: [
{
tcid: '0',
name: '@Promo-insert',
path: '/drafts/nala/features/promotions/promo-insert',
data: {
textMarquee: 'Promo test page',
textAfterMarquee: 'Marquee promo text insert',
textBeforeText: 'Promo text insert',
textDefault: 'Default text',
},
tags: '@promo @commerce @regression',
},
{
tcid: '1',
name: '@Promo-replace',
path: '/drafts/nala/features/promotions/promo-replace',
data: {
textReplaceMarquee: 'Marquee promo replace',
textReplace: 'Promo text replace',
},
tags: '@promo @commerce @regression',
},
{
tcid: '2',
name: '@Promo-remove',
path: '/drafts/nala/features/promotions/promo-remove',
data: {
textMarquee: 'Promo test page',
},
tags: '@promo @commerce @regression',
},
{
tcid: '3',
name: '@Promo-two-manifests',
path: '/drafts/nala/features/promotions/promo-default',
data: {
textReplaceMarquee: 'Marquee promo replace',
textReplace: 'Promo text replace',
textAfterMarquee: 'Marquee promo text insert',
textBeforeText: 'Promo text insert',
},
tags: '@promo @commerce @regression',
},
{
tcid: '4',
name: '@Promo-replace-fragment',
path: '/drafts/nala/features/promotions/promo-with-fragments',
data: {
textReplaceMarquee: 'Marquee promo replace',
},
tags: '@promo @commerce @regression',
},
{
tcid: '5',
name: '@Promo-future',
path: '/drafts/nala/features/promotions/promo-future',
data: {
mepPath: '/drafts/nala/features/promotions/manifests/promo-insert-future.json--all',
textMarquee: 'Promo test page',
textDefault: 'Default text',
textFuture: 'Future promo text insert',
status: 'Scheduled - inactive',
manifestFile: 'promo-insert-future.json',
},
tags: '@promo @commerce @regression',
},
{
tcid: '6',
name: '@Promo-with-personalization',
path: '/drafts/nala/features/promotions/promo-with-personalization',
data: {
textMarquee: 'Promo test page',
textAfterMarquee: 'Marquee promo text insert',
textBeforeText: 'Promo text insert',
},
tags: '@promo @commerce @regression',
},
{
tcid: '7',
name: '@Promo-with-personalization-and-target',
path: '/drafts/nala/features/promotions/promo-with-personalization-and-target',
data: {
textMarquee: 'Promo test page',
textAfterMarquee: 'Marquee promo text insert',
textBeforeText: 'Promo text insert',
},
tags: '@promo @commerce @regression',
},
{
tcid: '8',
name: '@Promo-preview',
path: '/drafts/nala/features/promotions/promo-default',
data: {
mepInsertOn: '/drafts/nala/features/promotions/manifests/promo-insert.json--all',
mepReplaceOn: '/drafts/nala/features/promotions/manifests/promo-replace.json--all',
mepInsertOff: '/drafts/nala/features/promotions/manifests/promo-insert.json--default',
mepReplaceOff: '/drafts/nala/features/promotions/manifests/promo-replace.json--default',
textMarquee: 'Promo test page',
textDefault: 'Default text',
textAfterMarquee: 'Marquee promo text insert',
textBeforeText: 'Promo text insert',
textReplaceMarquee: 'Marquee promo replace',
textReplace: 'Promo text replace',
inactiveStatus: 'Scheduled - inactive',
manifestInsertFile: 'promo-insert.json',
manifestReplaceFile: 'promo-replace.json',
},
tags: '@promo @commerce @regression',
},
],
};
28 changes: 28 additions & 0 deletions selectors/milo/ost.tools.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default class OSTPage {
constructor(page) {
this.page = page;

this.searchField = page.locator('//input[contains(@data-testid,"search")]');
this.productList = page.locator('//span[contains(@class,"productName")]');
this.planType = page.locator('//button/span[contains(@class, "spectrum-Dropdown-label") and (.//ancestor::div/span[contains(text(),"plan type")])]');
this.offerType = page.locator('//button/span[contains(@class, "spectrum-Dropdown-label") and (.//ancestor::div/span[contains(text(),"offer type")])]');
this.nextButton = page.locator('//button[contains(@data-testid, "nextButton")]/span');
this.price = page.locator('//div[@data-type="price"]/span');
this.priceOptical = page.locator('//div[contains(@data-type, "priceOptical")]/span');
this.priceStrikethrough = page.locator('//div[contains(@data-type, "priceStrikethrough")]/span');
this.termCheckbox = page.locator('//input[@value="displayRecurrence"]');
this.unitCheckbox = page.locator('//input[@value="displayPerUnit"]');
this.taxlabelCheckbox = page.locator('//input[@value="displayTax"]');
this.taxInlcusivityCheckbox = page.locator('//input[@value="forceTaxExclusive"]');
this.priceUse = page.locator('button:near(h4:text("Price"))').first();
this.priceOpticalUse = page.locator('button:near(:text("Optical price"))').first();
this.priceStrikethroughUse = page.locator('button:near(:text("Strikethrough price"))').first();
this.checkoutTab = page.locator('//div[@data-key="checkout"]');
this.checkoutLink = page.locator('//a[@data-type="checkoutUrl"]');
// this.workflowMenu = page.locator('//div//label[contains(text(), "Workflow")]');
this.workflowMenu = page.locator('button:near(label:text("Workflow"))').first();
this.promoField = page.locator('//input[contains(@class, "spectrum-Textfield-input")]');
this.cancelPromo = page.locator('button:right-of(span:text("Promotion:"))').first();
}
}

23 changes: 23 additions & 0 deletions selectors/milo/promotions.feature.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default class CommercePage {
constructor(page) {
this.page = page;

this.marqueeDefault = page.locator('.marquee #promo-test-page');
this.marqueeReplace = page.locator('.marquee #marquee-promo-replace');
this.marqueeFragment = page.locator('.marquee #fragment-marquee');
this.textBlock = page.locator('.text-block');
this.textDefault = page.locator('.text #default-text');
this.textReplace = page.locator('.text #promo-text-replace');
this.textInsertAfterMarquee = page.locator('.text #marquee-promo-text-insert');
this.textInsertBeforeText = page.locator('.text #promo-text-insert');
this.textInsertFuture = page.locator('.text #future-promo-text-insert');
this.mepMenuOpen = page.locator('.mep-open');
this.mepPreviewButton = page.locator('//a[contains(text(),"Preview")]');
this.mepManifestList = page.locator('.mep-manifest-list');
this.mepInsertDefault = page.locator('//input[contains(@name,"promo-insert") and @value="default"]');
this.mepInsertAll = page.locator('//input[contains(@name,"promo-insert") and @value="all"]');
this.mepReplaceDefault = page.locator('//input[contains(@name,"promo-replace") and @value="default"]');
this.mepReplaceAll = page.locator('//input[contains(@name,"promo-replace") and @value="all"]');
}
}

10 changes: 5 additions & 5 deletions tests/milo/commerce.feature.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { expect, test } from '@playwright/test';
import { features } from '../../features/milo/commerce.spec.js';
import CommercePage from '../../selectors/milo/commerce.feature.page.js';
import ims from '../../libs/imslogin.js';

const miloLibs = process.env.MILO_LIBS || '';

test.describe('Commerce feature test suite', () => {
// Validate price with term display
// skipping the commerce test, due to price rendering issue on pr branchs
test.skip(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
const COMM = new CommercePage(page);
const testPage = `${baseURL}${features[0].path}`;
const testPage = `${baseURL}${features[0].path}${miloLibs}`;
console.info('[Test Page]: ', testPage);

await test.step('Go to the test page', async () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ test.describe('Commerce feature test suite', () => {
// Validate price with term and unit display
test.skip(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
const COMM = new CommercePage(page);
const testPage = `${baseURL}${features[1].path}`;
const testPage = `${baseURL}${features[1].path}${miloLibs}`;
console.info('[Test Page]: ', testPage);

await test.step('Go to the test page', async () => {
Expand Down Expand Up @@ -103,7 +103,7 @@ test.describe('Commerce feature test suite', () => {
// Validate price with term, unit and tax label display
test.skip(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
const COMM = new CommercePage(page);
const testPage = `${baseURL}${features[2].path}`;
const testPage = `${baseURL}${features[2].path}${miloLibs}`;
console.info('[Test Page]: ', testPage);

await test.step('Go to the test page', async () => {
Expand Down Expand Up @@ -150,7 +150,7 @@ test.describe('Commerce feature test suite', () => {
// Validate price and CTAs have promo code applied
test.skip(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => {
const COMM = new CommercePage(page);
const testPage = `${baseURL}${features[3].path}`;
const testPage = `${baseURL}${features[3].path}${miloLibs}`;
const data = features[3].data;

console.info('[Test Page]: ', testPage);
Expand Down
Loading
Loading