| 1 |
import { changePricelist, checkPriceCart } from "@website_event_sale/../tests/tours/helpers/WebsiteEventSaleTourMethods"; |
| 2 |
|
| 3 |
function checkPriceBooth(eventName, price, priceSelected) { |
| 4 |
return [ |
| 5 |
{ |
| 6 |
content: "Go to page Event", |
| 7 |
trigger: '.nav-link:contains("Event")', |
| 8 |
run: "click", |
| 9 |
expectUnloadPage: true, |
| 10 |
}, |
| 11 |
{ |
| 12 |
content: 'Open "Test Event Booths" event', |
| 13 |
trigger: `h5.card-title span:contains(${eventName})`, |
| 14 |
run: "click", |
| 15 |
expectUnloadPage: true, |
| 16 |
}, |
| 17 |
{ |
| 18 |
content: 'Go to "Booth" page', |
| 19 |
trigger: 'a:contains("Become exhibitor")', |
| 20 |
run: "click", |
| 21 |
expectUnloadPage: true, |
| 22 |
}, |
| 23 |
{ |
| 24 |
content: 'Select the booth', |
| 25 |
trigger: ".o_wbooth_booths input[name=event_booth_ids]:not(:visible)", |
| 26 |
run: function () { |
| 27 |
document.querySelector('.o_wbooth_booths input[name="event_booth_ids"]:nth-child(1)').click(); |
| 28 |
}, |
| 29 |
}, |
| 30 |
{ |
| 31 |
content: "Verify Price displayed", |
| 32 |
trigger: `.oe_currency_value:contains(${price})`, |
| 33 |
}, |
| 34 |
{ |
| 35 |
content: "Verify Price of selected booth", |
| 36 |
trigger: `div.o_wbooth_booth_total_price span.oe_currency_value:contains(${priceSelected})`, |
| 37 |
}, |
| 38 |
] |
| 39 |
} |
| 40 |
function checkPriceDiscountBooth(eventName, price, priceSelected, discount) { |
| 41 |
return [ |
| 42 |
...checkPriceBooth(eventName, price, priceSelected), |
| 43 |
{ |
| 44 |
content: "Verify Price before discount", |
| 45 |
trigger: `del:contains(${discount})`, |
| 46 |
}, |
| 47 |
] |
| 48 |
} |
| 49 |
export const getPriceListChecksSteps = function ({pricelistName, eventName, price, priceSelected, priceCart, priceBeforeDiscount=false}) { |
| 50 |
const checkPriceSteps = priceBeforeDiscount ? checkPriceDiscountBooth(eventName, price, priceSelected, priceBeforeDiscount) : checkPriceBooth(eventName, price, priceSelected); |
| 51 |
return [ |
| 52 |
...changePricelist(pricelistName), |
| 53 |
...checkPriceSteps, |
| 54 |
...checkPriceCart(priceCart), |
| 55 |
] |
| 56 |
} |
| 57 |
export default { getPriceListChecksSteps } |