58 // Time to wait before continuing after an UI step |
58 // Time to wait before continuing after an UI step |
59 static const int waitTime = 10; |
59 static const int waitTime = 10; |
60 |
60 |
61 // UI coordinates |
61 // UI coordinates |
62 static const QPoint scrollMiddle(350, 280); |
62 static const QPoint scrollMiddle(350, 280); |
63 static const QPoint scrollTop(350, 50); |
63 static const QPoint scrollTop(350, 30); |
64 static const QPoint scrollBottom(350, 520); |
64 static const QPoint scrollBottom(350, 540); |
65 |
65 |
66 // Use positive offset if dropdown opens under the combobox |
66 // Use positive offset if dropdown opens under the combobox |
67 static const QPoint comboBoxItemOffset(0, 55); |
67 static const QPoint comboBoxFirstItemOffset(80, 75); |
|
68 static const QPoint comboBoxItemOffset(0, 51); |
68 // Use negative offset if dropdown opens above the combobox |
69 // Use negative offset if dropdown opens above the combobox |
69 static const QPoint comboBoxItemNegativeOffset(0, -50); |
70 static const QPoint comboBoxFirstItemNegativeOffset(80, -29); |
|
71 static const QPoint comboBoxItemNegativeOffset(0, -51); |
70 |
72 |
71 static const QPoint exitEditorOffset(-10, -20); |
73 static const QPoint exitEditorOffset(-10, -20); |
72 |
74 |
73 static const QPoint messageBoxOkButtonOffset(160, 140); |
75 static const QPoint messageBoxOkButtonOffset(160, 140); |
74 |
76 |
194 { |
196 { |
195 QTest::addColumn<QString>("string"); |
197 QTest::addColumn<QString>("string"); |
196 QTest::addColumn<QString>("result"); |
198 QTest::addColumn<QString>("result"); |
197 |
199 |
198 QTest::newRow("maximum length") |
200 QTest::newRow("maximum length") |
199 << "really long name 1234567890123" |
201 << "really long name 123456789012345678901234567890123" |
200 << "really long name 1234567890123"; |
202 << "really long name 123456789012345678901234567890123"; |
201 QTest::newRow("too long") |
203 QTest::newRow("too long") |
202 << "too long name 123456789012345678901234567890" |
204 << "too long name 12345678901234567890123456789012345678901234" |
203 << "too long name 1234567890123456"; |
205 << "too long name 123456789012345678901234567890123456"; |
204 QTest::newRow("basic") // last one must always fit on one line in UI |
206 QTest::newRow("basic") // last one must always fit on one line in UI |
205 << "test WLAN AP" |
207 << "test WLAN AP" |
206 << "test WLAN AP"; |
208 << "test WLAN AP"; |
207 } |
209 } |
208 |
210 |
314 /** |
316 /** |
315 * Tests changing of WLAN network status. |
317 * Tests changing of WLAN network status. |
316 */ |
318 */ |
317 void TestCpWlanApPlugin::tcChangeNetworkStatus() |
319 void TestCpWlanApPlugin::tcChangeNetworkStatus() |
318 { |
320 { |
319 QPointF publicPointOffset = comboBoxItemOffset; |
321 QPointF publicPointOffset = comboBoxFirstItemOffset; |
320 QPointF hiddenPointOffset = comboBoxItemOffset * 2; |
322 QPointF hiddenPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
321 |
323 |
322 // Set network status to hidden |
324 // Set network status to hidden |
323 HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget); |
325 HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget); |
324 HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget, hiddenPointOffset, 100); |
326 HbAutoTest::mouseClick(mMainWindow, mNetworkStatusWidget, hiddenPointOffset, 100); |
325 subVerifyNetworkStatus(HiddenStatus); |
327 subVerifyNetworkStatus(HiddenStatus); |
333 /** |
335 /** |
334 * Tests changing of WLAN network mode. |
336 * Tests changing of WLAN network mode. |
335 */ |
337 */ |
336 void TestCpWlanApPlugin::tcChangeNetworkMode() |
338 void TestCpWlanApPlugin::tcChangeNetworkMode() |
337 { |
339 { |
338 QPointF infraPointOffset = comboBoxItemOffset; |
340 QPointF infraPointOffset = comboBoxFirstItemOffset; |
339 QPointF adHocPointOffset = comboBoxItemOffset * 2; |
341 QPointF adHocPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
340 |
342 |
341 // Set network mode to ad-hoc |
343 // Set network mode to ad-hoc |
342 HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget); |
344 HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget); |
343 HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget, adHocPointOffset, 100); |
345 HbAutoTest::mouseClick(mMainWindow, mNetworkModeWidget, adHocPointOffset, 100); |
344 subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Adhoc); |
346 subVerifyUint(CMManagerShim::WlanConnectionMode, CMManagerShim::Adhoc); |
353 * Tests changing of WLAN security mode. |
355 * Tests changing of WLAN security mode. |
354 */ |
356 */ |
355 void TestCpWlanApPlugin::tcChangeSecurityMode() |
357 void TestCpWlanApPlugin::tcChangeSecurityMode() |
356 { |
358 { |
357 #ifdef WLAN_SECURITY_PLUGINS_AVAILABLE |
359 #ifdef WLAN_SECURITY_PLUGINS_AVAILABLE |
358 QPointF openPointOffset = comboBoxItemNegativeOffset * 4; |
360 QPointF openPointOffset = comboBoxFirstItemNegativeOffset + comboBoxItemNegativeOffset * 3; |
359 QPointF wepPointOffset = comboBoxItemNegativeOffset * 3; |
361 QPointF wepPointOffset = comboBoxFirstItemNegativeOffset + comboBoxItemNegativeOffset * 2; |
360 QPointF wpaPointOffset = comboBoxItemNegativeOffset * 2; |
362 QPointF wpaPointOffset = comboBoxFirstItemNegativeOffset + comboBoxItemNegativeOffset; |
361 QPointF wpa2PointOffset = comboBoxItemNegativeOffset; |
363 QPointF wpa2PointOffset = comboBoxFirstItemNegativeOffset; |
362 #else |
364 #else |
363 QPointF openPointOffset = comboBoxItemNegativeOffset; |
365 QPointF openPointOffset = comboBoxFirstItemNegativeOffset; |
364 #endif |
366 #endif |
365 |
367 |
366 #ifdef WLAN_SECURITY_PLUGINS_AVAILABLE |
368 #ifdef WLAN_SECURITY_PLUGINS_AVAILABLE |
367 // Set security mode to WEP |
369 // Set security mode to WEP |
368 HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget); |
370 HbAutoTest::mouseClick(mMainWindow, mSecurityModeWidget); |
899 * Tests enabling of automatic IPv6 DNS addresses. |
901 * Tests enabling of automatic IPv6 DNS addresses. |
900 */ |
902 */ |
901 void TestCpWlanApPlugin::tcEnableAutomaticIpv6DnsAddress() |
903 void TestCpWlanApPlugin::tcEnableAutomaticIpv6DnsAddress() |
902 { |
904 { |
903 // Enable automatic IPv6 DNS address |
905 // Enable automatic IPv6 DNS address |
904 QPointF automaticPointOffset = comboBoxItemOffset; |
906 QPointF automaticPointOffset = comboBoxFirstItemOffset; |
905 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
907 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
906 QTest::qWait(100); |
908 QTest::qWait(100); |
907 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, automaticPointOffset, 100); |
909 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, automaticPointOffset, 100); |
908 QTest::qWait(100); |
910 QTest::qWait(100); |
909 subVerifyBool( |
911 subVerifyBool( |
919 * Tests enabling of well-known IPv6 DNS addresses. |
921 * Tests enabling of well-known IPv6 DNS addresses. |
920 */ |
922 */ |
921 void TestCpWlanApPlugin::tcEnableWellKnownIpv6DnsAddress() |
923 void TestCpWlanApPlugin::tcEnableWellKnownIpv6DnsAddress() |
922 { |
924 { |
923 // Enable well-known IPv6 DNS address |
925 // Enable well-known IPv6 DNS address |
924 QPointF wellKnownPointOffset = comboBoxItemOffset * 2; |
926 QPointF wellKnownPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
925 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
927 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
926 QTest::qWait(100); |
928 QTest::qWait(100); |
927 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, wellKnownPointOffset, 100); |
929 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, wellKnownPointOffset, 100); |
928 QTest::qWait(100); |
930 QTest::qWait(100); |
929 subVerifyBool( |
931 subVerifyBool( |
947 * Tests enabling of user defined IPv6 DNS addresses. |
949 * Tests enabling of user defined IPv6 DNS addresses. |
948 */ |
950 */ |
949 void TestCpWlanApPlugin::tcEnableUserDefinedIpv6DnsAddress() |
951 void TestCpWlanApPlugin::tcEnableUserDefinedIpv6DnsAddress() |
950 { |
952 { |
951 // Select user defined IPv6 DNS address |
953 // Select user defined IPv6 DNS address |
952 QPointF userDefinedPointOffset = comboBoxItemOffset * 3; |
954 QPointF userDefinedPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset * 2; |
953 //QPointF userDefinedPointOffset(0, 160); |
955 //QPointF userDefinedPointOffset(0, 160); |
954 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
956 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
955 QTest::qWait(100); |
957 QTest::qWait(100); |
956 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, userDefinedPointOffset, 100); |
958 HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, userDefinedPointOffset, 100); |
957 QTest::qWait(100); |
959 QTest::qWait(100); |