summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Hilhorst <git@hilhorst.be>2021-05-19 14:22:52 +0200
committerPatrick Hilhorst <git@hilhorst.be>2021-11-19 21:20:53 +0100
commit6ecb9a352f046013b8d81053678017705a150559 (patch)
tree2a8179f08b0ee59516cb15739b004c604a0f33c6
parent1d1d332bb29aa651a22c4bea66a9d27ccbf9a760 (diff)
downloadnixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar.gz
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar.bz2
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar.lz
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar.xz
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.tar.zst
nixpkgs-6ecb9a352f046013b8d81053678017705a150559.zip
nixos/tests/vscodium-wayland: init
-rw-r--r--nixos/tests/common/wayland-cage.nix14
-rw-r--r--nixos/tests/vscodium-wayland.nix54
2 files changed, 68 insertions, 0 deletions
diff --git a/nixos/tests/common/wayland-cage.nix b/nixos/tests/common/wayland-cage.nix
new file mode 100644
index 00000000000..55aeb858d7a
--- /dev/null
+++ b/nixos/tests/common/wayland-cage.nix
@@ -0,0 +1,14 @@
+{ ... }:
+
+{
+  imports = [ ./user-account.nix ];
+  services.cage = {
+    enable = true;
+    user = "alice";
+  };
+
+  virtualisation = {
+    memorySize = 1024;
+    qemu.options = [ "-vga virtio" ];
+  };
+}
diff --git a/nixos/tests/vscodium-wayland.nix b/nixos/tests/vscodium-wayland.nix
new file mode 100644
index 00000000000..1321c8b9827
--- /dev/null
+++ b/nixos/tests/vscodium-wayland.nix
@@ -0,0 +1,54 @@
+import ./make-test-python.nix ({ pkgs, ...} :
+
+{
+  name = "vscodium-wayland";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ synthetica ];
+  };
+
+  machine = { ... }:
+
+  {
+    imports = [
+      ./common/wayland-cage.nix
+    ];
+
+    services.cage.program = ''
+      ${pkgs.vscodium}/bin/codium \
+        --enable-features=UseOzonePlatform \
+        --ozone-platform=wayland
+      '';
+
+    fonts.fonts = with pkgs; [
+      dejavu_fonts
+    ];
+  };
+
+  enableOCR = true;
+
+  testScript = { nodes, ... }: ''
+    start_all()
+    machine.wait_for_unit('graphical.target')
+    machine.wait_until_succeeds('pgrep -x codium')
+
+    machine.wait_for_text('VSCodium')
+    machine.screenshot('start_screen')
+
+    test_string = 'testfile'
+
+    machine.send_key('ctrl-n')
+    machine.wait_for_text('Untitled')
+    machine.screenshot('empty_editor')
+
+    machine.send_chars(test_string)
+    machine.wait_for_text(test_string)
+    machine.screenshot('editor')
+
+    machine.send_key('ctrl-s')
+    machine.wait_for_text('Save')
+    machine.screenshot('save_window')
+
+    machine.send_key('ret')
+    machine.wait_for_file(f'/home/alice/{test_string}')
+  '';
+})