| 1 |
import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util"; |
| 2 |
import * as Numpad from "@point_of_sale/../tests/generic_helpers/numpad_util"; |
| 3 |
import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util"; |
| 4 |
import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util"; |
| 5 |
import * as PartnerList from "@point_of_sale/../tests/pos/tours/utils/partner_list_util"; |
| 6 |
import * as TicketScreen from "@point_of_sale/../tests/pos/tours/utils/ticket_screen_util"; |
| 7 |
import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util"; |
| 8 |
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 9 |
import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; |
| 10 |
import { inLeftSide } from "@point_of_sale/../tests/pos/tours/utils/common"; |
| 11 |
import { registry } from "@web/core/registry"; |
| 12 |
import * as OfflineUtil from "@point_of_sale/../tests/generic_helpers/offline_util"; |
| 13 |
import * as ProductConfiguratorPopup from "@point_of_sale/../tests/pos/tours/utils/product_configurator_util"; |
| 14 |
|
| 15 |
registry.category("web_tour.tours").add("TicketScreenTour", { |
| 16 |
steps: () => |
| 17 |
[ |
| 18 |
Chrome.startPoS(), |
| 19 |
Dialog.confirm("Open Register"), |
| 20 |
OfflineUtil.setOfflineMode(), |
| 21 |
Chrome.clickOrders(), |
| 22 |
Dialog.confirm("Continue with limited functionality"), |
| 23 |
OfflineUtil.setOnlineMode(), |
| 24 |
Chrome.createFloatingOrder(), |
| 25 |
ProductScreen.addOrderline("Desk Pad", "1", "3"), |
| 26 |
Chrome.clickOrders(), |
| 27 |
TicketScreen.deleteOrder("002"), |
| 28 |
Dialog.confirm(), |
| 29 |
TicketScreen.nthRowContains(1, "001"), |
| 30 |
TicketScreen.nthRowIsHighlighted(1), |
| 31 |
Chrome.clickRegister(), |
| 32 |
ProductScreen.orderIsEmpty(), |
| 33 |
ProductScreen.addOrderline("Desk Pad", "1", "2"), |
| 34 |
Chrome.clickOrders(), |
| 35 |
TicketScreen.deleteOrder("001"), |
| 36 |
Dialog.confirm(), |
| 37 |
TicketScreen.nthRowContains(1, "001"), |
| 38 |
TicketScreen.nthRowIsHighlighted(1), |
| 39 |
Chrome.clickRegister(), |
| 40 |
ProductScreen.addOrderline("Desk Pad", "1", "2"), |
| 41 |
ProductScreen.clickPartnerButton(), |
| 42 |
ProductScreen.clickCustomer("Partner Test 1"), |
| 43 |
Chrome.clickOrders(), |
| 44 |
TicketScreen.nthRowContains(1, "Partner Test 1", false), |
| 45 |
Chrome.createFloatingOrder(), |
| 46 |
ProductScreen.addOrderline("Desk Pad", "1", "3"), |
| 47 |
ProductScreen.clickPartnerButton(), |
| 48 |
ProductScreen.clickCustomer("Partner Test 2"), |
| 49 |
ProductScreen.clickPayButton(), |
| 50 |
PaymentScreen.isShown(), |
| 51 |
Chrome.clickOrders(), |
| 52 |
TicketScreen.nthRowContains(1, "Partner Test 2", false), |
| 53 |
Chrome.createFloatingOrder(), |
| 54 |
ProductScreen.addOrderline("Desk Pad", "2", "4"), |
| 55 |
ProductScreen.clickPayButton(), |
| 56 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 57 |
PaymentScreen.clickValidate(), |
| 58 |
ReceiptScreen.isShown(), |
| 59 |
Chrome.clickOrders(), |
| 60 |
TicketScreen.nthRowContains(3, "Receipt"), |
| 61 |
TicketScreen.selectFilter("Receipt"), |
| 62 |
TicketScreen.nthRowContains(1, "Receipt"), |
| 63 |
TicketScreen.selectFilter("Payment"), |
| 64 |
TicketScreen.nthRowContains(1, "Payment"), |
| 65 |
TicketScreen.selectFilter("Ongoing"), |
| 66 |
TicketScreen.nthRowContains(1, "Ongoing"), |
| 67 |
TicketScreen.selectFilter("Active"), |
| 68 |
TicketScreen.nthRowContains(3, "Receipt"), |
| 69 |
TicketScreen.search("Receipt Number", "-00003"), |
| 70 |
TicketScreen.nthRowContains(1, "Receipt"), |
| 71 |
TicketScreen.search("Customer", "Partner Test 1"), |
| 72 |
TicketScreen.nthRowContains(1, "Partner Test 1", false), |
| 73 |
TicketScreen.search("Customer", "Partner Test 2"), |
| 74 |
TicketScreen.nthRowContains(1, "Partner Test 2", false), |
| 75 |
|
| 76 |
|
| 77 |
Chrome.clickRegister(), |
| 78 |
ReceiptScreen.isShown(), |
| 79 |
|
| 80 |
Chrome.clickOrders(), |
| 81 |
TicketScreen.selectFilter("Paid"), |
| 82 |
TicketScreen.nthRowContains(1, "003"), |
| 83 |
TicketScreen.selectOrder("003"), |
| 84 |
|
| 85 |
TicketScreen.selectFilter("Payment"), |
| 86 |
TicketScreen.selectOrder("002"), |
| 87 |
TicketScreen.loadSelectedOrder(), |
| 88 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 89 |
PaymentScreen.clickValidate(), |
| 90 |
ReceiptScreen.isShown(), |
| 91 |
ReceiptScreen.clickNextOrder(), |
| 92 |
ProductScreen.isShown(), |
| 93 |
|
| 94 |
Chrome.clickOrders(), |
| 95 |
TicketScreen.selectFilter("Paid"), |
| 96 |
TicketScreen.nthRowContains(1, "Partner Test 2", false), |
| 97 |
TicketScreen.nthRowContains(2, "003"), |
| 98 |
|
| 99 |
TicketScreen.selectOrder("003"), |
| 100 |
inLeftSide(Order.hasLine()), |
| 101 |
TicketScreen.clickControlButton("Invoice"), |
| 102 |
Dialog.confirm(), |
| 103 |
PartnerList.clickPartner("Partner Test 3"), |
| 104 |
TicketScreen.invoicePrinted(), |
| 105 |
TicketScreen.back(), |
| 106 |
|
| 107 |
TicketScreen.filterIs("Paid"), |
| 108 |
|
| 109 |
Chrome.clickRegister(), |
| 110 |
ProductScreen.isShown(), |
| 111 |
ProductScreen.orderIsEmpty(), |
| 112 |
...ProductScreen.clickRefund(), |
| 113 |
|
| 114 |
TicketScreen.filterIs("Paid"), |
| 115 |
TicketScreen.selectOrder("003"), |
| 116 |
inLeftSide([ |
| 117 |
...Order.hasLine({ productName: "Desk Pad", withClass: ".selected" }), |
| 118 |
Numpad.click("3"), |
| 119 |
Dialog.confirm(), |
| 120 |
]), |
| 121 |
Chrome.clickRegister(), |
| 122 |
{ ...ProductScreen.back(), isActive: ["mobile"] }, |
| 123 |
ProductScreen.isShown(), |
| 124 |
ProductScreen.orderIsEmpty(), |
| 125 |
...ProductScreen.clickRefund(), |
| 126 |
TicketScreen.selectOrder("003"), |
| 127 |
inLeftSide(Order.hasLine({ productName: "Desk Pad", withClass: ".selected" })), |
| 128 |
ProductScreen.clickNumpad("1"), |
| 129 |
TicketScreen.toRefundTextContains("To Refund: 1"), |
| 130 |
TicketScreen.confirmRefund(), |
| 131 |
PaymentScreen.isShown(), |
| 132 |
PaymentScreen.clickBack(), |
| 133 |
{ ...ProductScreen.back(), isActive: ["mobile"] }, |
| 134 |
ProductScreen.isShown(), |
| 135 |
inLeftSide([ |
| 136 |
...ProductScreen.clickLine("Desk Pad"), |
| 137 |
...ProductScreen.selectedOrderlineHasDirect("Desk Pad", "-1"), |
| 138 |
|
| 139 |
|
| 140 |
Numpad.click("2"), |
| 141 |
Dialog.confirm(), |
| 142 |
...["Price", "2"].map(Numpad.click), |
| 143 |
Dialog.confirm(), |
| 144 |
...["%", "5"].map(Numpad.click), |
| 145 |
Dialog.confirm(), |
| 146 |
]), |
| 147 |
|
| 148 |
...ProductScreen.clickRefund(), |
| 149 |
TicketScreen.selectOrder("003"), |
| 150 |
TicketScreen.toRefundTextContains("Refunding 1.00"), |
| 151 |
Chrome.clickRegister(), |
| 152 |
{ ...ProductScreen.back(), isActive: ["mobile"] }, |
| 153 |
|
| 154 |
ProductScreen.clickPayButton(), |
| 155 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 156 |
PaymentScreen.clickValidate(), |
| 157 |
ReceiptScreen.isShown(), |
| 158 |
ReceiptScreen.clickNextOrder(), |
| 159 |
|
| 160 |
...ProductScreen.clickRefund(), |
| 161 |
TicketScreen.selectOrder("003"), |
| 162 |
TicketScreen.refundedNoteContains("1.00 Refunded"), |
| 163 |
].flat(), |
| 164 |
}); |
| 165 |
|
| 166 |
registry.category("web_tour.tours").add("FiscalPositionNoTaxRefund", { |
| 167 |
steps: () => |
| 168 |
[ |
| 169 |
Chrome.startPoS(), |
| 170 |
Dialog.confirm("Open Register"), |
| 171 |
ProductScreen.clickDisplayedProduct("Product Test"), |
| 172 |
ProductScreen.totalAmountIs("100.00"), |
| 173 |
ProductScreen.clickFiscalPosition("No Tax"), |
| 174 |
ProductScreen.totalAmountIs("100.00"), |
| 175 |
ProductScreen.clickPayButton(), |
| 176 |
PaymentScreen.clickPaymentMethod("Bank", true, { remaining: "0.00" }), |
| 177 |
PaymentScreen.clickValidate(), |
| 178 |
ReceiptScreen.isShown(), |
| 179 |
ReceiptScreen.clickNextOrder(), |
| 180 |
...ProductScreen.clickRefund(), |
| 181 |
TicketScreen.selectOrder("001"), |
| 182 |
ProductScreen.clickNumpad("1"), |
| 183 |
TicketScreen.confirmRefund(), |
| 184 |
PaymentScreen.isShown(), |
| 185 |
PaymentScreen.clickBack(), |
| 186 |
ProductScreen.isShown(), |
| 187 |
{ ...ProductScreen.back(), isActive: ["mobile"] }, |
| 188 |
ProductScreen.totalAmountIs("100.00"), |
| 189 |
ProductScreen.clickPayButton(), |
| 190 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 191 |
PaymentScreen.clickValidate(), |
| 192 |
ReceiptScreen.isShown(), |
| 193 |
].flat(), |
| 194 |
}); |
| 195 |
|
| 196 |
registry.category("web_tour.tours").add("LotRefundTour", { |
| 197 |
steps: () => |
| 198 |
[ |
| 199 |
Chrome.startPoS(), |
| 200 |
Dialog.confirm("Open Register"), |
| 201 |
Chrome.clickOrders(), |
| 202 |
Chrome.clickOnScanButton(), |
| 203 |
TicketScreen.checkCameraIsOpen(), |
| 204 |
Chrome.clickOnScanButton(), |
| 205 |
Chrome.clickRegister(), |
| 206 |
ProductScreen.clickDisplayedProduct("Product A"), |
| 207 |
ProductScreen.enterLotNumber("123456789"), |
| 208 |
ProductScreen.selectedOrderlineHas("Product A", "1"), |
| 209 |
Chrome.clickOrders(), |
| 210 |
TicketScreen.selectOrder("001"), |
| 211 |
Chrome.clickOnScanButton(), |
| 212 |
TicketScreen.checkCameraIsOpen(), |
| 213 |
Chrome.clickOnScanButton(), |
| 214 |
Chrome.clickRegister(), |
| 215 |
ProductScreen.clickPayButton(), |
| 216 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 217 |
PaymentScreen.clickValidate(), |
| 218 |
ReceiptScreen.isShown(), |
| 219 |
ReceiptScreen.clickNextOrder(), |
| 220 |
...ProductScreen.clickRefund(), |
| 221 |
TicketScreen.selectOrder("001"), |
| 222 |
ProductScreen.clickNumpad("1"), |
| 223 |
TicketScreen.toRefundTextContains("To Refund: 1"), |
| 224 |
TicketScreen.confirmRefund(), |
| 225 |
PaymentScreen.isShown(), |
| 226 |
PaymentScreen.clickBack(), |
| 227 |
ProductScreen.isShown(), |
| 228 |
ProductScreen.clickLotIcon(), |
| 229 |
ProductScreen.checkFirstLotNumber("123456789"), |
| 230 |
].flat(), |
| 231 |
}); |
| 232 |
|
| 233 |
registry.category("web_tour.tours").add("RefundFewQuantities", { |
| 234 |
steps: () => |
| 235 |
[ |
| 236 |
Chrome.startPoS(), |
| 237 |
Dialog.confirm("Open Register"), |
| 238 |
ProductScreen.clickDisplayedProduct("Sugar"), |
| 239 |
inLeftSide([ |
| 240 |
...["0", "."].map(Numpad.click), |
| 241 |
...ProductScreen.selectedOrderlineHasDirect("Sugar", "0", "0.00"), |
| 242 |
...["0", "2"].map(Numpad.click), |
| 243 |
...ProductScreen.selectedOrderlineHasDirect("Sugar", "0.02", "0.06"), |
| 244 |
]), |
| 245 |
ProductScreen.clickPayButton(), |
| 246 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 247 |
PaymentScreen.clickValidate(), |
| 248 |
ReceiptScreen.isShown(), |
| 249 |
ReceiptScreen.clickNextOrder(), |
| 250 |
...ProductScreen.clickRefund(), |
| 251 |
TicketScreen.selectOrder("001"), |
| 252 |
ProductScreen.clickNumpad("0", "."), |
| 253 |
ProductScreen.clickNumpad("0", "2"), |
| 254 |
TicketScreen.toRefundTextContains("To Refund: 0.02"), |
| 255 |
TicketScreen.confirmRefund(), |
| 256 |
PaymentScreen.isShown(), |
| 257 |
PaymentScreen.clickBack(), |
| 258 |
ProductScreen.isShown(), |
| 259 |
Order.hasLine("Sugar", "-0.02", "-0.06"), |
| 260 |
].flat(), |
| 261 |
}); |
| 262 |
|
| 263 |
registry.category("web_tour.tours").add("test_order_refund_flow", { |
| 264 |
steps: () => |
| 265 |
[ |
| 266 |
Chrome.startPoS(), |
| 267 |
Dialog.confirm("Open Register"), |
| 268 |
ProductScreen.addOrderline("Desk Pad", "2", "3"), |
| 269 |
ProductScreen.addOrderline("Letter Tray", "3", "2"), |
| 270 |
ProductScreen.clickPayButton(), |
| 271 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 272 |
PaymentScreen.clickValidate(), |
| 273 |
ReceiptScreen.isShown(), |
| 274 |
ReceiptScreen.clickNextOrder(), |
| 275 |
|
| 276 |
ProductScreen.clickRefund(), |
| 277 |
TicketScreen.selectOrder("001"), |
| 278 |
ProductScreen.clickNumpad("1"), |
| 279 |
TicketScreen.toRefundTextContains("To Refund: 1.00"), |
| 280 |
TicketScreen.confirmRefund(), |
| 281 |
PaymentScreen.isShown(), |
| 282 |
PaymentScreen.clickBack(), |
| 283 |
ProductScreen.isShown(), |
| 284 |
Order.hasLine("Desk Pad", "-1"), |
| 285 |
|
| 286 |
Chrome.createFloatingOrder(), |
| 287 |
ProductScreen.clickRefund(), |
| 288 |
TicketScreen.selectOrder("001"), |
| 289 |
TicketScreen.toRefundTextContains("Refunding"), |
| 290 |
inLeftSide([...ProductScreen.clickLine("Letter Tray", "3.0")]), |
| 291 |
ProductScreen.clickNumpad("1"), |
| 292 |
TicketScreen.toRefundTextContains("To Refund: 1.00"), |
| 293 |
TicketScreen.confirmRefund(), |
| 294 |
PaymentScreen.isShown(), |
| 295 |
PaymentScreen.clickBack(), |
| 296 |
ProductScreen.isShown(), |
| 297 |
|
| 298 |
Order.hasLine("Letter Tray", "-1"), |
| 299 |
|
| 300 |
Chrome.clickOrders(), |
| 301 |
TicketScreen.deleteOrder("002"), |
| 302 |
Dialog.confirm(), |
| 303 |
TicketScreen.deleteOrder("003"), |
| 304 |
Dialog.confirm(), |
| 305 |
TicketScreen.selectFilter("Paid"), |
| 306 |
TicketScreen.selectOrder("001"), |
| 307 |
TicketScreen.noLinesToRefund(), |
| 308 |
].flat(), |
| 309 |
}); |
| 310 |
|
| 311 |
registry.category("web_tour.tours").add("test_pay_unpaid_order_from_kiosk", { |
| 312 |
steps: () => |
| 313 |
[ |
| 314 |
Chrome.startPoS(), |
| 315 |
Dialog.confirm("Open Register"), |
| 316 |
Chrome.clickOrders(), |
| 317 |
TicketScreen.selectOrder(2.53), |
| 318 |
TicketScreen.loadSelectedOrder(), |
| 319 |
ProductScreen.clickPayButton(), |
| 320 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 321 |
PaymentScreen.clickValidate(), |
| 322 |
ReceiptScreen.isShown(), |
| 323 |
].flat(), |
| 324 |
}); |
| 325 |
|
| 326 |
registry.category("web_tour.tours").add("refund_multiple_products_amounts_compliance", { |
| 327 |
steps: () => |
| 328 |
[ |
| 329 |
Chrome.startPoS(), |
| 330 |
Dialog.confirm("Open Register"), |
| 331 |
ProductScreen.clickDisplayedProduct("Test Product"), |
| 332 |
inLeftSide([ |
| 333 |
...["2"].map(Numpad.click), |
| 334 |
...ProductScreen.selectedOrderlineHasDirect("Test Product", "2", "20"), |
| 335 |
]), |
| 336 |
ProductScreen.clickPayButton(), |
| 337 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 338 |
PaymentScreen.clickValidate(), |
| 339 |
ReceiptScreen.isShown(), |
| 340 |
ReceiptScreen.clickNextOrder(), |
| 341 |
...ProductScreen.clickRefund(), |
| 342 |
TicketScreen.selectOrder("001"), |
| 343 |
ProductScreen.clickNumpad("2"), |
| 344 |
TicketScreen.confirmRefund(), |
| 345 |
PaymentScreen.isShown(), |
| 346 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 347 |
PaymentScreen.clickValidate(), |
| 348 |
ReceiptScreen.isShown(), |
| 349 |
].flat(), |
| 350 |
}); |
| 351 |
|
| 352 |
registry.category("web_tour.tours").add("LotTour", { |
| 353 |
steps: () => |
| 354 |
[ |
| 355 |
Chrome.startPoS(), |
| 356 |
Dialog.confirm("Open Register"), |
| 357 |
ProductScreen.clickDisplayedProduct("Product A"), |
| 358 |
ProductScreen.enterLotNumber("1"), |
| 359 |
ProductScreen.selectedOrderlineHas("Product A", "1"), |
| 360 |
inLeftSide( |
| 361 |
[ |
| 362 |
ProductScreen.clickLotIcon(), |
| 363 |
ProductScreen.deleteNthLotNumber(1), |
| 364 |
ProductScreen.enterLotNumber("2", "serial", true), |
| 365 |
Order.hasLine({ |
| 366 |
productName: "Product A", |
| 367 |
quantity: 1, |
| 368 |
}), |
| 369 |
ProductScreen.clickLotIcon(), |
| 370 |
ProductScreen.enterLotNumber("1"), |
| 371 |
Order.hasLine({ |
| 372 |
productName: "Product A", |
| 373 |
quantity: 2.0, |
| 374 |
}), |
| 375 |
].flat() |
| 376 |
), |
| 377 |
ProductScreen.clickPartnerButton(), |
| 378 |
ProductScreen.clickCustomer("Partner Test 1"), |
| 379 |
ProductScreen.clickDisplayedProduct("Product A"), |
| 380 |
ProductScreen.enterLotNumber("3"), |
| 381 |
ProductScreen.selectedOrderlineHas("Product A", "3"), |
| 382 |
inLeftSide({ |
| 383 |
trigger: ".info-list:contains('SN 3')", |
| 384 |
}), |
| 385 |
|
| 386 |
|
| 387 |
Chrome.createFloatingOrder(), |
| 388 |
ProductScreen.clickDisplayedProduct("Product A"), |
| 389 |
ProductScreen.enterLotNumber("5"), |
| 390 |
ProductScreen.clickDisplayedProduct("Product A"), |
| 391 |
ProductScreen.enterLotNumber("3"), |
| 392 |
inLeftSide({ |
| 393 |
trigger: ".info-list:not(:contains('SN 3'))", |
| 394 |
}), |
| 395 |
|
| 396 |
ProductScreen.clickDisplayedProduct("Product B"), |
| 397 |
inLeftSide({ |
| 398 |
trigger: ".info-list:contains('Lot Number 1001')", |
| 399 |
}), |
| 400 |
ProductScreen.clickPayButton(), |
| 401 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 402 |
PaymentScreen.clickValidate(), |
| 403 |
ReceiptScreen.isShown(), |
| 404 |
ReceiptScreen.clickNextOrder(), |
| 405 |
...ProductScreen.clickRefund(), |
| 406 |
TicketScreen.selectOrder("002"), |
| 407 |
inLeftSide( |
| 408 |
[Numpad.click("1"), ProductScreen.clickLine("Product B"), Numpad.click("1")].flat() |
| 409 |
), |
| 410 |
TicketScreen.confirmRefund(), |
| 411 |
PaymentScreen.isShown(), |
| 412 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 413 |
PaymentScreen.clickValidate(), |
| 414 |
ReceiptScreen.isShown(), |
| 415 |
ReceiptScreen.clickNextOrder(), |
| 416 |
].flat(), |
| 417 |
}); |
| 418 |
|
| 419 |
registry.category("web_tour.tours").add("OrderTimeTour", { |
| 420 |
steps: () => { |
| 421 |
const validateDateStep = { |
| 422 |
content: "Validate order date is Today", |
| 423 |
trigger: ".orders .order-row:first .fw-bolder", |
| 424 |
run: function ({ anchor: displayedDateElement }) { |
| 425 |
if (displayedDateElement.textContent.trim() !== "Today") { |
| 426 |
throw new Error("Order date does not match local timezone"); |
| 427 |
} |
| 428 |
}, |
| 429 |
}; |
| 430 |
|
| 431 |
const validateTimeStep = { |
| 432 |
content: "Validate order time matches local timezone", |
| 433 |
trigger: ".orders .order-row:first .small.text-muted", |
| 434 |
run: function ({ anchor: displayedTimeElement }) { |
| 435 |
const orderDateUTC = window.posmodel.getOrder().date_order; |
| 436 |
const orderDateTime = luxon.DateTime.fromSQL(orderDateUTC, { |
| 437 |
zone: "UTC", |
| 438 |
}).toLocal(); |
| 439 |
if (orderDateTime.toFormat("HH:mm") !== displayedTimeElement.textContent.trim()) { |
| 440 |
throw new Error("Order time does not match local timezone"); |
| 441 |
} |
| 442 |
}, |
| 443 |
}; |
| 444 |
|
| 445 |
return [ |
| 446 |
Chrome.startPoS(), |
| 447 |
Dialog.confirm("Open Register"), |
| 448 |
ProductScreen.clickDisplayedProduct("Desk Pad"), |
| 449 |
ProductScreen.setTimeZone("Pacific/Honolulu"), |
| 450 |
Chrome.clickOrders(), |
| 451 |
validateDateStep, |
| 452 |
validateTimeStep, |
| 453 |
ProductScreen.setTimeZone("Europe/Brussels"), |
| 454 |
Chrome.clickRegister(), |
| 455 |
Chrome.clickOrders(), |
| 456 |
validateDateStep, |
| 457 |
validateTimeStep, |
| 458 |
].flat(); |
| 459 |
}, |
| 460 |
}); |
| 461 |
|
| 462 |
registry |
| 463 |
.category("web_tour.tours") |
| 464 |
.add("test_consistent_refund_process_between_frontend_and_backend", { |
| 465 |
steps: () => |
| 466 |
[ |
| 467 |
Chrome.startPoS(), |
| 468 |
Dialog.confirm("Open Register"), |
| 469 |
ProductScreen.addOrderline("Desk Pad", "2", "4"), |
| 470 |
ProductScreen.clickPriceList("Percentage Pricelist"), |
| 471 |
ProductScreen.clickPayButton(), |
| 472 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 473 |
PaymentScreen.clickValidate(), |
| 474 |
ReceiptScreen.isShown(), |
| 475 |
ReceiptScreen.clickNextOrder(), |
| 476 |
...ProductScreen.clickRefund(), |
| 477 |
TicketScreen.selectOrder("001"), |
| 478 |
inLeftSide(Order.hasLine({ productName: "Desk Pad", withClass: ".selected" })), |
| 479 |
ProductScreen.clickNumpad("1"), |
| 480 |
TicketScreen.toRefundTextContains("To Refund: 1"), |
| 481 |
TicketScreen.confirmRefund(), |
| 482 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 483 |
PaymentScreen.clickValidate(), |
| 484 |
ReceiptScreen.isShown(), |
| 485 |
].flat(), |
| 486 |
}); |
| 487 |
|
| 488 |
registry.category("web_tour.tours").add("test_paid_order_with_archived_product_loads", { |
| 489 |
steps: () => |
| 490 |
[ |
| 491 |
Chrome.startPoS(), |
| 492 |
Dialog.confirm("Open Register"), |
| 493 |
Chrome.clickOrders(), |
| 494 |
TicketScreen.selectFilter("Paid"), |
| 495 |
TicketScreen.nthRowContains(1, "0002"), |
| 496 |
TicketScreen.selectOrder("0002"), |
| 497 |
inLeftSide([ |
| 498 |
...Order.hasLine({ productName: "Archived Product", withClass: ".selected" }), |
| 499 |
]), |
| 500 |
].flat(), |
| 501 |
}); |
| 502 |
|
| 503 |
registry.category("web_tour.tours").add("test_order_invoice_search", { |
| 504 |
steps: () => |
| 505 |
[ |
| 506 |
Chrome.startPoS(), |
| 507 |
Dialog.confirm("Open Register"), |
| 508 |
ProductScreen.clickDisplayedProduct("Desk Pad"), |
| 509 |
ProductScreen.clickPartnerButton(), |
| 510 |
ProductScreen.clickCustomer("Partner Test 1"), |
| 511 |
ProductScreen.clickPayButton(), |
| 512 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 513 |
PaymentScreen.clickInvoiceButton(), |
| 514 |
PaymentScreen.clickValidate(), |
| 515 |
ReceiptScreen.isShown(), |
| 516 |
Chrome.clickOrders(), |
| 517 |
TicketScreen.selectFilter("Paid"), |
| 518 |
TicketScreen.search("Invoice Number", "00001"), |
| 519 |
TicketScreen.nthRowContains(1, "001", false), |
| 520 |
Chrome.clickMenuOption("Close Register"), |
| 521 |
{ |
| 522 |
content: `Select button close register`, |
| 523 |
trigger: `button:contains(close register)`, |
| 524 |
run: "click", |
| 525 |
expectUnloadPage: true, |
| 526 |
}, |
| 527 |
Chrome.startPoS(), |
| 528 |
Dialog.confirm("Open Register"), |
| 529 |
Chrome.clickOrders(), |
| 530 |
TicketScreen.selectFilter("Paid"), |
| 531 |
{ |
| 532 |
content: |
| 533 |
"Verify that the order is paid; this ensures that the RPC process is complete.", |
| 534 |
trigger: ".orders .order-row:eq(0):has(.badge.rounded:contains(Paid))", |
| 535 |
}, |
| 536 |
].flat(), |
| 537 |
}); |
| 538 |
|
| 539 |
registry.category("web_tour.tours").add("test_order_with_existing_serial", { |
| 540 |
steps: () => |
| 541 |
[ |
| 542 |
Chrome.startPoS(), |
| 543 |
Dialog.confirm("Open Register"), |
| 544 |
ProductScreen.clickDisplayedProduct("Serial Product"), |
| 545 |
ProductScreen.enterExistingLotNumber("SN1"), |
| 546 |
ProductScreen.selectedOrderlineHas("Serial Product", "1.00"), |
| 547 |
inLeftSide({ |
| 548 |
trigger: ".info-list:contains('SN SN1')", |
| 549 |
}), |
| 550 |
ProductScreen.clickDisplayedProduct("Serial Product"), |
| 551 |
ProductScreen.enterExistingLotNumber("SN2"), |
| 552 |
ProductScreen.selectedOrderlineHas("Serial Product", "2.00"), |
| 553 |
inLeftSide({ |
| 554 |
trigger: ".info-list:contains('SN SN2')", |
| 555 |
}), |
| 556 |
].flat(), |
| 557 |
}); |
| 558 |
|
| 559 |
registry.category("web_tour.tours").add("test_lot_refund_lower_qty", { |
| 560 |
steps: () => |
| 561 |
[ |
| 562 |
Chrome.startPoS(), |
| 563 |
Dialog.confirm("Open Register"), |
| 564 |
ProductScreen.clickDisplayedProduct("Serial Product"), |
| 565 |
ProductScreen.enterExistingLotNumbers(["SN1", "SN2"]), |
| 566 |
ProductScreen.selectedOrderlineHas("Serial Product", "2.00"), |
| 567 |
ProductScreen.clickPayButton(), |
| 568 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 569 |
PaymentScreen.clickValidate(), |
| 570 |
ReceiptScreen.isShown(), |
| 571 |
ReceiptScreen.clickNextOrder(), |
| 572 |
ProductScreen.clickRefund(), |
| 573 |
TicketScreen.selectOrder("001"), |
| 574 |
ProductScreen.clickNumpad("1"), |
| 575 |
TicketScreen.toRefundTextContains("To Refund: 1"), |
| 576 |
TicketScreen.confirmRefund(), |
| 577 |
PaymentScreen.clickBack(), |
| 578 |
ProductScreen.isShown(), |
| 579 |
{ |
| 580 |
trigger: ".info-list:contains('SN SN1')", |
| 581 |
}, |
| 582 |
ProductScreen.clickLotIcon(), |
| 583 |
{ |
| 584 |
trigger: ".o-autocomplete--dropdown-item:contains('SN2')", |
| 585 |
}, |
| 586 |
Dialog.confirm(), |
| 587 |
{ |
| 588 |
content: "go back to the products", |
| 589 |
trigger: ".actionpad .back-button", |
| 590 |
run: "click", |
| 591 |
isActive: ["mobile"], |
| 592 |
}, |
| 593 |
ProductScreen.clickPayButton(), |
| 594 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 595 |
PaymentScreen.clickValidate(), |
| 596 |
ReceiptScreen.isShown(), |
| 597 |
ReceiptScreen.clickNextOrder(), |
| 598 |
ProductScreen.clickRefund(), |
| 599 |
TicketScreen.selectOrder("001"), |
| 600 |
ProductScreen.clickNumpad("1"), |
| 601 |
TicketScreen.confirmRefund(), |
| 602 |
PaymentScreen.clickBack(), |
| 603 |
ProductScreen.isShown(), |
| 604 |
{ |
| 605 |
trigger: ".info-list:contains('SN SN2')", |
| 606 |
}, |
| 607 |
].flat(), |
| 608 |
}); |
| 609 |
|
| 610 |
registry.category("web_tour.tours").add("test_refund_line_keep_attributes", { |
| 611 |
steps: () => |
| 612 |
[ |
| 613 |
Chrome.startPoS(), |
| 614 |
Dialog.confirm("Open Register"), |
| 615 |
ProductScreen.clickDisplayedProduct("Donut"), |
| 616 |
ProductConfiguratorPopup.pickRadio("Sugar"), |
| 617 |
Dialog.confirm(), |
| 618 |
ProductScreen.clickPayButton(), |
| 619 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 620 |
PaymentScreen.clickValidate(), |
| 621 |
ReceiptScreen.isShown(), |
| 622 |
ReceiptScreen.clickNextOrder(), |
| 623 |
ProductScreen.clickRefund(), |
| 624 |
TicketScreen.selectOrder("001"), |
| 625 |
ProductScreen.clickNumpad("1"), |
| 626 |
TicketScreen.confirmRefund(), |
| 627 |
PaymentScreen.clickBack(), |
| 628 |
Order.hasLine({ |
| 629 |
productName: "Donut", |
| 630 |
attributeLine: "Sugar", |
| 631 |
}), |
| 632 |
].flat(), |
| 633 |
}); |