mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
tests/emulator, .github/workflows/emulator: add
This commit is contained in:
parent
d72ab2a167
commit
291970c4c4
9 changed files with 374 additions and 0 deletions
33
tests/emulator/on_device_tests.py
Normal file
33
tests/emulator/on_device_tests.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from common import screenshot, wait_for
|
||||
|
||||
|
||||
def run(d):
|
||||
wait_for(d, 'bash-5.2$')
|
||||
|
||||
d('input text "nix-on-droid on-device-test"')
|
||||
d.ui.press('enter')
|
||||
wait_for(d, 'These semi-automated tests are destructive', timeout=180)
|
||||
wait_for(d, 'Proceeding will wreck your installation.')
|
||||
wait_for(d, 'Do you still wish to proceed?')
|
||||
d('input text "I do"')
|
||||
d.ui.press('enter')
|
||||
screenshot(d, 'tests-started')
|
||||
|
||||
d.ui.open_notification()
|
||||
d.ui(text='Nix').right(resourceId='android:id/expand_button').click()
|
||||
screenshot(d, 'notification_expanded')
|
||||
d.ui(description='Acquire wakelock').click()
|
||||
screenshot(d, 'wakelock_acquired')
|
||||
d.ui(description='Release wakelock').wait()
|
||||
screenshot(d, 'gotta-go-back')
|
||||
d.ui.press('back')
|
||||
screenshot(d, 'went-back')
|
||||
|
||||
if 'text="Allow"' in d.ui.dump_hierarchy():
|
||||
d.ui(text='Allow').click()
|
||||
elif 'text="ALLOW"' in d.ui.dump_hierarchy():
|
||||
d.ui(text='ALLOW').click()
|
||||
screenshot(d, 'tests-running')
|
||||
|
||||
wait_for(d, 'tests, 0 failures in', timeout=1800)
|
||||
screenshot(d, 'tests-finished')
|
||||
Loading…
Add table
Add a link
Reference in a new issue