nixos/tests/pulseaudio: fix pavucontrol detection

The test tries to detect the presence of pavucontrol's
window by looking for the tab label "Playback".
However, the OCR mechanism fails to resolve the
text, possibly due to the grey background color.

To fix this issue, we instead look for the name of the
sound device ("Dummy Output") which gets resolved by OCR.

Note: Strangely, the tab "Playback" *is* correctly
resolved when the test is run in interactive mode.
This might be due to the changed screen resolution,
but I didn't investigate further.
This commit is contained in:
Yarny0 2022-08-18 10:28:02 +02:00
parent 7df2bb1902
commit 0fd2538678

View File

@ -59,9 +59,9 @@ let
machine.screenshot("testPlay")
# Pavucontrol only loads when Pulseaudio is running. If it isn't, the
# text "Playback" (one of the tabs) will never show.
# text "Dummy Output" (sound device name) will never show.
machine.send_chars("pavucontrol\n")
machine.wait_for_text("Playback")
machine.wait_for_text("Dummy Output")
machine.screenshot("Pavucontrol")
'';
});