Debian Codegraph @

addons/product_expiry/static/tests/tours/stock_picking_tour.js

raw
1 import { registry } from "@web/core/registry";
2
3 registry.category("web_tour.tours").add('test_generate_serial_with_expiration', {
4 steps: () => [
5 {
6 trigger: "button:contains('Details')",
7 run: "click",
8 },
9 {
10 trigger: '.o_widget_generate_serials > button',
11 run: "click",
12 },
13 {
14 trigger: ".modal .btn-primary:contains('New')",
15 run: "click",
16 },
17 {
18 trigger: ".modal .btn-primary:contains('Generate')",
19 run: "click",
20 },
21 // Check that the expiration date is now set after generating Serials/Lots.
22 {
23 trigger: "td.o_field_cell[name=expiration_date]",
24 run: () => {
25 const exp_dates = document.querySelectorAll("td.o_field_cell[name=expiration_date]");
26 for (const exp_date of exp_dates) {
27 if (exp_date.innerText.trim() !== "Jun 3, 2020, 12:00 AM") {
28 throw new Error("Expiration date should be Jun 3, 12:00 AM.");
29 }
30 }
31 }
32 },
33 {
34 trigger: ".modal button:contains(save)",
35 run: "click",
36 },
37 {
38 trigger: "button.o_form_button_save",
39 run: "click",
40 },
41 {
42 trigger: ".o_form_saved",
43 },
44 ],
45 });