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