Skip to content

Commit 243dcb1

Browse files
authored
Merge pull request #256 from nesrineabdmouleh/adapt171
Adapt cart page with 171
2 parents a041b90 + dad0d12 commit 243dcb1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/pages/FO/classic/cart/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const psVersion = testContext.getPSVersion();
66

77
/* eslint-disable global-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */
88
function requirePage(): FoCartPageInterface {
9+
if (semver.lt(psVersion, '7.1.2')) {
10+
return require('@versions/1.7.1/pages/FO/classic/cart').cartPage;
11+
}
912
if (semver.lt(psVersion, '7.6.0')) {
1013
return require('@versions/1.7.5/pages/FO/classic/cart').cartPage;
1114
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Import pages
2+
import type {FoCartPageInterface} from '@interfaces/FO/cart';
3+
import {CartPage} from '@versions/1.7.5/pages/FO/classic/cart';
4+
5+
/**
6+
* FO cart page, contains functions that can be used on the page
7+
* @class
8+
* @extends ProductsPage
9+
*/
10+
class FoCartVersion extends CartPage implements FoCartPageInterface {
11+
/**
12+
* @constructs
13+
* Setting up texts and selectors to use on cart page
14+
*/
15+
constructor() {
16+
super();
17+
18+
this.productPrice = (number: number) => `${this.productItem(number)} div.product-line-grid-body div:nth-child(2)`;
19+
}
20+
}
21+
22+
const cartPage = new FoCartVersion();
23+
export {cartPage, FoCartVersion as CartPage};

0 commit comments

Comments
 (0)