food-market/src/food-market.pos/Program.cs
nns 84fc350bb6
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
test(pos): реальное окно на Windows 11 + демо-режим + раздел галереи
- --demo: окно с примером чека без логина (software-рендер на Windows, т.к. у
  тест-VM нет GPU — иначе окно чёрное).
- Снят реальный экран кассы на Windows 11 (интерактивная сессия tester через
  scheduled task /it + PrintWindow): подтверждён нативный рендер — кириллица,
  формат «3 362 ₸», кнопки без обрезки → docs/pos-screenshots/windows/ + раздел
  «Windows 11» в галерее.
- Ограничения VM (не код, честно в docs): нет GPU → software-рендер; консоль
  1280×800 → 1366/1920 реальным окном недоступны (они в headless-кадрах, тот же
  движок); меню «Пуск» VM залипает. Автоматизация логики UI — headless --uitest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:55:20 +05:00

39 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Avalonia;
using foodmarket.Pos.Tooling;
namespace foodmarket.Pos;
internal static class Program
{
[STAThread]
public static int Main(string[] args)
{
PosFormat.Apply(); // единый формат чисел (KZ/RU: «3 422 ₸», «1,235 кг»)
// CLI-режимы (без интерактивного окна):
// --smoke : прогон сценария кассы через логику (без UI), печать результатов.
// --screenshots : headless-рендер экранов в docs/pos-screenshots (1920×1080 + 1366×768).
// --uitest : headless UI-автотест экрана продажи (Avalonia.Headless, для CI/xvfb).
if (args.Contains("--smoke")) return SmokeRunner.Run(args);
if (args.Contains("--screenshots")) return ScreenshotRunner.Run(args);
if (args.Contains("--uitest")) return UiTestRunner.Run(args);
// --demo : показать реальное окно с примерами данных (для скриншота на Windows).
if (args.Contains("--demo")) App.DemoMode = true;
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
return 0;
}
public static AppBuilder BuildAvaloniaApp()
{
var b = AppBuilder.Configure<App>().UsePlatformDetect();
// Демо-скриншот на headless VM (без GPU) — ПО-рендеринг, иначе окно чёрное.
if (App.DemoMode && OperatingSystem.IsWindows())
b = b.With(new Avalonia.Win32PlatformOptions
{
RenderingMode = new[] { Avalonia.Win32RenderingMode.Software },
});
return b.WithInterFont().LogToTrace();
}
}