1import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "morph-browser-standalone";
3 meta.maintainers = lib.teams.lomiri.members;
4
5 nodes.machine = { config, pkgs, ... }: {
6 imports = [
7 ./common/x11.nix
8 ];
9
10 services.xserver.enable = true;
11
12 environment = {
13 systemPackages = with pkgs.lomiri; [
14 suru-icon-theme
15 morph-browser
16 ];
17 variables = {
18 UITK_ICON_THEME = "suru";
19 };
20 };
21
22 i18n.supportedLocales = [ "all" ];
23
24 fonts.packages = with pkgs; [
25 # Intended font & helps with OCR
26 ubuntu_font_family
27 ];
28 };
29
30 enableOCR = true;
31
32 testScript =
33 ''
34 machine.wait_for_x()
35
36 with subtest("morph browser launches"):
37 machine.execute("morph-browser >&2 &")
38 machine.wait_for_text(r"Web Browser|New|sites|Bookmarks")
39 machine.screenshot("morph_open")
40
41 with subtest("morph browser displays HTML"):
42 machine.send_chars("file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html\n")
43 machine.wait_for_text("Valgrind Documentation")
44 machine.screenshot("morph_htmlcontent")
45
46 machine.succeed("pkill -f morph-browser")
47
48 with subtest("morph browser localisation works"):
49 machine.execute("env LANG=de_DE.UTF-8 morph-browser >&2 &")
50 machine.wait_for_text(r"Web-Browser|Neuer|Seiten|Lesezeichen")
51 machine.screenshot("morph_localised")
52 '';
53})