nixosTests.vscodium: Workaround OCR tests

An attempt to help https://hydra.nixos.org/build/279535629/nixlog/1.

The "Get Started with" text is much easier to find.
Also scale vscodium to help OCR find the "Untitled" text.
This commit is contained in:
Bobby Rong 2024-11-30 20:38:25 +08:00
parent 73710fe751
commit cd45cfe9c4
No known key found for this signature in database

View File

@ -3,7 +3,8 @@ let
wayland = { pkgs, ... }: { wayland = { pkgs, ... }: {
imports = [ ./common/wayland-cage.nix ]; imports = [ ./common/wayland-cage.nix ];
services.cage.program = "${pkgs.vscodium}/bin/codium"; # We scale vscodium to help OCR find the small "Untitled" text.
services.cage.program = "${pkgs.vscodium}/bin/codium --force-device-scale-factor=2";
environment.variables.NIXOS_OZONE_WL = "1"; environment.variables.NIXOS_OZONE_WL = "1";
environment.variables.DISPLAY = "do not use"; environment.variables.DISPLAY = "do not use";
@ -16,7 +17,7 @@ let
virtualisation.memorySize = 2047; virtualisation.memorySize = 2047;
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = '' services.xserver.displayManager.sessionCommands = ''
${pkgs.vscodium}/bin/codium ${pkgs.vscodium}/bin/codium --force-device-scale-factor=2
''; '';
test-support.displayManager.auto.user = "alice"; test-support.displayManager.auto.user = "alice";
}; };
@ -46,7 +47,7 @@ let
codium_running.wait() # type: ignore[union-attr] codium_running.wait() # type: ignore[union-attr]
with codium_running: # type: ignore[union-attr] with codium_running: # type: ignore[union-attr]
# Wait until vscodium is visible. "File" is in the menu bar. # Wait until vscodium is visible. "File" is in the menu bar.
machine.wait_for_text('Welcome') machine.wait_for_text('Get Started with')
machine.screenshot('start_screen') machine.screenshot('start_screen')
test_string = 'testfile' test_string = 'testfile'