1 import ./make-test-python.nix ({ pkgs, ...} :
4 # Make sure we don't have to go through the startup tutorial
5 customMuseScoreConfig = pkgs.writeText "MuseScore4.ini" ''
7 hasCompletedFirstLaunchSetup=true
10 preferredScoreCreationMode=1
15 meta = with pkgs.lib.maintainers; {
16 maintainers = [ turion ];
19 nodes.machine = { ... }:
26 services.xserver.enable = true;
27 environment.systemPackages = with pkgs; [
35 testScript = { ... }: ''
39 # Inject custom settings
40 machine.succeed("mkdir -p /root/.config/MuseScore/")
42 "cp ${customMuseScoreConfig} /root/.config/MuseScore/MuseScore4.ini"
45 # Start MuseScore window
46 machine.execute("env XDG_RUNTIME_DIR=$PWD DISPLAY=:0.0 mscore >&2 &")
48 # Wait until MuseScore has launched
49 machine.wait_for_window("MuseScore Studio")
51 machine.screenshot("MuseScore0")
54 machine.send_key("ctrl-n")
56 # Wait until the creation wizard appears
57 machine.wait_for_window("New score")
59 machine.screenshot("MuseScore1")
61 machine.send_key("tab")
62 machine.send_key("tab")
63 machine.send_key("ret")
67 machine.send_key("tab")
68 # Type the beginning of https://de.wikipedia.org/wiki/Alle_meine_Entchen
69 machine.send_chars("cdef6gg5aaaa7g")
72 machine.screenshot("MuseScore2")
74 # Go to the export dialogue and create a PDF
75 machine.send_key("ctrl-p")
77 # Wait until the Print dialogue appears.
78 machine.wait_for_window("Print")
80 machine.screenshot("MuseScore4")
81 machine.send_key("alt-p")
84 machine.screenshot("MuseScore5")
86 # Wait until PDF is exported
87 machine.wait_for_file('"/root/Untitled score.pdf"')
89 ## Check that it contains the title of the score
90 machine.succeed('pdfgrep "Untitled score" "/root/Untitled score.pdf"')
91 machine.copy_from_vm("/root/Untitled score.pdf")