aboutsummaryrefslogtreecommitdiffstats
path: root/test/uitests.sikuli/lvcgui.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-06-01 20:25:35 -0500
committerJesús <heckyel@hyperbola.info>2020-06-01 20:25:35 -0500
commit9d221d5af918803180f74cd9fcbf107d38b068de (patch)
tree9d2b61b17c2a6305e9c62aa6f13e89826bcccfc2 /test/uitests.sikuli/lvcgui.py
parent507463cf0d147415d84990d9fd7eaff4aa6d7bd0 (diff)
downloadlibrevideoconverter-9d221d5af918803180f74cd9fcbf107d38b068de.tar.lz
librevideoconverter-9d221d5af918803180f74cd9fcbf107d38b068de.tar.xz
librevideoconverter-9d221d5af918803180f74cd9fcbf107d38b068de.zip
fix test
Diffstat (limited to 'test/uitests.sikuli/lvcgui.py')
-rw-r--r--test/uitests.sikuli/lvcgui.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/test/uitests.sikuli/lvcgui.py b/test/uitests.sikuli/lvcgui.py
index 4d9d65a..daa572c 100644
--- a/test/uitests.sikuli/lvcgui.py
+++ b/test/uitests.sikuli/lvcgui.py
@@ -1,9 +1,11 @@
from sikuli.Sikuli import *
import devices
import config
+import time
class MVCGui(object):
+
# ** APP UI IMAGES **
# ADD FILES
@@ -69,7 +71,6 @@ class MVCGui(object):
'''
config.set_image_dirs()
self.os_name = config.get_os_name()
-
# CMD or CTRL Key
if self.os_name == 'osx':
self.CMDCTRL = Key.CMD
@@ -101,7 +102,8 @@ class MVCGui(object):
def browse_for_files(self, dirname, testdata):
click(Pattern(self._CHOOSE_FILES))
- time.sleep(2) # osx freaks out if you start typing too fast
+ # osx freaks out if you start typing too fast
+ time.sleep(2)
self.type_a_path(dirname)
keyDown(self.CMDCTRL)
for f in testdata:
@@ -115,17 +117,20 @@ class MVCGui(object):
def drag_and_drop_files(self, dirname, testdata):
click(self._CHOOSE_FILES)
- y = getLastMatch() # y is drop destination
+ # y is drop destination
+ y = getLastMatch()
type(dirname)
type(Key.ENTER)
keyDown(self.CMDCTRL)
for f in testdata:
find(f)
- x = getLastMatch() # the drag start's last file we find and select
+ # the drag start is the last file we find and select
+ x = getLastMatch()
click(getLastMatch())
dragDrop(x, y)
keyUp(self.CMDCTRL)
- type(Key.ESC) # close the file browser dialog
+ # close the file browser dialog
+ type(Key.ESC)
def remove_files(self, *items):
for item in items:
@@ -166,8 +171,7 @@ class MVCGui(object):
def choose_device_conversion(self, device):
device_group = devices.dev_attr(device, 'group')
- menu_img = getattr(self, "".join(["_", device_group.upper(),
- "_", "MENU"]))
+ menu_img = getattr(self, "".join(["_",device_group.upper(),"_","MENU"]))
click(menu_img)
click(device)
@@ -193,11 +197,11 @@ class MVCGui(object):
if setting not in valid_settings:
print("valid setting value not proviced, must be 'on' or 'off'")
# CHECK THE BOX
- pref_image = getattr(self, "".join(["_", option]))
+ pref_image = getattr(self, "".join(["_",option]))
find(pref_image)
reg = Region(getLastMatch())
- box = Region(reg.getX()-15, sr_loc.getY()-10, pref_reg.getW(), 30)
# location of associated checkbox
+ box = Region(reg.getX()-15, sr_loc.getY()-10, pref_reg.getW(), 30)
if setting == "off":
if box.exists(self._PREFS_CHECKBOX_CHECKED):
click(box.getLastMatch())
@@ -251,8 +255,8 @@ class MVCGui(object):
if exists(device):
return True
else:
+ # all devices are mp4 by default
if exists(device) and exists("MP4"):
- # all devices are mp4 by default
return True
def verify_size(self, item, width, height):
@@ -260,8 +264,8 @@ class MVCGui(object):
expected_size_parameter = "-s "+width+"x"+height
type(self.CMDCTRL, 'f')
type('-s '+width+'x'+'height')
- type(self.CMDCTRL, 'c')
# copy the ffmpeg size command to the clipboard
+ type(self.CMDCTRL, 'c')
size_param = Env.getClipboard()
if size_param == expected_size_parameter:
return True
@@ -336,11 +340,9 @@ class MVCGui(object):
def verify_in_progress(self, item=None):
if item:
r = self.item_region(item)
- if r.exists(self._IN_PROGRESS):
- return True
+ if r.exists(self._IN_PROGRESS): return True
else:
- if exists(self._IN_PROGRESS):
- return True
+ if exists(self._IN_PROGRESS): return True
def verify_itunes(self, item):
pass