-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commerce: add OST tests cases for Jenkins (#426)
* commerce: add OST tests cases for Jenkins * fix lint * fix lint * refactor const * fix lint * remove commented lines * implement suggestions * remove extra lines
- Loading branch information
Showing
3 changed files
with
854 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
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 @regression @nopr', | ||
}, | ||
{ | ||
tcid: '1', | ||
name: '@OST-Offer-Entitlements', | ||
path: '/tools/ost', | ||
data: { | ||
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A', | ||
planType: 'PUF', | ||
offerType: 'TRIAL', | ||
}, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
|
||
}, | ||
{ | ||
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 @regression @nopr', | ||
}, | ||
{ | ||
tcid: '3', | ||
name: '@OST-Term', | ||
path: '/tools/ost', | ||
data: { | ||
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A', | ||
term: '/yr', | ||
opticalTerm: '/mo', | ||
}, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
{ | ||
tcid: '4', | ||
name: '@OST-Unit', | ||
path: '/tools/ost', | ||
data: { | ||
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A', | ||
unit: 'per license', | ||
}, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
{ | ||
tcid: '5', | ||
name: '@OST-TaxLabel', | ||
path: '/tools/ost', | ||
data: { | ||
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A', | ||
taxLabel: 'excl. tax', | ||
}, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
{ | ||
tcid: '6', | ||
name: '@OST-TaxInclusivity', | ||
path: '/tools/ost', | ||
data: { offerID: '0ADF92A6C8514F2800BE9E87DB641D2A' }, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
{ | ||
tcid: '7', | ||
name: '@OST-Price-Promo', | ||
path: '/tools/ost', | ||
data: { | ||
offerID: '0ADF92A6C8514F2800BE9E87DB641D2A', | ||
promo: 'testpromo', | ||
}, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
{ | ||
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 @regression @nopr', | ||
}, | ||
{ | ||
tcid: '9', | ||
name: '@OST-OldPrice', | ||
path: '/tools/ost', | ||
data: { offerID: '0ADF92A6C8514F2800BE9E87DB641D2A' }, | ||
browserParams: '?token=', | ||
tags: '@ost @commerce @regression @nopr', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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.oldPrice = page.locator('//input[@value="displayOldPrice"]'); | ||
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('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(); | ||
} | ||
} |
Oops, something went wrong.