1{ pkgs, ... }:
2
3{
4 name = "plasma6";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ k900 ];
7 };
8
9 nodes.machine =
10 { ... }:
11
12 {
13 imports = [ ./common/user-account.nix ];
14 services.xserver.enable = true;
15 services.displayManager.sddm.enable = true;
16 # FIXME: this should be testing Wayland
17 services.displayManager.defaultSession = "plasmax11";
18 services.desktopManager.plasma6.enable = true;
19 environment.plasma6.excludePackages = [ pkgs.kdePackages.elisa ];
20 services.displayManager.autoLogin = {
21 enable = true;
22 user = "alice";
23 };
24 };
25
26 testScript =
27 { nodes, ... }:
28 let
29 user = nodes.machine.users.users.alice;
30 xdo = "${pkgs.xdotool}/bin/xdotool";
31 in
32 ''
33 with subtest("Wait for login"):
34 start_all()
35 machine.wait_for_file("/run/user/1000/xauth_*")
36 machine.wait_until_succeeds("test -s /run/user/1000/xauth_*")
37 machine.succeed("xauth merge /run/user/1000/xauth_*")
38 machine.succeed("su - ${user.name} -c 'xauth merge /run/user/1000/xauth_*'")
39
40 with subtest("Check plasmashell started"):
41 machine.wait_until_succeeds("pgrep plasmashell")
42 machine.wait_for_window("^Desktop ")
43
44 with subtest("Check that KDED is running"):
45 machine.succeed("pgrep kded6")
46
47 with subtest("Ensure Elisa is not installed"):
48 machine.fail("which elisa")
49
50 with subtest("Run Dolphin"):
51 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
52 machine.wait_for_window(" Dolphin")
53
54 with subtest("Run Konsole"):
55 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
56 machine.wait_for_window("Konsole")
57
58 with subtest("Run systemsettings"):
59 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings >&2 &'")
60 machine.wait_for_window("Settings")
61
62 with subtest("Wait to get a screenshot"):
63 machine.execute(
64 "${xdo} key Alt+F1 sleep 10"
65 )
66 machine.screenshot("screen")
67 '';
68}