| 1 |
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; |
| 2 |
import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util"; |
| 3 |
import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util"; |
| 4 |
import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util"; |
| 5 |
import * as TicketScreen from "@point_of_sale/../tests/pos/tours/utils/ticket_screen_util"; |
| 6 |
import * as PosSale from "@pos_sale/../tests/tours/utils/pos_sale_utils"; |
| 7 |
import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; |
| 8 |
import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util"; |
| 9 |
import * as Utils from "@point_of_sale/../tests/generic_helpers/utils"; |
| 10 |
import { registry } from "@web/core/registry"; |
| 11 |
|
| 12 |
registry.category("web_tour.tours").add("PosSettleOrder", { |
| 13 |
steps: () => |
| 14 |
[ |
| 15 |
Chrome.startPoS(), |
| 16 |
Dialog.confirm("Open Register"), |
| 17 |
PosSale.settleNthOrder(1), |
| 18 |
ProductScreen.selectedOrderlineHas("Pizza Chicken", 9), |
| 19 |
ProductScreen.clickNumpad("Qty", "2"), |
| 20 |
ProductScreen.selectedOrderlineHas("Pizza Chicken", 2), |
| 21 |
ProductScreen.clickPayButton(), |
| 22 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 23 |
PaymentScreen.clickValidate(), |
| 24 |
ReceiptScreen.isShown(), |
| 25 |
Chrome.clickOrders(), |
| 26 |
].flat(), |
| 27 |
}); |
| 28 |
|
| 29 |
registry.category("web_tour.tours").add("PosSettleOrderIncompatiblePartner", { |
| 30 |
steps: () => |
| 31 |
[ |
| 32 |
Chrome.startPoS(), |
| 33 |
Dialog.confirm("Open Register"), |
| 34 |
|
| 35 |
PosSale.settleNthOrder(2), |
| 36 |
ProductScreen.selectedOrderlineHas("product1", 1), |
| 37 |
ProductScreen.totalAmountIs("10.00"), |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
PosSale.settleNthOrder(1), |
| 43 |
ProductScreen.selectedOrderlineHas("product2", 1), |
| 44 |
ProductScreen.totalAmountIs("11.00"), |
| 45 |
].flat(), |
| 46 |
}); |
| 47 |
|
| 48 |
registry.category("web_tour.tours").add("PosSettleOrder2", { |
| 49 |
steps: () => |
| 50 |
[ |
| 51 |
Chrome.startPoS(), |
| 52 |
Dialog.confirm("Open Register"), |
| 53 |
PosSale.settleNthOrder(1), |
| 54 |
ProductScreen.clickOrderline("Product A", "1"), |
| 55 |
ProductScreen.selectedOrderlineHas("Product A", "1"), |
| 56 |
ProductScreen.clickOrderline("Product B", "1"), |
| 57 |
ProductScreen.clickNumpad("Qty", "0"), |
| 58 |
ProductScreen.selectedOrderlineHas("Product B", "0"), |
| 59 |
ProductScreen.clickPayButton(), |
| 60 |
PaymentScreen.clickPaymentMethod("Bank", true, { remaining: "0.0" }), |
| 61 |
PaymentScreen.clickValidate(), |
| 62 |
ReceiptScreen.isShown(), |
| 63 |
].flat(), |
| 64 |
}); |
| 65 |
|
| 66 |
registry.category("web_tour.tours").add("PosRefundDownpayment", { |
| 67 |
steps: () => |
| 68 |
[ |
| 69 |
Chrome.startPoS(), |
| 70 |
Dialog.confirm("Open Register"), |
| 71 |
PosSale.downPaymentFirstOrder("+10"), |
| 72 |
ProductScreen.clickPayButton(), |
| 73 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 74 |
PaymentScreen.clickValidate(), |
| 75 |
ReceiptScreen.clickNextOrder(), |
| 76 |
...ProductScreen.clickRefund(), |
| 77 |
|
| 78 |
TicketScreen.filterIs("Paid"), |
| 79 |
TicketScreen.selectOrder("001"), |
| 80 |
Order.hasLine({ |
| 81 |
productName: "Down Payment", |
| 82 |
withClass: ".selected", |
| 83 |
quantity: "1", |
| 84 |
}), |
| 85 |
ProductScreen.clickNumpad("1"), |
| 86 |
TicketScreen.confirmRefund(), |
| 87 |
PaymentScreen.isShown(), |
| 88 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 89 |
PaymentScreen.clickValidate(), |
| 90 |
ReceiptScreen.clickNextOrder(), |
| 91 |
].flat(), |
| 92 |
}); |
| 93 |
|
| 94 |
registry.category("web_tour.tours").add("PosSettleOrderRealTime", { |
| 95 |
steps: () => |
| 96 |
[ |
| 97 |
Chrome.startPoS(), |
| 98 |
Dialog.confirm("Open Register"), |
| 99 |
PosSale.settleNthOrder(1), |
| 100 |
ProductScreen.totalAmountIs(40), |
| 101 |
ProductScreen.clickPayButton(), |
| 102 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 103 |
PaymentScreen.clickValidate(), |
| 104 |
ReceiptScreen.isShown(), |
| 105 |
].flat(), |
| 106 |
}); |
| 107 |
|
| 108 |
registry.category("web_tour.tours").add("PosSettleOrder3", { |
| 109 |
steps: () => |
| 110 |
[ |
| 111 |
Chrome.startPoS(), |
| 112 |
Dialog.confirm("Open Register"), |
| 113 |
PosSale.settleNthOrder(1), |
| 114 |
ProductScreen.selectedOrderlineHas("Product A", "1"), |
| 115 |
ProductScreen.clickPayButton(), |
| 116 |
PaymentScreen.clickPaymentMethod("Bank", true, { remaining: "0.0" }), |
| 117 |
PaymentScreen.clickValidate(), |
| 118 |
ReceiptScreen.isShown(), |
| 119 |
].flat(), |
| 120 |
}); |
| 121 |
|
| 122 |
registry.category("web_tour.tours").add("PosSettleOrderNotGroupable", { |
| 123 |
steps: () => |
| 124 |
[ |
| 125 |
Chrome.startPoS(), |
| 126 |
Dialog.confirm("Open Register"), |
| 127 |
PosSale.settleNthOrder(1), |
| 128 |
ProductScreen.totalAmountIs(28.98), |
| 129 |
ProductScreen.selectedOrderlineHas("Product A", "0.5"), |
| 130 |
ProductScreen.checkOrderlinesNumber(4), |
| 131 |
ProductScreen.selectedOrderlineHas("Product A", "0.5", "4.14"), |
| 132 |
].flat(), |
| 133 |
}); |
| 134 |
|
| 135 |
registry.category("web_tour.tours").add("test_import_lot_groupable_and_non_groupable", { |
| 136 |
steps: () => |
| 137 |
[ |
| 138 |
Chrome.startPoS(), |
| 139 |
Dialog.confirm("Open Register"), |
| 140 |
PosSale.settleNthOrder(1, { loadSN: true }), |
| 141 |
PosSale.selectedOrderLinesHasLots("Groupable Product", []), |
| 142 |
ProductScreen.checkOrderlinesNumber(5), |
| 143 |
ProductScreen.totalAmountIs(60), |
| 144 |
ProductScreen.selectedOrderlineHas("Groupable Product", "1", "10"), |
| 145 |
].flat(), |
| 146 |
}); |
| 147 |
|
| 148 |
registry.category("web_tour.tours").add("PosSettleOrderWithNote", { |
| 149 |
steps: () => |
| 150 |
[ |
| 151 |
Chrome.startPoS(), |
| 152 |
Dialog.confirm("Open Register"), |
| 153 |
PosSale.settleNthOrder(1), |
| 154 |
Order.hasLine({ |
| 155 |
customerNote: "Customer note 2--Customer note 3", |
| 156 |
}), |
| 157 |
ProductScreen.clickPayButton(), |
| 158 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 159 |
PaymentScreen.clickValidate(), |
| 160 |
|
| 161 |
Order.hasLine({ |
| 162 |
customerNote: "Customer note 2--Customer note 3", |
| 163 |
}), |
| 164 |
ReceiptScreen.clickNextOrder(), |
| 165 |
].flat(), |
| 166 |
}); |
| 167 |
|
| 168 |
registry.category("web_tour.tours").add("PosSettleAndInvoiceOrder", { |
| 169 |
steps: () => |
| 170 |
[ |
| 171 |
Chrome.startPoS(), |
| 172 |
Dialog.confirm("Open Register"), |
| 173 |
PosSale.settleNthOrder(1), |
| 174 |
Order.hasLine({}), |
| 175 |
ProductScreen.clickPayButton(), |
| 176 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 177 |
PaymentScreen.clickInvoiceButton(), |
| 178 |
PaymentScreen.clickValidate(), |
| 179 |
].flat(), |
| 180 |
}); |
| 181 |
|
| 182 |
registry.category("web_tour.tours").add("PosSettleAndInvoiceOrder2", { |
| 183 |
steps: () => |
| 184 |
[ |
| 185 |
Chrome.startPoS(), |
| 186 |
PosSale.settleNthOrder(1), |
| 187 |
Order.hasLine({}), |
| 188 |
ProductScreen.clickPayButton(), |
| 189 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 190 |
PaymentScreen.clickInvoiceButton(), |
| 191 |
PaymentScreen.clickValidate(), |
| 192 |
].flat(), |
| 193 |
}); |
| 194 |
|
| 195 |
registry.category("web_tour.tours").add("PosOrderDoesNotRemainInList", { |
| 196 |
steps: () => |
| 197 |
[ |
| 198 |
Chrome.startPoS(), |
| 199 |
Dialog.confirm("Open Register"), |
| 200 |
PosSale.settleNthOrder(1), |
| 201 |
ProductScreen.clickPayButton(), |
| 202 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 203 |
PaymentScreen.clickValidate(), |
| 204 |
ReceiptScreen.clickNextOrder(), |
| 205 |
PosSale.checkOrdersListEmpty(), |
| 206 |
].flat(), |
| 207 |
}); |
| 208 |
|
| 209 |
registry.category("web_tour.tours").add("PosSettleDraftOrder", { |
| 210 |
steps: () => |
| 211 |
[ |
| 212 |
Chrome.startPoS(), |
| 213 |
Dialog.confirm("Open Register"), |
| 214 |
PosSale.settleNthOrder(1), |
| 215 |
ProductScreen.selectedOrderlineHas("Test service product", "1", "50.00"), |
| 216 |
ProductScreen.clickPayButton(), |
| 217 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 218 |
PaymentScreen.clickValidate(), |
| 219 |
ReceiptScreen.isShown(), |
| 220 |
].flat(), |
| 221 |
}); |
| 222 |
|
| 223 |
registry.category("web_tour.tours").add("PosSettleCustomPrice", { |
| 224 |
steps: () => |
| 225 |
[ |
| 226 |
Chrome.startPoS(), |
| 227 |
Dialog.confirm("Open Register"), |
| 228 |
PosSale.settleNthOrder(1), |
| 229 |
ProductScreen.selectedOrderlineHas("Product A", "1", "100"), |
| 230 |
ProductScreen.clickPartnerButton(), |
| 231 |
ProductScreen.clickCustomer("A Test Partner AAA"), |
| 232 |
ProductScreen.selectedOrderlineHas("Product A", "1", "100"), |
| 233 |
].flat(), |
| 234 |
}); |
| 235 |
|
| 236 |
registry.category("web_tour.tours").add("PoSSaleOrderWithDownpayment", { |
| 237 |
steps: () => |
| 238 |
[ |
| 239 |
Chrome.startPoS(), |
| 240 |
Dialog.confirm("Open Register"), |
| 241 |
PosSale.settleNthOrder(1), |
| 242 |
ProductScreen.selectedOrderlineHas("Down Payment (POS)"), |
| 243 |
ProductScreen.totalAmountIs(980.0), |
| 244 |
].flat(), |
| 245 |
}); |
| 246 |
|
| 247 |
registry.category("web_tour.tours").add("test_settle_so_with_non_pos_groupable_uom", { |
| 248 |
steps: () => |
| 249 |
[ |
| 250 |
Chrome.startPoS(), |
| 251 |
Dialog.confirm("Open Register"), |
| 252 |
PosSale.settleNthOrder(1), |
| 253 |
ProductScreen.selectedOrderlineHas("Pomme de Terre", "0.5", "5.00"), |
| 254 |
].flat(), |
| 255 |
}); |
| 256 |
|
| 257 |
registry.category("web_tour.tours").add("PoSDownPaymentLinesPerTax", { |
| 258 |
steps: () => |
| 259 |
[ |
| 260 |
Chrome.startPoS(), |
| 261 |
Dialog.confirm("Open Register"), |
| 262 |
PosSale.downPaymentFirstOrder("+20"), |
| 263 |
Order.hasLine({ |
| 264 |
productName: "Down Payment", |
| 265 |
quantity: "1", |
| 266 |
price: "2.20", |
| 267 |
}), |
| 268 |
Order.hasLine({ |
| 269 |
productName: "Down Payment", |
| 270 |
quantity: "1", |
| 271 |
price: "1.00", |
| 272 |
}), |
| 273 |
Order.hasLine({ |
| 274 |
productName: "Down Payment", |
| 275 |
quantity: "1", |
| 276 |
price: "3.00", |
| 277 |
}), |
| 278 |
ProductScreen.clickPayButton(), |
| 279 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 280 |
PaymentScreen.clickInvoiceButton(), |
| 281 |
PaymentScreen.clickValidate(), |
| 282 |
ReceiptScreen.isShown(), |
| 283 |
].flat(), |
| 284 |
}); |
| 285 |
|
| 286 |
registry.category("web_tour.tours").add("PoSApplyDownpayment", { |
| 287 |
steps: () => |
| 288 |
[ |
| 289 |
Chrome.startPoS(), |
| 290 |
Dialog.confirm("Open Register"), |
| 291 |
PosSale.downPaymentFirstOrder("+10"), |
| 292 |
ProductScreen.clickPayButton(), |
| 293 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 294 |
PaymentScreen.clickValidate(), |
| 295 |
].flat(), |
| 296 |
}); |
| 297 |
|
| 298 |
registry.category("web_tour.tours").add("PoSApplyDownpaymentInvoice", { |
| 299 |
steps: () => |
| 300 |
[ |
| 301 |
Chrome.startPoS(), |
| 302 |
Dialog.confirm("Open Register"), |
| 303 |
PosSale.downPaymentFirstOrder("+10"), |
| 304 |
ProductScreen.clickPayButton(), |
| 305 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 306 |
PaymentScreen.clickInvoiceButton(), |
| 307 |
PaymentScreen.clickValidate(), |
| 308 |
].flat(), |
| 309 |
}); |
| 310 |
|
| 311 |
registry.category("web_tour.tours").add("PoSApplyDownpaymentInvoice2", { |
| 312 |
steps: () => |
| 313 |
[ |
| 314 |
Chrome.startPoS(), |
| 315 |
PosSale.downPaymentFirstOrder("+10"), |
| 316 |
ProductScreen.clickPayButton(), |
| 317 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 318 |
PaymentScreen.clickInvoiceButton(), |
| 319 |
PaymentScreen.clickValidate(), |
| 320 |
].flat(), |
| 321 |
}); |
| 322 |
|
| 323 |
registry.category("web_tour.tours").add("PosShipLaterNoDefault", { |
| 324 |
steps: () => |
| 325 |
[ |
| 326 |
Chrome.startPoS(), |
| 327 |
Dialog.confirm("Open Register"), |
| 328 |
PosSale.settleNthOrder(1), |
| 329 |
ProductScreen.clickPayButton(), |
| 330 |
PaymentScreen.isShown(), |
| 331 |
Utils.negateStep(PaymentScreen.shippingLaterHighlighted()), |
| 332 |
].flat(), |
| 333 |
}); |
| 334 |
|
| 335 |
registry.category("web_tour.tours").add("PosSaleTeam", { |
| 336 |
steps: () => |
| 337 |
[ |
| 338 |
Chrome.startPoS(), |
| 339 |
Dialog.confirm("Open Register"), |
| 340 |
ProductScreen.clickDisplayedProduct("Test Product"), |
| 341 |
ProductScreen.totalAmountIs("100.00"), |
| 342 |
ProductScreen.clickPayButton(), |
| 343 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 344 |
PaymentScreen.clickValidate(), |
| 345 |
].flat(), |
| 346 |
}); |
| 347 |
|
| 348 |
registry.category("web_tour.tours").add("PosOrdersListDifferentCurrency", { |
| 349 |
steps: () => |
| 350 |
[ |
| 351 |
Chrome.startPoS(), |
| 352 |
Dialog.confirm("Open Register"), |
| 353 |
ProductScreen.clickControlButton("Quotation/Order"), |
| 354 |
{ |
| 355 |
content: "Check that no orders are displayed", |
| 356 |
trigger: '.o_nocontent_help p:contains("No record found")', |
| 357 |
}, |
| 358 |
].flat(), |
| 359 |
}); |
| 360 |
|
| 361 |
registry.category("web_tour.tours").add("PoSDownPaymentAmount", { |
| 362 |
steps: () => |
| 363 |
[ |
| 364 |
Chrome.startPoS(), |
| 365 |
Dialog.confirm("Open Register"), |
| 366 |
PosSale.downPaymentFirstOrder("+20"), |
| 367 |
Order.hasLine({ |
| 368 |
productName: "Down Payment", |
| 369 |
quantity: "1", |
| 370 |
price: "20.0", |
| 371 |
}), |
| 372 |
ProductScreen.clickPayButton(), |
| 373 |
PaymentScreen.clickPaymentMethod("Cash"), |
| 374 |
PaymentScreen.clickValidate(), |
| 375 |
].flat(), |
| 376 |
}); |
| 377 |
|
| 378 |
registry.category("web_tour.tours").add("PosSettleOrder4", { |
| 379 |
steps: () => |
| 380 |
[ |
| 381 |
Chrome.startPoS(), |
| 382 |
Dialog.confirm("Open Register"), |
| 383 |
PosSale.settleNthOrder(1), |
| 384 |
ProductScreen.selectedOrderlineHas("Product A", "1"), |
| 385 |
ProductScreen.clickPayButton(), |
| 386 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 387 |
PaymentScreen.remainingIs("0.0"), |
| 388 |
PaymentScreen.clickShipLaterButton(), |
| 389 |
PaymentScreen.clickValidate(), |
| 390 |
ReceiptScreen.isShown(), |
| 391 |
].flat(), |
| 392 |
}); |
| 393 |
|
| 394 |
registry.category("web_tour.tours").add("PosSettleOrderShipLater", { |
| 395 |
steps: () => |
| 396 |
[ |
| 397 |
Chrome.startPoS(), |
| 398 |
Dialog.confirm("Open Register"), |
| 399 |
PosSale.settleNthOrder(2), |
| 400 |
ProductScreen.clickPayButton(), |
| 401 |
PaymentScreen.clickShipLaterButton(), |
| 402 |
PaymentScreen.shippingLaterHighlighted(), |
| 403 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 404 |
PaymentScreen.remainingIs("0.0"), |
| 405 |
PaymentScreen.clickValidate(), |
| 406 |
ReceiptScreen.isShown(), |
| 407 |
ReceiptScreen.clickNextOrder(), |
| 408 |
PosSale.settleNthOrder(1), |
| 409 |
ProductScreen.clickPayButton(), |
| 410 |
PaymentScreen.clickShipLaterButton(), |
| 411 |
PaymentScreen.shippingLaterHighlighted(), |
| 412 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 413 |
PaymentScreen.remainingIs("0.0"), |
| 414 |
PaymentScreen.clickValidate(), |
| 415 |
ReceiptScreen.isShown(), |
| 416 |
].flat(), |
| 417 |
}); |
| 418 |
|
| 419 |
registry.category("web_tour.tours").add("PosSettleOrder5", { |
| 420 |
steps: () => |
| 421 |
[ |
| 422 |
Chrome.startPoS(), |
| 423 |
Dialog.confirm("Open Register"), |
| 424 |
PosSale.settleNthOrder(1), |
| 425 |
ProductScreen.selectedOrderlineHas("Product A", 1), |
| 426 |
].flat(), |
| 427 |
}); |
| 428 |
|
| 429 |
registry.category("web_tour.tours").add("PosSaleWarning", { |
| 430 |
steps: () => |
| 431 |
[ |
| 432 |
Chrome.startPoS(), |
| 433 |
Dialog.confirm("Open Register"), |
| 434 |
ProductScreen.clickPartnerButton(), |
| 435 |
ProductScreen.clickCustomer("A Test Customer 2"), |
| 436 |
{ |
| 437 |
content: "Check warning popup are displayed", |
| 438 |
trigger: |
| 439 |
'.modal-dialog:has(.modal-header:contains("Warning for A Test Customer 2")):has(.modal-body:contains("Cannot afford our services"))', |
| 440 |
}, |
| 441 |
{ |
| 442 |
trigger: ".modal-footer button", |
| 443 |
run: "click", |
| 444 |
}, |
| 445 |
ProductScreen.customerIsSelected("A Test Customer 2"), |
| 446 |
ProductScreen.clickDisplayedProduct("Letter Tray", true, "1"), |
| 447 |
ProductScreen.selectedOrderlineHas("Letter Tray", "1"), |
| 448 |
ProductScreen.clickPartnerButton(), |
| 449 |
ProductScreen.clickCustomer("A Test Customer 1"), |
| 450 |
{ |
| 451 |
content: "Check warning popup are displayed", |
| 452 |
trigger: |
| 453 |
'.modal-dialog:has(.modal-header:contains("Warning for A Test Customer 1")):has(.modal-body:contains("Highly infectious disease"))', |
| 454 |
}, |
| 455 |
{ |
| 456 |
trigger: ".modal-footer button", |
| 457 |
run: "click", |
| 458 |
}, |
| 459 |
ProductScreen.customerIsSelected("A Test Customer 1"), |
| 460 |
ProductScreen.clickPayButton(), |
| 461 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 462 |
PaymentScreen.remainingIs("0.0"), |
| 463 |
PaymentScreen.clickValidate(), |
| 464 |
ReceiptScreen.isShown(), |
| 465 |
].flat(), |
| 466 |
}); |
| 467 |
|
| 468 |
registry.category("web_tour.tours").add("PoSSettleQuotation", { |
| 469 |
steps: () => |
| 470 |
[ |
| 471 |
Chrome.startPoS(), |
| 472 |
Dialog.confirm("Open Register"), |
| 473 |
PosSale.settleNthOrder(1), |
| 474 |
ProductScreen.clickPayButton(), |
| 475 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 476 |
PaymentScreen.clickValidate(), |
| 477 |
ReceiptScreen.isShown(), |
| 478 |
].flat(), |
| 479 |
}); |
| 480 |
|
| 481 |
registry.category("web_tour.tours").add("POSSalePaymentScreenInvoiceOrder", { |
| 482 |
steps: () => |
| 483 |
[ |
| 484 |
Chrome.startPoS(), |
| 485 |
Dialog.confirm("Open Register"), |
| 486 |
ProductScreen.addOrderline("Product Test", "1"), |
| 487 |
ProductScreen.clickPartnerButton(), |
| 488 |
ProductScreen.clickCustomer("AAA - Test Partner invoice"), |
| 489 |
ProductScreen.clickPayButton(), |
| 490 |
|
| 491 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 492 |
PaymentScreen.clickInvoiceButton(), |
| 493 |
PaymentScreen.clickValidate(), |
| 494 |
ReceiptScreen.receiptIsThere(), |
| 495 |
Chrome.waitRequest(), |
| 496 |
].flat(), |
| 497 |
}); |
| 498 |
|
| 499 |
registry.category("web_tour.tours").add("test_settle_order_with_lot", { |
| 500 |
steps: () => |
| 501 |
[ |
| 502 |
Chrome.startPoS(), |
| 503 |
Dialog.confirm("Open Register"), |
| 504 |
PosSale.settleNthOrder(1, { loadSN: true }), |
| 505 |
PosSale.selectedOrderLinesHasLots("Product A", ["1001", "1002"]), |
| 506 |
].flat(), |
| 507 |
}); |
| 508 |
|
| 509 |
registry.category("web_tour.tours").add("test_down_payment_displayed", { |
| 510 |
steps: () => |
| 511 |
[ |
| 512 |
Chrome.startPoS(), |
| 513 |
Dialog.confirm("Open Register"), |
| 514 |
PosSale.downPaymentFirstOrder("+10"), |
| 515 |
ProductScreen.clickPayButton(), |
| 516 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 517 |
PaymentScreen.clickValidate(), |
| 518 |
ReceiptScreen.clickNextOrder(), |
| 519 |
PosSale.settleNthOrder(1), |
| 520 |
Order.hasLine({ |
| 521 |
productName: "Down Payment", |
| 522 |
quantity: "1.0", |
| 523 |
price: "-1.15", |
| 524 |
}), |
| 525 |
].flat(), |
| 526 |
}); |
| 527 |
|
| 528 |
registry.category("web_tour.tours").add("test_sale_order_fp_different_from_partner_one", { |
| 529 |
steps: () => |
| 530 |
[ |
| 531 |
Chrome.startPoS(), |
| 532 |
Dialog.confirm("Open Register"), |
| 533 |
PosSale.settleSaleOrderByPrice("20.00"), |
| 534 |
ProductScreen.checkTaxAmount("10.00"), |
| 535 |
ProductScreen.checkFiscalPosition("Partner FP"), |
| 536 |
ProductScreen.clickPayButton(), |
| 537 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 538 |
PaymentScreen.clickValidate(), |
| 539 |
ReceiptScreen.receiptIsThere(), |
| 540 |
ReceiptScreen.clickNextOrder(), |
| 541 |
PosSale.settleSaleOrderByPrice("10.00"), |
| 542 |
ProductScreen.checkTaxAmount("0.00"), |
| 543 |
ProductScreen.checkFiscalPosition("Sale Order FP"), |
| 544 |
ProductScreen.clickPayButton(), |
| 545 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 546 |
PaymentScreen.clickValidate(), |
| 547 |
ReceiptScreen.receiptIsThere(), |
| 548 |
ReceiptScreen.clickNextOrder(), |
| 549 |
].flat(), |
| 550 |
}); |
| 551 |
|
| 552 |
registry.category("web_tour.tours").add("test_quantity_updated_settle", { |
| 553 |
steps: () => |
| 554 |
[ |
| 555 |
Chrome.startPoS(), |
| 556 |
Dialog.confirm("Open Register"), |
| 557 |
PosSale.settleNthOrder(1), |
| 558 |
ProductScreen.clickNumpad("2"), |
| 559 |
Order.hasLine({ productName: "Product A", quantity: "2.0" }), |
| 560 |
ProductScreen.clickPayButton(), |
| 561 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 562 |
PaymentScreen.clickValidate(), |
| 563 |
ReceiptScreen.clickNextOrder(), |
| 564 |
PosSale.settleNthOrder(1), |
| 565 |
Order.hasLine({ |
| 566 |
productName: "Product A", |
| 567 |
quantity: "3.0", |
| 568 |
price: "34.50", |
| 569 |
}), |
| 570 |
].flat(), |
| 571 |
}); |
| 572 |
|
| 573 |
registry.category("web_tour.tours").add("test_multiple_lots_sale_order_1", { |
| 574 |
steps: () => |
| 575 |
[ |
| 576 |
Chrome.startPoS(), |
| 577 |
Dialog.confirm("Open Register"), |
| 578 |
PosSale.settleNthOrder(1), |
| 579 |
Order.hasLine({ productName: "Product", quantity: "3.0" }), |
| 580 |
].flat(), |
| 581 |
}); |
| 582 |
|
| 583 |
registry.category("web_tour.tours").add("test_multiple_lots_sale_order_2", { |
| 584 |
steps: () => |
| 585 |
[ |
| 586 |
Chrome.startPoS(), |
| 587 |
PosSale.settleNthOrder(1, { loadSN: false }), |
| 588 |
Order.hasLine({ productName: "Product", quantity: "3.0" }), |
| 589 |
{ |
| 590 |
content: "Check that the line-lot-icon has text-danger class", |
| 591 |
trigger: `.order-container .orderline:has(.product-name:contains("Product")) .line-lot-icon.text-danger`, |
| 592 |
}, |
| 593 |
].flat(), |
| 594 |
}); |
| 595 |
|
| 596 |
registry.category("web_tour.tours").add("test_multiple_lots_sale_order_3", { |
| 597 |
steps: () => |
| 598 |
[ |
| 599 |
Chrome.startPoS(), |
| 600 |
PosSale.settleNthOrder(1, { loadSN: true }), |
| 601 |
PosSale.selectedOrderLinesHasLots("Product", ["1002"]), |
| 602 |
Utils.negateStep(...PosSale.selectedOrderLinesHasLots("Product", ["1001"])), |
| 603 |
ProductScreen.selectedOrderlineHas("Product", "2.00"), |
| 604 |
ProductScreen.clickOrderline("Product", "1"), |
| 605 |
PosSale.selectedOrderLinesHasLots("Product", ["1001"]), |
| 606 |
ProductScreen.selectedOrderlineHas("Product", "1.00"), |
| 607 |
Utils.negateStep(...PosSale.selectedOrderLinesHasLots("Product", ["1002"])), |
| 608 |
ProductScreen.clickPayButton(), |
| 609 |
PaymentScreen.clickPaymentMethod("Bank"), |
| 610 |
PaymentScreen.clickValidate(), |
| 611 |
ReceiptScreen.isShown(), |
| 612 |
].flat(), |
| 613 |
}); |
| 614 |
|
| 615 |
registry.category("web_tour.tours").add("test_selected_partner_quotation_loading", { |
| 616 |
steps: () => |
| 617 |
[ |
| 618 |
Chrome.startPoS(), |
| 619 |
Dialog.confirm("Open Register"), |
| 620 |
ProductScreen.clickPartnerButton(), |
| 621 |
ProductScreen.clickCustomer("A Test Partner 1"), |
| 622 |
PosSale.settleNthOrder(1), |
| 623 |
ProductScreen.selectedOrderlineHas("Product A", "1.00"), |
| 624 |
Chrome.createFloatingOrder(), |
| 625 |
ProductScreen.clickPartnerButton(), |
| 626 |
ProductScreen.clickCustomer("A Test Partner 2"), |
| 627 |
PosSale.settleNthOrder(1), |
| 628 |
ProductScreen.selectedOrderlineHas("Product B", "2.00"), |
| 629 |
].flat(), |
| 630 |
}); |
| 631 |
|
| 632 |
registry.category("web_tour.tours").add("test_ecommerce_paid_order_is_hidden_in_pos", { |
| 633 |
steps: () => |
| 634 |
[ |
| 635 |
Chrome.startPoS(), |
| 636 |
Dialog.confirm("Open Register"), |
| 637 |
ProductScreen.clickPartnerButton(), |
| 638 |
ProductScreen.clickCustomer("A Test Partner 1"), |
| 639 |
PosSale.checkOrdersListEmpty(), |
| 640 |
].flat(), |
| 641 |
}); |
| 642 |
|
| 643 |
registry.category("web_tour.tours").add("test_ecommerce_unpaid_order_is_shown_in_pos", { |
| 644 |
steps: () => |
| 645 |
[ |
| 646 |
Chrome.startPoS(), |
| 647 |
Dialog.confirm("Open Register"), |
| 648 |
ProductScreen.clickPartnerButton(), |
| 649 |
ProductScreen.clickCustomer("A Test Partner 1"), |
| 650 |
PosSale.checkOrdersListNotEmpty(), |
| 651 |
].flat(), |
| 652 |
}); |
| 653 |
|
| 654 |
registry.category("web_tour.tours").add("test_settle_groupable_lot_total_amount", { |
| 655 |
steps: () => |
| 656 |
[ |
| 657 |
Chrome.startPoS(), |
| 658 |
Dialog.confirm("Open Register"), |
| 659 |
PosSale.settleNthOrder(1, { loadSN: true }), |
| 660 |
Order.hasTotal("12.00"), |
| 661 |
].flat(), |
| 662 |
}); |