summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/testcases/app.py1
-rw-r--r--tests/testcases/common.py7
-rw-r--r--tests/testcases/events.py28
-rw-r--r--tests/testcases/montage.py1
-rw-r--r--tests/testcases/test.py2
-rw-r--r--www/templates/events-modal.html6
-rw-r--r--www/templates/events.html6
-rw-r--r--www/templates/menu.html2
8 files changed, 46 insertions, 7 deletions
diff --git a/tests/testcases/app.py b/tests/testcases/app.py
index b76f1edd..803751d5 100644
--- a/tests/testcases/app.py
+++ b/tests/testcases/app.py
@@ -13,6 +13,7 @@ def tap_menu_js():
c.log ('Tapping menu')
c.driver.execute_script("angular.element(document.getElementById('testaut-menu-controller')).scope().openMenu();")
+
# bah, in some cases this won't work, when the menu is open,
# there are two left items
# so I'm probably not going to use this
diff --git a/tests/testcases/common.py b/tests/testcases/common.py
index 9eb26dbd..cc3b1cdc 100644
--- a/tests/testcases/common.py
+++ b/tests/testcases/common.py
@@ -124,6 +124,13 @@ def click_item(id=id, save_screenshot=False, save_screenshot_file=None, retry=3)
_goto_element(element)
_click_with_retry(element, retry)
+
+def click_item_js(id=id, save_screenshot=False, save_screenshot_file=None):
+ _wait_for_id(id=id, save_screenshot=save_screenshot,
+ save_screenshot_file=save_screenshot_file)
+ element = driver.find_element_by_id(id)
+ log ("clicking {} using JS".format(id))
+ driver.execute_script("arguments[0].click()", element)
# sleep(wait)
# returns text value of loader
diff --git a/tests/testcases/events.py b/tests/testcases/events.py
new file mode 100644
index 00000000..9709dd3c
--- /dev/null
+++ b/tests/testcases/events.py
@@ -0,0 +1,28 @@
+'''
+Validates Events view
+'''
+
+import common as c
+from time import sleep
+import app
+
+def run_tests(self):
+ app.tap_menu_js()
+ c.log ('Validating events')
+ c.click_item('testaut_menu_events')
+
+ # Can't use click_item (el.click) due to footer button
+ # focus conflict
+ # taking 2nd event - first one goes off in emulator
+ # no idea why
+
+ c.click_item_js('testaut_events_footage_button-1')
+
+ sleep(4)
+ c.take_screenshot(None,'events-playback.png')
+ sleep(1)
+ c.dbl_click_item('testaut_events_playwindow')
+
+
+
+
diff --git a/tests/testcases/montage.py b/tests/testcases/montage.py
index cad1878e..7c7fc8a5 100644
--- a/tests/testcases/montage.py
+++ b/tests/testcases/montage.py
@@ -10,6 +10,7 @@ def run_tests(self):
app.tap_menu_js()
c.log ('Validating montage')
c.click_item('testaut_menu_montage')
+ c.take_screenshot(None, 'montage-view-initial.png')
c.click_item('img-0')
sleep(4)
c.take_screenshot(None,'montage-singleview.png')
diff --git a/tests/testcases/test.py b/tests/testcases/test.py
index 2dd4b6af..b1707f59 100644
--- a/tests/testcases/test.py
+++ b/tests/testcases/test.py
@@ -17,6 +17,7 @@ import wizard
import app
import montage
import state
+import events
class ZmninjaAndroidTests(unittest.TestCase):
@@ -119,6 +120,7 @@ class ZmninjaAndroidTests(unittest.TestCase):
wizard.run_tests(self, isFirstRun)
isFirstRun = False
montage.run_tests(self)
+ events.run_tests(self)
if c.testConfig['restart']:
state.run_tests(self)
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index 09a0ce12..3fe3824b 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -34,14 +34,14 @@
- <img ng-if="!liveFeedMid" image-spinner-src="{{constructStream()}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"
+ <img ng-if="!liveFeedMid" id="testaut_events_playwindow" image-spinner-src="{{constructStream()}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"
on-double-tap="closeModal();" img-spinner-w="1024" img-spinner-h="768" image-spinner-loader="lines"
imageonload="modalImageLoaded()" on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" />
<div ng-if="liveFeedMid">
- <img image-spinner-src="{{currentEvent.Event.streamingURL}}/nph-zms?mode=jpeg&monitor={{liveFeedMid}}&connkey={{connKey}}{{$root.authSession}}"
+ <img id="testaut_events_playwindow" image-spinner-src="{{currentEvent.Event.streamingURL}}/nph-zms?mode=jpeg&monitor={{liveFeedMid}}&connkey={{connKey}}{{$root.authSession}}"
ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}" on-double-tap="closeModal();"
img-spinner-w="1024" img-spinner-h="768" image-spinner-loader="lines" imageonload="modalImageLoaded()"
on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" />
@@ -68,7 +68,7 @@
<div on-swipe-left="onSwipeEvent(nextId,1)" on-swipe-right="onSwipeEvent(prevId,-1)" ng-style="{'height':$root.devHeight+'px', 'width':$root.devWidth+'px'}">
- <videogular vg-can-play="onCanPlay()" vg-native-fullscreen="videoObject.config.nativeFullScreen"
+ <videogular id="testaut_events_playwindow" vg-can-play="onCanPlay()" vg-native-fullscreen="videoObject.config.nativeFullScreen"
vg-player-ready="onPlayerReady($API)" vg-update-playback="onPlaybackUpdate($playBack)"
vg-plays-inline="videoObject.config.playsInline" vg-theme="videoObject.config.theme" vg-complete="playbackFinished()"
on-double-tap="closeModal();" vg-autoplay="videoObject.config.autoPlay" vg-responsive="videoObject.config.responsive"
diff --git a/www/templates/events.html b/www/templates/events.html
index e6d05e3e..394dfa14 100644
--- a/www/templates/events.html
+++ b/www/templates/events.html
@@ -120,7 +120,7 @@
ng-click="toggleGroupAlarms(event,$index,event.Event.Frames)">
<span translate="kAlarms"></span>
</button>
- <button class="button button-stable button-outline button-small icon icon-left ion-ios-eye" ng-click="closeIfOpen(event);openModal(event)">
+ <button id='testaut_events_footage_button-{{$index}}' class="button button-stable button-outline button-small icon icon-left ion-ios-eye" ng-click="closeIfOpen(event);openModal(event)">
<span translate="kFootage"></span>
</button>
@@ -197,7 +197,7 @@
<br />
<br />
<div class="videogular-container">
- <videogular vg-theme="event.Event.video.config.theme" vg-plays-inline="'true'" vg-auto-play="'true'"
+ <videogular vg-theme="event.Event.video.config.theme" vg-plays-inline="'true'" vg-auto-play="'true'"
vg-responsive="true" vg-player-ready="readyToPlay($API)">
<vg-overlay-play></vg-overlay-play>
<vg-controls>
@@ -273,7 +273,7 @@
</div>
<ion-pull-up-footer class="zmPullup" on-expand="footerExpand()" on-collapse="footerCollapse()" initial-state="minimized"
default-behavior="expand" state="footerState">
- <ion-pull-up-handle width="100" height="25" toggle="ion-chevron-up ion-chevron-down" style="border-radius: 25px 25px 0 0">
+ <ion-pull-up-handle id="testaut_events_footer_handle" width="100" height="25" toggle="ion-chevron-up ion-chevron-down" style="border-radius: 25px 25px 0 0">
<i class="icon ion-chevron-up"></i>
</ion-pull-up-handle>
<ion-pull-up-bar>
diff --git a/www/templates/menu.html b/www/templates/menu.html
index b9cf92c3..25df3422 100644
--- a/www/templates/menu.html
+++ b/www/templates/menu.html
@@ -42,7 +42,7 @@
</ion-item>
<!--<ion-item ng-click="navigateView('app.events', {id:0,playEvent:false})" menu-close>-->
- <ion-item id="menu-move-3" href="#/app/events/0/false" ng-click="go('/app/events/0/false')">
+ <ion-item id="testaut_menu_events" href="#/app/events/0/false" ng-click="go('/app/events/0/false')">
<span class=" item-icon-left">
<i class="icon ion-ios-calendar-outline"></i>
</span>{{'kMenuEvents'|translate}}