1 import ../make-test-python.nix (
5 # copy_from_host works only for store paths
8 meta.broken = true; # takes hours to time out since October 2021
17 ../common/user-account.nix
20 environment.systemPackages = [
21 # To avoid clashing with xfce4-terminal
31 lightdm.enable = true;
38 desktopManager.xfce.enable = true;
45 pkgs.fcitx-engines.m17n
46 pkgs.fcitx-engines.table-extra
53 testScript = { nodes, ... }:
55 user = nodes.machine.config.users.users.alice;
58 xauth = "${userHome}/.Xauthority";
59 fcitx_confdir = "${userHome}/.config/fcitx";
62 # We need config files before login session
65 # Point and click would be expensive,
66 # So configure using files
67 machine.copy_from_host(
69 "${fcitx_confdir}/profile",
71 machine.copy_from_host(
73 "${fcitx_confdir}/config",
78 machine.wait_for_file("${xauth}")
79 machine.succeed("xauth merge ${xauth}")
83 machine.succeed("su - ${userName} -c 'alacritty&'")
84 machine.succeed("su - ${userName} -c 'fcitx&'")
88 machine.send_chars("echo ")
91 ### Start fcitx Unicode input
92 machine.send_key("ctrl-alt-shift-u")
96 ### Search for smiling face
97 machine.send_chars("smil")
100 ### Navigate to the second one
101 machine.send_key("tab")
105 machine.send_key("\n")
108 ### Start fcitx language input
109 machine.send_key("ctrl-spc")
112 ### Default zhengma, enter 一下
113 machine.send_chars("a2")
116 ### Switch to Harvard Kyoto
117 machine.send_key("alt-shift")
121 machine.send_chars("ka ")
124 machine.send_key("alt-shift")
128 machine.send_key("ctrl-spc")
131 ### Redirect typed characters to a file
132 machine.send_chars(" > fcitx_test.out\n")
134 machine.screenshot("terminal_chars")
136 ### Verify that file contents are as expected
137 file_content = machine.succeed("cat ${userHome}/fcitx_test.out")
138 assert file_content == "☺一下क\n"