1import ./make-test-python.nix ({ pkgs, ...} :
2
3{
4 name = "vscodium";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ turion ];
7 };
8
9 machine = { ... }:
10
11 {
12 imports = [
13 ./common/user-account.nix
14 ./common/x11.nix
15 ];
16
17 virtualisation.memorySize = 2047;
18 services.xserver.enable = true;
19 test-support.displayManager.auto.user = "alice";
20 environment.systemPackages = with pkgs; [
21 vscodium
22 ];
23 };
24
25 enableOCR = true;
26
27 testScript = { nodes, ... }: ''
28 # Start up X
29 start_all()
30 machine.wait_for_x()
31
32 # Start VSCodium with a file that doesn't exist yet
33 machine.fail("ls /home/alice/foo.txt")
34 machine.succeed("su - alice -c 'codium foo.txt' &")
35
36 # Wait for the window to appear
37 machine.wait_for_text("VSCodium")
38
39 # Save file
40 machine.send_key("ctrl-s")
41
42 # Wait until the file has been saved
43 machine.wait_for_file("/home/alice/foo.txt")
44
45 machine.screenshot("VSCodium")
46 '';
47})