Commit 23436285 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Renamed "destination" to "target"

Change-Id: I8f8a1cc4b58642fc64adfa76eea84c2b4e9f0423
Reviewed-on: http://codereview.qt-project.org/6255


Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent bdf486fc
......@@ -129,7 +129,7 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks):
test.verify(os.path.exists(ui_path), "Checking if '" + ui_path + "' was created")
test.verify(os.path.exists(pro_path), "Checking if '" + pro_path + "' was created")
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, destination = QtQuickConstants.Destinations.DESKTOP):
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, targets = QtQuickConstants.Targets.DESKTOP):
invokeMenuItem("File", "New File or Project...")
clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton)
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick Application", 5, 5, 0, Qt.LeftButton)
......@@ -157,7 +157,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
type(baseLineEd, templateFile)
clickButton(nextButton)
chooseDestination(destination)
chooseTargets(targets)
snooze(1)
clickButton(nextButton)
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
......
......@@ -9,7 +9,7 @@ class QtQuickConstants:
MEEGO_HARMATTAN = 4
EXISTING_QML = 8
class Destinations:
class Targets:
DESKTOP = 1
SIMULATOR = 2
SYMBIAN = 4
......@@ -30,16 +30,16 @@ class QtQuickConstants:
return None
@staticmethod
def getStringForDestination(destination):
if destination==QtQuickConstants.Destinations.DESKTOP:
def getStringForTarget(target):
if target==QtQuickConstants.Targets.DESKTOP:
return "Desktop"
elif destination==QtQuickConstants.Destinations.SYMBIAN:
elif target==QtQuickConstants.Targets.SYMBIAN:
return "Symbian Device"
elif destination==QtQuickConstants.Destinations.MAEMO5:
elif target==QtQuickConstants.Targets.MAEMO5:
return "Maemo5"
elif destination==QtQuickConstants.Destinations.SIMULATOR:
elif target==QtQuickConstants.Targets.SIMULATOR:
return "Qt Simulator"
elif destination==QtQuickConstants.Destinations.HARMATTAN:
elif target==QtQuickConstants.Targets.HARMATTAN:
return "Harmattan"
else:
return None
......@@ -63,26 +63,26 @@ def chooseComponents(components=QtQuickConstants.Components.BUILTIN):
test.verify(rbComponentToChoose.checked, "Selected QRadioButton is '%s'"
% QtQuickConstants.getStringForComponents(components))
# parameter destination can be an OR'd value of QtQuickConstants.Destinations
def chooseDestination(destination=QtQuickConstants.Destinations.DESKTOP):
# parameter target can be an OR'd value of QtQuickConstants.Targets
def chooseTargets(targets=QtQuickConstants.Targets.DESKTOP):
# DESKTOP should be always accessible
destDesktop = waitForObject("{type='QCheckBox' text='%s' visible='1'}"
% QtQuickConstants.getStringForDestination(QtQuickConstants.Destinations.DESKTOP), 20000)
mustCheck = destination & QtQuickConstants.Destinations.DESKTOP==QtQuickConstants.Destinations.DESKTOP
if (mustCheck and not destDesktop.checked) or (not mustCheck and destDesktop.checked):
% QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.DESKTOP), 20000)
mustCheck = targets & QtQuickConstants.Targets.DESKTOP==QtQuickConstants.Targets.DESKTOP
if (mustCheck ^ destDesktop.checked):
clickButton(destDesktop)
# following destinations depend on the build environment - added for further/later tests
available = [QtQuickConstants.Destinations.SYMBIAN, QtQuickConstants.Destinations.MAEMO5,
QtQuickConstants.Destinations.SIMULATOR, QtQuickConstants.Destinations.HARMATTAN]
# following targets depend on the build environment - added for further/later tests
available = [QtQuickConstants.Targets.SYMBIAN, QtQuickConstants.Targets.MAEMO5,
QtQuickConstants.Targets.SIMULATOR, QtQuickConstants.Targets.HARMATTAN]
for current in available:
mustCheck = destination & current == current
mustCheck = targets & current == current
try:
target = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForDestination(current))
if (mustCheck and not target.checked) or (not mustCheck and target.checked):
clickButton(target)
targetCheckbox = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForTarget(current))
if mustCheck ^ targetCheckbox.checked:
clickButton(targetCheckbox)
except LookupError:
if mustCheck:
test.fail("Failed to check destination '%s'" % QtQuickConstants.getStringForDestination(current))
test.fail("Failed to check target '%s'" % QtQuickConstants.getStringForTarget(current))
def runAndCloseApp():
global processStarted, processExited
......
......@@ -35,9 +35,8 @@ def createNewQmlExtension():
# now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton)
chooseDestination()
chooseTargets()
clickButton(nextButton)
# buddy = waitForObject("{type='QLabel' text='Object Class-name:' unnamed='1' visible='1'}", 20000)
nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} "
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceEditorContent(nameLineEd, "TestItem")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment