at 25.11-pre 1.8 kB view raw
1import ./make-test-python.nix ( 2 { pkgs, ... }: 3 { 4 name = "i3wm"; 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ aszlig ]; 7 }; 8 9 nodes.machine = 10 { lib, ... }: 11 { 12 imports = [ 13 ./common/x11.nix 14 ./common/user-account.nix 15 ]; 16 test-support.displayManager.auto.user = "alice"; 17 services.displayManager.defaultSession = lib.mkForce "none+i3"; 18 services.xserver.windowManager.i3.enable = true; 19 }; 20 21 testScript = 22 { ... }: 23 '' 24 with subtest("ensure x starts"): 25 machine.wait_for_x() 26 machine.wait_for_file("/home/alice/.Xauthority") 27 machine.succeed("xauth merge ~alice/.Xauthority") 28 29 with subtest("ensure we get first configuration window"): 30 machine.wait_for_window(r".*?first configuration.*?") 31 machine.sleep(2) 32 machine.screenshot("started") 33 34 with subtest("ensure we generate and save a config"): 35 # press return to indicate we want to gen a new config 36 machine.send_key("\n") 37 machine.sleep(2) 38 machine.screenshot("preconfig") 39 # press alt then return to indicate we want to use alt as our Mod key 40 machine.send_key("alt") 41 machine.send_key("\n") 42 machine.sleep(2) 43 # make sure the config file is created before we continue 44 machine.wait_for_file("/home/alice/.config/i3/config") 45 machine.screenshot("postconfig") 46 machine.sleep(2) 47 48 with subtest("ensure we can open a new terminal"): 49 machine.send_key("alt-ret") 50 machine.sleep(2) 51 machine.wait_for_window(r"alice.*?machine") 52 machine.sleep(2) 53 machine.screenshot("terminal") 54 ''; 55 } 56)