1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00
nixpkgs/nixos/tests/vscodium.nix

48 lines
978 B
Nix
Raw Normal View History

2021-02-08 12:54:24 +00:00
import ./make-test-python.nix ({ pkgs, ...} :
{
name = "vscodium";
meta = with pkgs.lib.maintainers; {
maintainers = [ turion ];
};
machine = { ... }:
{
imports = [
./common/user-account.nix
./common/x11.nix
];
virtualisation.memorySize = 2047;
services.xserver.enable = true;
test-support.displayManager.auto.user = "alice";
environment.systemPackages = with pkgs; [
vscodium
];
};
enableOCR = true;
testScript = { nodes, ... }: ''
# Start up X
start_all()
machine.wait_for_x()
2021-02-10 15:03:52 +00:00
# Start VSCodium with a file that doesn't exist yet
machine.fail("ls /home/alice/foo.txt")
2021-02-08 12:54:24 +00:00
machine.succeed("su - alice -c 'codium foo.txt' &")
# Wait for the window to appear
machine.wait_for_text("VSCodium")
# Save file
machine.send_key("ctrl-s")
# Wait until the file has been saved
2021-02-10 15:03:52 +00:00
machine.wait_for_file("/home/alice/foo.txt")
2021-02-08 12:54:24 +00:00
machine.screenshot("VSCodium")
'';
})