Skip to content

Commit

Permalink
Add culebra examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmilano committed Sep 4, 2023
1 parent a38b8db commit 3bec72b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/helper/culebra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains example of "untouched" culebra generated files.
39 changes: 39 additions & 0 deletions examples/helper/culebra/culebra-take-snapshot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013-2022 Diego Torres Milano
Created on 2023-09-03 by Culebra v22.5.1
__ __ __ __
/ \ / \ / \ / \
____________________/ __\/ __\/ __\/ __\_____________________________
___________________/ /__/ /__/ /__/ /________________________________
| / \ / \ / \ / \ \___
|/ \_/ \_/ \_/ \ o \
\_____/--<
@author: Diego Torres Milano
@author: Jennifer E. Swofford (ascii art snake)
"""


import os
import re
import sys
import time

from com.dtmilano.android.viewclient import ViewClient, KEY_EVENT


TAG = 'CULEBRA'
_s = 5
_v = '--verbose' in sys.argv
pid = os.getpid()


kwargs1 = {'verbose': False, 'ignoresecuredevice': False, 'ignoreversioncheck': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)

kwargs2 = {'forceviewserveruse': False, 'startviewserver': True, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': True, 'useuiautomatorhelper': True, 'debug': {}}
vc = ViewClient(device, serialno, **kwargs2)

helper = vc.uiAutomatorHelper
helper.ui_device.take_screenshot(filename=f'/Users/diego/Work/PycharmProjects/AndroidViewClient/tmp/ZY22DRTMS7-{pid}-0001-no_name-{helper.timestamp()}.png')

0 comments on commit 3bec72b

Please sign in to comment.