--- a/cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.cpp Thu May 13 23:17:48 2010 +0300
+++ b/cmmanager/cpwlanapplugin/tsrc/ut/testcpwlanapplugin.cpp Fri May 14 10:52:16 2010 +0300
@@ -24,12 +24,16 @@
#include <HbDataForm>
#include <HbDataFormModel>
#include <HbDataFormModelItem>
+#include <HbDataFormViewItem>
+#include <HbModelIterator>
+#include <QSharedPointer>
#include <QtTest/QtTest>
#include <cpbearerapplugininterface.h>
#include <cmmanager_shim.h>
#include <cmconnectionmethod_shim.h>
#include "cpwlanapview.h"
+#include "cpwlanapadvancedview.h"
#include "hbautotest.h"
#include "testcpwlanapplugin.h"
@@ -55,33 +59,23 @@
static const int waitTime = 10;
// UI coordinates
-static const QPoint connectionNameLabel(175, 70);
-
-static const QPoint connectionNameLineEdit(330, 110);
-
-static const QPoint wlanNetworkNameLineEdit(330, 190);
+static const QPoint scrollMiddle(350, 280);
+static const QPoint scrollTop(350, 50);
+static const QPoint scrollBottom(350, 520);
-static const QPoint networkStatusComboBox(175, 270);
-static const QPoint networkStatusPublic(175, 325);
-static const QPoint networkStatusHidden(175, 375);
-
-static const QPoint networkModeComboBox(175, 365);
-static const QPoint networkModeIntrastructure(175, 415);
-static const QPoint networkModeAdHoc(175, 465);
+// Use positive offset if dropdown opens under the combobox
+static const QPoint comboBoxItemOffset(0, 55);
+// Use negative offset if dropdown opens above the combobox
+static const QPoint comboBoxItemNegativeOffset(0, -50);
-static const QPoint securityModeComboBox(175, 460);
-#ifndef WLAN_SECURITY_PLUGINS_AVAILABLE
-static const QPoint securityModeOpen(175, 510);
-#else
-static const QPoint securityModeOpen(175, 260);
-static const QPoint securityModeWep(175, 305);
-static const QPoint securityModeWpaWpa2(175, 355);
-static const QPoint securityModeWpa2(175, 405);
-#endif
+static const QPoint exitEditorOffset(-10, -20);
+
+static const QPoint messageBoxOkButtonOffset(160, 140);
-static const QPoint homepageLineEdit(330, 545);
-
-static const QPoint messageBoxOkButton(170, 320);
+// Advanced settings groups
+static const QPoint ipv4Group(160, 10);
+static const QPoint ipv6Group(160, 60);
+static const QPoint proxyGroup(160, 110);
// -----------------------------------------------------------------------------
// FRAMEWORK FUNCTIONS
@@ -121,8 +115,8 @@
// Load plugin
QDir dir(pluginDir);
- QPluginLoader loader(dir.absoluteFilePath(pluginName));
- mPlugin = qobject_cast<CpBearerApPluginInterface *>(loader.instance());
+ mPluginLoader = new QPluginLoader(dir.absoluteFilePath(pluginName));
+ mPlugin = qobject_cast<CpBearerApPluginInterface *>(mPluginLoader->instance());
QVERIFY(mPlugin != NULL);
// Verify plugin bearer type
@@ -130,6 +124,8 @@
// Create WLAN settings view (connection method ID given)
subCreateSettingsView(testApId);
+
+ subGetUiWidgets();
}
/**
@@ -139,6 +135,11 @@
{
delete mMainWindow;
mMainWindow = 0;
+
+ // Force unloading of plugin
+ mPluginLoader->unload();
+ delete mPluginLoader;
+ mPluginLoader = 0;
}
/**
@@ -168,15 +169,16 @@
QFETCH(QString, string);
QFETCH(QString, result);
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit);
+ HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget);
// Erase old string
- subClearLineEdit(CMManagerShim::CmNameLength);
+ QString text = mTestView->mConnectionNameItem->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
// Enter new string
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel);
+ HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget, exitEditorOffset);
// Verify both commsdat and UI widget
subVerifyString(
@@ -212,15 +214,20 @@
QString previous =
mTestView->mConnectionNameItem->contentWidgetData("text").toString();
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLineEdit);
+ HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget);
+
// Erase old string
- subClearLineEdit(CMManagerShim::CmNameLength);
+ QString text = mTestView->mConnectionNameItem->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel);
+ HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget, exitEditorOffset);
QTest::qWait(100);
// Dismiss messagebox
- HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton);
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestView->mMessageBox.data(),
+ messageBoxOkButtonOffset);
// Verify both commsdat and UI widget
subVerifyString(
@@ -237,15 +244,16 @@
QFETCH(QString, string);
QFETCH(QString, result);
- HbAutoTest::mouseClick(mMainWindow, mTestView, wlanNetworkNameLineEdit);
+ HbAutoTest::mouseClick(mMainWindow, mWlanNetworkNameWidget);
// Erase old string
- subClearLineEdit(CMManagerShim::WlanSSIDLength);
+ QString text = mTestView->mWlanNetworkNameItem->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
// Enter new string
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel);
+ HbAutoTest::mouseClick(mMainWindow, mWlanNetworkNameWidget, exitEditorOffset);
// Verify both commsdat and UI widget
subVerifyString(
@@ -281,16 +289,20 @@
QString previous =
mTestView->mWlanNetworkNameItem->contentWidgetData("text").toString();
- HbAutoTest::mouseClick(mMainWindow, mTestView, wlanNetworkNameLineEdit);
+ HbAutoTest::mouseClick(mMainWindow, mWlanNetworkNameWidget);
// Erase old string
- subClearLineEdit(CMManagerShim::WlanSSIDLength);
+ QString text = mTestView->mWlanNetworkNameItem->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel);
+ HbAutoTest::mouseClick(mMainWindow, mWlanNetworkNameWidget, exitEditorOffset);
QTest::qWait(100);
// Dismiss messagebox
- HbAutoTest::mouseClick(mMainWindow, mTestView, messageBoxOkButton);
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestView->mMessageBox.data(),
+ messageBoxOkButtonOffset);
// Verify both commsdat and UI widget
subVerifyString(
@@ -304,14 +316,17 @@
*/
void TestCpWlanApPlugin::tcChangeNetworkStatus()
{
+ QPointF publicPointOffset = comboBoxItemOffset;
+ QPointF hiddenPointOffset = comboBoxItemOffset * 2;
+
// Set network status to hidden
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusComboBox, 100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusHidden, 100);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget, hiddenPointOffset, 100);
subVerifyNetworkStatus(HiddenStatus);
// Set network status to public
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusComboBox, 100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkStatusPublic, 100);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget, publicPointOffset, 100);
subVerifyNetworkStatus(PublicStatus);
}
@@ -320,14 +335,17 @@
*/
void TestCpWlanApPlugin::tcChangeNetworkMode()
{
+ QPointF infraPointOffset = comboBoxItemOffset;
+ QPointF adHocPointOffset = comboBoxItemOffset * 2;
+
// Set network mode to ad-hoc
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeComboBox, 100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeAdHoc, 100);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget, adHocPointOffset, 100);
subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Adhoc);
// Set network mode to infrastructure
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeComboBox, 100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, networkModeIntrastructure, 100);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget);
+ HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget, infraPointOffset, 100);
subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Infra);
}
@@ -337,37 +355,52 @@
void TestCpWlanApPlugin::tcChangeSecurityMode()
{
#ifdef WLAN_SECURITY_PLUGINS_AVAILABLE
- // Ensure security mode is open
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100);
+ QPointF openPointOffset = comboBoxItemNegativeOffset * 4;
+ QPointF wepPointOffset = comboBoxItemNegativeOffset * 3;
+ QPointF wpaPointOffset = comboBoxItemNegativeOffset * 2;
+ QPointF wpa2PointOffset = comboBoxItemNegativeOffset;
+#else
+ QPointF openPointOffset = comboBoxItemNegativeOffset;
+#endif
+
+#ifdef WLAN_SECURITY_PLUGINS_AVAILABLE
+ // Set security mode to WEP
+ HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget);
QTest::qWait(100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeOpen, 100);
- subVerifyUint(
- CMManagerShim::WlanSecurityMode,
- CMManagerShim::WlanSecModeOpen);
-
- QTest::qWait(1000);
-
- // Set security mode to WEP
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100);
- QTest::qWait(100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeWep, 100);
+ HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget, wepPointOffset, 100);
subVerifyUint(
CMManagerShim::WlanSecurityMode,
CMManagerShim::WlanSecModeWep);
QTest::qWait(1000);
#endif
-
// Set security mode to open
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeComboBox, 100);
+ HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget);
QTest::qWait(100);
- HbAutoTest::mouseClick(mMainWindow, mTestView, securityModeOpen, 100);
+ HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget, openPointOffset, 100);
subVerifyUint(
CMManagerShim::WlanSecurityMode,
CMManagerShim::WlanSecModeOpen);
}
/**
+ * Scrolls the tested view to the bottom.
+ */
+void TestCpWlanApPlugin::tcScrollToBottom()
+{
+ subScrollToBottom();
+}
+
+/**
+ * Gets UI widget pointers because homepage view item may have been
+ * created before it was visible on the UI.
+ */
+void TestCpWlanApPlugin::tcGetUiWidgets()
+{
+ subGetUiWidgets();
+}
+
+/**
* Tests changing of homepage.
*/
void TestCpWlanApPlugin::tcChangeHomepage()
@@ -375,7 +408,7 @@
QFETCH(QString, string);
QFETCH(QString, result);
- HbAutoTest::mouseClick(mMainWindow, mTestView, homepageLineEdit);
+ HbAutoTest::mouseClick(mMainWindow, mHomepageWidget);
// Erase old string
QString text = mTestView->mHomepageItem->contentWidgetData("text").toString();
@@ -384,7 +417,7 @@
// Enter new string
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
- HbAutoTest::mouseClick(mMainWindow, mTestView, connectionNameLabel);
+ HbAutoTest::mouseClick(mMainWindow, mHomepageWidget, exitEditorOffset);
// Verify both commsdat and UI widget
subVerifyString(
@@ -401,10 +434,9 @@
QTest::addColumn<QString>("string");
QTest::addColumn<QString>("result");
-// Doesn't work always, view goes blank sometimes, Orbit bug?
-// QTest::newRow("long")
-// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"
-// << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html";
+ QTest::newRow("long")
+ << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"
+ << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html";
QTest::newRow("basic") // last one should always fit on one line in UI
<< "http://www.symbian.org/"
<< "http://www.symbian.org/";
@@ -414,9 +446,9 @@
}
/**
- * Tests advanced settings view (which is currently empty).
+ * Opens advanced settings view.
*/
-void TestCpWlanApPlugin::tcAdvancedSettings()
+void TestCpWlanApPlugin::tcOpenAdvancedSettingsView()
{
// Launch advanced settings view
bool status = connect(
@@ -426,9 +458,781 @@
SLOT(menuActionTriggered(HbAction *)));
Q_ASSERT(status);
emit menuActionTriggered(mTestView->mAdvancedSettingsAction);
+
+ QTest::qWait(1000);
+
+ mTestViewAdvanced = static_cast<CpWlanApAdvancedView *>(mMainWindow->currentView());
+}
- QTest::qWait(2000);
+/**
+ * Expands the IPv4 settings group and gets UI widget pointers.
+ */
+void TestCpWlanApPlugin::tcExpandIpv4SettingsAndGetUiWidgets()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipv4Group);
+
+ QTest::qWait(500);
+
+ subGetAdvancedUiWidgets(0);
+}
+
+/**
+ * Tests enabling of automatic phone IP address.
+ */
+void TestCpWlanApPlugin::tcEnableAutomaticIpv4Address()
+{
+ Qt::CheckState state = static_cast<Qt::CheckState>
+ (mTestViewAdvanced->mIpv4Automatic->contentWidgetData("checkState").toInt());
+ if (state == Qt::Checked) {
+ // Disable automatic IP address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget);
+ }
+ // Enable automatic IP address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget);
+ subVerifyBool(
+ CMManagerShim::CmIPAddrFromServer,
+ true);
+
+ // Ensure that editing the IP address is not allowed
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget);
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SubnetMaskWidget);
+ HbAutoTest::mouseClick(mMainWindow, mIpv4GatewayWidget);
+}
+
+/**
+ * Tests disabling of automatic phone IP address.
+ */
+void TestCpWlanApPlugin::tcEnableUserDefinedIpv4Address()
+{
+ Qt::CheckState state = static_cast<Qt::CheckState>
+ (mTestViewAdvanced->mIpv4Automatic->contentWidgetData("checkState").toInt());
+ if (state == Qt::Checked) {
+ // Disable automatic IP address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget);
+ }
+ // Can't verify the setting from CommsDat here, because CMManager will
+ // set it back to true if no valid IP address is yet defined. The flag
+ // is verified in tcChangeIpAddress().
+}
+
+/**
+ * Tests changing of IP address.
+ */
+void TestCpWlanApPlugin::tcChangeIpAddress()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4Address->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPAddress,
+ mTestViewAdvanced->mIpv4Address,
+ result);
+ subVerifyBool(
+ CMManagerShim::CmIPAddrFromServer,
+ false);
+}
+
+/**
+ * Test data for IP address change test case.
+ */
+void TestCpWlanApPlugin::tcChangeIpAddress_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("too long")
+ << "255.255.255.2551234"
+ << "255.255.255.255";
+ QTest::newRow("normal")
+ << "192.168.0.1"
+ << "192.168.0.1";
+}
+
+/**
+ * Tests changing of subnet mask.
+ */
+void TestCpWlanApPlugin::tcChangeSubnetMask()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SubnetMaskWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4SubnetMask->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SubnetMaskWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPNetmask,
+ mTestViewAdvanced->mIpv4SubnetMask,
+ result);
+}
+
+/**
+ * Test data for subnet mask change test case.
+ */
+void TestCpWlanApPlugin::tcChangeSubnetMask_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("empty")
+ << ""
+ << "0.0.0.0";
+ QTest::newRow("zero")
+ << "0.0.0.0"
+ << "0.0.0.0";
+ QTest::newRow("too long")
+ << "255.255.255.2551234"
+ << "255.255.255.255";
+ QTest::newRow("normal")
+ << "192.168.0.1"
+ << "192.168.0.1";
+}
+
+/**
+ * Tests invalid subnet mask.
+ */
+void TestCpWlanApPlugin::tcInvalidSubnetMask()
+{
+ QString previous =
+ mTestViewAdvanced->mIpv4SubnetMask->contentWidgetData("text").toString();
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SubnetMaskWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4SubnetMask->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, "999.999.999.999", 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SubnetMaskWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+ // Dismiss messagebox
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestViewAdvanced->mMessageBox.data(),
+ messageBoxOkButtonOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPNetmask,
+ mTestViewAdvanced->mIpv4SubnetMask,
+ previous);
+}
+
+/**
+ * Tests changing of gateway.
+ */
+void TestCpWlanApPlugin::tcChangeGateway()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4GatewayWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4Gateway->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4GatewayWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPGateway,
+ mTestViewAdvanced->mIpv4Gateway,
+ result);
+}
+
+/**
+ * Test data for gateway change test case.
+ */
+void TestCpWlanApPlugin::tcChangeGateway_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("empty")
+ << ""
+ << "0.0.0.0";
+ QTest::newRow("zero")
+ << "0.0.0.0"
+ << "0.0.0.0";
+ QTest::newRow("too long")
+ << "255.255.255.2551234"
+ << "255.255.255.255";
+ QTest::newRow("normal")
+ << "192.168.0.1"
+ << "192.168.0.1";
+}
+
+/**
+ * Tests invalid gateway address.
+ */
+void TestCpWlanApPlugin::tcInvalidGateway()
+{
+ QString previous =
+ mTestViewAdvanced->mIpv4Gateway->contentWidgetData("text").toString();
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4GatewayWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4Gateway->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, "999.999.999.999", 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4GatewayWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+ // Dismiss messagebox
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestViewAdvanced->mMessageBox.data(),
+ messageBoxOkButtonOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPGateway,
+ mTestViewAdvanced->mIpv4Gateway,
+ previous);
+}
+
+/**
+ * Scrolls the tested view to the bottom.
+ */
+void TestCpWlanApPlugin::tcScrollToBottom2()
+{
+ subScrollToBottom();
+}
+
+/**
+ * Tests enabling of automatic IPv4 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcEnableAutomaticIpv4DnsAddress()
+{
+ Qt::CheckState state = static_cast<Qt::CheckState>
+ (mTestViewAdvanced->mIpv4DnsAutomatic->contentWidgetData("checkState").toInt());
+ if (state == Qt::Checked) {
+ // Disable automatic IPv4 DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget);
+ }
+ // Enable automatic IPv4 DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget);
+ subVerifyBool(
+ CMManagerShim::CmIPDNSAddrFromServer,
+ true);
+
+ // Ensure that editing the IP address is not allowed
+ HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget);
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget);
+}
+
+/**
+ * Tests disabling of automatic IPv4 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcEnableUserDefinedIpv4DnsAddress()
+{
+ Qt::CheckState state = static_cast<Qt::CheckState>
+ (mTestViewAdvanced->mIpv4DnsAutomatic->contentWidgetData("checkState").toInt());
+ if (state == Qt::Checked) {
+ // Disable automatic IPv4 DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget);
+ }
+ // Can't verify the setting from CommsDat here, because CMManager will
+ // set it back to true if no valid IP address is yet defined. The flag
+ // is verified in tcChangeIpv4DnsAddress().
+}
+
+/**
+ * Tests changing of IPv4 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcChangeIpv4DnsAddress()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ // Primary DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPNameServer1,
+ mTestViewAdvanced->mIpv4DnsAddress1,
+ result);
+
+ // Secondary DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget);
+
+ // Erase old string
+ text = mTestViewAdvanced->mIpv4DnsAddress2->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPNameServer2,
+ mTestViewAdvanced->mIpv4DnsAddress2,
+ result);
+
+ // Verify user defined address is in use
+ subVerifyBool(
+ CMManagerShim::CmIPDNSAddrFromServer,
+ false);
+}
+
+/**
+ * Test data for IPv4 DNS address change test case.
+ */
+void TestCpWlanApPlugin::tcChangeIpv4DnsAddress_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("too long")
+ << "255.255.255.2551234"
+ << "255.255.255.255";
+ QTest::newRow("normal")
+ << "192.168.0.1"
+ << "192.168.0.1";
+}
+
+/**
+ * Tests invalid IPv4 DNS address.
+ */
+void TestCpWlanApPlugin::tcInvalidIpv4DnsAddress()
+{
+ QString previous =
+ mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString();
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, "999.999.999.999", 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+ // Dismiss messagebox
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestViewAdvanced->mMessageBox.data(),
+ messageBoxOkButtonOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIPNameServer1,
+ mTestViewAdvanced->mIpv4DnsAddress1,
+ previous);
+}
+
+/**
+ * Scrolls the tested view to the top.
+ */
+void TestCpWlanApPlugin::tcScrollToTop()
+{
+ subScrollToTop();
+}
+
+/**
+ * Collapses the IPv4 settings group.
+ */
+void TestCpWlanApPlugin::tcCollapseIpv4Settings()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipv4Group);
+}
+
+/**
+ * Expands the IPv6 settings group and gets UI widget pointers.
+ */
+void TestCpWlanApPlugin::tcExpandIpv6SettingsAndGetUiWidgets()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipv6Group);
+
+ QTest::qWait(500);
+
+ subGetAdvancedUiWidgets(1);
+}
+
+/**
+ * Tests enabling of automatic IPv6 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcEnableAutomaticIpv6DnsAddress()
+{
+ // Enable automatic IPv6 DNS address
+ QPointF automaticPointOffset = comboBoxItemOffset;
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget);
+ QTest::qWait(100);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, automaticPointOffset, 100);
+ QTest::qWait(100);
+ subVerifyBool(
+ CMManagerShim::CmIP6DNSAddrFromServer,
+ true);
+
+ // Ensure that editing the IP address is not allowed
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget);
+}
+
+/**
+ * Tests enabling of well-known IPv6 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcEnableWellKnownIpv6DnsAddress()
+{
+ // Enable well-known IPv6 DNS address
+ QPointF wellKnownPointOffset = comboBoxItemOffset * 2;
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget);
+ QTest::qWait(100);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, wellKnownPointOffset, 100);
+ QTest::qWait(100);
+ subVerifyBool(
+ CMManagerShim::CmIP6DNSAddrFromServer,
+ false);
+ subVerifyString(
+ CMManagerShim::CmIP6NameServer1,
+ mTestViewAdvanced->mIpv6DnsAddress1,
+ "fec0:000:0000:ffff::1");
+ subVerifyString(
+ CMManagerShim::CmIP6NameServer2,
+ mTestViewAdvanced->mIpv6DnsAddress2,
+ "fec0:000:0000:ffff::2");
+
+ // Ensure that editing the IP address is not allowed
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget);
+}
+
+/**
+ * Tests enabling of user defined IPv6 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcEnableUserDefinedIpv6DnsAddress()
+{
+ // Select user defined IPv6 DNS address
+ QPointF userDefinedPointOffset = comboBoxItemOffset * 3;
+ //QPointF userDefinedPointOffset(0, 160);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget);
+ QTest::qWait(100);
+ HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, userDefinedPointOffset, 100);
+ QTest::qWait(100);
+ // Can't verify the setting from CommsDat here, because CMManager will
+ // set it back to true if no valid IP address is yet defined. The flag
+ // is verified in tcChangeIpv4DnsAddress().
+}
+
+/**
+ * Tests changing of IPv6 DNS addresses.
+ */
+void TestCpWlanApPlugin::tcChangeIpv6DnsAddress()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ // Primary DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIP6NameServer1,
+ mTestViewAdvanced->mIpv6DnsAddress1,
+ result);
+
+ // Secondary DNS address
+ HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget);
+
+ // Erase old string
+ text = mTestViewAdvanced->mIpv6DnsAddress2->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget, exitEditorOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIP6NameServer2,
+ mTestViewAdvanced->mIpv6DnsAddress2,
+ result);
+
+ // Verify user defined address is in use
+ subVerifyBool(
+ CMManagerShim::CmIP6DNSAddrFromServer,
+ false);
+}
+
+/**
+ * Test data for IPv6 DNS address change test case.
+ */
+void TestCpWlanApPlugin::tcChangeIpv6DnsAddress_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("normal")
+ << "2001:db8:85a3::8a2e:370:7334"
+ << "2001:db8:85a3:0:0:8a2e:370:7334";
+}
+
+/**
+ * Tests invalid IPv6 DNS address.
+ */
+void TestCpWlanApPlugin::tcInvalidIpv6DnsAddress()
+{
+ QString previous =
+ mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString();
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, "abcdef:fedcba", 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+ // Dismiss messagebox
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestViewAdvanced->mMessageBox.data(),
+ messageBoxOkButtonOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmIP6NameServer1,
+ mTestViewAdvanced->mIpv6DnsAddress1,
+ previous);
+}
+
+/**
+ * Collapses the IPv6 settings group.
+ */
+void TestCpWlanApPlugin::tcCollapseIpv6Settings()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipv6Group);
+}
+
+/**
+ * Expands the proxy settings group and gets UI widget pointers.
+ */
+void TestCpWlanApPlugin::tcExpandProxySettingsAndGetUiWidgets()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, proxyGroup);
+
+ QTest::qWait(500);
+
+ subGetAdvancedUiWidgets(2);
+}
+
+/**
+ * Tests changing of proxy server address.
+ */
+void TestCpWlanApPlugin::tcChangeProxyServerAddress()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyServerAddressWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mProxyServer->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyServerAddressWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+
+ // Verify both commsdat and UI widget
+ subVerifyString(
+ CMManagerShim::CmProxyServerName,
+ mTestViewAdvanced->mProxyServer,
+ result);
+ // Verify user defined address flag is set correctly
+ if (result.isEmpty()) {
+ subVerifyBool(
+ CMManagerShim::CmProxyUsageEnabled,
+ false);
+ } else {
+ subVerifyBool(
+ CMManagerShim::CmProxyUsageEnabled,
+ true);
+ }
+}
+
+/**
+ * Test data for proxy server address change test case.
+ */
+void TestCpWlanApPlugin::tcChangeProxyServerAddress_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("long")
+ << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"
+ << "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html";
+ QTest::newRow("empty")
+ << ""
+ << "";
+ QTest::newRow("basic") // last one should always fit on one line in UI
+ << "http://www.symbian.org/"
+ << "http://www.symbian.org/";
+}
+
+/**
+ * Tests changing of proxy port number.
+ */
+void TestCpWlanApPlugin::tcChangeProxyPortNumber()
+{
+ QFETCH(QString, string);
+ QFETCH(QString, result);
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mProxyPort->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+
+ // Verify both commsdat and UI widget
+ subVerifyUint(
+ CMManagerShim::CmProxyPortNumber,
+ result.toInt());
+ QCOMPARE(
+ mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt(),
+ result.toInt());
+}
+
+/**
+ * Test data for proxy port number change test case.
+ */
+void TestCpWlanApPlugin::tcChangeProxyPortNumber_data()
+{
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<QString>("result");
+
+ QTest::newRow("basic")
+ << "8080"
+ << "8080";
+ QTest::newRow("too long")
+ << "1234567890"
+ << "12345";
+ QTest::newRow("zero")
+ << "0"
+ << "";
+ QTest::newRow("empty")
+ << ""
+ << "";
+}
+
+/**
+ * Tests invalid proxy port number.
+ */
+void TestCpWlanApPlugin::tcInvalidProxyPortNumber()
+{
+ int previous =
+ mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt();
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget);
+
+ // Erase old string
+ QString text = mTestViewAdvanced->mProxyPort->contentWidgetData("text").toString();
+ subClearLineEdit(text.size());
+
+ // Enter new string
+ HbAutoTest::keyClicks(mMainWindow, "65536", 0, waitTime);
+
+ HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget, exitEditorOffset);
+
+ QTest::qWait(100);
+ // Dismiss messagebox
+ HbAutoTest::mouseClick(
+ mMainWindow,
+ mTestViewAdvanced->mMessageBox.data(),
+ messageBoxOkButtonOffset);
+
+ // Verify both commsdat and UI widget
+ subVerifyUint(
+ CMManagerShim::CmProxyPortNumber,
+ previous);
+ QCOMPARE(
+ mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt(),
+ previous);
+}
+
+/**
+ * Collapses the proxy settings group.
+ */
+void TestCpWlanApPlugin::tcCollapseProxySettings()
+{
+ HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, proxyGroup);
+}
+
+/**
+ * Returns from advanced settings view.
+ */
+void TestCpWlanApPlugin::tcCloseAdvancedSettingsView()
+{
// Return from advanced settings view
subClickWidget("HbNavigationButton");
}
@@ -438,6 +1242,108 @@
// -----------------------------------------------------------------------------
/**
+ * Gets UI widget pointers.
+ */
+void TestCpWlanApPlugin::subGetUiWidgets()
+{
+ HbModelIterator iterator(mTestView->mModel);
+
+ // Get "Access point settings" group item
+ QModelIndex apGroupIndex = iterator.index(0);
+
+ // Get UI widgets
+ mConnectionNameWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(0, apGroupIndex));
+ mWlanNetworkNameWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(1, apGroupIndex));
+ mNetworkStatusWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(2, apGroupIndex));
+ mNetworkModeWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(3, apGroupIndex));
+ mSecurityModeWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(4, apGroupIndex));
+ mHomepageWidget = subGetWidgetByIndex(
+ mTestView->mForm,
+ iterator.index(5, apGroupIndex));
+}
+
+/**
+ * Gets advanced settings view UI widget pointers by group index.
+ */
+void TestCpWlanApPlugin::subGetAdvancedUiWidgets(
+ uint index)
+{
+ // Get the group item
+ HbModelIterator iterator(mTestViewAdvanced->mModel);
+ QModelIndex groupIndex = iterator.index(index);
+
+ // Get UI widgets
+ if (index == 0) {
+ // IPv4 settings group
+ mIpv4AddressAutomaticWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(0, groupIndex));
+ mIpv4AddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(1, groupIndex));
+ mIpv4SubnetMaskWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(2, groupIndex));
+ mIpv4GatewayWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(3, groupIndex));
+ mIpv4DnsAddressAutomaticWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(4, groupIndex));
+ mIpv4PrimaryDnsAddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(5, groupIndex));
+ mIpv4SecondaryDnsAddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(6, groupIndex));
+ } else if (index == 1) {
+ // IPv6 settings group
+ mIpv6DnsAddressAutomaticWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(0, groupIndex));
+ mIpv6PrimaryDnsAddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(1, groupIndex));
+ mIpv6SecondaryDnsAddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(2, groupIndex));
+ } else {
+ // Proxy settings group
+ mProxyServerAddressWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(0, groupIndex));
+ mProxyPortNumberWidget = subGetWidgetByIndex(
+ mTestViewAdvanced->mForm,
+ iterator.index(1, groupIndex));
+ }
+}
+
+/**
+ * Gets an UI widget from HbDataForm by index.
+ */
+HbWidget *TestCpWlanApPlugin::subGetWidgetByIndex(
+ HbDataForm *form,
+ const QModelIndex &index)
+{
+ HbDataFormViewItem *viewItem = qobject_cast<HbDataFormViewItem *>
+ (form->itemByIndex(index));
+ HbWidget *widget = viewItem->dataItemContentWidget();
+ //QString widgetClassName(widget->metaObject()->className());
+ //qDebug() << widgetClassName;
+ return widget;
+}
+
+/**
* Verifies that given string is correctly stored in CommsDat and shown on UI.
*/
void TestCpWlanApPlugin::subVerifyString(
@@ -503,17 +1409,15 @@
void TestCpWlanApPlugin::subClearLineEdit(
uint length)
{
- // Erase old string
- QTest::qWait(5000); // TODO: Remove this when item specific menu doesn't pop up anymore
-
// Move cursor to end of string
- //HbAutoTest::keyClick(mMainWindow, Qt::Key_End, 0, waitTime); // doesn't seem to do anything?
+ //HbAutoTest::keyClick(mMainWindow, Qt::Key_End, Qt::ControlModifier, waitTime); // doesn't seem to do anything?
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime);
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime);
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime);
for (int i=0; i<25; i++) {
HbAutoTest::keyClick(mMainWindow, Qt::Key_Right, 0, waitTime);
}
+ // Erase string
for (int i=0; i<length; i++) {
HbAutoTest::keyClick(mMainWindow, Qt::Key_Backspace, 0, waitTime);
}
@@ -558,3 +1462,56 @@
Q_ASSERT(target);
HbAutoTest::mouseClick(mMainWindow, static_cast<HbWidget *>(target));
}
+
+/**
+ * Returns the middle point of a widget.
+ */
+QPointF TestCpWlanApPlugin::subMiddlePointOfWidget(const HbWidget *widget)
+{
+ QRectF widgetRect = widget->rect();
+ QRectF widgetSceneRect = widget->mapRectToScene(widgetRect);
+ qreal middleX = ((widgetSceneRect.right() - widgetSceneRect.left()) / 2) + widgetSceneRect.left();
+ qreal middleY = ((widgetSceneRect.bottom() - widgetSceneRect.top()) / 2) + widgetSceneRect.top();
+
+ return QPointF(middleX, middleY);
+}
+
+/**
+ * Verifies that given attribute contains expected boolean value in CommsDat.
+ */
+void TestCpWlanApPlugin::subVerifyBool(
+ CMManagerShim::ConnectionMethodAttribute attribute,
+ bool expected)
+{
+ // Read attribute value from CommsDat
+ QScopedPointer<CmManagerShim> cmManager(new CmManagerShim);
+ QScopedPointer<CmConnectionMethodShim> connectionMethod(
+ cmManager->connectionMethod(testApId));
+ bool commsdat = connectionMethod->getBoolAttribute(attribute);
+
+ QCOMPARE(commsdat, expected);
+}
+
+/**
+ * Scrolls the tested view to the bottom.
+ */
+void TestCpWlanApPlugin::subScrollToBottom()
+{
+ // Scroll to the bottom of the view
+ HbAutoTest::mousePress(mMainWindow, mTestView, scrollMiddle);
+ QTest::qWait(1000);
+ HbAutoTest::mouseMove(mMainWindow, mTestView, scrollTop);
+ HbAutoTest::mouseRelease(mMainWindow, mTestView, scrollTop);
+}
+
+/**
+ * Scrolls the tested view to the top.
+ */
+void TestCpWlanApPlugin::subScrollToTop()
+{
+ // Scroll to the top of the view
+ HbAutoTest::mousePress(mMainWindow, mTestView, scrollMiddle);
+ QTest::qWait(1000);
+ HbAutoTest::mouseMove(mMainWindow, mTestView, scrollBottom);
+ HbAutoTest::mouseRelease(mMainWindow, mTestView, scrollBottom);
+}