19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:29:53 +01:00
parent 6e54c1af6c
commit 3ca647e428
1087 changed files with 132065 additions and 108499 deletions

View file

@ -0,0 +1,82 @@
import * as SelectionPopup from "@point_of_sale/../tests/generic_helpers/selection_popup_util";
import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
import * as NumberPopup from "@point_of_sale/../tests/generic_helpers/number_popup_util";
import { negate } from "@point_of_sale/../tests/generic_helpers/utils";
export function clickLoginButton() {
return [
{
content: "click login button",
trigger: ".login-overlay .select-cashier",
run: "click",
},
];
}
export function clickCashierName() {
return [
{
content: "click cashier name",
trigger: ".cashier-name",
run: "click",
},
];
}
export function loginScreenIsShown() {
return [
{
content: "login screen is shown",
trigger: ".login-overlay .screen-login",
},
];
}
export function loginScreenIsNotShown() {
return [
{
content: "login screen is not shown",
trigger: negate(".login-overlay .screen-login"),
},
];
}
export function cashierNameIs(name) {
return [
{
isActive: ["desktop"],
content: `logged cashier is '${name}'`,
trigger: `.pos .oe_status .username:contains("${name}")`,
},
{
isActive: ["mobile"],
content: `logged cashier is '${name}'`,
trigger: `.pos .oe_status img[alt="${name}"]`,
},
];
}
export function login(name, pin) {
const res = [...clickLoginButton(), ...SelectionPopup.has(name, { run: "click" })];
if (!pin) {
return res;
}
return res.concat(enterPin(pin));
}
export function enterPin(pin) {
return [...NumberPopup.enterValue(pin), ...NumberPopup.isShown("••••"), Dialog.confirm()];
}
export function clickLockButton() {
return {
content: "Click on the menu button",
trigger: ".pos-rightheader i.fa-unlock",
run: "click",
};
}
export function refreshPage() {
return [
{
trigger: ".pos",
run: () => {
window.location.reload();
},
expectUnloadPage: true,
},
];
}