-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathbootstrap_channels.py
53 lines (43 loc) · 1.59 KB
/
bootstrap_channels.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE
import time
from common import APK, BOOTSTRAP_URL, screenshot, wait_for
def run(d):
nod = d.app('com.termux.nix', url=APK)
nod.permissions.allow_notifications()
nod.launch()
time.sleep(0.5)
wait_for(d, 'Bootstrap zipball location')
time.sleep(0.5)
screenshot(d, 'initial')
d.ui(className='android.widget.EditText').set_text(BOOTSTRAP_URL)
time.sleep(0.5)
screenshot(d, 'entered-url')
for _ in range(2):
if 'text="OK"' not in d.ui.dump_hierarchy():
d.ui.press('back')
time.sleep(0.5)
else:
break
time.sleep(0.5)
screenshot(d, 'entered-url-back')
time.sleep(0.5)
d.ui(text='OK').click()
screenshot(d, 'ok-clicked')
wait_for(d, 'Welcome to Nix-on-Droid!')
screenshot(d, 'bootstrap-begins')
wait_for(d, 'Do you want to set it up with flakes? (y/N)')
d.ui.press('enter')
wait_for(d, 'Setting up Nix-on-Droid with channels...')
wait_for(d, 'Installing and updating nix-channels...')
wait_for(d, 'unpacking channels...')
wait_for(d, 'Installing first Nix-on-Droid generation...', timeout=600)
wait_for(d, 'Copying default Nix-on-Droid config...', timeout=180)
wait_for(d, 'Congratulations!')
wait_for(d, 'See config file for further information.')
wait_for(d, 'bash-5.2$')
screenshot(d, 'bootstrap-ends')
d('input text "echo smoke-test | base64"')
d.ui.press('enter')
wait_for(d, 'c21va2UtdGVzdAo=')
screenshot(d, 'success-bootstrap-channels')
return nod