Merge pull request #305845 from abathur/resholve_0.10.5
[NixPkgs.git] / nixos / tests / firefoxpwa.nix
blob374d67b01ac609ce8a89579f2e5dcc5cc2d4e056
1 import ./make-test-python.nix ({ lib, ... }:
4   name = "firefoxpwa";
5   meta.maintainers = with lib.maintainers; [ camillemndn ];
7   nodes.machine =
8     { pkgs, ... }:
9     {
10       imports = [ ./common/x11.nix ];
11       environment.systemPackages = with pkgs; [ firefoxpwa jq ];
13       programs.firefox = {
14         enable = true;
15         nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
16       };
18       services.jellyfin.enable = true;
19     };
21   enableOCR = true;
23   testScript = ''
24     machine.start()
26     with subtest("Install a progressive web app"):
27         machine.wait_for_unit("jellyfin.service")
28         machine.wait_for_open_port(8096)
29         machine.succeed("firefoxpwa site install http://localhost:8096/web/manifest.json >&2")
31     with subtest("Launch the progressive web app"):
32         machine.succeed("firefoxpwa site launch $(jq -r < ~/.local/share/firefoxpwa/config.json '.sites | keys[0]') >&2")
33         machine.wait_for_window("Jellyfin")
34         machine.wait_for_text("Jellyfin")
35   '';