Skip to content

Commit

Permalink
#801 final cleanups, some test aut stuff too
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Apr 2, 2019
1 parent 684bcc6 commit cc3f668
Show file tree
Hide file tree
Showing 27 changed files with 87 additions and 992 deletions.
3 changes: 0 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@
<plugin name="cordova-plugin-photo-library" spec="https://github.com/terikon/cordova-plugin-photo-library.git">
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="save event images from ZM" />
</plugin>
<plugin name="cordova-plugin-ionic-webview" spec="https://github.com/pliablepixels/cordova-plugin-ionic-webview.git">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-media-pp-fork" spec="^1.0.2-dev" />
<engine name="android" spec="7.1.4" />
<engine name="ios" spec="4.5.5" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
"cordova-plugin-photo-library": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "save event images from ZM"
},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-media-pp-fork": {}
}
},
Expand All @@ -84,7 +81,6 @@
"cordova-plugin-inappbrowser": "^1.7.2",
"cordova-plugin-insomnia": "^4.3.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "git+https://github.com/pliablepixels/cordova-plugin-ionic-webview.git",
"cordova-plugin-media-pp-fork": "^1.0.2-dev",
"cordova-plugin-multi-window": "0.0.3",
"cordova-plugin-network-information": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/chromedriver/README.TXT
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Download the chrome driver version corresponding to the chrome browser version you are testing with
from http://chromedriver.chromium.org/downloads and save it here as 'chromedriver'
from http://appium.io/docs/en/writing-running-appium/web/chromedriver/
4 changes: 3 additions & 1 deletion tests/startappium.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/bash
appium --chromedriver-executable ./chromedriver/chromedriver55
appium --chromedriver-executable ./chromedriver/chromedriver234
#appium --chromedriver-executable ./chromedriver/chromedriver55
#appium --chromedriver-executable ./chromedriver/chromedriver220
6 changes: 6 additions & 0 deletions tests/testcases/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# global pointer to chrome driver
driver = None
platform = None
avd = 'zmNinja_8_0'
native_context = None
web_context = None

Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/testcases/copy_binary.sh
Original file line number Diff line number Diff line change
@@ -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/
15 changes: 15 additions & 0 deletions tests/testcases/logs.py
Original file line number Diff line number Diff line change
@@ -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')

18 changes: 12 additions & 6 deletions tests/testcases/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import montage
import state
import events
import logs


class ZmninjaAndroidTests(unittest.TestCase):
Expand All @@ -33,10 +34,10 @@ def setUp(self):
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,
Expand Down Expand Up @@ -135,7 +136,7 @@ def test_app(self):


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'])
Expand All @@ -153,8 +154,9 @@ def test_app(self):
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)

Expand All @@ -166,6 +168,7 @@ def test_app(self):
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)

Expand All @@ -174,6 +177,9 @@ def test_app(self):
else:
c.platform = 'android'

if args['avd']:
c.avd = args['avd']



suite = unittest.TestLoader().loadTestsFromTestCase(ZmninjaAndroidTests)
Expand Down
15 changes: 15 additions & 0 deletions tests/testcases/timeline.py
Original file line number Diff line number Diff line change
@@ -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')


77 changes: 0 additions & 77 deletions www/css/_/_fountain.scss

This file was deleted.

67 changes: 0 additions & 67 deletions www/css/_/_slidein-spring.scss

This file was deleted.

53 changes: 0 additions & 53 deletions www/css/_/_slidein.scss

This file was deleted.

0 comments on commit cc3f668

Please sign in to comment.