forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9863d55
commit 0a1ce91
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import ./make-test-python.nix ({ pkgs, ...}: let | ||
pin = "1234"; | ||
in { | ||
name = "phosh"; | ||
meta = with pkgs.lib.maintainers; { | ||
maintainers = [ zhaofengli ]; | ||
}; | ||
|
||
nodes = { | ||
phone = { config, pkgs, ... }: { | ||
users.users.nixos = { | ||
isNormalUser = true; | ||
password = pin; | ||
}; | ||
|
||
services.xserver.desktopManager.phosh = { | ||
enable = true; | ||
user = "nixos"; | ||
group = "users"; | ||
|
||
phocConfig = { | ||
outputs.Virtual-1 = { | ||
scale = 2; | ||
}; | ||
}; | ||
}; | ||
|
||
virtualisation.resolution = { x = 720; y = 1440; }; | ||
virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci,xres=720,yres=1440" ]; | ||
}; | ||
}; | ||
|
||
enableOCR = true; | ||
|
||
testScript = '' | ||
import time | ||
start_all() | ||
phone.wait_for_unit("phosh.service") | ||
with subtest("Check that we can see the lock screen info page"): | ||
# Saturday, January 1 | ||
phone.succeed("timedatectl set-time '2022-01-01 07:00'") | ||
phone.wait_for_text("Saturday") | ||
phone.screenshot("01lockinfo") | ||
with subtest("Check that we can unlock the screen"): | ||
phone.send_chars("${pin}", delay=0.2) | ||
time.sleep(1) | ||
phone.screenshot("02unlock") | ||
phone.send_chars("\n") | ||
phone.wait_for_text("All Apps") | ||
phone.screenshot("03launcher") | ||
with subtest("Check that we can launch an app"): | ||
phone.send_chars("settings\n\n", delay=0.2) | ||
phone.wait_for_text("Network") | ||
phone.screenshot("04settings") | ||
with subtest("Check that we can summon the on-screen keyboard"): | ||
phone.succeed("busctl call [email protected] --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true") | ||
phone.wait_for_text("123") # Button label for the number layer | ||
phone.screenshot("05keyboard") | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters