tests/emulator/bootstrap-*: work around ADD TO DICTIONARY

This commit is contained in:
Alexander Sosedkin 2024-07-06 15:24:17 +02:00
parent 3f744f2475
commit faaacc18a5
2 changed files with 20 additions and 0 deletions

View file

@ -9,8 +9,16 @@ def run(d):
nod.launch() nod.launch()
wait_for(d, 'Bootstrap zipball location') wait_for(d, 'Bootstrap zipball location')
time.sleep(.5)
screenshot(d, 'initial') screenshot(d, 'initial')
d.ui(className='android.widget.EditText').set_text(BOOTSTRAP_URL) d.ui(className='android.widget.EditText').set_text(BOOTSTRAP_URL)
time.sleep(.5)
if 'android:id/addToDictionaryButton' in d.ui.dump_hierarchy():
screenshot(d, 'add-to-dictionary-interferes')
d.ui.press('back')
time.sleep(.5)
screenshot(d, 'add-to-dictionary-back-pressed')
time.sleep(.5)
screenshot(d, 'entered-url') screenshot(d, 'entered-url')
for i in range(2): for i in range(2):
if 'text="OK"' not in d.ui.dump_hierarchy(): if 'text="OK"' not in d.ui.dump_hierarchy():
@ -18,7 +26,9 @@ def run(d):
time.sleep(.5) time.sleep(.5)
else: else:
break break
time.sleep(.5)
screenshot(d, 'entered-url-back') screenshot(d, 'entered-url-back')
time.sleep(.5)
d.ui(text='OK').click() d.ui(text='OK').click()
screenshot(d, 'ok-clicked') screenshot(d, 'ok-clicked')

View file

@ -9,8 +9,16 @@ def run(d):
nod.launch() nod.launch()
wait_for(d, 'Bootstrap zipball location') wait_for(d, 'Bootstrap zipball location')
time.sleep(.5)
screenshot(d, 'initial') screenshot(d, 'initial')
d.ui(className='android.widget.EditText').set_text(BOOTSTRAP_URL) d.ui(className='android.widget.EditText').set_text(BOOTSTRAP_URL)
time.sleep(.5)
if 'android:id/addToDictionaryButton' in d.ui.dump_hierarchy():
screenshot(d, 'add-to-dictionary-interferes')
d.ui.press('back')
time.sleep(.5)
screenshot(d, 'add-to-dictionary-back-pressed')
time.sleep(.5)
screenshot(d, 'entered-url') screenshot(d, 'entered-url')
for i in range(2): for i in range(2):
if 'text="OK"' not in d.ui.dump_hierarchy(): if 'text="OK"' not in d.ui.dump_hierarchy():
@ -18,7 +26,9 @@ def run(d):
time.sleep(.5) time.sleep(.5)
else: else:
break break
time.sleep(.5)
screenshot(d, 'entered-url-back') screenshot(d, 'entered-url-back')
time.sleep(.5)
d.ui(text='OK').click() d.ui(text='OK').click()
screenshot(d, 'ok-clicked') screenshot(d, 'ok-clicked')