diff options
Diffstat (limited to 'tests/testcases')
| -rw-r--r-- | tests/testcases/common.py | 6 | ||||
| -rwxr-xr-x | tests/testcases/copy_binary.sh | 3 | ||||
| -rw-r--r-- | tests/testcases/logs.py | 15 | ||||
| -rw-r--r-- | tests/testcases/test.py | 18 | ||||
| -rw-r--r-- | tests/testcases/timeline.py | 15 |
5 files changed, 50 insertions, 7 deletions
diff --git a/tests/testcases/common.py b/tests/testcases/common.py index 7216f7ad..05587f2d 100644 --- a/tests/testcases/common.py +++ b/tests/testcases/common.py @@ -18,6 +18,7 @@ from selenium.webdriver.support import expected_conditions as EC # global pointer to chrome driver driver = None platform = None +avd = 'zmNinja_8_0' native_context = None web_context = None @@ -74,9 +75,12 @@ def _click_with_retry(element, max_retry=3): # makes sure we can see the element to avoid out of view issues def _goto_element(e): driver.execute_script("arguments[0].scrollIntoView();", e) + #driver.execute_script("mobile:scroll", {"direction": 'up', 'element': e}) # waits for an element to load # allows you to also specify if you want a screenshot after it comes in + + def _wait_for_id(id=id, dur=30, save_screenshot=False, save_screenshot_file=None): log('Waiting for '+id+'...') WebDriverWait(driver, dur).until( @@ -86,6 +90,8 @@ def _wait_for_id(id=id, dur=30, save_screenshot=False, save_screenshot_file=None if save_screenshot: take_screenshot(id, save_screenshot_file) + + # element properties def get_element_attributes(id=id, save_screenshot=False, save_screenshot_file=None): _wait_for_id(id=id, save_screenshot=save_screenshot, diff --git a/tests/testcases/copy_binary.sh b/tests/testcases/copy_binary.sh index a02e8118..4719ea6b 100755 --- a/tests/testcases/copy_binary.sh +++ b/tests/testcases/copy_binary.sh @@ -1,4 +1,5 @@ #!/bin/bash rm -rf binary/* -cp ../../debug_files/app-debug.apk binary/zmNinja.apk +#cp ../../debug_files/app-debug.apk binary/zmNinja.apk +cp ../../release_files/zmNinja.apk binary/zmNinja.apk cp -R ~/Library/Developer/Xcode/DerivedData/zmNinja-dgoooijqwytvduflzaereulftmpl/Build/Products/Debug-iphonesimulator/zmNinja.app binary/ diff --git a/tests/testcases/logs.py b/tests/testcases/logs.py new file mode 100644 index 00000000..a24abb8c --- /dev/null +++ b/tests/testcases/logs.py @@ -0,0 +1,15 @@ +''' +Validates Logs View +''' + +import common as c +from time import sleep +import app + +def run_tests(self): + app.tap_menu_js() + c.log ('Validating logs') + c.click_item('testaut_menu_logs') + sleep(2) + c.take_screenshot(None, 'logs-app-ver.png') + diff --git a/tests/testcases/test.py b/tests/testcases/test.py index 5c54f40c..c9ee5d35 100644 --- a/tests/testcases/test.py +++ b/tests/testcases/test.py @@ -19,6 +19,7 @@ import app import montage import state import events +import logs class ZmninjaAndroidTests(unittest.TestCase): @@ -33,10 +34,10 @@ class ZmninjaAndroidTests(unittest.TestCase): desired_caps = { 'platformName': 'Android', 'automationName': 'UiAutomator2', - 'platformVersion': '7.1.1', + 'platformVersion': '8.0', 'deviceName': 'DoesntMatter', - 'avd': 'zmNinja_7_1_1', - # 'avd': 'zmNinja_6_0', + 'avd': c.avd, + # 'avd': 'zmNinja_6_0', 'nativeWebTap': True, 'nativeWebScreenshot': True, # important, for screenshots 'autoAcceptAlerts': True, @@ -135,7 +136,7 @@ class ZmninjaAndroidTests(unittest.TestCase): c.testConfig = config - run_dir = strftime(c.platform+'-%b-%d-%I_%M_%S%p', localtime()) + run_dir = strftime(c.avd+'_'+c.platform+'-%b-%d-%I_%M_%S%p', localtime()) c.testConfig['screenshot_dir'] = './screenshots/'+run_dir try: os.makedirs(c.testConfig['screenshot_dir']) @@ -153,8 +154,9 @@ class ZmninjaAndroidTests(unittest.TestCase): sleep(5) wizard.run_tests(self, isFirstRun) isFirstRun = False - montage.run_tests(self) - events.run_tests(self) + #montage.run_tests(self) + #events.run_tests(self) + logs.run_tests(self) if c.testConfig['restart']: state.run_tests(self) @@ -166,6 +168,7 @@ platform = None ap = argparse.ArgumentParser() ap.add_argument('-i', '--ios', action='store_true') ap.add_argument('-a', '--android', action='store_true') +ap.add_argument('--avd') args, u = ap.parse_known_args() args = vars(args) @@ -174,6 +177,9 @@ if args['ios']: else: c.platform = 'android' +if args['avd']: + c.avd = args['avd'] + suite = unittest.TestLoader().loadTestsFromTestCase(ZmninjaAndroidTests) diff --git a/tests/testcases/timeline.py b/tests/testcases/timeline.py new file mode 100644 index 00000000..59d94bb2 --- /dev/null +++ b/tests/testcases/timeline.py @@ -0,0 +1,15 @@ +''' +Validates Timeline View +''' + +import common as c +from time import sleep +import app + +def run_tests(self): + app.tap_menu_js() + c.log ('Validating timeline') + _wait_for_id('timeline-ctrl') + c.take_screenshot(None, 'view-after-timeline-draw.png') + + |
