1 import ./make-test-python.nix ({ lib, pkgs, ...} :
5 meta.maintainers = [ lib.maintainers.pbek ];
7 nodes.machine = { ... }:
11 ./common/user-account.nix
15 test-support.displayManager.auto.user = "alice";
16 environment.systemPackages = [
24 testScript = { nodes, ... }: let
25 aliceDo = cmd: ''machine.succeed("su - alice -c '${cmd}' >&2 &");'';
27 with subtest("Ensure X starts"):
31 with subtest("Check QOwnNotes version on CLI"):
32 ${aliceDo "qownnotes --version"}
34 machine.wait_for_console_text("QOwnNotes ${pkgs.qownnotes.version}")
36 with subtest("Ensure QOwnNotes starts"):
37 # start QOwnNotes window
38 ${aliceDo "qownnotes"}
40 machine.wait_for_text("Welcome to QOwnNotes")
41 machine.screenshot("QOwnNotes-Welcome")
43 with subtest("Finish first-run wizard"):
44 # The wizard should show up now
45 machine.wait_for_text("Note folder")
46 machine.send_key("ret")
47 machine.wait_for_console_text("Note path '/home/alice/Notes' was now created.")
48 machine.wait_for_text("Panel layout")
49 machine.send_key("ret")
50 machine.wait_for_text("Nextcloud")
51 machine.send_key("ret")
52 machine.wait_for_text("App metric")
53 machine.send_key("ret")
55 # The main window should now show up
56 machine.wait_for_text("QOwnNotes - ${pkgs.qownnotes.version}")
57 machine.wait_for_open_port(22222)
58 machine.wait_for_console_text("QOwnNotes server listening on port 22222")
60 machine.screenshot("QOwnNotes-DemoNote")
62 with subtest("Create a new note"):
63 machine.send_key("ctrl-n")
65 machine.send_chars("This is a NixOS test!\n")
66 machine.wait_for_text("This is a NixOS test!")
68 machine.screenshot("QOwnNotes-NewNote")