3 wayland = { pkgs, ... }: {
4 imports = [ ./common/wayland-cage.nix ];
6 services.cage.program = "${pkgs.vscodium}/bin/codium";
8 environment.variables.NIXOS_OZONE_WL = "1";
9 environment.variables.DISPLAY = "do not use";
11 fonts.fonts = with pkgs; [ dejavu_fonts ];
13 xorg = { pkgs, ... }: {
14 imports = [ ./common/user-account.nix ./common/x11.nix ];
16 virtualisation.memorySize = 2047;
17 services.xserver.enable = true;
18 services.xserver.displayManager.sessionCommands = ''
19 ${pkgs.vscodium}/bin/codium
21 test-support.displayManager.auto.user = "alice";
25 mkTest = name: machine:
26 import ./make-test-python.nix ({ pkgs, ... }: {
29 nodes = { "${name}" = machine; };
31 meta = with pkgs.lib.maintainers; {
32 maintainers = [ synthetica turion ];
36 # testScriptWithTypes:55: error: Item "function" of
37 # "Union[Callable[[Callable[..., Any]], ContextManager[Any]], ContextManager[Any]]"
38 # has no attribute "__enter__"
39 # with codium_running:
46 machine.succeed('pgrep -x codium')
51 machine.wait_for_unit('graphical.target')
52 machine.wait_until_succeeds('pgrep -x codium')
55 # Wait until vscodium is visible. "File" is in the menu bar.
56 machine.wait_for_text('Get Started')
57 machine.screenshot('start_screen')
59 test_string = 'testfile'
62 machine.send_key('ctrl-n')
63 machine.wait_for_text('Untitled')
64 machine.screenshot('empty_editor')
67 machine.send_chars(test_string)
68 machine.wait_for_text(test_string)
69 machine.screenshot('editor')
72 machine.send_key('ctrl-s')
73 machine.wait_for_text('(Save|Desktop|alice|Size)')
74 machine.screenshot('save_window')
75 machine.send_key('ret')
77 # (the default filename is the first line of the file)
78 machine.wait_for_file(f'/home/alice/{test_string}')
80 # machine.send_key('ctrl-q')
81 # machine.wait_until_fails('pgrep -x codium')
86 builtins.mapAttrs (k: v: mkTest k v { }) tests