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