diff options
author | Zheng Liu (George) <zheng.g.liu@nokia.com> | 2011-05-12 09:54:36 +1000 |
---|---|---|
committer | Zheng Liu (George) <zheng.g.liu@nokia.com> | 2011-05-12 09:54:36 +1000 |
commit | 1a48602005960e83fb17252cf2bf31df062721b1 (patch) | |
tree | c97b2d41a5a069c7a9bb487cc4c7f65023a109de | |
parent | ac586a299abf3f52d60ecacba2521f2139d0f9da (diff) | |
parent | 15579ec2cc81ec7cff3f6b1fd17434b0c4554f20 (diff) |
Merge branch 'master' of scm.dev.nokia.troll.no:research/systemtests
-rw-r--r-- | Qt/examples/declarative/pincharea/pincharea.qml | 33 | ||||
-rw-r--r-- | Qt/examples/declarative/rtl/rtltext.qml | 5 | ||||
-rw-r--r-- | Qt/examples/declarative/rtl/rtltexteditselection.qml | 134 | ||||
-rw-r--r-- | Qt/examples/declarative/rtl/sys_rtl/sys_rtl.qtt | 32 | ||||
-rw-r--r-- | Qt/examples/declarative/textedit/sys_textedit/sys_textedit.qtt | 11 | ||||
-rw-r--r-- | Qt/examples/declarative/textedit/textedit.qml | 16 | ||||
-rw-r--r-- | Qt/examples/declarative/textinput/sys_textinput/sys_textinput.qtt | 4 | ||||
-rw-r--r-- | Qt/examples/declarative/textinput/textinput.qml | 15 | ||||
-rw-r--r-- | QtMobility/sys_location/sys_location.qtt | 52 |
9 files changed, 259 insertions, 43 deletions
diff --git a/Qt/examples/declarative/pincharea/pincharea.qml b/Qt/examples/declarative/pincharea/pincharea.qml index 2324ace..98af88f 100644 --- a/Qt/examples/declarative/pincharea/pincharea.qml +++ b/Qt/examples/declarative/pincharea/pincharea.qml @@ -47,13 +47,9 @@ Rectangle { Rectangle { color: "transparent"; border.color: "black"; x: 150; y: 150; height: 250; width: 250 } PinchArea { - property int xpoint - property int ypoint - property int pinchscale - property int pinchrotation id: pinchy - enabled: false pinch.target: logo + enabled: false anchors.fill: parent pinch.dragAxis: Pinch.XandYAxis pinch.minimumScale: 0.5 @@ -64,14 +60,10 @@ Rectangle { pinch.maximumY: 300 pinch.minimumRotation: -150 pinch.maximumRotation: 150 - onPinchUpdated: { xpoint = pinch.center.x; ypoint = pinch.center.y; pinchrotation = pinch.rotation; pinchscale = pinch.scale } } Rectangle { - id: logo; width: 200; height: 200 - x: 100 - y: 100 - color: "white" + id: logo; width: 200; height: 200; x: 100; y: 100; color: "white" Image { anchors.fill: parent source: "qt-logo.jpg" @@ -90,13 +82,13 @@ Rectangle { Item { Column { Text { - text: "Scale: " + pinchy.pinchscale + " (" + pinchy.pinch.minimumScale + "/" + pinchy.pinch.maximumScale + ")" + text: "Scale: " + pinchy.pinch.target.scale + " (" + pinchy.pinch.minimumScale + "/" + pinchy.pinch.maximumScale + ")" } Text { - text: "Coord: " + pinchy.xpoint + "/" + pinchy.ypoint + " (" + pinchy.pinch.minimumX + "/" + pinchy.pinch.maximumX + "," + pinchy.pinch.minimumY + "/" + pinchy.pinch.maximumY + ")" + text: "Coord: " + pinchy.pinch.target.x + "/" + pinchy.pinch.target.y + " (" + pinchy.pinch.minimumX + "/" + pinchy.pinch.maximumX + "," + pinchy.pinch.minimumY + "/" + pinchy.pinch.maximumY + ")" } Text { - text: "Rotation: " + pinchy.pinchrotation + " (" + pinchy.pinch.minimumRotation + "/" + pinchy.pinch.maximumRotation + ")" + text: "Rotation: " + pinchy.pinch.target.rotation + " (" + pinchy.pinch.minimumRotation + "/" + pinchy.pinch.maximumRotation + ")" } } } @@ -110,4 +102,19 @@ Rectangle { Text { anchors.centerIn: parent; text: "Reload" } MouseArea { anchors.fill: parent; onClicked: { qmlViewer.reload(); } } } + + Item { + height: runtime.orientation != 2 ? parent.height : 0 + Behavior on height { NumberAnimation { duration: 200 } } + width: runtime.orientation != 2 ? parent.width : 0 + Behavior on width { NumberAnimation { duration: 200 } } + anchors.centerIn: parent + Rectangle { + height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue" + Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter + text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device" + } + } + MouseArea { anchors.fill: parent } + } } diff --git a/Qt/examples/declarative/rtl/rtltext.qml b/Qt/examples/declarative/rtl/rtltext.qml index c517671..e573b66 100644 --- a/Qt/examples/declarative/rtl/rtltext.qml +++ b/Qt/examples/declarative/rtl/rtltext.qml @@ -89,6 +89,7 @@ Flickable { } } } + Text { text: "Default application\ndirection is " + (Qt.application.layoutDirection == Qt.RightToLeft ? "Right-to-left" : "Left-to-right") horizontalAlignment: Text.AlignHCenter @@ -102,7 +103,7 @@ Flickable { Text { text: { if (root.horizontalAlignment == undefined) - return "Implict alignment"; + return "Implicit alignment"; switch (root.horizontalAlignment) { case Text.AlignLeft: return "Left alignment"; @@ -229,6 +230,8 @@ Flickable { anchors.fill: parent color: Qt.rgba(0.5, 0.5, 0.2, 0.3) } + onSelectedTextChanged: { copy(); } + selectByMouse: true Text { text: root.description[index] color: Qt.rgba(1,1,1,1.0) diff --git a/Qt/examples/declarative/rtl/rtltexteditselection.qml b/Qt/examples/declarative/rtl/rtltexteditselection.qml new file mode 100644 index 0000000..d1d4945 --- /dev/null +++ b/Qt/examples/declarative/rtl/rtltexteditselection.qml @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of QtUiTest. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 + +Flickable { + height: 640; width: 360; contentHeight: root.height; contentWidth: 360; boundsBehavior: Flickable.StopAtBounds + Rectangle { + id: root + width: 300; height: 600; anchors.centerIn: parent + color: "white" + property string text: "مرحبا العالم" + property string pastetext + property variant horizontalAlignment: undefined + Column { + id: containerColumn + spacing: 10 + width: parent.width + anchors.top: parent.top + anchors.topMargin: 5 + TextEdit { + id: tedit + wrapMode: TextEdit.Wrap + width: parent.width + height: 250 + text: root.text + font.pixelSize: 30 + horizontalAlignment: root.horizontalAlignment + selectByMouse: true + Rectangle { + z: -1 + anchors.fill: parent + color: Qt.rgba(0.5, 0.5, 0.2, 0.3) + } + onSelectedTextChanged: { if(selectedText != ""){ copy(); root.pastetext = selectedText; } } + Text { + color: "white" + text: { + if (tedit.horizontalAlignment == undefined) + return "I"; + switch (tedit.horizontalAlignment) { + case Text.AlignLeft: + return "L"; + case Text.AlignRight: + return "R"; + case Text.AlignHCenter: + return "C"; + case Text.AlignJustify: + return "J"; + } + } + anchors{ top: parent.top; right: parent.right; margins: 2 } + } + } + Rectangle { + height: 50; width: parent.width; color: Qt.rgba(0.5, 0.5, 0.2, 0.3); radius: 10; border.color: "gray" + MouseArea { anchors.fill: parent; onClicked: { tedit.paste(); } } + Text { + height: 25; width: parent.width - 10; anchors.centerIn: parent; font.pixelSize: 20 + text: "Paste: " + root.pastetext + } + } + Rectangle { + height: 50; width: parent.width; color: Qt.rgba(0.5, 0.5, 0.2, 0.3); radius: 10; border.color: "gray" + MouseArea { anchors.fill: parent + property int index: 0 + onClicked: { + if (index < 0) { + root.horizontalAlignment = undefined; + } else { + root.horizontalAlignment = Math.pow(2, index); + } + index = (index + 2) % 5 - 1; + } + } + Text { + height: 25; width: parent.width - 10; anchors.centerIn: parent; font.pixelSize: 20 + text: { + if (root.horizontalAlignment == undefined) + return "Implicit alignment"; + switch (tedit.horizontalAlignment) { + case Text.AlignLeft: + return "Left alignment"; + case Text.AlignRight: + return "Right alignment"; + case Text.AlignHCenter: + return "Center alignment"; + case Text.AlignJustify: + return "Justify alignment"; + } + } + } + } + } + } +}
\ No newline at end of file diff --git a/Qt/examples/declarative/rtl/sys_rtl/sys_rtl.qtt b/Qt/examples/declarative/rtl/sys_rtl/sys_rtl.qtt index b6d5b60..43bb38f 100644 --- a/Qt/examples/declarative/rtl/sys_rtl/sys_rtl.qtt +++ b/Qt/examples/declarative/rtl/sys_rtl/sys_rtl.qtt @@ -49,10 +49,6 @@ Note: Empty/whitepace text has no direction, thus TextEdits will still show the | *Step* | *Verification* | | Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment | | Observe the three different element types - Text, TextInput, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the right | -| (Skip this on devices with no Home/End key) In the right-to-left TextInput, press Home, then End | Verify the cursor moves fully to the right, and fully to the left respectively | -| In the TextEdit field, copy some of the Arabic text | | -| At the leftmost position of the text, press Enter | | -| Paste the copied text | The text is pasted into the box, also right aligned |')); }, left_center_and_right_text_alignment_data: @@ -67,13 +63,9 @@ Note: Empty/whitepace text has no direction, thus TextEdits will still show the prompt(twiki('---++ '+name+' Text alignment Note: Empty/whitepace text has no direction, thus TextEdits will still show the cursor to the left. See http://bugreports.qt.nokia.com/browse/QTBUG-17973 | *Step* | *Verification* | -| Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Left alignment | +| Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment | | Press the indicator until '+name+' alignment shows | Verify that the indicator at the bottom shows '+name+' alignment | | Observe the three different element types - Text, TextInput, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the '+alignment+' | -| (Skip this on devices with no Home/End key) In the right-to-left TextInput, press Home, then End | Verify the cursor moves fully to the right of the text only, and then fully to the left side respectively | -| In the TextEdit field, copy some of the Arabic text | | -| At the leftmost position of the text, press Enter | | -| Paste the copied text | The text is pasted into the box, also '+alignment+' aligned |')); }, justified_text_alignment: function() @@ -85,10 +77,24 @@ Note: Empty/whitepace text has no direction, thus TextEdits will still show the | Execute systemtests/Qt/examples/declarative/rtl/rtltext.qml | Verify that the indicator at the bottom shows Implicit alignment | | Press the indicator until Justify alignment shows | Verify that the indicator at the bottom shows Justify alignment | | Observe two of the three different element types - Text, TextEdit | Verify that for each case where the text box shows right-to-left text, the text is aligned to the right | -| (Skip this on devices with no Home/End key) In the right-to-left TextInput, press Home, then End | Verify the cursor moves fully to the right, and fully to the left respectively | -| In the TextEdit field, copy some of the Arabic text | | -| At the leftmost position of the text, press Enter | | -| Paste the copied text | The text is pasted into the box, also right aligned |')); + }, + + left_center_and_right_text_alignment_data: + { + left: ["Left", "left"], + center: ["Center", "center"], + right: ["Right", "right"] + }, + + select_copy_paste: function(name,alignment) + { +| *Step* | *Verification* | +| Execute systemtests/Qt/examples/declarative/rtl/rtltexteditselection.qml | Verify that the indicator at the bottom button shows Implicit alignment | +| (Skip this on devices with no Home/End key) In the right-to-left TextInput, press Home, then End | Verify the cursor moves fully to the right of the text only, and then fully to the left side respectively | +| Press the lower button until it shows '+name+' Alignment | | +| In the TextEdit field, select some of the text some of the Arabic text | The selected text is shown in the Paste: <text> button - it is now copied | +| At the leftmost position of the text, press Enter on the keypad or soft keyboard | A new line is created below the existing text | +| Press the Paste: <text> button | The text is pasted into the box, also '+alignment+' aligned |')); } } diff --git a/Qt/examples/declarative/textedit/sys_textedit/sys_textedit.qtt b/Qt/examples/declarative/textedit/sys_textedit/sys_textedit.qtt index e30ba5e..4ca41fe 100644 --- a/Qt/examples/declarative/textedit/sys_textedit/sys_textedit.qtt +++ b/Qt/examples/declarative/textedit/sys_textedit/sys_textedit.qtt @@ -49,13 +49,14 @@ testcase = { | *Step* | *Verification* | | Execute systemtests/Qt/examples/declarative/textedit/textedit.qml | | | Enter Hello World into the green textedit field | Hello World is shown | -| Press the Select Word button | World is selected | +| Press the Select Word button, ensuring the previously entered text in no longer in pre-commit mode | World is selected | | Press the Select All button | Hello World is selected | | Press the Select None button | No text is selected | -| Press the Mouse Select button | The button is highlighted to represent selectByMouse = true | -| Click and drag over some text | Only that text is selected. On sans-keyboard Symbian, the soft keyboard will show with selected text highlighted | -| Press the Mouse Select button | The button is un-highlighted to represent selectByMouse = false | -| Click and drag over some text | No text is selected. On sans-keyboard Symbian, the soft keyboard will show | +| Press the Mouse Select button | The button turns green and indicates Mouse On | +| Click and drag over some text | Only that text is selected. On sans-keyboard Symbian, the soft keyboard may show with selected text highlighted | +| If the soft keyboard is shown, close it | | +| Press the Mouse Select button | The button turns gray and indicates Mouse Off | +| Click and drag over some text | No text is selected. On sans-keyboard Symbian, the soft keyboard may show | ')); }, diff --git a/Qt/examples/declarative/textedit/textedit.qml b/Qt/examples/declarative/textedit/textedit.qml index 771250d..91d1ee2 100644 --- a/Qt/examples/declarative/textedit/textedit.qml +++ b/Qt/examples/declarative/textedit/textedit.qml @@ -42,6 +42,7 @@ import QtQuick 1.1 Rectangle { + height: 360; width: 640; color: "gray" Rectangle { id: textedit1box; width: 200; height: 30; color: "green" @@ -229,4 +230,19 @@ Rectangle { } } } + + Item { + height: runtime.orientation != 2 ? parent.height : 0 + Behavior on height { NumberAnimation { duration: 200 } } + width: runtime.orientation != 2 ? parent.width : 0 + Behavior on width { NumberAnimation { duration: 200 } } + anchors.centerIn: parent + Rectangle { + height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue" + Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter + text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device" + } + } + MouseArea { anchors.fill: parent } + } }
\ No newline at end of file diff --git a/Qt/examples/declarative/textinput/sys_textinput/sys_textinput.qtt b/Qt/examples/declarative/textinput/sys_textinput/sys_textinput.qtt index 51e4bf0..8a6af73 100644 --- a/Qt/examples/declarative/textinput/sys_textinput/sys_textinput.qtt +++ b/Qt/examples/declarative/textinput/sys_textinput/sys_textinput.qtt @@ -52,9 +52,9 @@ testcase = { | Press the Select Word button | World is selected | | Press the Select All button | Hello World is selected | | Press the Select None button | No text is selected | -| Press the Mouse Select button | The button is highlighted to represent selectByMouse = true | +| Press the Mouse Select button | The button turns green and indicates Mouse On | | Click and drag over some text | Only that text is selected. On sans-keyboard Symbian, the soft keyboard will show with selected text highlighted | -| Press the Mouse Select button | The button is un-highlighted to represent selectByMouse = false | +| Press the Mouse Select button | The button turns gray and indicates Mouse Off | | Click and drag over some text | No text is selected. On sans-keyboard Symbian, the soft keyboard will show | ')); }, diff --git a/Qt/examples/declarative/textinput/textinput.qml b/Qt/examples/declarative/textinput/textinput.qml index 999f1af..70b3ebf 100644 --- a/Qt/examples/declarative/textinput/textinput.qml +++ b/Qt/examples/declarative/textinput/textinput.qml @@ -266,4 +266,19 @@ Rectangle { } } } + + Item { + height: runtime.orientation != 2 ? parent.height : 0 + Behavior on height { NumberAnimation { duration: 200 } } + width: runtime.orientation != 2 ? parent.width : 0 + Behavior on width { NumberAnimation { duration: 200 } } + anchors.centerIn: parent + Rectangle { + height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue" + Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter + text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device" + } + } + MouseArea { anchors.fill: parent } + } }
\ No newline at end of file diff --git a/QtMobility/sys_location/sys_location.qtt b/QtMobility/sys_location/sys_location.qtt index e4e6bc7..52b1a0a 100644 --- a/QtMobility/sys_location/sys_location.qtt +++ b/QtMobility/sys_location/sys_location.qtt @@ -54,11 +54,10 @@ testcase = { location_is_updated: function() { prompt(twiki('---+++ Position changes are detected - 1. Run the fetchgooglemaps example (sources are in examples/fetchgooglemaps). - 1. Note the initial position displayed in the example. - 1. Move to a different location. - 1. Note the updated position displayed in the example. - 1. Verify that the new position in step 4 corresponds to the move in step 3 (i.e. if the device moved north, the new position should clearly indicate this).' + Note that GPS and internet connection is required for this test case. + | *Step* | *Verification* | + | Run the lightmaps_with_location app (sources are in demos\lightmaps). | Verify that map is displayed and centered with the current position | + | Move to a different location | Verify that map is updated and centered with new location |' )); }, @@ -195,7 +194,7 @@ testcase = { | Fill in 9 in to Top Left Lat field | | | Fill in 0 in to Top Left Long field | | | Fill in 0 i to Bottom Right Lat filed | | - | Fill in 1 in to Top Left Long field | | + | Fill in 1 in to Bottom Right Long field | | | Press Ok button | Verify that only C and D landmarks are in the list and landmarks appear in alphabetical order |' )); }, @@ -282,7 +281,7 @@ testcase = { }, request_route_from_one_GPS_location_to_another_data: { - route:["-27.575", "153.088", "-27.465", "153.023", "16050", "15989"] + route:["-27.575", "153.088", "-27.465", "153.023", "15901", "15987"] }, request_route_from_one_GPS_location_to_another: function(lat1, long1, lat2, long2, distance1, distance2) @@ -299,7 +298,7 @@ testcase = { enter(long2); select("Ok"); prompt(twiki("Wait until the route is calculated (should be less than 10 seconds)")); - prompt(twiki("Verify the instructions for segments 1 and 5 indicate to 'Head towards Logan rd' and 'Turn left on Logan rd'")); + prompt(twiki("Verify the there are 8 segments, first and last instructions indicate to 'Head toward Logan rd' and 'Turn right onto Bartley St'")); select("routes/route"); compare(getText("distance"), distance1); select("Request Route"); @@ -312,11 +311,46 @@ testcase = { prompt(twiki('Verify the instructions for segments 1 and 2 indicate to Head towards Sedgebrook st and Turn right onto Sedgebrook st')); compare(getText("distance"), distance2); }, + + geocoding: function() + { + prompt(twiki('---+++ Geocoding + Note that testing via proxy is not recommended, incorrect settings can be a cause of the " Socket operation timed out" error + | *Step* | *Verification* | + | Run the GeoServiceDemo application (sources are /tests/location-testing-tools/geoservicedemo) | | + | Select Search By Adress tab | | + | Select One-box Search checkbox | | + | Fill in "Brandl st, Eight Mile Plains, Australia" in search field | | + | Select Geocoding search | | + | Press Ok button | | + | Wait until data is recieved | | + | Select places | Verify that count = 1 | + | Select place | Verify that latitude is -27.5798, longitude is 153.1 | + | Select address | Verify that Country is AUSTRALIA, country code is AUS, city is Eight Mile Plains, street name is Branl St, post code is 4113 |' + )); + + }, + + reverse_geocoding: function() + { + prompt(twiki('---+++ Reverse geocoding + Note that testing via proxy is not recommended, incorrect settings can be a cause of the " Socket operation timed out" error + | *Step* | *Verification* | + | Run the GeoServiceDemo application | | + | Select Reverse Geocoding tab | | + | Press Search By Coordinates button | | + | Fill in -27.5798 in Latitude field | | + | Fill in 153.1 in Longitude field | | + | Press Ok button | | + | Wait until data is recieved | | + | Select places/place/adress | Verify that Country is AUSTRALIA, country code is AUS, city is Eight Mile Plains, street name is 54 Branl St, post code is 4113 |' + )); + }, displaying_a_map: function() { prompt(twiki('---+++ Different views are displayed - Note that GPS and internet connection is required for this test case. + Note that internet connection is required for this test case. Note that Nokia map engine supports only Street, Satellite and Terrain map types | *Step* | *Verification* | | Run the MapView application (sources are /tests/location-testing-tools/mapviewer) | Map for current location is displayed on the screen | |