Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4800 lines
152 KiB

4 years ago
  1. '******************************************************************************
  2. ' DP32.inc
  3. ' Created January 03, 1996
  4. ' By Ron Rohr
  5. ' This include file contains all the Functions and Constants used by the
  6. ' DP32.MST test Script
  7. '******************************************************************************
  8. ' Note: This file uses the Object Naming convention defined in the Visual Basic
  9. ' 4.0 Programmers Guide to name variables and contants associated with a control.
  10. '$IFNDEF DP32_INC
  11. '$DEFINE DP32_INC
  12. '**************************** BEGIN CONSTANTS *********************************
  13. '$include 'DialRule.inc'
  14. '------------------------------------------------------------------------------
  15. ' Section and Key constants of the dp32.ini file
  16. '------------------------------------------------------------------------------
  17. Const TEST_INI_FILE = "DP32.INI"
  18. Const Seclang = "Language"
  19. Const Secmenu = "Menu Strings"
  20. Const SecCaption = "Caption Strings"
  21. Const SecWinClass = "Window Classes"
  22. Const SecLabels = "Dialing Properties Control Labels"
  23. Const KeyMFILE = "MFILE"
  24. Const KeyMEXIT = "MEXIT"
  25. Const KeyMTOOLS = "MTOOLS"
  26. Const KeyMDP = "MDIAL_PROPERTIES"
  27. Const keyMOPTIONS = "MOPTIONS"
  28. Const keyMDEFAULT = "MDEFAULT"
  29. Const KeyPHONEDIALER = "DIALER_CAPTION"
  30. Const KeyPROPERTIES = "PROPERTIES_CAPTION"
  31. Const KeyConnectUse = "CONNECT_USE_CAPTION"
  32. Const KeyWarning = "WARNING_BOX_CAPTION"
  33. Const KeyLocInfo = "LOCATION_CAPTION"
  34. Const KeyTB20 = "TB20_CAPTION"
  35. Const KeyUTB = "USING_TB_CAPTION"
  36. Const KeyForSure = "REALLY_CAPTION"
  37. Const KeyChangeCard = "CHANGE_CARD_CAPTION"
  38. Const KeyNewCard = "NEW_CARD_CAPTION"
  39. Const KeyDefault = "DEFAULT_VALUES_CAPTION"
  40. Const KeyDialingR = "DIAL_RULE_CAPTION"
  41. Const KeyNoPIN = "NO_PIN_CAPTION"
  42. Const KeyPDCLASS = "PHONE_DIALER_CLASS"
  43. Const KeyCopyRule = "COPY_RULE_CAPTION"
  44. Const KeyImproperRule = "IMPROPER_CHAR_CAPTION"
  45. Const KeyLANG = "Language"
  46. Const KeyNEWBUTTON = "cmd_NEW"
  47. Const KeyREMOVEBUTTON = "cmd_REMOVE"
  48. Const KeyCHANGEBUTTON = "cmd_CHANGE"
  49. Const KeyOKBUTTON = "cmd_OK"
  50. Const KeyCANCELBUTTON = "cmd_Cancel"
  51. Const KeyAPPLYBUTTON = "cmd_Apply"
  52. Const KeyLOCALTXT = "txt_LOCAL"
  53. Const KeyLONGTXT = "txt_LONGDIST"
  54. Const KeyAREACODETXT = "txt_AREACODE"
  55. Const KeyTONEOPT = "opt_TONE"
  56. Const KeyPULSEOPT = "opt_PULSE"
  57. Const KeyCARDCHK = "chk_CARD"
  58. Const KeyWAITCHK = "chk_WAITING"
  59. Const KeyFROMSTR = "cbo_DIALINGFROM"
  60. Const KeyIAMINSTR = "cbo_IAMIN"
  61. Const KeyACCESSLABLE = "lable_ACCESS"
  62. Const KeyOPTLABLE = "lable_OPT_BTN"
  63. Const KeyWHERELABLE = "lable_FRM_WHERE"
  64. Const KeyHOWLABLE = "lable_FRM_HOW"
  65. Const KeyNONELABLE = "lable_DIR_DIAL"
  66. Const KeyLOCATIONTAB = "tab_MY_LOCATION"
  67. Const KeyTELDRVTAB = "tab_TEL_DRV"
  68. Const lable_FRM_WHERE = "Where I am:"
  69. ' End Section and Key constants of the dp32.ini file
  70. '------------------------------------------------------------------------------
  71. '------------------------------------------------------------------------------
  72. ' Begin Constant definitions used with child control handle arrays
  73. ' (array element enumerations)
  74. Const DP_OKcmd = 0
  75. Const DP_CANCELcmd = 1
  76. Const DP_APPLYcmd = 2
  77. Const NEW_cmd = 0
  78. Const REMOVE_cmd = 1
  79. Const CHANGE_cmd = 2
  80. Const LOCATION_cbo = 3
  81. Const COUNTRY_cbo = 4
  82. Const AREA_txt = 5
  83. Const LOCAL_txt = 6
  84. Const LONG_txt = 7
  85. Const CARD_chk = 8
  86. Const WAIT_chk = 9
  87. Const WaitStr_cbo = 10
  88. Const TONE_opt = 11
  89. Const PULSE_opt = 12
  90. Const ADDRESS_lbl = 13
  91. Const NUMBER_lbl = 14
  92. Const DIAL_AS_chk = 15
  93. Const TD_ADDcmd =0
  94. Const TD_REMOVEcmd =1
  95. Const TD_SETUPcmd =2
  96. Const TD_DRIVERlst =3
  97. Const CARD_OKcmd = 0
  98. Const CARD_CANCELcmd = 1
  99. Const CARD_NAMEcbo = 2
  100. Const CARD_NUMBERtxt = 3
  101. Const CARD_NEWcmd = 4
  102. Const Card_RULEScmd = 5
  103. Const CARD_REMOVEcmd = 6
  104. Const NEW_OKcmd = 0
  105. Const NEW_CANCELcmd = 1
  106. Const NEW_NAMETXT = 2
  107. Const Rule_CLOSEcmd = 0
  108. Const Rule_COPYcmd = 1
  109. Const Rule_LOCALtxt = 2
  110. Const Rule_LONGtxt = 3
  111. Const Rule_INTERtxt = 4
  112. ' End Constant definitions used with MY_hCtrl and TD_hCtrl arrays
  113. '------------------------------------------------------------------------------
  114. '------------------------------------------------------------------------------
  115. ' Begin Registry Editor Constant definitions (used with SetLocationsZero)
  116. Const REGEDIT_CAPTION = "Registry Editor"
  117. Const REGEDIT_CLASS = "RegEdit_RegEdit"
  118. Const REG_lOC_PATH = "My Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Telephony\locations"
  119. ' End Registry Editor Constant definitions
  120. '------------------------------------------------------------------------------
  121. '------------------------------------------------------------------------------
  122. ' Begin Other Constant definitions
  123. Const NEW_LOCATION = "New Location"
  124. ' End Other Constant definitions
  125. '------------------------------------------------------------------------------
  126. '------------------------------------------------------------------------------
  127. ' Begin VerifyCallingCard Constant definitions
  128. Const TAPI_BROWSER = "\TB20.exe"
  129. Const lineTranDlg_API = "lineTranslateDialog"
  130. ' End VerifyCallingCard Constant definitions
  131. '------------------------------------------------------------------------------
  132. '------------------------------------------------------------------------------
  133. ' Begin Type declarations
  134. Type Location
  135. Location as string
  136. AreaCode as string
  137. Country as string
  138. LocalAccess as string
  139. LongAccess as string
  140. CardSet as short
  141. WaitSet as short
  142. ToneSet as short
  143. PulseSet as short
  144. end type
  145. ' End Type declarations
  146. '------------------------------------------------------------------------------
  147. '------------------------------------------------------------------------------
  148. ' Begin Global declarations and definitions
  149. Global WTIMEOUT AS LONG 'Timeout value for WFndWnd
  150. Global teststring as CaseStruct ' Holds test case info for logging by logcase routine
  151. Global w_flags as long 'used with WFndWnd function
  152. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  153. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE 'FW_PART OR
  154. ' End Global declarations and definitions
  155. '------------------------------------------------------------------------------
  156. '------------------------------------------------------------------------------
  157. ' DP32.ini
  158. ' The following variables are use to save strings from DP32.INI
  159. '------------------------------------------------------------------------------
  160. global Language as string
  161. ' Menu Strings Variables
  162. global MFILE as string
  163. global MExit as string
  164. global MTOOLS as string
  165. global MDIAL_PROPERTIES as string
  166. global MOPTIONS as string
  167. global MDEFAULT as string
  168. ' Caption Strings Variables
  169. global DIALER_CAPTION as string
  170. global PROPERTIES_CAPTION as string
  171. global LOC_INFO_CAPTION as string
  172. global CONNECT_USE_CAPTION as string
  173. global WARN_BOX_CAPTION as string
  174. global TAPI_BROWSER_CAPTION as string
  175. global USING_TB_CAPTION as string
  176. global REALLY_CAPTION as string
  177. global CHANGE_CARD_CAPTION as string
  178. global NEW_CARD_CAPTION as string
  179. global DEFAULT_VALUES_CAPTION as string
  180. global DIAL_RULE_CAPTION as string
  181. global NO_PIN_CAPTION as string
  182. global COPY_RULE_CAPTION as string
  183. global IMPROPER_CHAR_CAPTION as string
  184. ' Window Classes Strings Variables
  185. global DIALOG_CLASS as string
  186. 'Dialing Properties Control Labels Strings Variables
  187. global cmd_NEW as string
  188. global cmd_REMOVE as string
  189. global cmd_CHANGE as string
  190. global cmd_OK as string
  191. global cmd_CANCEL as string
  192. global cmd_APPLY as string
  193. global txt_LOCAL as string
  194. global txt_LONGDIST as string
  195. global txt_AREACODE as string
  196. global cbo_DIALINGFROM as string
  197. global cbo_IAMIN as string
  198. global chk_CARD as string
  199. global chk_WAIT as string
  200. global opt_TONE as string
  201. global opt_PULSE as string
  202. global lbl_ACCESS as string
  203. global lbl_OPT_BTN as string
  204. global lbl_FRM_WHERE as string
  205. global lbl_FRM_HOW as string
  206. global lbl_DIR_DIAL as string
  207. global tab_MY_LOCATION as string
  208. global tab_TEL_DRV as string
  209. ' End of strings from DP32.INI variables
  210. '------------------------------------------------------------------------------
  211. '*********************** PROCEDURE DECLARATIONS (In order of appearence) ******
  212. Declare Sub BoundsChkHandler (vtNotifyData as variant)
  213. Declare Sub SetWndTimeout ()
  214. Declare Function Start_App () as long
  215. Declare Function Call_Dialing_Prop (hTabCtrl as long, hMLTab as long, hTDTab as long) as long
  216. Declare Sub GetLangStr ()
  217. Declare Function GetStringandValidate (Section as string * 35, KeyName as string, _
  218. Default as string * 20, FileNameINI as string * 128) as string
  219. Declare Sub SetDefaultLabels ()
  220. Declare Sub Validate_Strings (hTab as long, hChild() as long)
  221. Declare Sub GetDPCtrlh (hDProp as long, Prop_hChild() as long, _
  222. Prop_ChildID() as long)
  223. Declare Sub GetChildhandles (hParent as long, hChild() as long, ChildID() as long)
  224. Declare Sub AddLocations (Prop_hChild() as long, ML_hChild() as long, _
  225. FirstLoc as location, Eastside as location, Cork as location)
  226. Declare Sub FindNewLocMessage ()
  227. Declare Sub ModifyLocation (Prop_hChild() as long, ML_hChild() as long, ChangeLoc as location)
  228. Declare Sub VerifyModifyLoc (ML_hChild() as long, ChangeLoc as location, hDP_OKcmd as long)
  229. Declare Sub VerifyCallWaiting (Prop_ChildID() as long, ML_ChildID() as long, TestLoc as location)
  230. Declare Sub DefaultCallingCard (CallingCard() as CardData, Prop_ChildID() as long, ML_ChildID() as long)
  231. Declare Sub VerifyCallingCard (Prop_ChildID() as long, ML_ChildID() as long)
  232. Declare Function SetLocationsZero () as short
  233. Declare Sub EditLocationInfo (NewLocal as location, hML_Child() as long)
  234. Declare Sub SetLocationInfo (FirstLoc as Location)
  235. Declare Sub VerifyCurrentLoc (ML_hChild() as long, Default as location)
  236. Declare Sub CountryDialRules (DialingRule() as CountryRule, Prop_ChildID() as long, _
  237. ML_ChildID() as long)
  238. Declare Function RemoveLocation (Prop_hChild() as long, ML_hChild() as long, _
  239. CmdButton as short) as string
  240. Declare Sub VerifyRemoveLoc (ML_hChild() as long, LocString as string)
  241. Declare Sub FindRemLocMessage (RemoveState as short)
  242. Declare Sub SetCallingCardChildID (Card_ChildID() as long, NEW_ChildID() as long, _
  243. Rule_ChildID() as long, DV_OKcmd as long, _
  244. DV_list as long, DV_edit as long, TAPI_API_List as long)
  245. Declare Function CreateDestAddress (Rule as string, phone as TelephoneNo ) as string
  246. Declare Function ConvertRule (Rule as string) as string
  247. Declare Function lTranslateDialog ( hMLTab as long, hTB20 as long) as long
  248. '*********************** BEGIN PROCEDURES *************************************
  249. '*****************************************************************************
  250. 'Name : BoundsChkHandler
  251. 'Desc : This routine is called whenever BoundsChecker uncovers a failure.
  252. ' The failure is then written ton the log and reports to the user via
  253. ' a message box.
  254. ' The routine is called with the On BoundsCheckerNotify (NULL) Call
  255. ' BoundsChkHandler statement in DP32.mst.
  256. '
  257. 'Parms : None.
  258. '
  259. 'Return : None. Writes failure data directly to the log.
  260. '
  261. 'History: 02/26/96 : a-rrohr: Created
  262. '*****************************************************************************
  263. sub BoundsChkHandler (vtNotifyData as variant)
  264. dim ErrorMessage as string, SizeofString as long, count as short, lastchar as short
  265. ErrorMessage = "Unexpected BoundsChecker error in Dialing Properties Test" + CRLF
  266. ' Since the size of the string BoundsChecker returns is unknown the routine must be
  267. ' capable of formatting a large string into a paragraph whose lines are not greater
  268. ' than 72 characters.
  269. While (len(vtNotifyData) >= 72)
  270. SizeofString = len(vtNotifyData)
  271. count = 1
  272. do
  273. lastchar = count
  274. count = instr(lastchar + 1,vtNotifyData, " ")
  275. ' instr(lastchar + 1,vtNotifyData, " ") will return zero on the last word of
  276. ' the string so break the do loop when count = 0
  277. loop while count < 72 and count <> 0
  278. ErrorMessage = ErrorMessage + rtrim$(left$(vtNotifyData, lastchar)) + CRLF
  279. vtNotifyData = right$(vtNotifyData, (SizeofString - lastchar))
  280. Wend
  281. If (len(vtNotifyData) >= 1) then
  282. ErrorMessage = ErrorMessage + vtNotifyData + CRLF
  283. end if
  284. '$IFDEF DEBUG_TEST_SCRIPT
  285. if Msgbox(ErrorMessage, MB_ICONEXCLAMATION or MB_YESNO) = IDYES then
  286. resume next
  287. else
  288. Stop
  289. endif
  290. '$ENDIF 'DEBUG_TEST_SCRIPT
  291. end sub 'BoundsChkHandler
  292. '******************************************************************************
  293. '******************************************************************************
  294. 'Name : SetWndTimeout
  295. 'Desc : Sets the timeout variable used by the WFndWnd function.
  296. ' Some of the platforms tested on are very slow and if the timeout isn't
  297. ' long enough then the test continues with out finding the Window and its
  298. ' handle, dooming all subsequent test (that are dependent on this handle)
  299. ' to complete and utter failure.
  300. '
  301. 'Parms :
  302. '
  303. 'Return : None. Sets the Global String variables WTIMEOUT
  304. '
  305. 'History: 02/22/96 : a-rrohr: Created
  306. '*****************************************************************************
  307. Sub SetWndTimeout ()
  308. dim tempstring as string ' Generic string variable
  309. tempstring = space(40)
  310. tempstring = environ$("PROCESSOR_ARCHITECTURE")
  311. select case tempstring
  312. case "x86"
  313. WTIMEOUT = 5 ' Dog
  314. case "Alpha"
  315. WTIMEOUT = 10 ' Old Dog
  316. case "MIPS"
  317. WTIMEOUT = 20 ' Comatose Dog
  318. case "PPC"
  319. WTIMEOUT = 30 ' Road Kill
  320. case else
  321. WTIMEOUT = 30 ' IBM PS/2
  322. logitem (CurrentLoggingLevel, "Unable to set WTIMEOUT: Unknown Processor Architecture")
  323. logitem (CurrentLoggingLevel, "Processor Architecture environment variable = " + tempstring)
  324. end select
  325. '$IFDEF DEBUG_TEST_SCRIPT
  326. WTIMEOUT = WTIMEOUT + 5 'If using BoundsChecker then add a few more seconds
  327. '$ENDIF
  328. end Sub 'SetWndTimeout ()
  329. '*****************************************************************************
  330. 'Name : GetLangStr
  331. 'Desc : Gets the language strings from DP32.ini and save them in global
  332. ' variables or If DP32.ini file doesnt exist it gets default srtings.
  333. ' Also Runtime arguments COMMAND$ and TESTMODE$.
  334. ' COMMAND$ is the path to the DP32.ini file
  335. ' TESTMODE$ is the name of the Results file
  336. '
  337. 'Parms : None. This function uses the language string file (DP32.ini) Constant
  338. ' and the command line variable, command$, that has the path to the
  339. ' language string file
  340. '
  341. 'Return : None. Sets the Global String variables defined in section DP32.ini
  342. '
  343. 'History: 01/13/96 : a-rrohr: Created
  344. '*****************************************************************************
  345. Sub GetLangStr ()
  346. dim szSection as String *35
  347. dim szDefault as String *20
  348. dim szDestBuffer as String *64
  349. dim BufferSize as long
  350. dim szFileNameINI as String *128
  351. DIM TEMPSTRING AS STRING
  352. dim rtn as long
  353. TotalTestCases = TotalTestCases + 1
  354. TEMPSTRING = COMMAND$
  355. if exists(TEMPSTRING) then 'IF THE LANGUAGE STRING FILE EXISTS THEN
  356. ' ************************** COMMON STRINGS *******************
  357. szFileNameINI = TempString
  358. szDefault = "A"
  359. ' Get Language Section Strings
  360. szSection = SecLang '+ string$(len(szSection) - len(SecLang), 0)
  361. Language = GetStringandValidate ((szSection), (KeyLang), (szDefault), (szFileNameINI))
  362. ' Get Menu Section Strings
  363. szSection = Secmenu + string$(1, 0)
  364. MFILE = GetStringandValidate (szSection, KEYMFILE, szDefault, szFileNameINI)
  365. MExit = GetStringandValidate (szSection, KEYMEXIT, szDefault, szFileNameINI)
  366. MTOOLS = GetStringandValidate (szSection, KeyMTOOLS, szDefault, szFileNameINI)
  367. MDIAL_PROPERTIES = GetStringandValidate (szSection, KeyMDP, szDefault, szFileNameINI)
  368. MOPTIONS = GetStringandValidate (szSection, keyMOPTIONS, szDefault, szFileNameINI)
  369. MDEFAULT = GetStringandValidate (szSection, keyMDEFAULT, szDefault, szFileNameINI)
  370. ' Get Caption Section Strings
  371. szSection = SecCaption + string$(1, 0)
  372. DIALER_CAPTION = GetStringandValidate (szSection, KeyPHONEDIALER, szDefault, szFileNameINI)
  373. LOC_INFO_CAPTION = GetStringandValidate (szSection, KeyLocInfo, szDefault, szFileNameINI)
  374. PROPERTIES_CAPTION = GetStringandValidate (szSection, KeyPROPERTIES, szDefault, szFileNameINI)
  375. CONNECT_USE_CAPTION = GetStringandValidate (szSection, KeyConnectUse, szDefault, szFileNameINI)
  376. WARN_BOX_CAPTION = GetStringandValidate (szSection, KeyWarning, szDefault, szFileNameINI)
  377. TAPI_BROWSER_CAPTION = GetStringandValidate (szSection, KeyTB20, szDefault, szFileNameINI)
  378. USING_TB_CAPTION = GetStringandValidate (szSection, KeyUTB, szDefault, szFileNameINI)
  379. REALLY_CAPTION = GetStringandValidate (szSection, KeyForSure, szDefault, szFileNameINI)
  380. CHANGE_CARD_CAPTION = GetStringandValidate (szSection, KeyChangeCard, szDefault, szFileNameINI)
  381. NEW_CARD_CAPTION = GetStringandValidate (szSection, KeyNewCard, szDefault, szFileNameINI)
  382. DEFAULT_VALUES_CAPTION = GetStringandValidate (szSection, KeyDefault, szDefault, szFileNameINI)
  383. DIAL_RULE_CAPTION = GetStringandValidate (szSection, KeyDialingR, szDefault, szFileNameINI)
  384. NO_PIN_CAPTION = GetStringandValidate (szSection, KeyNoPIN, szDefault, szFileNameINI)
  385. COPY_RULE_CAPTION = GetStringandValidate (szSection, KeyCopyRule, szDefault, szFileNameINI)
  386. IMPROPER_CHAR_CAPTION = GetStringandValidate (szSection, KeyImproperRule, szDefault, szFileNameINI)
  387. ' Get Window Class Section Strings
  388. szSection = SecWinClass + string$(1, 0)
  389. DIALOG_CLASS = GetStringandValidate (szSection, KeyPDClass, szDefault, szFileNameINI)
  390. ' Get Control label Strings
  391. szSection = SecLabels + string$(1, 0)
  392. chk_CARD = GetStringandValidate (szSection, KeyCARDCHK, szDefault, szFileNameINI)
  393. chk_WAIT = GetStringandValidate (szSection, KeyWAITCHK, szDefault, szFileNameINI)
  394. opt_TONE = GetStringandValidate (szSection, KeyTONEOPT, szDefault, szFileNameINI)
  395. opt_PULSE = GetStringandValidate (szSection, KeyPULSEOPT, szDefault, szFileNameINI)
  396. cmd_OK = GetStringandValidate (szSection, KeyOKBUTTON, szDefault, szFileNameINI)
  397. cmd_CANCEL = GetStringandValidate (szSection, KeyCANCELBUTTON, szDefault, szFileNameINI)
  398. cmd_APPLY = GetStringandValidate (szSection, KeyAPPLYBUTTON, szDefault, szFileNameINI)
  399. cmd_NEW = GetStringandValidate (szSection, KeyNEWBUTTON, szDefault, szFileNameINI)
  400. cmd_REMOVE = GetStringandValidate (szSection, KeyREMOVEBUTTON, szDefault, szFileNameINI)
  401. cmd_CHANGE = GetStringandValidate (szSection, KeyCHANGEBUTTON, szDefault, szFileNameINI)
  402. txt_LOCAL = GetStringandValidate (szSection, KeyLOCALTXT, szDefault, szFileNameINI)
  403. txt_LONGDIST = GetStringandValidate (szSection, KeyLONGTXT, szDefault, szFileNameINI)
  404. txt_AREACODE = GetStringandValidate (szSection, KeyAREACODETXT, szDefault, szFileNameINI)
  405. cbo_DIALINGFROM = GetStringandValidate (szSection, KeyFROMSTR, szDefault, szFileNameINI)
  406. cbo_IAMIN = GetStringandValidate (szSection, KeyIAMINSTR, szDefault, szFileNameINI)
  407. lbl_ACCESS = GetStringandValidate (szSection, KeyACCESSLABLE, szDefault, szFileNameINI)
  408. lbl_OPT_BTN = GetStringandValidate (szSection, KeyOPTLABLE, szDefault, szFileNameINI)
  409. lbl_FRM_WHERE = GetStringandValidate (szSection, KeyWHERELABLE, szDefault, szFileNameINI)
  410. lbl_FRM_HOW = GetStringandValidate (szSection, KeyHOWLABLE, szDefault, szFileNameINI)
  411. lbl_DIR_DIAL = GetStringandValidate (szSection, KeyNONELABLE, szDefault, szFileNameINI)
  412. tab_MY_LOCATION = GetStringandValidate (szSection, KeyLOCATIONTAB, szDefault, szFileNameINI)
  413. tab_TEL_DRV = GetStringandValidate (szSection, KeyTELDRVTAB, szDefault, szFileNameINI)
  414. else 'IF THE LANGUAGE STRING FILE DOESN'T EXIST THEN USE DEFAULTS
  415. SetDefaultLabels
  416. teststring.TC_Num = 35
  417. teststring.Expect_Res = TEST_INI_FILE + " Does Exist"
  418. teststring.Actual_Res = TEST_INI_FILE + " Doesn't Exist"
  419. teststring.Apprase = "FAIL *"
  420. FailedTestCases = FailedTestCases + 1
  421. LogCase (teststring)
  422. end if
  423. end sub
  424. '*****************************************************************************
  425. 'Name : GetStringandValidate
  426. 'Desc : Uses the GetPrivateProfileString to obtain test strings from the
  427. ' DP32.INI file. Verifies that a Null or default string was not returned.
  428. '
  429. 'Parms : Section: zero terminated string containing Section Name,
  430. ' Key: zero terminated string containing Key Name,
  431. ' Default: zero terminated string containing Default string,
  432. ' DestBuffer: Buffer for retrieved string,
  433. ' FileNameINI: zero terminated string containing INI File Name
  434. '
  435. 'Return : None. Sets the Global String variables defined in section DP32.ini
  436. '
  437. 'History: 01/13/96 : a-rrohr: Created
  438. '*****************************************************************************
  439. function GetStringandValidate (Section as string * 35, KeyName as string, _
  440. Default as string * 20, FileNameINI as string * 128) as string
  441. dim rtn as long
  442. dim teststring as casestruct
  443. dim Key as string * 30
  444. dim DestBuffer as string
  445. Key = KeyName + string$(len(Key) - len(KeyName), 0)
  446. DestBuffer = string$(64, 0)
  447. rtn = GetPrivateProfileString(Section, Key, Default, DestBuffer, _
  448. len(DestBuffer), FileNameINI)
  449. teststring.TC_Num = 35
  450. teststring.Expect_Res = Key + "label"
  451. teststring.Actual_Res = DestBuffer
  452. if (rtn = 0) or (DestBuffer ="") then
  453. teststring.Apprase = "FAIL *"
  454. LogCase (teststring)
  455. else
  456. teststring.Apprase = "Pass"
  457. LogCase (teststring)
  458. GetStringandValidate = DestBuffer
  459. endif
  460. 'print "Section "; section
  461. 'print "KeyName ="; KeyName
  462. 'print "Default ="; Default
  463. 'print "FileNameINI ="; FileNameINI
  464. 'print "DestBuffer ="; DestBuffer
  465. End function
  466. '*****************************************************************************
  467. 'Name : SetDefaultLabels
  468. 'Desc : Sets the language string variables to default US English strings
  469. '
  470. 'Parms : None. This function uses the language string file (DP32.ini) Constant
  471. ' and the command line variable, command$, that has the path to the
  472. ' language string file
  473. '
  474. 'Return : None. Sets the Global String variables defined in section DP32.ini
  475. '
  476. 'History: 01/13/96 : a-rrohr: Created
  477. '*****************************************************************************
  478. Sub SetDefaultLabels ()
  479. Language= "USA_ENG"
  480. MFILE = "&File"
  481. MExit = "E&xit"
  482. MTOOLS = "&Tools"
  483. MDIAL_PROPERTIES = "&Dialing Properties..."
  484. MOPTIONS = "&Options"
  485. MDEFAULT = "&Default values..."
  486. DIALER_CAPTION = "Phone Dialer"
  487. LOC_INFO_CAPTION = "Location Information"
  488. CONNECT_USE_CAPTION = "Connect Using"
  489. WARN_BOX_CAPTION = "Warning"
  490. PROPERTIES_CAPTION = "Dialing Properties"
  491. TAPI_BROWSER_CAPTION = "TAPI32 Browser"
  492. USING_TB_CAPTION = "Using the TAPI Browser"
  493. REALLY_CAPTION = "Are You Sure?"
  494. CHANGE_CARD_CAPTION = "Change Calling Card"
  495. NEW_CARD_CAPTION = "Create New Calling Card"
  496. DIALOG_CLASS = "#32770"
  497. DEFAULT_VALUES_CAPTION = "Default values"
  498. DIAL_RULE_CAPTION = "Dialing Rules"
  499. NO_PIN_CAPTION = "Required Entry Not Made"
  500. COPY_RULE_CAPTION = "Copy Dialing Rules"
  501. IMPROPER_CHAR_CAPTION = "Improper Character Entered"
  502. cmd_NEW = "&New..."
  503. cmd_REMOVE = "&Remove"
  504. cmd_CHANGE = "C&hange..."
  505. cmd_OK = "OK"
  506. cmd_Cancel = "Cancel"
  507. cmd_Apply = "&Apply"
  508. txt_LOCAL = "for local,"
  509. txt_LONGDIST = "for long distance."
  510. txt_AREACODE = "The area &code is:"
  511. cbo_DIALINGFROM = "I am &dialing from:"
  512. cbo_IAMIN = "&I am in:"
  513. opt_TONE = "&Tone dialing"
  514. opt_PULSE = "&Pulse dialing"
  515. chk_CARD = "Dial &using Calling Card:"
  516. chk_WAIT = "This location has call &waiting. To disable it, dial:"
  517. lbl_ACCESS = "To access an &outside line, first dial:"
  518. lbl_OPT_BTN = "The phone system at this location uses:"
  519. lbl_FRM_WHERE = "Where I am:"
  520. lbl_FRM_HOW = "How I dial from this location:"
  521. lbl_DIR_DIAL = "None (Direct Dial)"
  522. tab_MY_LOCATION = "My Locations"
  523. tab_TEL_DRV = "Telephony Drivers"
  524. End Sub 'SetDefaultLabels
  525. '*****************************************************************************
  526. '*****************************************************************************
  527. 'Name : Start_App
  528. 'Desc : Invokes Phone Dialer Application.
  529. '
  530. 'Parms : None. This function uses the Const that contains the Phone Dialer
  531. ' application name
  532. '
  533. 'Return : Returns the Handle to the Phone Dialer
  534. '
  535. 'History: 01/12/96 : a-rrohr: Created
  536. '*****************************************************************************
  537. Function Start_App () as long
  538. dim handle as long, hctrl as long
  539. dim teststring as casestruct
  540. dim txtAreaCodeID as integer, txtAccessCodeID as integer, Failcount as short
  541. dim StaticID as long
  542. dim messagestr as string
  543. txtAreaCodeID = &h0000040E
  544. txtAccessCodeID = &h0000040C
  545. teststring.TC_Num = 33
  546. '$ifdef NUMEGA
  547. run TEST_APP, BoundsChecker
  548. '$else
  549. run TEST_APP, nowait
  550. '$endif 'NUMEGA
  551. handle = 0
  552. ' look for the Location Information window and if it exists enter default location
  553. '$ifdef WIN95
  554. handle = WFndWndC (LOC_INFO_CAPTION, DIALOG_CLASS, W_Flags, WTIMEOUT)
  555. if handle <> 0 then
  556. TotalTestCases = TotalTestCases + 1
  557. WSetActWnd handle
  558. hctrl = GetDlgItem (handle, txtAreaCodeID)
  559. if hctrl <> 0 then
  560. WEditSetText _hwnd(hctrl), "333"
  561. else
  562. failcount = failcount + 1
  563. end if
  564. hctrl = GetDlgItem (handle, txtAccessCodeID)
  565. if hctrl <> 0 then
  566. WEditSetText _hwnd(hctrl), "7"
  567. else
  568. failcount = failcount + 1
  569. end if
  570. if failcount > 0 then
  571. teststring.Expect_Res = "Accessible Window Controls"
  572. teststring.Actual_Res = "dialog Controls Inoperative" + Str$(handle)
  573. teststring.Apprase = "FAIL *"
  574. LogCase (teststring)
  575. FailedTestCases = FailedTestCases + 1
  576. end if
  577. WButtonClick cmd_OK
  578. end if
  579. '$elseifdef NT OR PROCESSOR_MIPS OR PROCESSOR_ALPHA OR PROCESSOR_POWERPC
  580. handle = WFndWndC (WARN_BOX_CAPTION, DIALOG_CLASS, w_flags, Wtimeout)
  581. if handle <> 0 then
  582. TotalTestCases = TotalTestCases + 1
  583. teststring.Expect_Res = "Enabled Telephone Device"
  584. teststring.Actual_Res = "No Telephone Device Enabled"
  585. teststring.Apprase = "FAIL *"
  586. LogCase (teststring)
  587. FailedTestCases = FailedTestCases + 1
  588. StaticID = &h0000FFFF&
  589. hCtrl = GetDlgItem (handle, StaticID)
  590. IF hCtrl <> 0 then
  591. messagestr = StaticText (_hwnd(hCtrl), TIMEOUT)
  592. logitem (CurrentLoggingLevel, messagestr)
  593. WButtonClick (cmd_OK)
  594. endif
  595. endif
  596. handle = WFndWndC (CONNECT_USE_CAPTION, DIALOG_CLASS, w_flags, wtimeout)
  597. if handle <> 0 then
  598. WButtonClick (cmd_OK)
  599. endif
  600. '$endif
  601. '$ifdef WIN95
  602. handle = WFndWndC (DIALER_CAPTION, "DialerClass", w_flags, WTIMEOUT)
  603. '$elseifdef NT OR PROCESSOR_MIPS OR PROCESSOR_ALPHA OR PROCESSOR_POWERPC
  604. handle = WFndWndC (DIALER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  605. '$endif
  606. TotalTestCases = TotalTestCases + 1
  607. teststring.Expect_Res = "Valid Phone Dialer Handle"
  608. teststring.Actual_Res = "Phone Dialer Handle =" + Str$(handle)
  609. if handle = 0 then
  610. teststring.Apprase = "FAIL *"
  611. LogCase (teststring)
  612. FailedTestCases = FailedTestCases + 1
  613. stop
  614. else
  615. teststring.Apprase = "Pass"
  616. LogCase (teststring)
  617. endif
  618. Start_App = handle
  619. end function 'Start_App
  620. '*****************************************************************************
  621. 'Name : SetLocationInfo
  622. 'Desc : Sets the Data in the Location Information window
  623. ' SetLocationsZero is called to set Telephony Register Location
  624. ' NumEntries to zero inorder to force the Location Information window
  625. ' to appear.
  626. '
  627. 'Parms : FirstLoc Location structure containing the default location info.
  628. '
  629. 'Return : None
  630. '
  631. 'History: 02/16/96 : a-rrohr: Created
  632. '*****************************************************************************
  633. Sub SetLocationInfo (FirstLoc as Location)
  634. dim handle as long 'Generic window handle
  635. dim hctrl as long 'Generic Handle to Control
  636. dim teststring as casestruct 'Test Log Info
  637. dim SysDirPath as string 'Path to system32 directory
  638. dim rtn as long 'Generic return variable
  639. dim failcount as short
  640. dim StaticID as long
  641. dim messagestr as string
  642. dim txtAreaCodeID as integer, txtAccessCodeID as integer
  643. dim cboCountryID as integer, optPulseID as integer, cmdCloseID as integer
  644. txtAreaCodeID = &h0000040E 'Location Information dialog
  645. txtAccessCodeID = &h0000040C 'Control IDs
  646. cboCountryID = &h0000040F
  647. optPulseID = &h000017A2
  648. cmdCloseID = &h00000001
  649. SysDirPath = space$(168)
  650. rtn = GetSystemDirectory (SysDirPath, 168)
  651. if SetLocationsZero() then
  652. '$ifdef NUMEGA
  653. run "control.exe " + SysDirPath + "\TELEPHON.CPL", BoundsChecker
  654. '$else
  655. run "control.exe " + SysDirPath + "\TELEPHON.CPL", nowait
  656. '$endif 'NUMEGA
  657. 'Test for the existance of the Location Information Window
  658. 'Note: This window appears only once when telepony.cpl is invoked and no
  659. ' locations have been set. The window can be forced to appear if the
  660. ' NumEntries in the Registry editor is set to 0 (done in SetLocationsZero)
  661. ' path = HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Telephony\Locations
  662. handle = WFndWndC (LOC_INFO_CAPTION, DIALOG_CLASS, w_Flags, WTIMEOUT)
  663. if handle <> 0 then
  664. TotalTestCases = TotalTestCases + 1
  665. WSetActWnd (handle)
  666. hctrl = GetDlgItem (handle, cboCountryID)
  667. if hctrl <> 0 then
  668. WComboItemClk (_hwnd(hctrl), FirstLoc.COUNTRY)
  669. else
  670. failcount = failcount + 1
  671. end if
  672. sleep 1
  673. hctrl = GetDlgItem (handle, txtAreaCodeID)
  674. if hctrl <> 0 then
  675. WEditSetText (_hwnd(hctrl), FirstLoc.AreaCode)
  676. else
  677. failcount = failcount + 1
  678. end if
  679. sleep 1
  680. hctrl = GetDlgItem (handle, txtAccessCodeID)
  681. if hctrl <> 0 then
  682. WEditSetText (_hwnd(hctrl), FirstLoc.LocalAccess)
  683. else
  684. failcount = failcount + 1
  685. end if
  686. sleep 1
  687. hctrl = GetDlgItem (handle, optPulseID)
  688. if hctrl <> 0 then
  689. if WOptionState(_hwnd(hctrl), TIMEOUT) = FALSE THEN
  690. WOptionClick(_hwnd(hctrl), TIMEOUT)
  691. endif
  692. else
  693. failcount = failcount + 1
  694. end if
  695. sleep 1
  696. if failcount > 0 then
  697. teststring.Expect_Res = "Accessible Window Controls"
  698. teststring.Actual_Res = "dialog Controls Inoperative" + Str$(handle)
  699. teststring.Apprase = "FAIL *"
  700. LogCase (teststring)
  701. FailedTestCases = FailedTestCases + 1
  702. end if
  703. hctrl = GetDlgItem (handle, cmdCloseID)
  704. WButtonClick (_hwnd(hctrl))
  705. sleep 1
  706. end if ' handle
  707. else
  708. logitem (CurrentLoggingLevel, "Problem accessing Telephony Registry Info")
  709. logitem (CurrentLoggingLevel, "Test Will Terminate")
  710. Stop
  711. endif 'SetLocationsZero
  712. ' End Test for the existance of the Location Information Window
  713. End Sub ' SetLocationInfo
  714. '*****************************************************************************
  715. 'Name : Call_Dialing_Prop
  716. 'Desc : Invokes the Dialing Properties window and returns the handle to the
  717. ' Dialing Properties dialog, the SysTabControl32, the My Location Tab,
  718. ' and the Telephony Drivers Tab.
  719. '
  720. 'Parms : Passed 3 variables to store the handles to the Tab Control,
  721. ' My Location Tab and the Telephony Drivers Tab
  722. '
  723. 'Return : Returns the Handle to the Dialing Properties dialog
  724. '
  725. 'History: 01/12/96: a-rrohr: Created
  726. 'Modified 02/16/96: a-rrohr: deleted the Location Information code
  727. ' (now in subroutine SetLocationInfo)
  728. '*****************************************************************************
  729. Function Call_Dialing_Prop (hTabCtrl as long, hMLTab as long, hTDTab as long) as long
  730. dim handle as long 'Generic window handle
  731. dim hdialog as long 'Handle of Dialing Properties dialog, function rtns this value
  732. dim hctrl as long 'Generic Handle to Control
  733. dim teststring as casestruct 'Test Log Info
  734. dim SysDirPath as string 'Path to system32 directory
  735. dim rtn as long 'Generic return variable
  736. dim SysTabCtrlID as integer 'ID of SysTabCtrl32 control
  737. dim OK_cmdID as long 'ID of Dialing Properties OK button
  738. dim failcount as short
  739. dim StaticID as long
  740. dim messagestr as string
  741. SysTabCtrlID = &h03020&
  742. OK_cmdID = &h0001&
  743. SysDirPath = space$(168)
  744. rtn = GetSystemDirectory (SysDirPath, 168)
  745. ' If a pre-existing instance of dialing properties exists close it with an OK button click
  746. hdialog = WFndWnd (PROPERTIES_CAPTION, FW_EXIST, WTIMEOUT)
  747. if hdialog <> 0 then
  748. hctrl = GetDlgItem (hdialog, OK_cmdID)
  749. WButtonClick (_hwnd(hctrl)) 'Click the Dialing Properties OK button
  750. sleep 1
  751. end if
  752. ' Invoke Dialing Properties
  753. '$ifdef NUMEGA
  754. run "control.exe " + SysDirPath + "\TELEPHON.CPL", BoundsChecker
  755. '$else
  756. run "control.exe " + SysDirPath + "\TELEPHON.CPL", nowait
  757. '$endif 'NUMEGA
  758. ' Get and validate Dialing Properties window handle
  759. hdialog = WFndWnd (PROPERTIES_CAPTION, FW_EXIST, WTIMEOUT)
  760. TotalTestCases = TotalTestCases + 1
  761. teststring.TC_Num = 34
  762. teststring.Expect_Res = "Valid Properties Handle"
  763. teststring.Actual_Res = "Properties Handle =" + Str$(hdialog)
  764. if hdialog = 0 then
  765. teststring.Apprase = "FAIL *"
  766. FailedTestCases = FailedTestCases + 1
  767. LogCase (teststring)
  768. else
  769. teststring.Apprase = "Pass"
  770. LogCase (teststring)
  771. endif
  772. WSetWndPos (hdialog, 1, 1)
  773. Call_Dialing_Prop = hdialog
  774. ' End - Get and validate Dialing Properties window handle
  775. ' Get and validate SysTabControl32 handle
  776. hTabCtrl = GetDlgItem (hdialog, SysTabCtrlID)
  777. TotalTestCases = TotalTestCases + 1
  778. teststring.TC_Num = 34
  779. teststring.Expect_Res = "Valid SysTab Control Handle"
  780. teststring.Actual_Res = "Sys Tab Handle =" + Str$(hTabCtrl)
  781. if hTabCtrl = 0 then
  782. teststring.Apprase = "FAIL *"
  783. FailedTestCases = FailedTestCases + 1
  784. LogCase (teststring)
  785. else
  786. teststring.Apprase = "Pass"
  787. LogCase (teststring)
  788. endif
  789. ' End - Get and validate SysTabControl32 handle
  790. ' Get and validate My Location Tab handle
  791. hMLTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, W_Flags, WTIMEOUT)
  792. TotalTestCases = TotalTestCases + 1
  793. teststring.TC_Num = 34
  794. teststring.Expect_Res = "Valid My Location Handle"
  795. teststring.Actual_Res = "Tab Handle =" + Str$(hMLTab)
  796. if hMLTab = 0 then
  797. teststring.Apprase = "FAIL *"
  798. FailedTestCases = FailedTestCases + 1
  799. LogCase (teststring)
  800. else
  801. teststring.Apprase = "Pass"
  802. LogCase (teststring)
  803. endif
  804. ' End Get and validate My Location Tab handle
  805. ' Get and validate Telephony Drivers Tab handle
  806. ' Make the SysTabControl32 the active window and
  807. ' Send a right arrow key to the Tab to put the focus on the Telephony Tab
  808. WSetActWnd (hTabCtrl)
  809. ' play hTabCtrl, "^({Tab})"
  810. play hTabCtrl, "{RIGHT}"
  811. hTDTab= WFndWndC (tab_TEL_DRV, DIALOG_CLASS, W_Flags, WTIMEOUT)
  812. TotalTestCases = TotalTestCases + 1
  813. teststring.TC_Num = 34
  814. teststring.Expect_Res = "Valid Telephony Drv Handle"
  815. teststring.Actual_Res = "Tab Handle =" + Str$(hTDTab)
  816. if hTDTab = 0 then
  817. teststring.Apprase = "FAIL *"
  818. FailedTestCases = FailedTestCases + 1
  819. LogCase (teststring)
  820. else
  821. teststring.Apprase = "Pass"
  822. LogCase (teststring)
  823. endif
  824. WSetActWnd (hTabCtrl)
  825. play hTabCtrl, "{LEFT}"
  826. WSetActWnd (hdialog)
  827. end function
  828. '*****************************************************************************
  829. 'Name : SetLocationsZero
  830. 'Desc : Calls the Registry editor and sets Telephony locations
  831. ' NumEntries value equal to zero
  832. '
  833. 'Parms : None
  834. '
  835. 'Return : TRUE if successful in setting NumEntries equal to zero,
  836. ' otherwise false
  837. '
  838. 'History: 02/14/96 : a-rrohr: Created
  839. '*****************************************************************************
  840. Function SetLocationsZero () as short
  841. dim handle as long, hTree as long, hList as long 'handles for regedit
  842. dim hdialog as long, hEdit as long, hOKcmd as long 'handles for Edit dialog
  843. dim treepath as string
  844. dim Windowpath as string
  845. dim rtn as long
  846. dim Value_txtID as long, OK_cmdID as long 'Edit dialog control IDs
  847. Value_txtID = &h03E9&
  848. OK_cmdID =&h0001&
  849. WindowPath = space$(64)
  850. GetWindowsDirectory (WindowPath, len(WindowPath))
  851. Run (WindowPath + "\Regedit.exe"), NOWAIT
  852. handle = WFndWndC (REGEDIT_CAPTION, REGEDIT_CLASS , w_flags, WTIMEOUT)
  853. if handle = 0 then
  854. SetLocationsZero = FALSE
  855. logitem (CurrentLoggingLevel, "Invailid handle to Registry Editor")
  856. goto End_Of_Sub
  857. end if
  858. hTree = GetDlgItem (handle, &h00000001)
  859. if hTree = 0 then
  860. SetLocationsZero = FALSE
  861. logitem (CurrentLoggingLevel, "Invailid handle to Registry Editor Tree")
  862. goto End_Of_Sub
  863. end if
  864. hList = GetDlgItem (handle, &h00000002)
  865. if hList = 0 then
  866. SetLocationsZero = FALSE
  867. logitem (CurrentLoggingLevel, "Invailid handle to Registry Editor List")
  868. goto End_Of_Sub
  869. end if
  870. WTreeItemExpand (_hwnd(hTree), REG_lOC_PATH, TIMEOUT)
  871. WTreeItemClk (_hwnd(hTree), REG_lOC_PATH, VK_LBUTTON, TIMEOUT)
  872. sleep 1
  873. ' The first time dialing properties is invoked the NumEntries dword may not exist.
  874. if WViewItemExists (_hwnd(hList), "NumEntries", TIMEOUT) then
  875. WViewItemDblClk (_hwnd(hList), "NumEntries", VK_LBUTTON, TIMEOUT)
  876. else
  877. goto DONE
  878. endif
  879. hDialog = WFndWndC ("Edit DWORD Value", DIALOG_CLASS , w_flags, WTIMEOUT)
  880. if hDialog = 0 then
  881. SetLocationsZero = FALSE
  882. logitem (CurrentLoggingLevel, "Invailid handle to Edit dialog")
  883. goto End_Of_Sub
  884. end if
  885. hEdit = GetDlgItem (hDialog, Value_txtID)
  886. if hEdit = 0 then
  887. SetLocationsZero = FALSE
  888. logitem (CurrentLoggingLevel, "Invailid handle to Edit dialog Value data edit box")
  889. goto End_Of_Sub
  890. end if
  891. hOKcmd = GetDlgItem (hDialog, OK_cmdID)
  892. if hOKcmd = 0 then
  893. SetLocationsZero = FALSE
  894. logitem (CurrentLoggingLevel, "Invailid handle to Edit dialog OK button")
  895. goto End_Of_Sub
  896. end if
  897. WeditSetText (_hwnd(hEdit), "0", Timeout)
  898. sleep 2
  899. WButtonClick (_hwnd(hOKcmd), Timeout)
  900. DONE:' if numentries doesn't exist then jump here
  901. handle = WFndWndC (REGEDIT_CAPTION, REGEDIT_CLASS , w_flags, WTIMEOUT)
  902. if handle <> 0 then
  903. SetLocationsZero = TRUE
  904. else
  905. SetLocationsZero = FALSE
  906. endif
  907. WSetActWnd (handle)
  908. WMenuSelect ("&Registry\E&xit", TIMEOUT)
  909. End_Of_Sub: 'line lable
  910. end Sub 'SetLocationsZero
  911. '*****************************************************************************
  912. 'Name : GetDPCtrlh
  913. 'Desc : Get the handles to the dialing properties OK, Cancel and Apply
  914. ' command buttons
  915. '
  916. 'Parms : hDProp handle to the dialing properties window
  917. ' hctrlOK assigned handle to OK button
  918. ' hctrlCancel assigned handle to Cancel button
  919. ' hctlApply assigned handle to Apply button
  920. '
  921. 'Return : None. Handles are assigned to the above referenced parameters
  922. '
  923. 'History: 02/07/96: a-rrohr: Created
  924. 'Modified 02/16/96: handles are now saved in an array of handles
  925. '*****************************************************************************
  926. sub GetDPCtrlh (hDProp as long, Prop_hChild() as long, Prop_ChildID() as long)
  927. Prop_hChild(DP_OKcmd) = GetDlgItem (hDProp, Prop_ChildID(DP_OKcmd))
  928. Prop_hChild(DP_CANCELcmd) = GetDlgItem (hDProp, Prop_ChildID(DP_CANCELcmd))
  929. Prop_hChild(DP_APPLYcmd) = GetDlgItem (hDProp, Prop_ChildID(DP_APPLYcmd))
  930. end sub
  931. '*****************************************************************************
  932. 'Name : Validate_Strings
  933. 'Desc : Verifies the strings in the Dialing Properties dialog and fills the
  934. ' hCtrl array with the handles to the child controls of the Tab window
  935. '
  936. 'Parms : hTab = handle to My Location Tab
  937. ' hCtrl = array of My Location child control handles.
  938. '
  939. 'Return : Void:
  940. ' Subroutine fills in the hCtrl array
  941. '
  942. 'History: 02/01/96 : a-rrohr: Created
  943. '*****************************************************************************
  944. sub Validate_Strings (hTab as long, hChild() as long)
  945. dim numchar as long 'Generic long return variable
  946. dim rtn as short 'Generic short return variable
  947. dim lable as string 'Generic string return variable
  948. dim hCtrl as long 'Generic control handle
  949. teststring.TC_Num = 46
  950. ' ******************* Verify Strings of Dialing Properties ********************
  951. ' TO BE ADDED
  952. ' ******************* End Verify Strings of Dialing Properties ****************
  953. ' ******************* Verify Strings of My location Tab ***********************
  954. IF hTab <> 0 then
  955. 'Get "Where am I" lable
  956. teststring.Expect_Res = lbl_FRM_WHERE
  957. TotalTestCases = TotalTestCases + 1
  958. lable = string$(64, str$(0))
  959. Numchar = GetDlgItemText (hTab, &h0000FFFF&, lable, 63)
  960. teststring.Actual_Res = lable
  961. IF lable = lbl_FRM_WHERE THEN
  962. teststring.Apprase = "Pass"
  963. LogCase (teststring)
  964. else
  965. teststring.Apprase = "FAIL *"
  966. FailedTestCases = FailedTestCases + 1
  967. LogCase (teststring)
  968. endif
  969. 'Get "How I dial ..." lable
  970. teststring.Expect_Res = lbl_FRM_HOW
  971. lable = string$(64, str$(0))
  972. TotalTestCases = TotalTestCases + 1
  973. Numchar = GetDlgItemText (hTab, &h00000001, lable, 63)
  974. teststring.Actual_Res = lable
  975. IF lable = lbl_FRM_HOW THEN
  976. teststring.Apprase = "Pass"
  977. LogCase (teststring)
  978. else
  979. teststring.Apprase = "FAIL *"
  980. FailedTestCases = FailedTestCases + 1
  981. LogCase (teststring)
  982. endif
  983. 'Get "To access an outside ..." lable
  984. teststring.Expect_Res = lbl_ACCESS
  985. lable = string$(64, str$(0))
  986. TotalTestCases = TotalTestCases + 1
  987. Numchar = GetDlgItemText (hTab, &h00001395, lable, 63)
  988. teststring.Actual_Res = lable
  989. IF lable = lbl_ACCESS THEN
  990. teststring.Apprase = "Pass"
  991. LogCase (teststring)
  992. else
  993. teststring.Apprase = "FAIL *"
  994. FailedTestCases = FailedTestCases + 1
  995. LogCase (teststring)
  996. endif
  997. 'Get "The Phone system ..." lable
  998. teststring.Expect_Res = lbl_OPT_BTN
  999. lable = string$(64, str$(0))
  1000. TotalTestCases = TotalTestCases + 1
  1001. Numchar = GetDlgItemText (hTab, &h000017A4, lable, 63)
  1002. teststring.Actual_Res = lable
  1003. IF lable = lbl_OPT_BTN THEN
  1004. teststring.Apprase = "Pass"
  1005. LogCase (teststring)
  1006. else
  1007. teststring.Apprase = "FAIL *"
  1008. FailedTestCases = FailedTestCases + 1
  1009. LogCase (teststring)
  1010. endif
  1011. 'Get "None (Direct Dial)" lable
  1012. teststring.Expect_Res = lbl_DIR_DIAL
  1013. lable = string$(64, str$(0))
  1014. TotalTestCases = TotalTestCases + 1
  1015. Numchar = GetDlgItemText (hTab, &h00001391, lable, 63)
  1016. teststring.Actual_Res = lable
  1017. IF lable = lbl_DIR_DIAL THEN
  1018. teststring.Apprase = "Pass"
  1019. LogCase (teststring)
  1020. else
  1021. teststring.Apprase = "FAIL *"
  1022. FailedTestCases = FailedTestCases + 1
  1023. LogCase (teststring)
  1024. endif
  1025. 'Get "Dialing From" combo box lable
  1026. teststring.Expect_Res = cbo_DIALINGFROM
  1027. TotalTestCases = TotalTestCases + 1
  1028. hCtrl = GetDlgItem (hTab, &h00001392)
  1029. IF hCtrl <> 0 then
  1030. lable = StaticText (_hwnd(hCtrl), TIMEOUT)
  1031. teststring.Actual_Res = lable
  1032. IF lable = cbo_DIALINGFROM THEN
  1033. teststring.Apprase = "Pass"
  1034. LogCase (teststring)
  1035. else
  1036. teststring.Apprase = "FAIL *"
  1037. FailedTestCases = FailedTestCases + 1
  1038. LogCase (teststring)
  1039. endif
  1040. endif
  1041. 'Get "I am in" combo box lable
  1042. teststring.Expect_Res = cbo_IAMIN
  1043. TotalTestCases = TotalTestCases + 1
  1044. hCtrl = GetDlgItem (hTab, &h00001394)
  1045. IF hCtrl <> 0 then
  1046. lable = StaticText (_hwnd(hCtrl), TIMEOUT)
  1047. teststring.Actual_Res = lable
  1048. IF lable = cbo_IAMIN THEN
  1049. teststring.Apprase = "Pass"
  1050. LogCase (teststring)
  1051. else
  1052. teststring.Apprase = "FAIL *"
  1053. FailedTestCases = FailedTestCases + 1
  1054. LogCase (teststring)
  1055. endif
  1056. endif
  1057. 'Get "The area code ..." edit box lable
  1058. teststring.Expect_Res = txt_AREACODE
  1059. TotalTestCases = TotalTestCases + 1
  1060. hCtrl = GetDlgItem (hTab, &h00001393)
  1061. IF hCtrl <> 0 then
  1062. lable = StaticText (_hwnd(hCtrl), TIMEOUT)
  1063. teststring.Actual_Res = lable
  1064. IF lable = txt_AREACODE THEN
  1065. teststring.Apprase = "Pass"
  1066. LogCase (teststring)
  1067. else
  1068. teststring.Apprase = "FAIL *"
  1069. FailedTestCases = FailedTestCases + 1
  1070. LogCase (teststring)
  1071. endif
  1072. endif
  1073. 'Get "for local" edit box lable
  1074. teststring.Expect_Res = txt_LOCAL
  1075. TotalTestCases = TotalTestCases + 1
  1076. hCtrl = GetDlgItem (hTab, &h00001396)
  1077. IF hCtrl <> 0 then
  1078. lable = StaticText (_hwnd(hCtrl), TIMEOUT)
  1079. teststring.Actual_Res = lable
  1080. IF lable = txt_LOCAL THEN
  1081. teststring.Apprase = "Pass"
  1082. LogCase (teststring)
  1083. else
  1084. teststring.Apprase = "FAIL *"
  1085. FailedTestCases = FailedTestCases + 1
  1086. LogCase (teststring)
  1087. endif
  1088. endif
  1089. 'Get "for long dist" edit box lable
  1090. teststring.Expect_Res = txt_LONGDIST
  1091. TotalTestCases = TotalTestCases + 1
  1092. hCtrl = GetDlgItem (hTab, &h00001397)
  1093. IF hCtrl <> 0 then
  1094. lable = StaticText (_hwnd(hCtrl), TIMEOUT)
  1095. teststring.Actual_Res = lable
  1096. IF lable = txt_LONGDIST THEN
  1097. teststring.Apprase = "Pass"
  1098. LogCase (teststring)
  1099. else
  1100. teststring.Apprase = "FAIL *"
  1101. FailedTestCases = FailedTestCases + 1
  1102. LogCase (teststring)
  1103. endif
  1104. endif
  1105. 'Verify "New" command button lable
  1106. teststring.Expect_Res = cmd_NEW
  1107. lable = string$(64, str$(0))
  1108. TotalTestCases = TotalTestCases + 1
  1109. Numchar = GetDlgItemText (hTab, &h00001389, lable, 63)
  1110. teststring.Actual_Res = lable
  1111. IF lable = cmd_NEW THEN
  1112. teststring.Apprase = "Pass"
  1113. LogCase (teststring)
  1114. else
  1115. teststring.Apprase = "FAIL *"
  1116. FailedTestCases = FailedTestCases + 1
  1117. LogCase (teststring)
  1118. endif
  1119. 'Verify "Remove" command button lable
  1120. teststring.Expect_Res = cmd_REMOVE
  1121. lable = string$(64, str$(0))
  1122. TotalTestCases = TotalTestCases + 1
  1123. Numchar = GetDlgItemText (hTab, &h0000138B, lable, 63)
  1124. teststring.Actual_Res = lable
  1125. IF lable = cmd_REMOVE THEN
  1126. teststring.Apprase = "Pass"
  1127. LogCase (teststring)
  1128. else
  1129. teststring.Apprase = "FAIL *"
  1130. FailedTestCases = FailedTestCases + 1
  1131. LogCase (teststring)
  1132. endif
  1133. 'Verify "Change" command button lable
  1134. teststring.Expect_Res = cmd_CHANGE
  1135. lable = string$(64, str$(0))
  1136. TotalTestCases = TotalTestCases + 1
  1137. Numchar = GetDlgItemText (hTab, &h0000138C, lable, 63)
  1138. teststring.Actual_Res = lable
  1139. IF lable = cmd_CHANGE THEN
  1140. teststring.Apprase = "Pass"
  1141. LogCase (teststring)
  1142. else
  1143. teststring.Apprase = "FAIL *"
  1144. FailedTestCases = FailedTestCases + 1
  1145. LogCase (teststring)
  1146. endif
  1147. 'Verify "Tone" option button lable
  1148. teststring.Expect_Res = opt_TONE
  1149. lable = string$(64, str$(0))
  1150. TotalTestCases = TotalTestCases + 1
  1151. Numchar = GetDlgItemText (hTab, &h000017A3, lable, 63)
  1152. teststring.Actual_Res = lable
  1153. IF lable = opt_TONE THEN
  1154. teststring.Apprase = "Pass"
  1155. LogCase (teststring)
  1156. else
  1157. teststring.Apprase = "FAIL *"
  1158. FailedTestCases = FailedTestCases + 1
  1159. LogCase (teststring)
  1160. endif
  1161. 'Verify "Pulse" option button lable
  1162. teststring.Expect_Res = opt_PULSE
  1163. lable = string$(64, str$(0))
  1164. TotalTestCases = TotalTestCases + 1
  1165. Numchar = GetDlgItemText (hTab, &h000017A2, lable, 63)
  1166. teststring.Actual_Res = lable
  1167. IF lable = opt_PULSE THEN
  1168. teststring.Apprase = "Pass"
  1169. LogCase (teststring)
  1170. else
  1171. teststring.Apprase = "FAIL *"
  1172. FailedTestCases = FailedTestCases + 1
  1173. LogCase (teststring)
  1174. endif
  1175. teststring.Expect_Res = chk_CARD
  1176. lable = string$(64, str$(0))
  1177. TotalTestCases = TotalTestCases + 1
  1178. Numchar = GetDlgItemText (hTab, &h0000138D, lable, 63)
  1179. teststring.Actual_Res = lable
  1180. IF lable = chk_CARD THEN
  1181. teststring.Apprase = "Pass"
  1182. LogCase (teststring)
  1183. else
  1184. teststring.Apprase = "FAIL *"
  1185. FailedTestCases = FailedTestCases + 1
  1186. LogCase (teststring)
  1187. endif
  1188. teststring.Expect_Res = chk_WAIT
  1189. lable = string$(64, str$(0))
  1190. TotalTestCases = TotalTestCases + 1
  1191. Numchar = GetDlgItemText (hTab, &h0000138E, lable, 63)
  1192. teststring.Actual_Res = lable
  1193. IF lable = chk_WAIT THEN
  1194. teststring.Apprase = "Pass"
  1195. LogCase (teststring)
  1196. else
  1197. teststring.Apprase = "FAIL *"
  1198. FailedTestCases = FailedTestCases + 1
  1199. LogCase (teststring)
  1200. endif
  1201. end if 'hTab
  1202. ' **************** End Verify Strings of My location Tab **********************
  1203. ' **************** Verify Strings of Telephony Drivers Tab ********************
  1204. ' TO BE ADDED
  1205. ' **************** End Verify Strings of Telephony Drivers Tab ****************
  1206. end sub 'Validate_Strings
  1207. '*************************************************************************************
  1208. '*****************************************************************************
  1209. 'Name : GetChildhandles
  1210. 'Desc : Fills the hChild array with the handles to the child controls of hParent
  1211. '
  1212. 'Parms : hTab = handle to My Location Tab
  1213. ' hChild = array of My Location child control handles.
  1214. ' ChildID = array of child control IDs
  1215. '
  1216. 'Return : Void: Subroutine fills in the hChild array parameter
  1217. '
  1218. 'History: 02/10/96 : a-rrohr: Created
  1219. '*****************************************************************************
  1220. sub GetChildhandles (hParent as long, hChild() as long, ChildID() as long)
  1221. dim count as short
  1222. dim beginning as short
  1223. dim ending as short
  1224. beginning = lbound(hChild)
  1225. ending = ubound(hChild)
  1226. for count = beginning to ending
  1227. hChild(count) = GetDlgItem (hParent, ChildID(count))
  1228. next
  1229. end sub
  1230. '*************************************************************************************
  1231. '*****************************************************************************
  1232. 'Name : AddLocations
  1233. 'Desc : Verifies Default location information and creates several new
  1234. ' locations. This routine requires that the My Location property page
  1235. ' is displayed.
  1236. '
  1237. 'Parms : ML_hChild: array holding the handles to the My Location controls
  1238. ' The 2 locations to be added.
  1239. '
  1240. 'Return : None
  1241. '
  1242. 'History: 02/14/96 : a-rrohr: Created
  1243. '*****************************************************************************
  1244. sub AddLocations (Prop_hChild() as long, ML_hChild() as long, FirstLoc as location, _
  1245. Eastside as location, Cork as location)
  1246. dim CurrentLoc as string
  1247. dim CurrentArea as string
  1248. dim CurrentCountry as string
  1249. dim CurrentAccess as string
  1250. dim item as long
  1251. teststring.TC_Num = 41
  1252. 'Verify Default Location Information = Info as set in Location Information window
  1253. VerifyCurrentLoc (ML_hChild, FirstLoc)
  1254. ' Add 2 new locations, Redmond & Cork
  1255. WButtonClick (_hwnd(ML_hChild(New_cmd)))
  1256. FindNewLocMessage() 'close New location message box
  1257. ' The 'I am dialing from:' combobox should have the focus
  1258. teststring.Expect_Res = "Location Combo has Focus"
  1259. TotalTestCases = TotalTestCases + 1
  1260. IF WComboFocus (_hwnd(ML_hChild(Location_cbo))) THEN
  1261. teststring.Actual_Res = "True"
  1262. teststring.Apprase = "Pass"
  1263. LogCase (teststring)
  1264. else
  1265. teststring.Actual_Res = "False"
  1266. teststring.Apprase = "FAIL *"
  1267. FailedTestCases = FailedTestCases + 1
  1268. LogCase (teststring)
  1269. endif
  1270. EditLocationInfo (Eastside, ML_hChild) 'enter Redmond location info
  1271. WButtonClick (_hwnd(ML_hChild(New_cmd)))
  1272. FindNewLocMessage() 'close New location message box
  1273. ' The 'I am dialing from:' combobox should have the focus
  1274. teststring.Expect_Res = "Location Combo has Focus"
  1275. TotalTestCases = TotalTestCases + 1
  1276. IF WComboFocus (_hwnd(ML_hChild(Location_cbo))) THEN
  1277. teststring.Actual_Res = "True"
  1278. teststring.Apprase = "Pass"
  1279. LogCase (teststring)
  1280. else
  1281. teststring.Actual_Res = "False"
  1282. teststring.Apprase = "FAIL *"
  1283. FailedTestCases = FailedTestCases + 1
  1284. LogCase (teststring)
  1285. endif
  1286. ' The 'I am dialing from:' combobox should read New Location
  1287. teststring.Expect_Res = NEW_LOCATION
  1288. TotalTestCases = TotalTestCases + 1
  1289. CurrentLoc = string$(64, str$(0))
  1290. item = WComboIndex (_hwnd(ML_hChild( LOCATION_cbo )), TIMEOUT)
  1291. CurrentLoc = ComboItemText (_hwnd ( ML_hChild( LOCATION_cbo )), Item, TIMEOUT)
  1292. teststring.Actual_Res = CurrentLoc
  1293. 'Test for the existance New Location in current location String. The location string
  1294. 'has a counter that is incremented every time a new location is created.
  1295. IF instr(1, CurrentLoc, NEW_LOCATION) > 0 THEN
  1296. teststring.Apprase = "Pass"
  1297. LogCase (teststring)
  1298. else
  1299. teststring.Apprase = "FAIL *"
  1300. FailedTestCases = FailedTestCases + 1
  1301. LogCase (teststring)
  1302. endif
  1303. EditLocationInfo (Cork, ML_hChild) 'enter Ireland location Info
  1304. ' Close Dialing Properties dialog
  1305. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd)))
  1306. end sub 'AddLocations
  1307. '*****************************************************************************
  1308. 'Name : FindNewLocMessage
  1309. '
  1310. 'Desc : As of build 1261 clicking the New button to create a New location
  1311. ' opens a message box telling the user that he clicked the New button
  1312. ' This function detects the message box and closes it with
  1313. ' the appropriate button.
  1314. ' Can't blame the developer as this fixes a "bug" in Raid.
  1315. '
  1316. 'Parms : None
  1317. '
  1318. 'Return : None
  1319. '
  1320. 'History: 03/06/96 : a-rrohr: Created
  1321. '*****************************************************************************
  1322. sub FindNewLocMessage ()
  1323. dim w_flags as long
  1324. dim hParent as long
  1325. dim hChildWnd as long, hButton as long
  1326. dim OK_CmdID as long
  1327. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  1328. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE 'FW_PART OR
  1329. OK_CmdID = &h00000002&
  1330. 'Get the handle to the static message field
  1331. hChildWnd = WFndWndC ("A new location was created", "Static", w_flags, TIMEOUT)
  1332. 'Get the static message parent handle (the message box handle)
  1333. if hChildWnd > 0 then
  1334. hParent = GetParent (hChildWnd)
  1335. else
  1336. logitem (CurrentLoggingLevel, "FindNewLocMessage Procedure")
  1337. logitem (CurrentLoggingLevel, "Invalid handle to New Location message box Static Control")
  1338. logitem (CurrentLoggingLevel, "Test Will Terminate")
  1339. Stop
  1340. end if
  1341. 'Get the handle to the message box OK button
  1342. if hParent > 0 then
  1343. hButton = GetDlgItem (hParent, OK_cmdID)
  1344. else
  1345. logitem (CurrentLoggingLevel, "FindNewLocMessage Procedure")
  1346. logitem (CurrentLoggingLevel, "Invalid handle to New Location message box")
  1347. logitem (CurrentLoggingLevel, "Test Will Terminate")
  1348. Stop
  1349. endif
  1350. 'Close the Message Box
  1351. if hButton > 0 then
  1352. WButtonClick (_hwnd(hButton), TIMEOUT)
  1353. else
  1354. logitem (CurrentLoggingLevel, "FindNewLocMessage Procedure")
  1355. logitem (CurrentLoggingLevel, "Invalid handle to New Location message box OK Button")
  1356. logitem (CurrentLoggingLevel, "Test Will Terminate")
  1357. Stop
  1358. endif
  1359. end sub'FindNewLocMessage
  1360. '*****************************************************************************
  1361. 'Name : ModifyLocation
  1362. 'Desc : Sets the Current location to the existing New Location and modifys
  1363. ' the Location Info to that contained in the ChangeLoc structure.
  1364. ' Verifies Changed location data is saved when dialing properties is
  1365. ' closed and reopened. This routine requires that the My Location
  1366. ' property page is displayed.
  1367. '
  1368. 'Parms : ML_hChild: array holding the handles to the My Location controls
  1369. ' The Change Location Info .
  1370. '
  1371. 'Return : None
  1372. '
  1373. 'History: 02/14/96 : a-rrohr: Created
  1374. '*****************************************************************************
  1375. sub ModifyLocation (Prop_hChild() as long, ML_hChild() as long, ChangeLoc as location)
  1376. ' Change current location to the existing New Location
  1377. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), New_Location, Timeout)
  1378. ' enter the change location data and close the dialing properties dialog.
  1379. EditLocationInfo (ChangeLoc, ML_hChild)
  1380. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd)))
  1381. end sub 'ModifyLocation
  1382. '*****************************************************************************
  1383. 'Name : VerifyModifyLoc
  1384. 'Desc : Sets the Current location to the existing New Location and modifys
  1385. ' the Location Info to that contained in the ChangeLoc structure.
  1386. ' Verifies Changed location data is saved when dialing properties is
  1387. ' closed and reopened. This routine requires that the My Location
  1388. ' property page is displayed.
  1389. '
  1390. 'Parms : ML_hChild: array holding the handles to the My Location controls
  1391. ' The Change Location Info .
  1392. '
  1393. 'Return : None
  1394. '
  1395. 'History: 02/14/96 : a-rrohr: Created
  1396. '*****************************************************************************
  1397. sub VerifyModifyLoc (ML_hChild() as long, ChangeLoc as location, hDP_OKcmd as long)
  1398. VerifyCurrentLoc (ML_hChild, ChangeLoc)
  1399. teststring.Expect_Res = NEW_LOCATION + " Doesn't Exist"
  1400. TotalTestCases = TotalTestCases + 1
  1401. if (NOT WComboItemExists (_hwnd(ML_hChild( LOCATION_cbo )),NEW_LOCATION, TIMEOUT)) then
  1402. teststring.Actual_Res = NEW_LOCATION + " Doesn't Exist"
  1403. teststring.Apprase = "Pass"
  1404. LogCase (teststring)
  1405. else
  1406. teststring.Actual_Res = NEW_LOCATION + " Exist"
  1407. teststring.Apprase = "FAIL *"
  1408. FailedTestCases = FailedTestCases + 1
  1409. LogCase (teststring)
  1410. endif
  1411. WButtonClick (_hwnd(hDP_OKcmd), TIMEOUT)
  1412. end sub 'VerifyModifyLoc
  1413. '*****************************************************************************
  1414. 'Name : VerifyCallWaiting
  1415. 'Desc :
  1416. '
  1417. 'Parms : Prop_ChildID: array holding the IDs to the Dialing Prop controls
  1418. ' ML_ChildID: array holding the IDs to the My Location controls
  1419. ' TestLoc structure that hold location Info
  1420. '
  1421. 'Return : None
  1422. '
  1423. 'History: 04/08/96 : a-rrohr: Created
  1424. '*****************************************************************************
  1425. Sub VerifyCallWaiting (Prop_ChildID() as long, ML_ChildID() as long, TestLoc as location)
  1426. dim w_flags as long 'used with WFndWnd function
  1427. dim PhoneNo as TelephoneNo 'Holds lpszDestAddress
  1428. dim rtn as long 'Generic Return variable
  1429. dim WinSysDir as string 'Path to Windows System32 directory
  1430. dim count as short 'Generic counter
  1431. dim WaitStr(3) as string 'Wait Strings in Call Waiiting combobox
  1432. dim tempstr as string 'Generic string variable
  1433. 'handles & IDs
  1434. dim hTB20 as long 'handle to TAPI Browser
  1435. dim hList as long 'handle to TAPI Browser API list box
  1436. dim hProperties as long 'handle to Dialing Properties
  1437. dim Prop_hChild(2) as long 'handles to Dialing Properties child controls
  1438. dim hMyLocTab as long 'handle to the My Location property page
  1439. dim ML_hChild(15) as long 'handles to My Locations child controls
  1440. dim hCtrl as long 'Generic Handle to a control
  1441. dim DV_OKcmd as long 'ID to Default Values dialog OK button
  1442. dim DV_list as long 'ID to Default Values dialog list
  1443. dim DV_edit as long
  1444. dim TAPI_API_List as long 'ID to TB20 API list
  1445. dim hDlg as long 'Generic dialog handle
  1446. 'ID to the Default Values child controls
  1447. DV_OKcmd = &h00000001&
  1448. DV_list = &h000003E8&
  1449. DV_edit = &h000003E9&
  1450. 'ID to the TAPI Browser list box control listing all the TAPI API functions
  1451. TAPI_API_List = &h000003E9&
  1452. WaitStr(0) = "*70,"
  1453. WaitStr(1) = "70#,"
  1454. WaitStr(2) = "1170,"
  1455. WaitStr(3) = "*99#,"
  1456. 'Set Test Values
  1457. PhoneNo.CountryCode = 1
  1458. PhoneNo.AreaCode = "777"
  1459. PhoneNo.SubscriberNo = "9998888"
  1460. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  1461. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  1462. '** Start Tapi Browser and set lpszDestAddress
  1463. WinSysDir = space$(32)
  1464. rtn = GetSystemDirectory (WinSysDir, len(WinSysDir))
  1465. '-- Start TAPI Browser and save handles
  1466. if exists(WinSysDir + TAPI_BROWSER) then
  1467. run WinSysDir + TAPI_BROWSER, nowait
  1468. else
  1469. logitem (CurrentLoggingLevel, "Unable to Find " + WinSysDir + TAPI_BROWSER)
  1470. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1471. goto StopTestCase
  1472. endif
  1473. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1474. 'Look for the "Using the TAPI Browser" dialog. This dialog appears automatically
  1475. 'the first time TB is invoked and never again. it must be closed before the test
  1476. 'can proceed.
  1477. hDlg = WFndWndC (USING_TB_CAPTION, DIALOG_CLASS, w_flags, 5)
  1478. if hDlg > 0 then
  1479. 'Get handle to Using the TAPI Browser OK button and close dialog
  1480. hCtrl = GetDlgItem(hDlg, DV_OKcmd)
  1481. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  1482. end if
  1483. ' Select Options / Default Values from menu and
  1484. ' Set Destination Address in TAPI Browser
  1485. WMenuSelect (MOPTIONS + "\" + MDEFAULT, TIMEOUT)
  1486. hDlg = WFndWndC (DEFAULT_VALUES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1487. sleep .1
  1488. 'Select lpszDestAddress
  1489. hCtrl = GetDlgItem(hDlg, DV_list)
  1490. if WListItemExists (_hwnd(hCtrl), "line: lpszDestAddress", TIMEOUT) THEN
  1491. WListItemclk (_hwnd(hCtrl), "line: lpszDestAddress", TIMEOUT)
  1492. else
  1493. logitem (CurrentLoggingLevel, "Unable to Find line: lpszDestAddress in Default Option Parameter list")
  1494. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1495. goto CloseTB20
  1496. end if
  1497. ' Enter Destination Address (phone number) in edit control
  1498. ' I have to tab to the Edit box as both the Values edit box and the
  1499. ' Bit flags list box have the same ID.
  1500. play hDlg, "{TAB}"
  1501. play hDlg, "{+}"+ ltrim$(str$(PhoneNo.CountryCode)) +"{(}"+ PhoneNo.AreaCode +"{)}" + PhoneNo.SubscriberNo
  1502. 'Close Dialog with OK
  1503. hCtrl = GetDlgItem(hDlg, DV_OKcmd)
  1504. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  1505. '** Start Dialing Properties
  1506. hList = GetDlgItem (hTB20, TAPI_API_List)
  1507. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  1508. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  1509. else
  1510. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  1511. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1512. goto CloseTB20
  1513. endif
  1514. '** Get Handles to Dialing Properties, My Location and all child controls
  1515. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1516. if hProperties = 0 then
  1517. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  1518. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1519. goto CloseDP
  1520. endif
  1521. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  1522. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1523. if hMyLocTab = 0 then
  1524. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  1525. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1526. goto CloseDP
  1527. endif
  1528. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  1529. '** Set Location to TestLoc
  1530. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), TestLoc.location, Timeout)
  1531. '** Verify initial condition of Call Waiting Controls
  1532. teststring.Expect_Res = "Call Waiting Chkbox Unchk"
  1533. TotalTestCases = TotalTestCases + 1
  1534. rtn= WCheckEnabled (_Hwnd(ML_hChild(Wait_Chk)))
  1535. select case rtn
  1536. case UNCHECKED
  1537. teststring.Actual_Res = "Call Waiting Chkbox Unchk"
  1538. teststring.Apprase = "Pass"
  1539. LogCase (teststring)
  1540. case CHECKED
  1541. teststring.Actual_Res = "Call Waiting Chkbox is Set"
  1542. teststring.Apprase = "FAIL *"
  1543. FailedTestCases = FailedTestCases + 1
  1544. LogCase (teststring)
  1545. case GRAYED
  1546. teststring.Actual_Res = "Call Waiting Chkbox is Grayed"
  1547. teststring.Apprase = "FAIL *"
  1548. FailedTestCases = FailedTestCases + 1
  1549. LogCase (teststring)
  1550. end select
  1551. teststring.Expect_Res = "Call Waiting Combo Disabled"
  1552. TotalTestCases = TotalTestCases + 1
  1553. if Not WComboEnabled (_hwnd(ML_hChild(WaitStr_Cbo)), 1) then
  1554. teststring.Actual_Res = "Call Waiting Combo Disabled"
  1555. teststring.Apprase = "Pass"
  1556. LogCase (teststring)
  1557. else
  1558. teststring.Actual_Res = "Call Waiting Combo Enabled"
  1559. teststring.Apprase = "FAIL *"
  1560. FailedTestCases = FailedTestCases + 1
  1561. LogCase (teststring)
  1562. end if
  1563. '** Set Call Waiting Check Box
  1564. WCheckCheck (_hwnd(ML_hChild(Wait_Chk)), 1)
  1565. '** Verify Call Waiting Stings combobox is enabled and has proper strings.
  1566. teststring.Expect_Res = "Call Waiting Combo Enabled"
  1567. TotalTestCases = TotalTestCases + 1
  1568. if WComboEnabled (_hwnd(ML_hChild(WaitStr_Cbo)), 1) then
  1569. teststring.Actual_Res = "Call Waiting Combo Enabled"
  1570. teststring.Apprase = "Pass"
  1571. LogCase (teststring)
  1572. else
  1573. teststring.Actual_Res = "Call Waiting Combo Disabled"
  1574. teststring.Apprase = "FAIL *"
  1575. FailedTestCases = FailedTestCases + 1
  1576. LogCase (teststring)
  1577. end if
  1578. for count = lbound(WaitStr) to (Ubound(WaitStr) - 1)
  1579. teststring.Expect_Res = "Call Waiting String " + WaitStr(count)
  1580. TotalTestCases = TotalTestCases + 1
  1581. if WComboItemExists (_hwnd(ML_hChild(WaitStr_Cbo)), WaitStr(count), 1) then
  1582. teststring.Actual_Res = WaitStr(count) + " Exists"
  1583. teststring.Apprase = "Pass"
  1584. LogCase (teststring)
  1585. else
  1586. teststring.Actual_Res = WaitStr(count) + " Does Not Exist"
  1587. teststring.Apprase = "FAIL *"
  1588. FailedTestCases = FailedTestCases + 1
  1589. LogCase (teststring)
  1590. end if
  1591. next
  1592. teststring.Expect_Res = "Total Number of String = 3" + WaitStr(count)
  1593. TotalTestCases = TotalTestCases + 1
  1594. count = WComboCount(_hwnd(ML_hChild(WaitStr_Cbo)), 1)
  1595. teststring.Actual_Res = "String count = " + ltrim$(str$(count))
  1596. if count = 3 then
  1597. teststring.Apprase = "Pass"
  1598. LogCase (teststring)
  1599. else
  1600. teststring.Apprase = "FAIL *"
  1601. FailedTestCases = FailedTestCases + 1
  1602. LogCase (teststring)
  1603. end if
  1604. '** Select each string and verify Number to be dialed has string
  1605. for count = lbound(WaitStr) to (Ubound(WaitStr) - 1)
  1606. WComboItemClk (_hwnd(ML_hChild(WaitStr_Cbo)), WaitStr(count), 1)
  1607. teststring.Expect_Res = "Call Waiting String " + WaitStr(count)
  1608. TotalTestCases = TotalTestCases + 1
  1609. TempStr = string$(64, str$(0))
  1610. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempStr, 63)
  1611. rtn = instr (1, TempStr, WaitStr(count))
  1612. if rtn = 1 then
  1613. teststring.Actual_Res = WaitStr(count) + " Exists in Number"
  1614. teststring.Apprase = "Pass"
  1615. LogCase (teststring)
  1616. else
  1617. teststring.Actual_Res = WaitStr(count) + " Not in Number"
  1618. teststring.Apprase = "FAIL *"
  1619. FailedTestCases = FailedTestCases + 1
  1620. LogCase (teststring)
  1621. end if
  1622. next
  1623. '** Type in new string in combobox and verify Number to be dialed has it.
  1624. count = 3
  1625. WComboSetText(_hwnd(ML_hChild(WaitStr_Cbo)), WaitStr(count), 1)
  1626. sleep .1
  1627. teststring.Expect_Res = "Call Waiting String " + WaitStr(count)
  1628. TotalTestCases = TotalTestCases + 1
  1629. TempStr = string$(64, str$(0))
  1630. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempStr, 63)
  1631. rtn = instr (1, TempStr, WaitStr(count))
  1632. if rtn = 1 then
  1633. teststring.Actual_Res = WaitStr(count) + " Exists in Number"
  1634. teststring.Apprase = "Pass"
  1635. LogCase (teststring)
  1636. else
  1637. teststring.Actual_Res = WaitStr(count) + " Not in Number"
  1638. teststring.Apprase = "FAIL *"
  1639. FailedTestCases = FailedTestCases + 1
  1640. LogCase (teststring)
  1641. end if
  1642. '** Close and reopen Dialing Properties
  1643. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd))) 'Close dialing properties
  1644. rtn = SetActiveWindow (hTB20) 'Make sure TB20 is the active window
  1645. WMenuSelect (MFILE + "\" + MEXIT, TIMEOUT) 'Exit TB20
  1646. sleep .2
  1647. ' Start TAPI Browser and save handles
  1648. if exists(WinSysDir + TAPI_BROWSER) then
  1649. run WinSysDir + TAPI_BROWSER, nowait
  1650. else
  1651. logitem (CurrentLoggingLevel, "Unable to Find " + WinSysDir + TAPI_BROWSER)
  1652. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1653. goto StopTestCase
  1654. endif
  1655. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1656. ' Start Dialing properties
  1657. hList = GetDlgItem (hTB20, TAPI_API_List)
  1658. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  1659. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  1660. else
  1661. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  1662. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1663. goto CloseTB20
  1664. endif
  1665. ' Get Handles to Dialing Properties, My Location and all child controls
  1666. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1667. if hProperties = 0 then
  1668. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  1669. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1670. goto CloseDP
  1671. endif
  1672. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  1673. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1674. if hMyLocTab = 0 then
  1675. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  1676. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  1677. goto CloseDP
  1678. endif
  1679. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  1680. '** Verify previous condition has been saved.
  1681. count = 3
  1682. teststring.Expect_Res = "Call Waiting String " + WaitStr(count)
  1683. TotalTestCases = TotalTestCases + 1
  1684. TempStr = string$(64, str$(0))
  1685. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempStr, 63)
  1686. rtn = instr (1, TempStr, WaitStr(count))
  1687. if rtn = 1 then
  1688. teststring.Actual_Res = WaitStr(count) + " Exists in Number"
  1689. teststring.Apprase = "Pass"
  1690. LogCase (teststring)
  1691. else
  1692. teststring.Actual_Res = WaitStr(count) + " Not in Number"
  1693. teststring.Apprase = "FAIL *"
  1694. FailedTestCases = FailedTestCases + 1
  1695. LogCase (teststring)
  1696. end if
  1697. '** Reset Call Waiting Checkbox
  1698. WCheckUnCheck (_hwnd(ML_hChild(Wait_Chk)), 1)
  1699. '** Verify Call Waiting ComboBox is disabled and Number to be dialed is correct
  1700. teststring.Expect_Res = "Call Waiting Combo Disabled"
  1701. TotalTestCases = TotalTestCases + 1
  1702. if Not WComboEnabled (_hwnd(ML_hChild(WaitStr_Cbo)), 1) then
  1703. teststring.Actual_Res = "Call Waiting Combo Disabled"
  1704. teststring.Apprase = "Pass"
  1705. LogCase (teststring)
  1706. else
  1707. teststring.Actual_Res = "Call Waiting Combo Enabled"
  1708. teststring.Apprase = "FAIL *"
  1709. FailedTestCases = FailedTestCases + 1
  1710. LogCase (teststring)
  1711. end if
  1712. '** Close Dialing Properties and TAPI Browser
  1713. CloseDP:
  1714. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd))) 'Close dialing properties
  1715. CloseTB20:
  1716. rtn = SetActiveWindow (hTB20) 'Make sure TB20 is the active window
  1717. WMenuSelect (MFILE + "\" + MEXIT, TIMEOUT) 'Exit TB20
  1718. StopTestCase:
  1719. End Sub 'VerifyCallWaiting
  1720. '*****************************************************************************
  1721. 'Name : ModifyCallingCard
  1722. 'Desc : Verifies that the the default calling cards are listed correctly in
  1723. ' the Calling Call to use combobox and that their dialing rules are
  1724. ' correct.
  1725. '
  1726. 'Parms : Prop_ChildID: array containing the IDs to the Dialing Prop controls
  1727. ' ML_ChildID: array containing the IDs to the My Location controls
  1728. ' CallingCard array containing information on the default cards
  1729. 'Return : None
  1730. '
  1731. 'History: 04/11/96 : a-rrohr: Created
  1732. '*****************************************************************************
  1733. Sub DefaultCallingCard (CallingCard() as CardData, Prop_ChildID() as long, ML_ChildID() as long)
  1734. dim w_flags as long 'used with WFndWnd function
  1735. dim PhoneNo as TelephoneNo 'Holds lpszDestAddress
  1736. dim rtn as long 'Generic long return variable
  1737. dim WinSysDir as string 'Path to Windows System32 directory
  1738. dim count as long 'Generic counter
  1739. dim Startcount as short 'starting element of array
  1740. dim Endcount as short 'ending element of array
  1741. dim tempstr as string 'Generic string variable
  1742. dim item as long
  1743. dim SizeofArray as short
  1744. dim itemtest as array of long 'Calling-Card-to-used tested flag
  1745. 'handles & IDs
  1746. dim hTB20 as long 'handle to TAPI Browser
  1747. dim hList as long 'handle to TAPI Browser API list box
  1748. dim hProperties as long 'handle to Dialing Properties
  1749. dim Prop_hChild(2) as long 'handles to Dialing Properties child controls
  1750. dim hMyLocTab as long 'handle to the My Location property page
  1751. dim ML_hChild(15) as long 'handles to My Locations child controls
  1752. dim DV_OKcmd as long 'ID to Default Values dialog OK button
  1753. dim DV_list as long 'ID to Default Values dialog list
  1754. dim DV_edit as long
  1755. dim TAPI_API_List as long 'ID to TB20 API list
  1756. dim hCardDlg as long 'handles to Change Calling Card dialog & controls
  1757. dim Card_hChild(6) as long
  1758. dim Card_ChildID(6) as long
  1759. dim hRuleDlg as long 'handles to Dialing Rules dialog & controls
  1760. dim Rule_hChild(4) as long
  1761. dim Rule_ChildID(4) as long
  1762. dim NEW_ChildID(2) as long 'Just to utilize SetCallingCardChildID, not used
  1763. dim hCtrl as long 'Generic Handle to a control
  1764. dim hDlg as long 'Generic dialog handle
  1765. 'Set Test Values
  1766. PhoneNo.CountryCode = 1
  1767. PhoneNo.AreaCode = "777"
  1768. PhoneNo.SubscriberNo = "9998888"
  1769. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  1770. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  1771. '** 1 Get IDs
  1772. SetCallingCardChildID (Card_ChildID, NEW_ChildID, Rule_ChildID, _
  1773. DV_OKcmd, DV_list, DV_edit, TAPI_API_List)
  1774. '** 2 Start TAPI Browser and set lpszDestAddress
  1775. WinSysDir = space$(32)
  1776. rtn = GetSystemDirectory (WinSysDir, len(WinSysDir))
  1777. if exists(WinSysDir + TAPI_BROWSER) then
  1778. run WinSysDir + TAPI_BROWSER, nowait
  1779. else
  1780. logitem (CurrentLoggingLevel, "Unable to Find " + WinSysDir + TAPI_BROWSER)
  1781. logitem (CurrentLoggingLevel, "Ending Default Calling Card test")
  1782. goto StopTestCase
  1783. endif
  1784. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1785. ' Select Options / Default Values from menu and
  1786. ' Set Destination Address in TAPI Browser
  1787. WMenuSelect (MOPTIONS + "\" + MDEFAULT, TIMEOUT)
  1788. hDlg = WFndWndC (DEFAULT_VALUES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1789. sleep .1
  1790. 'Select lpszDestAddress
  1791. hCtrl = GetDlgItem(hDlg, DV_list)
  1792. if WListItemExists (_hwnd(hCtrl), "line: lpszDestAddress", TIMEOUT) THEN
  1793. WListItemclk (_hwnd(hCtrl), "line: lpszDestAddress", TIMEOUT)
  1794. else
  1795. logitem (CurrentLoggingLevel, "Unable to Find line: lpszDestAddress in Default Option Parameter list")
  1796. logitem (CurrentLoggingLevel, "Ending Default Calling Card test")
  1797. goto CloseTB20
  1798. end if
  1799. ' Enter Destination Address (phone number) in edit control
  1800. ' I have to tab to the Edit box as both the Values edit box and the
  1801. ' Bit flags list box have the same ID.
  1802. play hDlg, "{TAB}"
  1803. play hDlg, "{+}"+ ltrim$(str$(PhoneNo.CountryCode)) +"{(}"+ PhoneNo.AreaCode +"{)}" + PhoneNo.SubscriberNo
  1804. 'Close Dialog with OK
  1805. hCtrl = GetDlgItem(hDlg, DV_OKcmd)
  1806. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  1807. '** 3 Start Dialing Properties, get handles and set the location
  1808. hList = GetDlgItem (hTB20, TAPI_API_List)
  1809. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  1810. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  1811. else
  1812. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  1813. logitem (CurrentLoggingLevel, "Ending Default Calling Card test")
  1814. goto CloseTB20
  1815. endif
  1816. '** Get Handles to Dialing Properties, My Location and all child controls
  1817. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1818. if hProperties = 0 then
  1819. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  1820. logitem (CurrentLoggingLevel, "Ending Default Calling Card test")
  1821. goto CloseDP
  1822. endif
  1823. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  1824. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1825. if hMyLocTab = 0 then
  1826. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  1827. logitem (CurrentLoggingLevel, "Ending Default Calling Card test")
  1828. goto CloseDP
  1829. endif
  1830. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  1831. '** 4 Set Dial using Calling Card and click Change
  1832. WCheckCheck (_hwnd(ML_hChild(CARD_Chk)), 1)
  1833. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd))) 'open Change Calling Card
  1834. '** 5 Get Change Calling Card handles
  1835. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1836. teststring.Expect_Res = "Valid Change Calling Card Handle"
  1837. teststring.Actual_Res = "Handle = " + Str$(hCardDlg)
  1838. TotalTestCases = TotalTestCases + 1
  1839. if hCardDlg > 0 then
  1840. teststring.Apprase = "Pass"
  1841. logcase (teststring)
  1842. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  1843. else
  1844. teststring.Apprase = "FAIL *"
  1845. FailedTestCases = FailedTestCases + 1
  1846. logcase (teststring)
  1847. logitem (CurrentLoggingLevel, "Unable to find Change Calling Card dialog")
  1848. logitem (CurrentLoggingLevel, "Terminating Default Calling Cards test")
  1849. Goto CloseDP
  1850. End if
  1851. '** 5a Verify all callingcard() are listed in Calling Card to use list box
  1852. startcount = lbound(callingcard)
  1853. endcount = ubound(callingcard)
  1854. rtn = WComboCount(_hwnd(Card_hChild(CARD_NAMEcbo)), 1)
  1855. redim itemtest (1 to rtn)
  1856. for count = 1 to rtn
  1857. itemtest(count) = FALSE 'set item tested flags to false
  1858. next
  1859. 'Test for Number of default cards
  1860. sizeofarray = endcount - (startcount -1)
  1861. teststring.Expect_Res = ltrim$(Str$(sizeofarray)) +" Cards in Calling Card to use"
  1862. teststring.Actual_Res = ltrim$(Str$(rtn)) + " Cards in ComboBox"
  1863. TotalTestCases = TotalTestCases + 1
  1864. select case rtn
  1865. case is < sizeofarray
  1866. teststring.Apprase = "FAIL *"
  1867. FailedTestCases = FailedTestCases + 1
  1868. case sizeofarray
  1869. teststring.Apprase = "Pass"
  1870. case is > sizeofarray
  1871. teststring.Apprase = "FAIL *"
  1872. FailedTestCases = FailedTestCases + 1
  1873. end select
  1874. logcase (teststring)
  1875. 'Verify that CallingCard(count) is listed in Calling Card to use Combobox
  1876. for count = startcount to endcount
  1877. WritelogItem ("" , " ")
  1878. item = WComboItemIndex(_hwnd(Card_hChild(CARD_NAMEcbo)), CallingCard(count).Cardname, 1)
  1879. teststring.Expect_Res = CallingCard(count).Cardname +" is in ComboBox"
  1880. TotalTestCases = TotalTestCases + 1
  1881. if (item-1) >= 0 then
  1882. itemtest(item) = TRUE
  1883. CallingCard(count).Tested = TRUE
  1884. teststring.Actual_Res = CallingCard(count).Cardname +" is in ComboBox"
  1885. teststring.Apprase = "Pass"
  1886. logcase (teststring)
  1887. else
  1888. teststring.Actual_Res = CallingCard(count).Cardname + " is Not in ComboBox"
  1889. teststring.Apprase = "FAIL *"
  1890. FailedTestCases = FailedTestCases + 1
  1891. logcase (teststring)
  1892. End if
  1893. '** 5b Select each calling card and verify controls and dialing rules
  1894. if CallingCard(count).Tested then 'Test only those cards verified in the combobox
  1895. WComboItemClk (_hwnd(Card_hChild(CARD_NAMEcbo)), CallingCard(count).Cardname, 1)
  1896. ' Verify state of Calling Card Number edit box
  1897. if CallingCard(count).Number then
  1898. teststring.Expect_Res = "Calling Card Number Enabled"
  1899. else
  1900. teststring.Expect_Res = "Calling Card Number Disabled"
  1901. endif
  1902. TotalTestCases = TotalTestCases + 1
  1903. rtn = WEditEnabled (_hwnd(Card_hChild(CARD_NUMBERtxt)),1)
  1904. if rtn then
  1905. teststring.Actual_Res = "Calling Card Number Enabled"
  1906. else
  1907. teststring.Actual_Res = "Calling Card Number Disabled"
  1908. endif
  1909. if CallingCard(count).Number = rtn then
  1910. teststring.Apprase = "Pass"
  1911. logcase (teststring)
  1912. else
  1913. teststring.Apprase = "FAIL *"
  1914. FailedTestCases = FailedTestCases + 1
  1915. logcase (teststring)
  1916. endif
  1917. 'Verify Dialing rules of Calling card
  1918. WButtonClick (_hwnd(Card_hChild(Card_RULEScmd)))
  1919. sleep .1
  1920. hRuleDlg = WFndWndC (DIAL_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  1921. GetChildhandles (hRuleDlg, Rule_hChild, Rule_ChildID)
  1922. 'Verify Local Dialing Rule
  1923. teststring.Actual_Res = edittext(_hwnd(Rule_hChild(Rule_LOCALtxt)),1)
  1924. teststring.Expect_Res = CallingCard(count).LocalRule +" Local Rule"
  1925. TotalTestCases = TotalTestCases + 1
  1926. if teststring.Actual_Res = CallingCard(count).LocalRule then
  1927. teststring.Apprase = "Pass"
  1928. logcase (teststring)
  1929. else
  1930. teststring.Apprase = "FAIL *"
  1931. FailedTestCases = FailedTestCases + 1
  1932. logcase (teststring)
  1933. End if
  1934. 'Verify Long Distance Dialing Rule
  1935. teststring.Actual_Res = edittext(_hwnd(Rule_hChild(Rule_LONGtxt)),1)
  1936. teststring.Expect_Res = CallingCard(count).LongRule + " Long Dist Rule"
  1937. TotalTestCases = TotalTestCases + 1
  1938. if teststring.Actual_Res = CallingCard(count).LongRule then
  1939. teststring.Apprase = "Pass"
  1940. logcase (teststring)
  1941. else
  1942. teststring.Apprase = "FAIL *"
  1943. FailedTestCases = FailedTestCases + 1
  1944. logcase (teststring)
  1945. End if
  1946. 'Verify International Dialing Rule
  1947. teststring.Actual_Res = edittext(_hwnd(Rule_hChild(Rule_INTERtxt)),1)
  1948. teststring.Expect_Res = CallingCard(count).interRule +" International Rule"
  1949. TotalTestCases = TotalTestCases + 1
  1950. if teststring.Actual_Res = CallingCard(count).interRule then
  1951. teststring.Apprase = "Pass"
  1952. logcase (teststring)
  1953. else
  1954. teststring.Apprase = "FAIL *"
  1955. FailedTestCases = FailedTestCases + 1
  1956. logcase (teststring)
  1957. End if
  1958. 'Close Dialing Rules
  1959. WButtonClick (_hwnd(Rule_hChild(Rule_CLOSEcmd)))
  1960. endif
  1961. next
  1962. '** 5c Verify that no listed default calling cards were untested
  1963. startcount = lbound(itemtest)
  1964. endcount = ubound(itemtest)
  1965. for count = startcount to endcount
  1966. if Not itemtest(count) then
  1967. teststring.Actual_Res = "Is Not a Default card"
  1968. teststring.Expect_Res = ComboItemText(_hwnd(Card_hChild(CARD_NAMEcbo)), count, 1) + " Default card"
  1969. TotalTestCases = TotalTestCases + 1
  1970. teststring.Apprase = "FAIL *"
  1971. FailedTestCases = FailedTestCases + 1
  1972. logcase (teststring)
  1973. End if
  1974. Next
  1975. '** 6 Close Change Calling Card, Dialing properties and tapi browser
  1976. CloseCallingCard:
  1977. WButtonClick (_hwnd(Card_hChild(CARD_CANCELcmd))) 'Close Change Calling Card dialog
  1978. CloseDP:
  1979. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd))) 'Close dialing properties
  1980. CloseTB20:
  1981. rtn = SetActiveWindow (hTB20) 'Make sure TB20 is the active window
  1982. WMenuSelect (MFILE + "\" + MEXIT, TIMEOUT) 'Exit TB20
  1983. StopTestCase:
  1984. end Sub 'DefaultCallingCard
  1985. '*****************************************************************************
  1986. 'Name : VerifyCallingCard
  1987. 'Desc : Verifies default location and location information added in the
  1988. ' AddLocation sub. This routine requires that the My Location
  1989. ' property page is displayed.
  1990. '
  1991. 'Parms : Prop_ChildID: array holding the IDs to the Dialing Prop controls
  1992. ' ML_ChildID: array holding the IDs to the My Location controls
  1993. '
  1994. 'Return : None
  1995. '
  1996. 'History: 03/08/96 : a-rrohr: Created
  1997. '*****************************************************************************
  1998. sub VerifyCallingCard (Prop_ChildID() as long, ML_ChildID() as long)
  1999. dim w_flags as long 'used with WFndWnd function
  2000. dim hTB20 as long, hProperties as long, hMyLocTab as long
  2001. dim hList as long, Prop_hChild (2) as long, ML_hChild(14) as long
  2002. dim hCardDlg as long, Card_hChild(6) as long, Card_ChildID(6) as long
  2003. dim hNewDlg as long, NEW_hChild(2) as long, NEW_ChildID(2) as long, hNewCtrl as long
  2004. dim hRuleDlg as long, Rule_hChild(4) as long, Rule_ChildID(4) as long, hRuleCtrl as long
  2005. dim TAPI_API_List as long
  2006. DIM DV_OKcmd as long, DV_list as long, DV_edit as long, hDVctrl as long
  2007. dim rtn as long, item as long, hDlg as long, hCtrl as long
  2008. dim CardName as string, TempString as string
  2009. dim WinSysDir as string
  2010. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  2011. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  2012. 'Set Child control IDs
  2013. SetCallingCardChildID (Card_ChildID, NEW_ChildID, Rule_ChildID, _
  2014. DV_OKcmd, DV_list, DV_edit, TAPI_API_List)
  2015. ' Start the TAPI Browser application
  2016. WinSysDir = space$(32)
  2017. rtn = GetSystemDirectory (WinSysDir, len(WinSysDir))
  2018. if exists(WinSysDir + TAPI_BROWSER) then
  2019. run WinSysDir + TAPI_BROWSER, nowait
  2020. else
  2021. logitem (CurrentLoggingLevel, "Unable to Find " + WinSysDir + TAPI_BROWSER)
  2022. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  2023. goto NoTAPIBrowser
  2024. endif
  2025. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2026. ' Set Destination Address in TAPI Browser
  2027. WMenuSelect (MOPTIONS + "\" + MDEFAULT, TIMEOUT)
  2028. hDlg = WFndWndC (DEFAULT_VALUES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2029. 'Select lpszDestAddress
  2030. hDVctrl = GetDlgItem(hDlg, DV_list)
  2031. if WListItemExists (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT) THEN
  2032. WListItemclk (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT)
  2033. end if
  2034. 'Enter Destination Address (phone number) in edit control
  2035. ' I have to tab to the Edit box as both the Values edit box and the
  2036. ' Bit flags list box have the same ID.
  2037. play hDlg, "{TAB}"
  2038. play hDlg, "{+}1{(}206{)}7881234"
  2039. 'hDVctrl = GetDlgItem(hDlg, DV_edit)
  2040. 'WEditSetText (_hwnd(hDVctrl), "+1(206)7881234", TIMEOUT)
  2041. 'Close Dialog with OK
  2042. hDVctrl = GetDlgItem(hDlg, DV_OKcmd)
  2043. WButtonClick (_hwnd(hDVctrl), TIMEOUT)
  2044. ' Call lineTranslateDialog from TAPI Browser
  2045. hList = GetDlgItem (hTB20, TAPI_API_List)
  2046. 'print "Listbox handle = "; hList
  2047. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  2048. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  2049. else
  2050. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  2051. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  2052. goto NoDialingProp
  2053. endif
  2054. ' Get all Dialing Properties handles
  2055. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2056. if hProperties = 0 then
  2057. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  2058. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  2059. goto NoDialingProp
  2060. endif
  2061. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  2062. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2063. if hMyLocTab = 0 then
  2064. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  2065. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  2066. goto StopTestCase
  2067. endif
  2068. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  2069. 'Set location to local (Redmond) area code
  2070. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), "Redmond", timeout)
  2071. ' Start of Test Cases
  2072. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd))) 'Open Change Calling Card dialog
  2073. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2074. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  2075. ' TEST FOR DEFAULT STATE OF CHANGE CALLING CARD DIALOG CONTROLS
  2076. teststring.Expect_Res = "NEW Button Enabled"
  2077. TotalTestCases = TotalTestCases + 1
  2078. if WButtonEnabled (_Hwnd(Card_hChild(CARD_NEWcmd))) then
  2079. teststring.Actual_Res = "NEW Button Enabled"
  2080. teststring.Apprase = "Pass"
  2081. LogCase (teststring)
  2082. else
  2083. teststring.Actual_Res = "NEW Button is not Enabled"
  2084. teststring.Apprase = "FAIL *"
  2085. FailedTestCases = FailedTestCases + 1
  2086. LogCase (teststring)
  2087. end if
  2088. teststring.Expect_Res = "Remove Button is not Enabled"
  2089. TotalTestCases = TotalTestCases + 1
  2090. if WButtonEnabled (_Hwnd(Card_hChild(CARD_REMOVEcmd))) then
  2091. teststring.Actual_Res = "Remove Button is Enabled"
  2092. teststring.Apprase = "FAIL *"
  2093. FailedTestCases = FailedTestCases + 1
  2094. LogCase (teststring)
  2095. else
  2096. teststring.Actual_Res = "Remove Button is not Enabled"
  2097. teststring.Apprase = "Pass"
  2098. LogCase (teststring)
  2099. endif
  2100. teststring.Expect_Res = "Advanced Button Enabled"
  2101. TotalTestCases = TotalTestCases + 1
  2102. if WButtonEnabled (_Hwnd(Card_hChild(Card_RULEScmd))) then
  2103. teststring.Actual_Res = "Advanced Button Enabled"
  2104. teststring.Apprase = "Pass"
  2105. LogCase (teststring)
  2106. else
  2107. teststring.Actual_Res = "Advanced Button is not Enabled"
  2108. teststring.Apprase = "FAIL *"
  2109. FailedTestCases = FailedTestCases + 1
  2110. LogCase (teststring)
  2111. end if
  2112. teststring.Expect_Res = "OK Button Enabled"
  2113. TotalTestCases = TotalTestCases + 1
  2114. if WButtonEnabled (_Hwnd(Card_hChild(CARD_OKcmd))) then
  2115. teststring.Actual_Res = "OK Button Enabled"
  2116. teststring.Apprase = "Pass"
  2117. LogCase (teststring)
  2118. else
  2119. teststring.Actual_Res = "OK Button is not Enabled"
  2120. teststring.Apprase = "FAIL *"
  2121. FailedTestCases = FailedTestCases + 1
  2122. LogCase (teststring)
  2123. end if
  2124. teststring.Expect_Res = "OK Button has Focus"
  2125. TotalTestCases = TotalTestCases + 1
  2126. if WButtonFocus (_Hwnd(Card_hChild(CARD_OKcmd))) then
  2127. teststring.Actual_Res = "OK Button has Focus"
  2128. teststring.Apprase = "Pass"
  2129. LogCase (teststring)
  2130. else
  2131. teststring.Actual_Res = "OK Button does not have Focus"
  2132. teststring.Apprase = "FAIL *"
  2133. FailedTestCases = FailedTestCases + 1
  2134. LogCase (teststring)
  2135. end if
  2136. teststring.Expect_Res = "CANCEL Button Enabled"
  2137. TotalTestCases = TotalTestCases + 1
  2138. if WButtonEnabled (_Hwnd(Card_hChild(CARD_CANCELcmd))) then
  2139. teststring.Actual_Res = "CANCEL Button Enabled"
  2140. teststring.Apprase = "Pass"
  2141. LogCase (teststring)
  2142. else
  2143. teststring.Actual_Res = "CANCEL Button is not Enabled"
  2144. teststring.Apprase = "FAIL *"
  2145. FailedTestCases = FailedTestCases + 1
  2146. LogCase (teststring)
  2147. end if
  2148. teststring.Expect_Res = "No Calling Card Number"
  2149. TotalTestCases = TotalTestCases + 1
  2150. if WEditLen (_Hwnd(Card_hChild(CARD_NUMBERtxt))) = 0 then
  2151. teststring.Actual_Res = "No Calling Card Number"
  2152. teststring.Apprase = "Pass"
  2153. LogCase (teststring)
  2154. else
  2155. teststring.Actual_Res = "Calling Card Number"
  2156. teststring.Apprase = "FAIL *"
  2157. FailedTestCases = FailedTestCases + 1
  2158. LogCase (teststring)
  2159. end if
  2160. teststring.Expect_Res = "Default Calling Card exists"
  2161. TotalTestCases = TotalTestCases + 1
  2162. item = WComboIndex (_hwnd(Card_hChild(CARD_NAMEcbo)), TIMEOUT)
  2163. if item = 0 then
  2164. teststring.Actual_Res = "No Default Calling Card"
  2165. teststring.Apprase = "FAIL *"
  2166. FailedTestCases = FailedTestCases + 1
  2167. LogCase (teststring)
  2168. else
  2169. teststring.Actual_Res = "Default Calling Card exists"
  2170. teststring.Apprase = "Pass"
  2171. LogCase (teststring)
  2172. end if
  2173. teststring.Expect_Res = lbl_DIR_DIAL
  2174. TotalTestCases = TotalTestCases + 1
  2175. CardName = space$(32)
  2176. CardName = ComboItemText (_hwnd(Card_hChild(CARD_NAMEcbo)), item, TIMEOUT)
  2177. if CardName = teststring.Expect_Res then
  2178. teststring.Actual_Res = "Valid Calling Card " + CardName
  2179. teststring.Apprase = "Pass"
  2180. LogCase (teststring)
  2181. else
  2182. teststring.Actual_Res = "Invalid Calling Card " + CardName
  2183. teststring.Apprase = "FAIL *"
  2184. FailedTestCases = FailedTestCases + 1
  2185. LogCase (teststring)
  2186. end if
  2187. ' Add New Calling Card
  2188. WButtonClick (_hwnd(Card_hChild(CARD_NEWcmd)))
  2189. hNewDlg = WFndWndC (NEW_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2190. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_NAMEtxt))
  2191. WEditSetText (_hwnd(hNewCtrl), "New Card", TIMEOUT)
  2192. teststring.Expect_Res = "New Card"
  2193. TotalTestCases = TotalTestCases + 1
  2194. CardName = space$(32)
  2195. CardName = EditText (_hwnd(hNewCtrl), TIMEOUT)
  2196. if CardName = teststring.Expect_Res then
  2197. teststring.Actual_Res = "Valid Calling Card " + CardName
  2198. teststring.Apprase = "Pass"
  2199. LogCase (teststring)
  2200. else
  2201. teststring.Actual_Res = "Invalid Calling Card " + CardName
  2202. teststring.Apprase = "FAIL *"
  2203. FailedTestCases = FailedTestCases + 1
  2204. LogCase (teststring)
  2205. end if
  2206. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_OKcmd))
  2207. WButtonClick (_hwnd(hNewCtrl)) 'Close Create New Calling Card
  2208. '************* Add Test to verify DP Message and close *****************
  2209. w_flags = FW_ALL OR FW_CHILDOK OR FW_PART OR FW_EXIST _
  2210. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  2211. hCtrl = WFndWndC ("You Now Must", "Static", w_flags, WTIMEOUT)
  2212. hDlg = GetParent (hCtrl)
  2213. 'Verify Caption of Parent is Dialing Properties
  2214. teststring.Expect_Res = PROPERTIES_CAPTION
  2215. teststring.Actual_Res = string$(64, str$(0))
  2216. rtn = GetWindowText (hDlg, teststring.Actual_Res, len(teststring.Actual_Res))
  2217. TotalTestCases = TotalTestCases + 1
  2218. if teststring.Actual_Res = teststring.Expect_Res then
  2219. teststring.Apprase = "Pass"
  2220. logcase (teststring)
  2221. else
  2222. teststring.Apprase = "FAIL *"
  2223. FailedTestCases = FailedTestCases + 1
  2224. logcase (teststring)
  2225. logitem (CurrentLoggingLevel, "Unable to find Dialing Properties Message")
  2226. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2227. Goto StopTestCase
  2228. End if
  2229. hCtrl = GetDlgItem (hDlg, &h0002&) 'Get Handle to OK button
  2230. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  2231. 'reset window search flag
  2232. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  2233. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  2234. 'Verify that the Dialing Rules dialog appears, enter dialing rules and close
  2235. hRuleDlg = WFndWndC (DIAL_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2236. teststring.Expect_Res = "Valid Dialing Rules Handle"
  2237. teststring.Actual_Res = "Handle = " + Str$(hRuleDlg)
  2238. TotalTestCases = TotalTestCases + 1
  2239. if hRuleDlg > 0 then
  2240. teststring.Apprase = "Pass"
  2241. logcase (teststring)
  2242. GetChildhandles (hRuleDlg, Rule_hChild, Rule_ChildID)
  2243. else
  2244. teststring.Apprase = "FAIL *"
  2245. FailedTestCases = FailedTestCases + 1
  2246. logcase (teststring)
  2247. logitem (CurrentLoggingLevel, "Unable to find Dialing Rules dialog")
  2248. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2249. Goto StopTestCase
  2250. End if
  2251. 'Verify US Country Dialing Rules
  2252. teststring.Expect_Res = TempString + "G"
  2253. TotalTestCases = TotalTestCases + 1
  2254. teststring.Actual_Res = string$(32, str$(0))
  2255. teststring.Actual_Res = ltrim$(EditText (_hwnd(Rule_hChild(Rule_LOCALtxt)), TIMEOUT))
  2256. IF teststring.Actual_Res = teststring.Expect_Res THEN
  2257. teststring.Apprase = "Pass"
  2258. LogCase (teststring)
  2259. else
  2260. teststring.Apprase = "FAIL *"
  2261. FailedTestCases = FailedTestCases + 1
  2262. LogCase (teststring)
  2263. endif
  2264. teststring.Expect_Res = TempString + "1FG"
  2265. TotalTestCases = TotalTestCases + 1
  2266. teststring.Actual_Res = string$(32, str$(0))
  2267. teststring.Actual_Res = ltrim$(EditText (_hwnd(Rule_hChild(Rule_LONGtxt)), TIMEOUT))
  2268. IF teststring.Actual_Res = teststring.Expect_Res THEN
  2269. teststring.Apprase = "Pass"
  2270. LogCase (teststring)
  2271. else
  2272. teststring.Apprase = "FAIL *"
  2273. FailedTestCases = FailedTestCases + 1
  2274. LogCase (teststring)
  2275. endif
  2276. teststring.Expect_Res = TempString + "011EFG"
  2277. TotalTestCases = TotalTestCases + 1
  2278. teststring.Actual_Res = string$(32, str$(0))
  2279. teststring.Actual_Res = ltrim$(EditText (_hwnd(Rule_hChild(Rule_INTERtxt)), TIMEOUT))
  2280. IF teststring.Actual_Res = teststring.Expect_Res THEN
  2281. teststring.Apprase = "Pass"
  2282. LogCase (teststring)
  2283. else
  2284. teststring.Apprase = "FAIL *"
  2285. FailedTestCases = FailedTestCases + 1
  2286. LogCase (teststring)
  2287. endif
  2288. 'Set Rules to NULL string
  2289. WEditSetText (_hwnd(Rule_hChild(Rule_LOCALtxt)), "", TIMEOUT)
  2290. WEditSetText (_hwnd(Rule_hChild(Rule_LONGtxt)), "", TIMEOUT)
  2291. WEditSetText (_hwnd(Rule_hChild(Rule_INTERtxt)), "", TIMEOUT)
  2292. WButtonClick (_hwnd(Rule_hChild(Rule_CLOSEcmd)), TIMEOUT)
  2293. '****************************************************************************
  2294. teststring.Expect_Res = "New Card"
  2295. TotalTestCases = TotalTestCases + 1
  2296. CardName = space$(32)
  2297. CardName = ComboItemText (_hwnd(Card_hChild(CARD_NAMEcbo)), item, TIMEOUT)
  2298. if CardName = teststring.Expect_Res then
  2299. teststring.Actual_Res = "Valid Calling Card " + CardName
  2300. teststring.Apprase = "Pass"
  2301. LogCase (teststring)
  2302. else
  2303. teststring.Actual_Res = "Invalid Calling Card " + CardName
  2304. teststring.Apprase = "FAIL *"
  2305. FailedTestCases = FailedTestCases + 1
  2306. LogCase (teststring)
  2307. end if
  2308. WButtonClick (_hwnd(Card_hChild(CARD_OKcmd))) 'Close Change Calling Card
  2309. '*** Verify Number to be dialed Test - blank dialing rules
  2310. 'Verify calling card static lable
  2311. teststring.Expect_Res = "New Card"
  2312. TotalTestCases = TotalTestCases + 1
  2313. CardName = string$(32, str$(0))
  2314. TotalTestCases = TotalTestCases + 1
  2315. rtn = GetDlgItemText (hMyLocTab, &h00001391, CardName, 31)
  2316. teststring.Actual_Res = CardName
  2317. IF CardName = "New Card" THEN
  2318. teststring.Apprase = "Pass"
  2319. LogCase (teststring)
  2320. else
  2321. teststring.Apprase = "FAIL *"
  2322. FailedTestCases = FailedTestCases + 1
  2323. LogCase (teststring)
  2324. endif
  2325. 'Verify Number to be dialed static lable
  2326. TempString = string$(32, str$(0))
  2327. TempString = EditText (_hwnd(ML_hChild(local_txt)), TIMEOUT)
  2328. if TempString <> "" then
  2329. teststring.Expect_Res = TempString + " 7881234"
  2330. else
  2331. teststring.Expect_Res = "7881234"
  2332. end if
  2333. TotalTestCases = TotalTestCases + 1
  2334. TempString = string$(64, str$(0))
  2335. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 31)
  2336. teststring.Actual_Res = TempString
  2337. IF TempString = teststring.Expect_Res THEN
  2338. teststring.Apprase = "Pass"
  2339. LogCase (teststring)
  2340. else
  2341. teststring.Apprase = "FAIL *"
  2342. FailedTestCases = FailedTestCases + 1
  2343. LogCase (teststring)
  2344. endif
  2345. 'Set Calling Card checkbox and Verify Number to be dialed static lable
  2346. WCheckCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2347. TempString = string$(32, str$(0))
  2348. TempString = EditText (_hwnd(ML_hChild(local_txt)), TIMEOUT)
  2349. teststring.Expect_Res = TempString
  2350. TotalTestCases = TotalTestCases + 1
  2351. TempString = string$(64, str$(0))
  2352. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(Address_lbl), TempString, 31)
  2353. teststring.Actual_Res = TempString
  2354. IF TempString = teststring.Expect_Res THEN
  2355. teststring.Apprase = "Pass"
  2356. LogCase (teststring)
  2357. else
  2358. teststring.Apprase = "FAIL *"
  2359. FailedTestCases = FailedTestCases + 1
  2360. LogCase (teststring)
  2361. endif
  2362. '*** Enter Advanced Dialing Rules
  2363. ' Open Change Calling Card and click the Advanced button
  2364. 'Open Change Calling Card dialog & get child handles
  2365. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd)))
  2366. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2367. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  2368. '*******************************************************************************
  2369. ' At this point the Calling Card should be New Card (works manually)
  2370. ' But when the automated test is executed the default card is None.
  2371. ' As a workaround select the New Card and force it to be the default.
  2372. '*******************************************************************************
  2373. WComboItemClk (_hwnd(Card_hChild(Card_Namecbo)), "New Card", timeout)
  2374. 'Open Dialing Rules dialog & get child handles
  2375. WButtonClick (_hwnd(Card_hChild(Card_RULEScmd)))
  2376. hRuleDlg = WFndWndC (DIAL_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2377. ' Verify that the Dialing Rules dialog appears, enter dialing rules and close
  2378. teststring.Expect_Res = "Valid Dialing Rules Handle"
  2379. teststring.Actual_Res = "Handle = " + Str$(hRuleDlg)
  2380. TotalTestCases = TotalTestCases + 1
  2381. if hRuleDlg > 0 then
  2382. teststring.Apprase = "Pass"
  2383. logcase (teststring)
  2384. GetChildhandles (hRuleDlg, Rule_hChild, Rule_ChildID)
  2385. WEditSetText (_hwnd(Rule_hChild(Rule_LOCALtxt)), "HG", TIMEOUT)
  2386. WEditSetText (_hwnd(Rule_hChild(Rule_LONGtxt)), "FG", TIMEOUT)
  2387. WEditSetText (_hwnd(Rule_hChild(Rule_INTERtxt)), "EFG", TIMEOUT)
  2388. WButtonClick (_hwnd(Rule_hChild(Rule_CLOSEcmd)), TIMEOUT)
  2389. else
  2390. teststring.Apprase = "FAIL *"
  2391. FailedTestCases = FailedTestCases + 1
  2392. logcase (teststring)
  2393. logitem (CurrentLoggingLevel, "Unable to find Dialing Rules dialog")
  2394. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2395. Goto StopTestCase
  2396. End if
  2397. ' Click Change Calling Card OK & verify error message
  2398. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)))
  2399. hDlg = WFndWndC (NO_PIN_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2400. teststring.Expect_Res = "Valid Error Dialog Handle"
  2401. teststring.Actual_Res = "Handle = " + Str$(hDlg)
  2402. TotalTestCases = TotalTestCases + 1
  2403. if hDlg > 0 Then
  2404. teststring.Apprase = "Pass"
  2405. logcase (teststring)
  2406. hCtrl = GetDlgItem(hDlg, &h02&) 'Close error message box with OK button
  2407. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  2408. else
  2409. teststring.Apprase = "FAIL *"
  2410. FailedTestCases = FailedTestCases + 1
  2411. logcase (teststring)
  2412. logitem (CurrentLoggingLevel, "Unable to find No PIN error message")
  2413. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2414. Goto StopTestCase
  2415. End if
  2416. ' Enter Pin number, click OK and verify error message does not appear
  2417. WEditSetText (_hwnd(Card_hChild(Card_NUMBERtxt)), "1234", TIMEOUT)
  2418. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)), TIMEOUT)
  2419. hDlg = WFndWndC (NO_PIN_CAPTION, DIALOG_CLASS, w_flags, 1)
  2420. teststring.Expect_Res = "No Error Message"
  2421. TotalTestCases = TotalTestCases + 1
  2422. if hDlg = 0 Then
  2423. teststring.Actual_Res = "No Error Message"
  2424. teststring.Apprase = "Pass"
  2425. logcase (teststring)
  2426. else
  2427. teststring.Actual_Res = "PIN Error Message"
  2428. teststring.Apprase = "FAIL *"
  2429. FailedTestCases = FailedTestCases + 1
  2430. logcase (teststring)
  2431. logitem (CurrentLoggingLevel, "PIN error message dialog was found")
  2432. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2433. hCtrl = GetDlgItem(hDlg, &h02&) 'Close error message box with OK button
  2434. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  2435. Goto StopTestCase
  2436. End if
  2437. ' Verify Local Dialing rule
  2438. WCheckUnCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2439. WCheckCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2440. TempString = string$(32, str$(0))
  2441. TempString = EditText (_hwnd(ML_hChild(local_txt)), TIMEOUT)
  2442. teststring.Expect_Res = TempString + " [New Card] 7881234"
  2443. TotalTestCases = TotalTestCases + 1
  2444. TempString = string$(64, str$(0))
  2445. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(Address_lbl), TempString, 31)
  2446. teststring.Actual_Res = TempString
  2447. IF TempString = teststring.Expect_Res THEN
  2448. teststring.Apprase = "Pass"
  2449. LogCase (teststring)
  2450. else
  2451. teststring.Apprase = "FAIL *"
  2452. FailedTestCases = FailedTestCases + 1
  2453. LogCase (teststring)
  2454. endif
  2455. ' Select Long distance location, Open Change calling card, select card
  2456. ' & verify Long distance dialing rules
  2457. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), "Chicago", timeout)
  2458. ' Make sure new card is selected for long distance location
  2459. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd)))
  2460. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2461. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  2462. WComboItemClk (_hwnd(Card_hChild(Card_NAMEcbo)), lbl_DIR_DIAL, timeout)
  2463. WComboItemClk (_hwnd(Card_hChild(Card_NAMEcbo)), "New Card", timeout)
  2464. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)), TIMEOUT)
  2465. 'Verify Calling Card Dialing Rules
  2466. WCheckCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2467. TempString = string$(32, str$(0))
  2468. TempString = EditText (_hwnd(ML_hChild(LONG_txt)), TIMEOUT)
  2469. teststring.Expect_Res = TempString + " 206 7881234"
  2470. TotalTestCases = TotalTestCases + 1
  2471. TempString = string$(64, str$(0))
  2472. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(Address_lbl), TempString, 31)
  2473. teststring.Actual_Res = TempString
  2474. IF TempString = teststring.Expect_Res THEN
  2475. teststring.Apprase = "Pass"
  2476. LogCase (teststring)
  2477. else
  2478. teststring.Apprase = "FAIL *"
  2479. FailedTestCases = FailedTestCases + 1
  2480. LogCase (teststring)
  2481. endif
  2482. ' Select International location, Open Cahnge calling card, select card
  2483. ' & verify International dialing rules
  2484. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), "Cork", timeout)
  2485. ' Make sure new card is selected for long distance location
  2486. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd)))
  2487. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2488. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  2489. WComboItemClk (_hwnd(Card_hChild(Card_NAMEcbo)), lbl_DIR_DIAL, timeout)
  2490. WComboItemClk (_hwnd(Card_hChild(Card_NAMEcbo)), "New Card", timeout)
  2491. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)), TIMEOUT)
  2492. 'Verify Calling Card Dialing Rules
  2493. WCheckCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2494. TempString = string$(32, str$(0))
  2495. TempString = EditText (_hwnd(ML_hChild(LONG_txt)), TIMEOUT)
  2496. teststring.Expect_Res = TempString + " 1 206 7881234"
  2497. TotalTestCases = TotalTestCases + 1
  2498. TempString = string$(64, str$(0))
  2499. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(Address_lbl), TempString, 31)
  2500. teststring.Actual_Res = TempString
  2501. IF TempString = teststring.Expect_Res THEN
  2502. teststring.Apprase = "Pass"
  2503. LogCase (teststring)
  2504. else
  2505. teststring.Apprase = "FAIL *"
  2506. FailedTestCases = FailedTestCases + 1
  2507. LogCase (teststring)
  2508. endif
  2509. ' Deselect dialing rules & verify dialing rule revers to country rule
  2510. WCheckUnCheck (_hwnd(ML_hChild(CARD_chk)), TIMEOUT)
  2511. TempString = string$(32, str$(0))
  2512. TempString = EditText (_hwnd(ML_hChild(LONG_txt)), TIMEOUT)
  2513. teststring.Expect_Res = TempString + " 00 1 206 7881234"
  2514. TotalTestCases = TotalTestCases + 1
  2515. TempString = string$(64, str$(0))
  2516. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(Address_lbl), TempString, 31)
  2517. teststring.Actual_Res = TempString
  2518. IF TempString = teststring.Expect_Res THEN
  2519. teststring.Apprase = "Pass"
  2520. LogCase (teststring)
  2521. else
  2522. teststring.Apprase = "FAIL *"
  2523. FailedTestCases = FailedTestCases + 1
  2524. LogCase (teststring)
  2525. endif
  2526. ' Create a 2nd New calling card and copy rules from previous new card
  2527. 'CREATE SECOND CARD
  2528. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd)))
  2529. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2530. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  2531. WButtonClick (_hwnd(Card_hChild(CARD_NEWcmd)))
  2532. hNewDlg = WFndWndC (NEW_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2533. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_NAMEtxt))
  2534. WEditSetText (_hwnd(hNewCtrl), "Second Card", TIMEOUT)
  2535. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_OKcmd))
  2536. WButtonClick (_hwnd(hNewCtrl))
  2537. 'Close Dialing Properties message Box
  2538. w_flags = FW_ALL OR FW_CHILDOK OR FW_PART OR FW_EXIST _
  2539. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  2540. hCtrl = WFndWndC ("You Now Must", "Static", w_flags, WTIMEOUT)
  2541. hDlg = GetParent (hCtrl)
  2542. 'Verify Caption of Parent is Dialing Properties
  2543. hCtrl = GetDlgItem (hDlg, &h0002&)
  2544. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  2545. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  2546. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  2547. 'SELECT ADVANCED BUTTON, SELECT COPY FROM, VERIFY COPY DIALING RULES APPEARS
  2548. WButtonClick (_hwnd(Card_hChild(Card_RULEScmd)))
  2549. hRuleDlg = WFndWndC (DIAL_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2550. GetChildhandles (hRuleDlg, Rule_hChild, Rule_ChildID)
  2551. WButtonClick (_hwnd(Rule_hChild(Rule_COPYcmd)))
  2552. hDlg = WFndWndC (COPY_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2553. teststring.Expect_Res = "Valid dialog handle"
  2554. TotalTestCases = TotalTestCases + 1
  2555. teststring.Actual_Res = "Handle " + Str$(hDlg)
  2556. if hDlg > 0 Then
  2557. teststring.Apprase = "Pass"
  2558. logcase (teststring)
  2559. else
  2560. teststring.Apprase = "FAIL *"
  2561. FailedTestCases = FailedTestCases + 1
  2562. logcase (teststring)
  2563. logitem (CurrentLoggingLevel, "Unable to find Copy Dialing Rules dialog")
  2564. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2565. Goto StopTestCase
  2566. End if
  2567. 'SELECT NEW CARD FROM LIST BOX AND CLICK OK
  2568. hCtrl = GetDlgItem (hDlg, &h0407&)
  2569. WListItemClk (_hwnd(hCtrl), "New Card", timeout)
  2570. 'Click OK button
  2571. hCtrl = GetDlgItem (hDlg, &h01&)
  2572. WButtonClick (_hwnd(hCtrl))
  2573. 'VERIFY TEXT FIELDS ARE FILLED AND CLICK OK
  2574. TempString = Space$(10)
  2575. TempString = EditText (_hwnd(Rule_hChild(Rule_LOCALtxt)))
  2576. teststring.Expect_Res = "HG"
  2577. TotalTestCases = TotalTestCases + 1
  2578. teststring.Actual_Res = TempString
  2579. IF TempString = teststring.Expect_Res THEN
  2580. teststring.Apprase = "Pass"
  2581. LogCase (teststring)
  2582. else
  2583. teststring.Apprase = "FAIL *"
  2584. FailedTestCases = FailedTestCases + 1
  2585. LogCase (teststring)
  2586. endif
  2587. TempString = Space$(10)
  2588. TempString = EditText (_hwnd(Rule_hChild(Rule_LONGtxt)))
  2589. teststring.Expect_Res = "FG"
  2590. TotalTestCases = TotalTestCases + 1
  2591. teststring.Actual_Res = TempString
  2592. IF TempString = teststring.Expect_Res THEN
  2593. teststring.Apprase = "Pass"
  2594. LogCase (teststring)
  2595. else
  2596. teststring.Apprase = "FAIL *"
  2597. FailedTestCases = FailedTestCases + 1
  2598. LogCase (teststring)
  2599. endif
  2600. TempString = Space$(10)
  2601. TempString = EditText (_hwnd(Rule_hChild(Rule_INTERtxt)))
  2602. teststring.Expect_Res = "EFG"
  2603. TotalTestCases = TotalTestCases + 1
  2604. teststring.Actual_Res = TempString
  2605. IF TempString = teststring.Expect_Res THEN
  2606. teststring.Apprase = "Pass"
  2607. LogCase (teststring)
  2608. else
  2609. teststring.Apprase = "FAIL *"
  2610. FailedTestCases = FailedTestCases + 1
  2611. LogCase (teststring)
  2612. endif
  2613. WButtonClick (_hwnd(Rule_hChild(Rule_CLOSEcmd)))
  2614. ' Remove Calling Card
  2615. 'REMOVE SECOND CARD, VERIFY "ARE YOU SURE" MESSAGE APPEARS, CLOSE MESSAGE
  2616. WButtonClick (_hwnd(Card_hChild(Card_REMOVEcmd)))
  2617. hDlg = WFndWndC (REALLY_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2618. teststring.Expect_Res = "Valid dialog handle"
  2619. TotalTestCases = TotalTestCases + 1
  2620. teststring.Actual_Res = "Handle " + str$(hDlg)
  2621. if hDlg > 0 Then
  2622. teststring.Apprase = "Pass"
  2623. logcase (teststring)
  2624. else
  2625. teststring.Apprase = "FAIL *"
  2626. FailedTestCases = FailedTestCases + 1
  2627. logcase (teststring)
  2628. logitem (CurrentLoggingLevel, "Unable to find Are You Sure dialog")
  2629. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2630. Goto StopTestCase
  2631. End if
  2632. 'Get handle to yes button and click it.
  2633. hCtrl = GetDlgItem (hDlg, &h0006&)
  2634. WButtonClick (_hwnd(hCtrl))
  2635. 'VERIFY CARD IS REMOVED, NONE BECOMES DEFAULT AND REMOVE BUTTON IS DISABLED.
  2636. teststring.Expect_Res = "Second Card is removed"
  2637. TotalTestCases = TotalTestCases + 1
  2638. if WComboItemExists (_hwnd(Card_hChild(Card_NAMEcbo)), "Second Card") Then
  2639. teststring.Actual_Res = "Second Card still exists"
  2640. teststring.Apprase = "FAIL *"
  2641. FailedTestCases = FailedTestCases + 1
  2642. logcase (teststring)
  2643. else
  2644. teststring.Actual_Res = "Second Card is removed"
  2645. teststring.Apprase = "Pass"
  2646. logcase (teststring)
  2647. End if
  2648. teststring.Expect_Res = "None (Direct Dial)"
  2649. TotalTestCases = TotalTestCases + 1
  2650. TempString = ComboText (_hwnd(Card_hChild(Card_NAMEcbo)))
  2651. teststring.Actual_Res = TempString
  2652. if TempString = teststring.Expect_Res Then
  2653. teststring.Apprase = "Pass"
  2654. logcase (teststring)
  2655. else
  2656. teststring.Apprase = "FAIL *"
  2657. FailedTestCases = FailedTestCases + 1
  2658. logcase (teststring)
  2659. End if
  2660. 'SELECT NEW CARD, REMOVE, VERIFY "ARE YOU SURE" MESSAGE APPEARS, CLOSE MESSAGE
  2661. WComboItemClk (_hwnd(Card_hChild(Card_NAMEcbo)), "New Card")
  2662. WButtonClick (_hwnd(Card_hChild(Card_REMOVEcmd)))
  2663. hDlg = WFndWndC (REALLY_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  2664. teststring.Expect_Res = "Valid dialog handle"
  2665. TotalTestCases = TotalTestCases + 1
  2666. teststring.Actual_Res = "Handle " + str$(hDlg)
  2667. if hDlg > 0 Then
  2668. teststring.Apprase = "Pass"
  2669. logcase (teststring)
  2670. else
  2671. teststring.Apprase = "FAIL *"
  2672. FailedTestCases = FailedTestCases + 1
  2673. logcase (teststring)
  2674. logitem (CurrentLoggingLevel, "Unable to find Are You Sure dialog")
  2675. logitem (CurrentLoggingLevel, "Terminating Validate Calling Cards test")
  2676. Goto StopTestCase
  2677. End if
  2678. 'Get handle to yes button and click it.
  2679. hCtrl = GetDlgItem (hDlg, &h0006&)
  2680. WButtonClick (_hwnd(hCtrl))
  2681. 'VERIFY CARD IS REMOVED, NONE BECOMES DEFAULT AND REMOVE BUTTON IS DISABLED.
  2682. teststring.Expect_Res = "New Card is removed"
  2683. TotalTestCases = TotalTestCases + 1
  2684. if WComboItemExists (_hwnd(Card_hChild(Card_NAMEcbo)), "New Card") Then
  2685. teststring.Actual_Res = "New Card still exists"
  2686. teststring.Apprase = "FAIL *"
  2687. FailedTestCases = FailedTestCases + 1
  2688. logcase (teststring)
  2689. else
  2690. teststring.Actual_Res = "New Card is removed"
  2691. teststring.Apprase = "Pass"
  2692. logcase (teststring)
  2693. End if
  2694. teststring.Expect_Res = "None (Direct Dial)"
  2695. TotalTestCases = TotalTestCases + 1
  2696. TempString = ComboText (_hwnd(Card_hChild(Card_NAMEcbo)))
  2697. teststring.Actual_Res = TempString
  2698. if TempString = teststring.Expect_Res Then
  2699. teststring.Apprase = "Pass"
  2700. logcase (teststring)
  2701. else
  2702. teststring.Apprase = "FAIL *"
  2703. FailedTestCases = FailedTestCases + 1
  2704. logcase (teststring)
  2705. End if
  2706. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)))
  2707. ' End of Test Cases
  2708. StopTestCase:
  2709. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd))) 'Close dialing properties
  2710. NoDialingProp:
  2711. rtn = SetActiveWindow (hTB20) 'Make sure TB20 is the active window
  2712. WMenuSelect (MFILE + "\" + MEXIT, TIMEOUT) 'Exit TB20
  2713. NoTapiBrowser:
  2714. end sub 'VerifyCallingCard
  2715. '*****************************************************************************
  2716. 'Name : VerifyCurrentLoc
  2717. 'Desc : Verifies default location and location information added in the
  2718. ' AddLocation sub. This routine requires that the My Location
  2719. ' property page is displayed.
  2720. '
  2721. 'Parms : ML_hChild: array holding the handles to the My Location controls
  2722. ' The 2 locations to be added
  2723. '
  2724. 'Return : None
  2725. '
  2726. 'History: 02/16/96 : a-rrohr: Created
  2727. '*****************************************************************************
  2728. sub VerifyCurrentLoc (ML_hChild() as long, Default as location)
  2729. dim CurrentLoc as string
  2730. dim CurrentArea as string
  2731. dim CurrentCountry as string
  2732. dim CurrentAccess as string
  2733. dim item as long
  2734. dim State as long 'State of option button 1 for set 0 for reset
  2735. ' verify 'I am dialing from' text
  2736. teststring.Expect_Res = Default.Location
  2737. TotalTestCases = TotalTestCases + 1
  2738. CurrentLoc = string$(64, str$(0))
  2739. item = WComboIndex (_hwnd(ML_hChild( LOCATION_cbo )), TIMEOUT)
  2740. CurrentLoc = ComboItemText (_hwnd ( ML_hChild( LOCATION_cbo )), Item, TIMEOUT)
  2741. teststring.Actual_Res = CurrentLoc
  2742. IF CurrentLoc = Default.Location THEN
  2743. teststring.Apprase = "Pass"
  2744. LogCase (teststring)
  2745. else
  2746. teststring.Apprase = "FAIL *"
  2747. FailedTestCases = FailedTestCases + 1
  2748. LogCase (teststring)
  2749. endif
  2750. teststring.Expect_Res = Default.Country
  2751. TotalTestCases = TotalTestCases + 1
  2752. CurrentCountry = string$(64, str$(0))
  2753. CurrentCountry = ComboText (_hwnd ( ML_hChild( COUNTRY_cbo )), TIMEOUT)
  2754. teststring.Actual_Res = CurrentCountry
  2755. IF CurrentCountry = Default.Country THEN
  2756. teststring.Apprase = "Pass"
  2757. LogCase (teststring)
  2758. else
  2759. teststring.Apprase = "FAIL *"
  2760. FailedTestCases = FailedTestCases + 1
  2761. LogCase (teststring)
  2762. endif
  2763. teststring.Expect_Res = Default.AreaCode
  2764. TotalTestCases = TotalTestCases + 1
  2765. CurrentArea = string$(64, str$(0))
  2766. CurrentArea = EditText (_hwnd ( ML_hChild( AREA_txt )), TIMEOUT)
  2767. teststring.Actual_Res = CurrentArea
  2768. IF CurrentArea = Default.AreaCode THEN
  2769. teststring.Apprase = "Pass"
  2770. LogCase (teststring)
  2771. else
  2772. teststring.Apprase = "FAIL *"
  2773. FailedTestCases = FailedTestCases + 1
  2774. LogCase (teststring)
  2775. endif
  2776. teststring.Expect_Res = Default.localAccess
  2777. TotalTestCases = TotalTestCases + 1
  2778. CurrentAccess = string$(64, str$(0))
  2779. CurrentAccess = EditText (_hwnd ( ML_hChild( LOCAL_txt )), TIMEOUT)
  2780. teststring.Actual_Res = CurrentAccess
  2781. IF CurrentAccess = Default.LocalAccess THEN
  2782. teststring.Apprase = "Pass"
  2783. LogCase (teststring)
  2784. else
  2785. teststring.Apprase = "FAIL *"
  2786. FailedTestCases = FailedTestCases + 1
  2787. LogCase (teststring)
  2788. endif
  2789. teststring.Expect_Res = Default.LongAccess
  2790. TotalTestCases = TotalTestCases + 1
  2791. CurrentAccess = string$(64, str$(0))
  2792. CurrentAccess = EditText (_hwnd ( ML_hChild( LONG_txt )), TIMEOUT)
  2793. teststring.Actual_Res = CurrentAccess
  2794. IF CurrentAccess = Default.longAccess THEN
  2795. teststring.Apprase = "Pass"
  2796. LogCase (teststring)
  2797. else
  2798. teststring.Apprase = "FAIL *"
  2799. FailedTestCases = FailedTestCases + 1
  2800. LogCase (teststring)
  2801. endif
  2802. if Default.PulseSet then
  2803. teststring.Expect_Res = "Pulse Dialing Set"
  2804. else
  2805. teststring.Expect_Res = "Pulse Dialing Not Set"
  2806. end if
  2807. TotalTestCases = TotalTestCases + 1
  2808. 'WOptionState returns 1 and not true for set therefor the state
  2809. 'variable is set to 1 for true & 0 for false to test against the
  2810. 'WOptionState return value.
  2811. IF Default.PulseSet then
  2812. State = 1
  2813. else
  2814. State = 0
  2815. end if
  2816. IF (WOptionState (_hwnd ( ML_hChild(PULSE_opt)), TIMEOUT) = State) THEN
  2817. if Default.PulseSet then
  2818. teststring.Actual_Res = "Pulse Dialing Set"
  2819. else
  2820. teststring.Actual_Res = "Pulse Dialing Not Set"
  2821. end if
  2822. teststring.Apprase = "Pass"
  2823. LogCase (teststring)
  2824. else
  2825. if Default.PulseSet then
  2826. teststring.Actual_Res = "Pulse Dialing Set"
  2827. else
  2828. teststring.Actual_Res = "Pulse Dialing Not Set"
  2829. end if
  2830. teststring.Apprase = "FAIL *"
  2831. FailedTestCases = FailedTestCases + 1
  2832. LogCase (teststring)
  2833. endif
  2834. if Default.ToneSet then
  2835. teststring.Expect_Res = "Tone Dialing Set"
  2836. else
  2837. teststring.Expect_Res = "Tone Dialing Not Set"
  2838. end if
  2839. TotalTestCases = TotalTestCases + 1
  2840. 'WOptionState returns 1 and not true for set therefor the state
  2841. 'variable is set to 1 for true & 0 for false to test against the
  2842. 'WOptionState return value.
  2843. IF Default.ToneSet then
  2844. State = 1
  2845. else
  2846. State = 0
  2847. end if
  2848. IF (WOptionState (_hwnd ( ML_hChild(TONE_opt)), TIMEOUT) = State) THEN
  2849. if Default.ToneSet then
  2850. teststring.Actual_Res = "Tone Dialing Set"
  2851. else
  2852. teststring.Actual_Res = "Tone Dialing Not Set"
  2853. end if
  2854. teststring.Apprase = "Pass"
  2855. LogCase (teststring)
  2856. else
  2857. if Default.ToneSet then
  2858. teststring.Actual_Res = "Tone Dialing Set"
  2859. else
  2860. teststring.Actual_Res = "Tone Dialing Not Set"
  2861. end if
  2862. teststring.Apprase = "FAIL *"
  2863. FailedTestCases = FailedTestCases + 1
  2864. LogCase (teststring)
  2865. endif
  2866. if Default.Cardset then
  2867. teststring.Expect_Res = "Calling Card Checked"
  2868. else
  2869. teststring.Expect_Res = "Calling Card Not Checked"
  2870. end if
  2871. TotalTestCases = TotalTestCases + 1
  2872. IF WCheckState (_hwnd ( ML_hChild(CARD_chk)), TIMEOUT) = Default.CardSet THEN
  2873. if Default.Cardset then
  2874. teststring.Actual_Res = "Calling Card Checked"
  2875. else
  2876. teststring.Actual_Res = "Calling Card Not Checked"
  2877. end if
  2878. teststring.Apprase = "Pass"
  2879. LogCase (teststring)
  2880. else
  2881. if Default.Cardset then
  2882. teststring.Actual_Res = "Calling Card Not Checked"
  2883. else
  2884. teststring.Actual_Res = "Calling Card Checked"
  2885. end if
  2886. teststring.Apprase = "FAIL *"
  2887. FailedTestCases = FailedTestCases + 1
  2888. LogCase (teststring)
  2889. endif
  2890. if Default.WaitSet then
  2891. teststring.Expect_Res = "Call Waiting Checked"
  2892. else
  2893. teststring.Expect_Res = "Call Waiting Not Checked"
  2894. end if
  2895. TotalTestCases = TotalTestCases + 1
  2896. IF WCheckState (_hwnd ( ML_hChild(WAIT_chk)), TIMEOUT) = Default.WaitSet THEN
  2897. if Default.Waitset then
  2898. teststring.Actual_Res = "Call Waiting Checked"
  2899. else
  2900. teststring.Actual_Res = "Call Waiting Not Checked"
  2901. end if
  2902. teststring.Apprase = "Pass"
  2903. LogCase (teststring)
  2904. else
  2905. if Default.Waitset then
  2906. teststring.Actual_Res = "Call Waiting Not Checked"
  2907. else
  2908. teststring.Actual_Res = "Call Waiting Checked"
  2909. end if
  2910. teststring.Apprase = "FAIL *"
  2911. FailedTestCases = FailedTestCases + 1
  2912. LogCase (teststring)
  2913. endif
  2914. end sub
  2915. '*****************************************************************************
  2916. 'Name : EditLocationInfo
  2917. 'Desc : Enters data from location variable into My Location controls
  2918. ' Called by SetLocationsZero, AddLocation and ModifyLocation.
  2919. '
  2920. 'Parms : Location structure containing new location info
  2921. ' Array of My Location child control handles
  2922. 'Return : None
  2923. '
  2924. 'History: 02/15/96 : a-rrohr: Created
  2925. '*****************************************************************************
  2926. sub EditLocationInfo (NewLocal as location, hML_Child() as long)
  2927. dim rtn as long
  2928. WComboSetText (_hwnd(hML_Child(LOCATION_cbo)), NewLocal.Location)
  2929. WComboItemClk (_hwnd(hML_Child(COUNTRY_cbo)), NewLocal.Country)
  2930. WEditSetText (_hwnd(hML_Child(AREA_txt)), NewLocal.AreaCode)
  2931. WEditSetText (_hwnd(hML_Child(LOCAL_txt)), NewLocal.LocalAccess)
  2932. WEditSetText (_hwnd(hML_Child(LONG_txt)), NewLocal.LongAccess)
  2933. if (NewLocal.CardSet = Checked) then
  2934. WCheckSetFocus (_hwnd(hML_Child(CARD_chk)), TIMEOUT)
  2935. WCheckCheck (_hwnd(hML_Child(CARD_chk)), TIMEOUT)
  2936. else
  2937. WCheckSetFocus (_hwnd(hML_Child(CARD_chk)), TIMEOUT)
  2938. WCheckUnCheck (_hwnd(hML_Child(CARD_chk)), TIMEOUT)
  2939. endif
  2940. sleep .1
  2941. if (NewLocal.WaitSet = Checked) then
  2942. WCheckSetFocus (_hwnd(hML_Child(WAIT_chk)), TIMEOUT)
  2943. WCheckCheck (_hwnd(hML_Child(WAIT_chk)), TIMEOUT)
  2944. 'print "NewLocal.WaitSet = Checked is true"
  2945. 'print "Handle to Call waiting check box = ";hML_Child(WAIT_chk)
  2946. else
  2947. 'print "NewLocal.WaitSet = Checked is False"
  2948. 'print "NewLocal.WaitSet = ";NewLocal.WaitSet
  2949. WCheckSetFocus (_hwnd(hML_Child(WAIT_chk)), TIMEOUT)
  2950. WCheckUnCheck (_hwnd(hML_Child(WAIT_chk)), TIMEOUT)
  2951. endif
  2952. rtn = WOptionState (_hwnd(hML_Child(TONE_opt)))
  2953. if rtn <> NewLocal.ToneSet then
  2954. WOptionClick (_hwnd(hML_Child(TONE_opt)), TIMEOUT)
  2955. endif
  2956. end sub 'EditLocationInfo
  2957. '*****************************************************************************
  2958. 'Name : CountryDialRules
  2959. 'Desc : Verifies the dialing rules of each country.
  2960. '
  2961. 'Parms : DialingRule() containg the Country dialing rule information
  2962. ' IDs to the Dialing properties and My Location child windows
  2963. '
  2964. 'Return : None
  2965. '
  2966. 'History: 03/22/96 : a-rrohr: Created
  2967. '*****************************************************************************
  2968. Sub CountryDialRules (DialRule() as CountryRule, Prop_ChildID() as long, ML_ChildID() as long)
  2969. 'generic variables
  2970. dim rtn as long, item as long, hDlg as long, hCtrl as long, Tempstring as string
  2971. 'other variables
  2972. dim count as long, startcount as short, endcount as short, w_flags as long
  2973. dim WinSysDir as string, searchstr as string, startsearch as short, endsearch as short
  2974. dim NumberToBeDialed as string
  2975. dim PhoneNo as TelephoneNo
  2976. 'handles & IDs
  2977. dim hTB20 as long 'handle to TAPI Browser
  2978. dim hList as long 'handle to TAPI Browser API list box
  2979. dim hProperties as long 'handle to Dialing Properties
  2980. dim Prop_hChild(2) as long 'handles to Dialing Properties child controls
  2981. dim hMyLocTab as long
  2982. dim ML_hChild(14) as long 'handles to Dialing Properties child controls
  2983. dim hCardDlg as long 'handle to Calling Card
  2984. dim Card_hChild(6) as long 'handles to Calling Card child controls
  2985. dim Card_ChildID(6) as long 'IDs to Calling Card child controls
  2986. dim hNewDlg as long
  2987. dim NEW_hChild(2) as long
  2988. dim NEW_ChildID(2) as long
  2989. dim hNewCtrl as long
  2990. dim hRuleDlg as long
  2991. dim Rule_hChild(4) as long
  2992. dim Rule_ChildID(4) as long
  2993. dim hRuleCtrl as long
  2994. dim TAPI_API_List as long
  2995. dim DV_OKcmd as long
  2996. dim DV_list as long
  2997. dim DV_edit as long
  2998. dim hDVctrl as long
  2999. 'initialize varibles
  3000. '********************** Delete Me *****************************
  3001. dim countrylist (1 to 242) as itemlist
  3002. for count = 1 to 242
  3003. countrylist(count).tested = false
  3004. next
  3005. '**************************************************************
  3006. SetCallingCardChildID (Card_ChildID, NEW_ChildID, Rule_ChildID, _
  3007. DV_OKcmd, DV_list, DV_edit, TAPI_API_List)
  3008. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  3009. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  3010. startcount = Lbound(dialrule)
  3011. endcount = Ubound(dialrule)
  3012. PhoneNo.AreaCode = "777"
  3013. PhoneNo.SubscriberNo = "9998888"
  3014. WinSysDir = space$(32)
  3015. rtn = GetSystemDirectory (WinSysDir, len(WinSysDir))
  3016. '-- Start TAPI Browser and save handles
  3017. if exists(WinSysDir + TAPI_BROWSER) then
  3018. 'run WinSysDir + "\cdb -g -G " + WinSysDir + TAPI_BROWSER, nowait
  3019. run WinSysDir + TAPI_BROWSER, nowait
  3020. else
  3021. logitem (CurrentLoggingLevel, "Unable to Find " + WinSysDir + TAPI_BROWSER)
  3022. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  3023. goto StopTestCase
  3024. endif
  3025. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3026. sleep 1
  3027. 'PAUSE "DIALING PPROPERTIES TEST" + CRLF + "New Set up PView and continue with the test"
  3028. '========================= START TEST LOOP ================================
  3029. FOR COUNT = STARTCOUNT TO ENDCOUNT
  3030. '-- Select Options / Default Values from menu and
  3031. ' Set Destination Address in TAPI Browser
  3032. ' the following line is here to better format the output log file
  3033. WritelogItem ("" , " ")
  3034. WMenuSelect (MOPTIONS + "\" + MDEFAULT, TIMEOUT)
  3035. hDlg = WFndWndC (DEFAULT_VALUES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3036. sleep .1
  3037. 'Select lpszDestAddress
  3038. hDVctrl = GetDlgItem(hDlg, DV_list)
  3039. if WListItemExists (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT) THEN
  3040. WListItemclk (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT)
  3041. else
  3042. logitem (CurrentLoggingLevel, "Unable to Find line: lpszDestAddress in Default Option Parameter list")
  3043. logitem (CurrentLoggingLevel, "Ending Country Dialing Rules test")
  3044. goto StopTestCase
  3045. end if
  3046. '-- Enter Destination Address with country(count) code and close default values
  3047. 'Enter Destination Address (phone number) in edit control
  3048. ' I have to tab to the Edit box as both the Values edit box and the
  3049. ' Bit flags list box have the same ID.
  3050. play hDlg, "{TAB}"
  3051. play hDlg, "{+}"+ ltrim$(str$(DialRule(count).code)) +"{(}"+ PhoneNo.AreaCode +"{)}" + PhoneNo.SubscriberNo
  3052. 'Close Dialog with OK
  3053. hDVctrl = GetDlgItem(hDlg, DV_OKcmd)
  3054. WButtonClick (_hwnd(hDVctrl), TIMEOUT)
  3055. '-- Start dialing properties with lineTranslateDialog and save handles
  3056. Tempstring = space$(32)
  3057. Tempstring = "Dialing Properties Test" + CRLF + "Country " + ltrim$(str$(count)) + " to " + ltrim$(str$(endcount))
  3058. StatusBox tempstring, 5000, -1, 210, 50, FALSE, TRUE,"courier",9,400
  3059. hList = GetDlgItem (hTB20, TAPI_API_List)
  3060. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  3061. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  3062. else
  3063. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  3064. logitem (CurrentLoggingLevel, "Ending Country Dialing Rules test")
  3065. goto StopTestCase
  3066. endif
  3067. '**************************************************************************
  3068. 'if count = 0 or count = 12 then
  3069. ' Pause "Country Rules Pause, Count =" + Str$(count) + " Check Calling Cards"
  3070. 'endif
  3071. '**************************************************************************
  3072. ' Get all Dialing Properties handles
  3073. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3074. if hProperties = 0 then
  3075. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  3076. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  3077. goto StopTestCase
  3078. endif
  3079. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  3080. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3081. if hMyLocTab = 0 then
  3082. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  3083. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  3084. goto StopTestCase
  3085. endif
  3086. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  3087. '-- If country(count) code = 353 set "I am in:" = USA else set to Ireland.
  3088. if DialRule(count).Code = 353 then
  3089. WComboItemClk (_hwnd(ML_hChild(COUNTRY_cbo)), DialRule(1).Country, 1)
  3090. end if
  3091. '-- Set area code to 999
  3092. WEditSetText (_hwnd(ML_hChild(AREA_txt)), "777")
  3093. '-- Veriy country(count)code is part of number to be dialed
  3094. teststring.Expect_Res = ltrim$(str$(DialRule(count).Code))
  3095. TotalTestCases = TotalTestCases + 1
  3096. TempString = string$(64, str$(0))
  3097. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 63)
  3098. searchstr = ltrim$(str$(DialRule(count).Code)) + " 777"
  3099. startsearch = instr(1, tempstring, searchstr)
  3100. if startsearch > 0 then
  3101. endsearch = instr(startsearch, tempstring, " ")
  3102. if endsearch > 0 then
  3103. teststring.Actual_Res = mid$(tempstring, startsearch, endsearch - startsearch)
  3104. else
  3105. teststring.Actual_Res = tempstring
  3106. endif
  3107. else
  3108. teststring.Actual_Res = tempstring
  3109. end if
  3110. IF teststring.Actual_Res = teststring.Expect_Res THEN
  3111. teststring.Apprase = "Pass"
  3112. teststring.Expect_Res = DialRule(count).Country + " code = " + teststring.Expect_Res
  3113. LogCase (teststring)
  3114. else
  3115. teststring.Apprase = "FAIL *"
  3116. teststring.Expect_Res = DialRule(count).Country + " code = " + teststring.Expect_Res
  3117. FailedTestCases = FailedTestCases + 1
  3118. LogCase (teststring)
  3119. endif
  3120. '-- Verify country(count) is listed in "I am in" combobox
  3121. teststring.Expect_Res = DialRule(count).Country
  3122. TotalTestCases = TotalTestCases + 1
  3123. rtn = WComboItemIndex (_hwnd(ML_hChild(COUNTRY_cbo)), DialRule(count).Country, 1)
  3124. if rtn > 0 then
  3125. teststring.Actual_Res = DialRule(count).Country + " Index # =" + ltrim$(str$(rtn))
  3126. teststring.Apprase = "Pass"
  3127. LogCase (teststring)
  3128. else
  3129. teststring.Actual_Res = DialRule(count).Country + " Doesn't Exist"
  3130. teststring.Apprase = "FAIL *" + str$(rtn)
  3131. FailedTestCases = FailedTestCases + 1
  3132. LogCase (teststring)
  3133. end if
  3134. '-- Set "I am in:" to Country under test
  3135. if WComboItemIndex (_hwnd(ML_hChild(COUNTRY_cbo)), DialRule(count).Country, 1) then
  3136. WComboItemClk (_hwnd(ML_hChild(COUNTRY_cbo)), DialRule(count).Country, 1)
  3137. endif
  3138. '-- Veriy country(count)code is not part of number to be dialed
  3139. '*****************************************************************************
  3140. ' Do not run this test if country is INMARSAT
  3141. ' By design of Dialing Properties they will all fail (Normal)
  3142. '*****************************************************************************
  3143. IF DialRule(count).Code < 870 OR DialRule(count).Code > 874 THEN
  3144. 'teststring.Expect_Res = ltrim$(str$(DialRule(count).Code))
  3145. TotalTestCases = TotalTestCases + 1
  3146. TempString = string$(64, str$(0))
  3147. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 63)
  3148. searchstr = ltrim$(str$(DialRule(count).Code)) + " 777"
  3149. startsearch = instr(1, tempstring, searchstr)
  3150. if startsearch = 0 then
  3151. teststring.Apprase = "Pass"
  3152. teststring.Actual_Res = "777"
  3153. teststring.Expect_Res = "777"
  3154. else
  3155. teststring.Apprase = "FAIL *"
  3156. teststring.Actual_Res = searchstr
  3157. teststring.Expect_Res = "No code in Dial string"
  3158. FailedTestCases = FailedTestCases + 1
  3159. endif
  3160. LogCase (teststring)
  3161. END IF 'DialRule(count).Code) < 870 OR DialRule(count).Code) > 874
  3162. '*****************************************************************************
  3163. ' Do not run the following tests if country is International FreePhone
  3164. ' By design of Dialing Properties they will all fail (Normal)
  3165. '*****************************************************************************
  3166. IF DialRule(count).code <> 800 THEN
  3167. '-- Verify local Number to be dialed
  3168. PhoneNo.CountryCode = DialRule(count).code
  3169. NumberToBeDialed = CreateDestAddress ((DialRule(count).LocalRule), PhoneNo)
  3170. tempstring = EditText (_hwnd ( ML_hChild( LOCAL_txt )), TIMEOUT)
  3171. if tempString <> "" then
  3172. NumberToBeDialed = tempstring + " " + NumberToBeDialed
  3173. endif
  3174. teststring.Expect_Res = NumberToBeDialed
  3175. TotalTestCases = TotalTestCases + 1
  3176. TempString = string$(64, str$(0))
  3177. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 63)
  3178. if TempString = teststring.Expect_Res then
  3179. teststring.Actual_Res = "Local Number OK"
  3180. teststring.Apprase = "Pass"
  3181. LogCase (teststring)
  3182. else
  3183. teststring.Apprase = "FAIL *"
  3184. teststring.Actual_Res = TempString
  3185. FailedTestCases = FailedTestCases + 1
  3186. LogCase (teststring)
  3187. endif
  3188. '** Verify long distance Number to be dialed
  3189. WEditSetText (_hwnd(ML_hChild(AREA_txt)), "333")
  3190. NumberToBeDialed = CreateDestAddress ((DialRule(count).LongRule), PhoneNo)
  3191. if DialRule(count).LongRule = "" then 'There is no long distance dialing rule
  3192. tempstring = EditText (_hwnd ( ML_hChild( LOCAL_txt )), TIMEOUT)
  3193. if tempstring <> "" then
  3194. NumberToBeDialed = tempstring + " " + NumberToBeDialed
  3195. endif
  3196. else
  3197. tempstring = EditText (_hwnd ( ML_hChild( LONG_txt )), TIMEOUT)
  3198. if tempstring <> "" then
  3199. NumberToBeDialed = tempstring + " " + NumberToBeDialed
  3200. endif
  3201. endif
  3202. teststring.Expect_Res = NumberToBeDialed
  3203. TotalTestCases = TotalTestCases + 1
  3204. TempString = string$(64, str$(0))
  3205. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 63)
  3206. if TempString = teststring.Expect_Res then
  3207. teststring.Actual_Res = "Long Distance Number OK"
  3208. teststring.Apprase = "Pass"
  3209. LogCase (teststring)
  3210. else
  3211. teststring.Apprase = "FAIL *"
  3212. teststring.Actual_Res = TempString
  3213. FailedTestCases = FailedTestCases + 1
  3214. LogCase (teststring)
  3215. endif
  3216. '** Verify International Number to be dialed **************************************
  3217. 'close dialing properties
  3218. WButtonClick (_hwnd(Prop_hChild(DP_CANCELcmd))) 'Close dialing properties
  3219. 'set lpszDestAddress to a country other that the country under test
  3220. WMenuSelect (MOPTIONS + "\" + MDEFAULT, TIMEOUT)
  3221. hDlg = WFndWndC (DEFAULT_VALUES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3222. sleep .1
  3223. 'Select lpszDestAddress
  3224. hDVctrl = GetDlgItem(hDlg, DV_list)
  3225. if WListItemExists (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT) THEN
  3226. WListItemclk (_hwnd(hDVctrl), "line: lpszDestAddress", TIMEOUT)
  3227. else
  3228. logitem (CurrentLoggingLevel, "Unable to Find line: lpszDestAddress in Default Option Parameter list")
  3229. logitem (CurrentLoggingLevel, "Ending Country Dialing Rules test")
  3230. goto StopTestCase
  3231. end if
  3232. select case DialRule(count).code
  3233. 'countries that share the same code
  3234. case 1, 7, 33, 41, 42, 53, 61, 269, 590, 670, 672
  3235. PhoneNo.CountryCode = 353 'Ireland
  3236. case DialRule(endcount).code
  3237. PhoneNo.CountryCode = 1 'USA
  3238. case else
  3239. PhoneNo.CountryCode = DialRule(count+1).code 'Next country
  3240. end select
  3241. play hDlg, "{TAB}"
  3242. play hDlg, "{+}"+ ltrim$(str$(PhoneNo.CountryCode)) +"{(}"+ PhoneNo.AreaCode +"{)}" + PhoneNo.SubscriberNo
  3243. 'Close Dialog with OK
  3244. hDVctrl = GetDlgItem(hDlg, DV_OKcmd)
  3245. WButtonClick (_hwnd(hDVctrl), TIMEOUT)
  3246. '** Start Dialing Properties
  3247. hList = GetDlgItem (hTB20, TAPI_API_List)
  3248. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  3249. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  3250. else
  3251. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  3252. logitem (CurrentLoggingLevel, "Ending Country Dialing Rules test")
  3253. goto StopTestCase
  3254. endif
  3255. ' Get all Dialing Properties handles
  3256. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3257. if hProperties = 0 then
  3258. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  3259. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  3260. goto StopTestCase
  3261. endif
  3262. GetDPCtrlh (hProperties, Prop_hChild, Prop_ChildID)
  3263. hMyLocTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3264. if hMyLocTab = 0 then
  3265. logitem (CurrentLoggingLevel, "Unable to Find " + tab_MY_LOCATION + " Property Page")
  3266. logitem (CurrentLoggingLevel, "Ending Validate Calling Cards test")
  3267. goto StopTestCase
  3268. endif
  3269. GetChildhandles (hMyLocTab, ML_hChild, ML_ChildID)
  3270. '** Set location to country to be tested and verify Number to be dialed
  3271. WComboItemClk (_hwnd(ML_hChild(COUNTRY_cbo)), DialRule(count).Country, 1)
  3272. NumberToBeDialed = CreateDestAddress ((DialRule(count).InterRule), PhoneNo)
  3273. tempstring = EditText (_hwnd ( ML_hChild( LONG_txt )), TIMEOUT)
  3274. if tempString <> "" then
  3275. NumberToBeDialed = tempstring + " " + NumberToBeDialed
  3276. endif
  3277. teststring.Expect_Res = NumberToBeDialed
  3278. TotalTestCases = TotalTestCases + 1
  3279. TempString = string$(64, str$(0))
  3280. rtn = GetDlgItemText (hMyLocTab, ML_ChildID(ADDRESS_LBL), TempString, 63)
  3281. if TempString = teststring.Expect_Res then
  3282. teststring.Actual_Res = "International Number OK"
  3283. teststring.Apprase = "Pass"
  3284. LogCase (teststring)
  3285. else
  3286. teststring.Apprase = "FAIL *"
  3287. teststring.Actual_Res = TempString
  3288. FailedTestCases = FailedTestCases + 1
  3289. LogCase (teststring)
  3290. endif
  3291. '*********************************************************
  3292. '-- Select Change and add a calling card.
  3293. WButtonClick (_hwnd(ML_hChild(CHANGE_cmd))) 'Open Change Calling Card dialog
  3294. hCardDlg = WFndWndC (CHANGE_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3295. GetChildhandles (hCardDlg, Card_hChild, Card_ChildID)
  3296. ' Add a new card
  3297. WButtonClick (_hwnd(Card_hChild(CARD_NEWcmd)))
  3298. hNewDlg = WFndWndC (NEW_CARD_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3299. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_NAMEtxt))
  3300. WEditSetText (_hwnd(hNewCtrl), DialRule(count).Country, TIMEOUT)
  3301. hNewCtrl = GetDlgItem (hNewDlg, NEW_ChildID(NEW_OKcmd))
  3302. WButtonClick (_hwnd(hNewCtrl)) 'Close Create New Calling Card
  3303. ' Get Handle to Dialing Properties Message & click OK button
  3304. w_flags = FW_ALL OR FW_CHILDOK OR FW_PART OR FW_EXIST _
  3305. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  3306. hCtrl = WFndWndC ("You Now Must", "Static", w_flags, WTIMEOUT)
  3307. hDlg = GetParent (hCtrl)
  3308. hCtrl = GetDlgItem (hDlg, &h0002&) 'Get Handle to OK button
  3309. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  3310. 'reset window search flag
  3311. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  3312. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  3313. ' Look for 'Improper Character Entered' message and click OK if it appears
  3314. hDlg = WFndWndC (IMPROPER_CHAR_CAPTION, DIALOG_CLASS, w_flags, 1)
  3315. if hDlg <> 0 then
  3316. hCtrl = GetDlgItem (hDlg, &h0002&) 'Get Handle to OK button
  3317. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  3318. logitem (CurrentLoggingLevel, IMPROPER_CHAR_CAPTION + " Dialog has appeared and was closed")
  3319. logitem (CurrentLoggingLevel, "This dialog appeared because of an invalid dialing rule character")
  3320. logitem (CurrentLoggingLevel, "is in the default dialing rules. This is an error with Dialing Properties")
  3321. FailedTestCases = FailedTestCases + 1
  3322. endif
  3323. 'Verify that the Dialing Rules dialog appears, enter dialing rules and close
  3324. hRuleDlg = WFndWndC (DIAL_RULE_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3325. GetChildhandles (hRuleDlg, Rule_hChild, Rule_ChildID)
  3326. '--Verify Country Dialing Rules
  3327. ' Verify local rule
  3328. teststring.Expect_Res = ConvertRule((DialRule(count).LocalRule))
  3329. TotalTestCases = TotalTestCases + 1
  3330. teststring.Actual_Res = string$(32, str$(0))
  3331. teststring.Actual_Res = EditText (_hwnd(Rule_hChild(Rule_LOCALtxt)), TIMEOUT)
  3332. IF teststring.Actual_Res = teststring.Expect_Res THEN
  3333. teststring.Apprase = "Pass"
  3334. LogCase (teststring)
  3335. else
  3336. teststring.Apprase = "FAIL *"
  3337. FailedTestCases = FailedTestCases + 1
  3338. LogCase (teststring)
  3339. endif
  3340. ' Verify Long Distance rule
  3341. teststring.Expect_Res = ConvertRule((DialRule(count).LongRule))
  3342. TotalTestCases = TotalTestCases + 1
  3343. teststring.Actual_Res = string$(32, str$(0))
  3344. teststring.Actual_Res = EditText (_hwnd(Rule_hChild(Rule_LONGtxt)), TIMEOUT)
  3345. IF teststring.Actual_Res = teststring.Expect_Res THEN
  3346. teststring.Apprase = "Pass"
  3347. LogCase (teststring)
  3348. else
  3349. teststring.Apprase = "FAIL *"
  3350. FailedTestCases = FailedTestCases + 1
  3351. LogCase (teststring)
  3352. endif
  3353. teststring.Expect_Res = ConvertRule((DialRule(count).InterRule))
  3354. TotalTestCases = TotalTestCases + 1
  3355. teststring.Actual_Res = string$(32, str$(0))
  3356. teststring.Actual_Res = EditText (_hwnd(Rule_hChild(Rule_INTERtxt)), TIMEOUT)
  3357. IF teststring.Actual_Res = teststring.Expect_Res THEN
  3358. teststring.Apprase = "Pass"
  3359. LogCase (teststring)
  3360. else
  3361. teststring.Apprase = "FAIL *"
  3362. FailedTestCases = FailedTestCases + 1
  3363. LogCase (teststring)
  3364. endif
  3365. ' Close Dialing Rules dialog
  3366. WButtonClick (_hwnd(Rule_hChild(Rule_CLOSEcmd)), TIMEOUT)
  3367. '-- Remove the calling card and close calling card dialog
  3368. ' Set focus on New Calling Card
  3369. WComboItemClk (_hwnd(Card_hChild(Card_Namecbo)), DialRule(count).Country, timeout)
  3370. ' Click Remove button
  3371. WButtonClick (_hwnd(Card_hChild(Card_REMOVEcmd)))
  3372. 'Find 'Are You Sure' dailog, get handle to yes button and click it.
  3373. hDlg = WFndWndC (REALLY_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3374. hCtrl = GetDlgItem (hDlg, &h0006&)
  3375. WButtonClick (_hwnd(hCtrl))
  3376. 'Close 'Change Calling Card' dialog with OK button
  3377. WButtonClick (_hwnd(Card_hChild(Card_OKcmd)))
  3378. '-- Reset Country Location to USA or Ireland as required.
  3379. END IF 'DialRule(count).code <> 800
  3380. WButtonClick (_hwnd(Prop_hChild(DP_CANCELcmd))) 'Close dialing properties
  3381. '-- Close Dialing properties
  3382. 'if count =100 or count = 200 then
  3383. ' PAUSE "DIALING PPROPERTIES TEST" + CRLF + "Count = " + ltrim$(str$(count))
  3384. 'endif
  3385. next 'count
  3386. rtn = SetActiveWindow (hTB20) 'Make sure TB20 is the active window
  3387. WMenuSelect (MFILE + "\" + MEXIT, TIMEOUT) 'Exit TB20
  3388. 'PAUSE "DIALING PPROPERTIES TEST" + CRLF + "TAPI Browser will close when OK is selected"
  3389. '============================== END TEST LOOP ================================
  3390. StatusBox Close
  3391. StopTestCase:
  3392. end Sub 'CountryDialRules ()
  3393. '*****************************************************************************
  3394. 'Name : RemoveLocation
  3395. 'Desc : Verifies the functionality of Removing locations.
  3396. '
  3397. 'Parms : ML_hChild: array holding the handles to the My Location controls
  3398. ' Prop_hChild() array holding handles to the Dialing Prop controls
  3399. ' CmdButton Boolean to select OK or Cancel Button.
  3400. '
  3401. 'Return : String containing last location name
  3402. '
  3403. 'History: 02/23/96 : a-rrohr: Created
  3404. '*****************************************************************************
  3405. Function RemoveLocation (Prop_hChild() as long, ML_hChild() as long, _
  3406. CmdButton as short) as string
  3407. dim LocationText as string
  3408. dim LastLocationText as string
  3409. dim count as long
  3410. dim item as long
  3411. dim RemoveState as short
  3412. ' Find and save the number of combobox items
  3413. count = WComboCount (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3414. 'print "The number of items in the Location combobox = ";count
  3415. ' Verify Remove button is enabled otherwise end the test
  3416. teststring.Expect_Res = cmd_REMOVE + " is enabled"
  3417. TotalTestCases = TotalTestCases + 1
  3418. if WButtonEnabled (_hwnd(ML_hChild(REMOVE_cmd)), TIMEOUT) then
  3419. teststring.Actual_Res = cmd_REMOVE + " is enabled"
  3420. teststring.Apprase = "Pass"
  3421. LogCase (teststring)
  3422. else
  3423. teststring.Actual_Res = cmd_REMOVE + " is Not Enabled"
  3424. teststring.Apprase = "FAIL *"
  3425. FailedTestCases = FailedTestCases + 1
  3426. LogCase (teststring)
  3427. logitem (CurrentLoggingLevel, "Remove Locations test case is terminated")
  3428. Goto TheEnd
  3429. endif
  3430. 'Click the last item, save the location name, click the Remove button
  3431. 'butdo not remove
  3432. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), _ord(count), TIMEOUT)
  3433. LocationText = space$(96)
  3434. LocationText = ComboText (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3435. teststring.Expect_Res = LocationText + " is not deleted"
  3436. TotalTestCases = TotalTestCases + 1
  3437. WButtonClick (_hwnd(ML_hChild(REMOVE_cmd)), TIMEOUT)
  3438. RemoveState = FALSE
  3439. FindRemLocMessage (RemoveState)
  3440. if WComboItemIndex (_hwnd(ML_hChild(LOCATION_cbo)), LocationText, TIMEOUT) then
  3441. teststring.Actual_Res = LocationText + " still exists"
  3442. teststring.Apprase = "Pass"
  3443. LogCase (teststring)
  3444. else
  3445. teststring.Actual_Res = LocationText + " is deleted"
  3446. teststring.Apprase = "FAIL *"
  3447. FailedTestCases = FailedTestCases + 1
  3448. LogCase (teststring)
  3449. end if
  3450. 'Click the last item, save the location name and then remove
  3451. WComboItemClk (_hwnd(ML_hChild(LOCATION_cbo)), _ord(count), TIMEOUT)
  3452. LocationText = space$(96)
  3453. LocationText = ComboText (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3454. teststring.Expect_Res = LocationText + " is deleted"
  3455. TotalTestCases = TotalTestCases + 1
  3456. WButtonClick (_hwnd(ML_hChild(REMOVE_cmd)), TIMEOUT)
  3457. RemoveState = TRUE
  3458. FindRemLocMessage (RemoveState)
  3459. if WComboItemIndex (_hwnd(ML_hChild(LOCATION_cbo)), LocationText, TIMEOUT) then
  3460. teststring.Actual_Res = LocationText + " still exists"
  3461. teststring.Apprase = "FAIL *"
  3462. FailedTestCases = FailedTestCases + 1
  3463. LogCase (teststring)
  3464. else
  3465. teststring.Actual_Res = LocationText + " is deleted"
  3466. teststring.Apprase = "Pass"
  3467. LogCase (teststring)
  3468. end if
  3469. 'The current location should now be the first location
  3470. teststring.Expect_Res = "Current Location index = 1"
  3471. TotalTestCases = TotalTestCases + 1
  3472. item = WComboIndex (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3473. If (item = 1) then
  3474. teststring.Actual_Res = "Current location Index = " + str$(item)
  3475. teststring.Apprase = "Pass"
  3476. LogCase (teststring)
  3477. else
  3478. teststring.Actual_Res = "Current location Index = " + str$(item)
  3479. teststring.Apprase = "FAIL *"
  3480. FailedTestCases = FailedTestCases + 1
  3481. LogCase (teststring)
  3482. end if
  3483. LastLocationText = space$(96)
  3484. LastLocationText = ComboItemText (_hwnd(ML_hChild(LOCATION_cbo)), (count-1), TIMEOUT)
  3485. 'Remove all locations but the last
  3486. while (WComboCount (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT) > 1)
  3487. WButtonClick (_hwnd(ML_hChild(REMOVE_cmd)), TIMEOUT)
  3488. RemoveState = TRUE
  3489. FindRemLocMessage (RemoveState)
  3490. Wend
  3491. ' Verify Remove button is disabled otherwise end the test
  3492. teststring.Expect_Res = cmd_REMOVE + " is disabled"
  3493. TotalTestCases = TotalTestCases + 1
  3494. if Not(WButtonEnabled (_hwnd(ML_hChild(REMOVE_cmd)), TIMEOUT)) then
  3495. teststring.Actual_Res = cmd_REMOVE + " is disabled"
  3496. teststring.Apprase = "Pass"
  3497. LogCase (teststring)
  3498. else
  3499. teststring.Actual_Res = cmd_REMOVE + " is Not Disabled"
  3500. teststring.Apprase = "FAIL *"
  3501. FailedTestCases = FailedTestCases + 1
  3502. LogCase (teststring)
  3503. logitem (CurrentLoggingLevel, "Remove Locations test case is terminated")
  3504. Goto TheEnd
  3505. endif
  3506. 'Verify current location is the last location
  3507. 'then return the text of the location
  3508. LocationText = space$(96)
  3509. LocationText = ComboText (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3510. teststring.Expect_Res = "Current Location = " + LastLocationText
  3511. TotalTestCases = TotalTestCases + 1
  3512. if (LastLocationText = LocationText) then
  3513. teststring.Actual_Res = "Current Location = " + LocationText
  3514. teststring.Apprase = "Pass"
  3515. LogCase (teststring)
  3516. else
  3517. teststring.Actual_Res = "Current Location = " + LocationText
  3518. teststring.Apprase = "FAIL *"
  3519. FailedTestCases = FailedTestCases + 1
  3520. LogCase (teststring)
  3521. end if
  3522. RemoveLocation = LocationText
  3523. If CmdButton then
  3524. WButtonClick (_hwnd(Prop_hChild(DP_OKcmd)), TIMEOUT)
  3525. else
  3526. WButtonClick (_hwnd(Prop_hChild(DP_CANCELcmd)), TIMEOUT)
  3527. end if
  3528. TheEnd:
  3529. end Sub 'RemoveLocations
  3530. '*****************************************************************************
  3531. 'Name : VerifyRemoveLoc
  3532. 'Desc : Verifies that locations removed from Dialing Properties
  3533. ' (and Dialing Properties is closed with the OK button) are actually remove
  3534. ' when Dialing Properties is opened again,
  3535. '
  3536. 'Parms : ML_hChild: array holding the handles to the My Location controls
  3537. ' Prop_hChild() array holding handles to the Dialing Prop controls
  3538. ' Locstring: Text of current location when Dialing Properties is closed
  3539. '
  3540. 'Return : None
  3541. '
  3542. 'History: 02/23/96 : a-rrohr: Created
  3543. '*****************************************************************************
  3544. sub VerifyRemoveLoc (ML_hChild() as long, Locstring as string)
  3545. dim LocationText as string
  3546. dim count as long
  3547. LocationText = space$(96)
  3548. LocationText = ComboText (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3549. teststring.Expect_Res = "Current Location = " + LocationText
  3550. TotalTestCases = TotalTestCases + 1
  3551. if (LocationText = Locstring) then
  3552. teststring.Actual_Res = "Current Location = " + Locstring
  3553. teststring.Apprase = "Pass"
  3554. LogCase (teststring)
  3555. else
  3556. teststring.Actual_Res = "Current Location = " + Locstring
  3557. teststring.Apprase = "FAIL *"
  3558. FailedTestCases = FailedTestCases + 1
  3559. LogCase (teststring)
  3560. end if
  3561. count = WComboCount (_hwnd(ML_hChild(LOCATION_cbo)), TIMEOUT)
  3562. teststring.Expect_Res = "Location item count = 1"
  3563. TotalTestCases = TotalTestCases + 1
  3564. If (Count <> 1) then
  3565. teststring.Actual_Res = "Location item count = " + str$(count)
  3566. teststring.Apprase = "FAIL *"
  3567. FailedTestCases = FailedTestCases + 1
  3568. LogCase (teststring)
  3569. else
  3570. teststring.Actual_Res = "Location item count = " + str$(count)
  3571. teststring.Apprase = "Pass"
  3572. LogCase (teststring)
  3573. end if
  3574. end sub 'VerifyRemoveLoc
  3575. '*****************************************************************************
  3576. 'Name : FindRemLocMessage
  3577. '
  3578. 'Desc : As of build 1261 Removing a location by clicking the Remove button
  3579. ' opens a message box asking the user if he really wants to remove the
  3580. ' location. This function detects the message box and closes it with
  3581. ' the appropriate button.
  3582. ' Can't blame the developer as this fixes a "bug" in Raid.
  3583. '
  3584. 'Parms : None
  3585. '
  3586. 'Return : None
  3587. '
  3588. 'History: 03/07/96 : a-rrohr: Created
  3589. '*****************************************************************************
  3590. sub FindRemLocMessage (RemoveState as short)
  3591. dim w_flags as long
  3592. dim hWnd as long, hButton as long
  3593. dim Yes_CmdID as long, No_CmdID as long
  3594. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  3595. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE 'FW_PART OR
  3596. Yes_CmdID = &h00000006&
  3597. No_CmdID = &h00000007&
  3598. 'Get the handle to the static message field
  3599. hWnd = WFndWndC ("Are You Sure?", DIALOG_CLASS, w_flags, TIMEOUT)
  3600. 'Get the static message parent handle (the message box handle)
  3601. if hWnd > 0 then
  3602. If RemoveState Then
  3603. hButton = GetDlgItem (hWnd, Yes_cmdID)
  3604. else
  3605. hButton = GetDlgItem (hWnd, No_cmdID)
  3606. end if
  3607. else
  3608. logitem (CurrentLoggingLevel, "FindRemLocMessage Procedure")
  3609. logitem (CurrentLoggingLevel, "Invalid handle to 'Are You Sure?' message box")
  3610. logitem (CurrentLoggingLevel, "Test Will Terminate")
  3611. Stop
  3612. endif
  3613. 'Close the Message box
  3614. if hButton > 0 then
  3615. WButtonClick (_hwnd(hButton), TIMEOUT)
  3616. else
  3617. logitem (CurrentLoggingLevel, "FindRemLocMessage Procedure")
  3618. if RemoveState then
  3619. logitem (CurrentLoggingLevel, "Invalid handle to New Location message box Yes button")
  3620. else
  3621. logitem (CurrentLoggingLevel, "Invalid handle to New Location message box No button")
  3622. endif
  3623. logitem (CurrentLoggingLevel, "Test Will Terminate")
  3624. Stop
  3625. endif
  3626. end sub'FindRemLocMessage
  3627. '*****************************************************************************
  3628. 'Name : SetCallingCardChildID
  3629. '
  3630. 'Desc : Sets IDs for use in calling card and country dialing rule test
  3631. '
  3632. 'Parms : Card_ChildID() Calling Card dialog control IDs
  3633. ' NEW_ChildID() Create New Calling Card dialog control IDs
  3634. ' Rule_ChildID() Dialing Rules dialog control IDs
  3635. ' DV_OKcmd Default Value OK button
  3636. ' DV_list Default Value parameters list box
  3637. ' DV_edit Default Value value edit box
  3638. ' TAPI_API_List TAPI API list box
  3639. '
  3640. 'Return : None
  3641. '
  3642. 'History: 03/22/96 : a-rrohr: Created
  3643. '*****************************************************************************
  3644. sub SetCallingCardChildID (Card_ChildID() as long, NEW_ChildID() as long, _
  3645. Rule_ChildID() as long, DV_OKcmd as long, _
  3646. DV_list as long, DV_edit as long, TAPI_API_List as long)
  3647. 'ID to the Default Values child controls
  3648. DV_OKcmd = &h00000001&
  3649. DV_list = &h000003E8&
  3650. DV_edit = &h000003E9&
  3651. 'ID to the TAPI Browser list box control listing all the TAPI API functions
  3652. TAPI_API_List = &h000003E9&
  3653. 'ID to the Change Calling Card child controls
  3654. Card_ChildID(CARD_OKcmd) = &h00000001&
  3655. Card_ChildID(CARD_CANCELcmd) = &h00000002&
  3656. Card_ChildID(CARD_NAMEcbo) = &h00001770&
  3657. Card_ChildID(CARD_NUMBERtxt) = &h00001771&
  3658. Card_ChildID(CARD_NEWcmd) = &h00001773&
  3659. Card_ChildID(Card_RULEScmd) = &h00001775&
  3660. Card_ChildID(CARD_REMOVEcmd) = &h00001774&
  3661. 'ID to the Change Calling Card child controls
  3662. NEW_ChildID(NEW_OKcmd) = &h00000001&
  3663. NEW_ChildID(NEW_CANCELcmd) = &h00000002&
  3664. NEW_ChildID(NEW_NAMEtxt) = &h00001F41&
  3665. 'ID to the Dialing Rules child controls
  3666. Rule_ChildID(Rule_CLOSEcmd) = &h00000001&
  3667. Rule_ChildID(Rule_COPYcmd) = &h000003FE&
  3668. Rule_ChildID(Rule_LOCALtxt) = &h00000400&
  3669. Rule_ChildID(Rule_LONGtxt) = &h00000401&
  3670. Rule_ChildID(Rule_INTERtxt) = &h00000402&
  3671. end sub 'SetCallingCardChildID
  3672. '*****************************************************************************
  3673. 'Name : CreateDestAddress
  3674. '
  3675. 'Desc : Creates destination addresses based on the local and long distance
  3676. ' dialing rules of the country under test and an international
  3677. ' destination address based on the dialing rule of the next country
  3678. ' under test
  3679. '
  3680. 'Parms : A structure containing the area code and phone number
  3681. ' A structure containing the dialing rules.
  3682. '
  3683. 'Return : A structure containing the three destination address.
  3684. '
  3685. 'History: 03/22/96 : a-rrohr: Created
  3686. '*****************************************************************************
  3687. function CreateDestAddress (Rule as string, phone as TelephoneNo ) as string
  3688. dim tempstr as string
  3689. dim char as string
  3690. dim count as short
  3691. dim LeadingSpace as long
  3692. LeadingSpace = FALSE
  3693. COUNT = 0
  3694. if Rule = "" then
  3695. tempstr = phone.SubscriberNo
  3696. else
  3697. while len(RULE) > 0
  3698. char = space$(1)
  3699. char = mid$(rule, 1, 1)
  3700. RULE = right$(rule, len(rule) - 1)
  3701. select case char
  3702. case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
  3703. Tempstr = Tempstr + char
  3704. case "A", "B", "C", "D", "*"
  3705. Tempstr = Tempstr + char
  3706. case "#"
  3707. Tempstr = Tempstr + " " + char
  3708. case " "
  3709. Tempstr = Tempstr + char
  3710. if count = 0 then
  3711. LeadingSpace = TRUE
  3712. endif
  3713. case ",", "W"
  3714. 'ignore
  3715. case "E"
  3716. Tempstr = Tempstr + " " + ltrim$(str$(Phone.CountryCode))
  3717. case "F"
  3718. Tempstr = Tempstr + " " + Phone.AreaCode
  3719. case "G"
  3720. Tempstr = Tempstr + " " + Phone.SubscriberNo
  3721. case "I"
  3722. Tempstr = Tempstr + " " + Phone.AreaCode
  3723. case else
  3724. Tempstr = Tempstr + char 'should show as an error
  3725. end select
  3726. COUNT = COUNT + 1
  3727. Wend
  3728. endif
  3729. IF LeadingSpace THEN
  3730. CreateDestAddress = tempstr
  3731. else
  3732. CreateDestAddress = ltrim$(tempstr)
  3733. endif
  3734. end function 'CreateDestAddress
  3735. '*****************************************************************************
  3736. 'Name : ConvertRule
  3737. '
  3738. 'Desc : Converts a dialing rules of the country under test to the format
  3739. ' expected in the dialing rules dialog. That is it converts I to F.
  3740. '
  3741. 'Parms : The dialing rule of interest
  3742. '
  3743. 'Return : The converted dialing rule .
  3744. '
  3745. 'History: 04/05/96 : a-rrohr: Created
  3746. '*****************************************************************************
  3747. function ConvertRule (Rule as string) as string
  3748. dim tempstr as string
  3749. dim char as string
  3750. tempstr = Space$(10)
  3751. tempstr = ""
  3752. if RULE <> "" then
  3753. while len(RULE) > 0
  3754. char = space$(1)
  3755. char = mid$(rule, 1, 1)
  3756. RULE = right$(rule, len(rule) - 1)
  3757. select case char
  3758. case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
  3759. Tempstr = Tempstr + char
  3760. case "A", "B", "C", "D", "*", " ", "#", ","
  3761. Tempstr = Tempstr + char
  3762. case ","
  3763. 'ignore
  3764. case "E", "F", "G"
  3765. Tempstr = Tempstr + char
  3766. case "I"
  3767. Tempstr = Tempstr + "F"
  3768. case else
  3769. Tempstr = Tempstr + char 'should show as an error
  3770. end select
  3771. Wend
  3772. endif
  3773. ConvertRule = tempstr
  3774. end function 'ConvertRule
  3775. '*****************************************************************************
  3776. 'Name : lTranslateDialog
  3777. 'Desc : Invokes the Dialing Properties dialog with TAPI Browser 2.0
  3778. ' lineTranslateDialog call. The function returns the handle to the
  3779. ' Dialing Properties dialog, the My Location Tab, and TAPI Browser.
  3780. ' This function was derived from Call_Dialing_Prop function
  3781. '
  3782. 'Parms : Passed 3 variables to store the handles to the Tab Control,
  3783. ' My Location Tab and TAPI Browser
  3784. '
  3785. 'Return : Returns the Handle to the Dialing Properties dialog
  3786. '
  3787. 'History: 05/23/96: a-rrohr: Created
  3788. '*****************************************************************************
  3789. Function lTranslateDialog ( hMLTab as long, hTB20 as long) as long
  3790. dim hdialog as long 'Generic window handle
  3791. dim hProperties as long 'Handle of Dialing Properties dialog, function rtns this value
  3792. dim hctrl as long 'Generic Handle to Control
  3793. dim teststring as casestruct 'Test Log Info
  3794. dim SysDirPath as string 'Path to system32 directory
  3795. dim rtn as long 'Generic return variable
  3796. dim TAPI_API_List as long 'ID of TB API list box
  3797. dim OK_cmdID as long
  3798. dim StaticID as long
  3799. dim messagestr as string
  3800. dim hDlg as long, hList as long
  3801. TAPI_API_List = &h000003E9&
  3802. OK_cmdID = &h00000001&
  3803. w_flags = FW_ALL OR FW_CHILDOK OR FW_DIALOGOK OR FW_EXIST _
  3804. OR FW_NOERROR OR FW_FOCUS OR FW_NOCASE
  3805. SysDirPath = space$(MAX_PATH)
  3806. rtn = GetSystemDirectory (SysDirPath, MAX_PATH)
  3807. lTranslateDialog = 0
  3808. ' If a pre-existing instance of dialing properties exists close it with an OK button click
  3809. hdialog = WFndWnd (PROPERTIES_CAPTION, FW_EXIST, WTIMEOUT)
  3810. if hdialog <> 0 then
  3811. hctrl = GetDlgItem (hdialog, OK_cmdID)
  3812. WButtonClick (_hwnd(hctrl)) 'Click the Dialing Properties OK button
  3813. sleep 1
  3814. end if
  3815. '-- Start TAPI Browser and save handles
  3816. if hTB20 = 0 then
  3817. if exists(SysDirPath + TAPI_BROWSER) then
  3818. run SysDirPath + TAPI_BROWSER, nowait
  3819. else
  3820. logitem (CurrentLoggingLevel, "Unable to Find " + SysDirPath + TAPI_BROWSER)
  3821. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  3822. goto StopTestCase
  3823. endif
  3824. hTB20 = WFndWndC (TAPI_BROWSER_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3825. 'Look for the "Using the TAPI Browser" dialog. This dialog appears automatically
  3826. 'the first time TB is invoked and never again. it must be closed before the test
  3827. 'can proceed.
  3828. hDlg = WFndWndC (USING_TB_CAPTION, DIALOG_CLASS, w_flags, 5)
  3829. if hDlg > 0 then
  3830. 'Get handle to Using the TAPI Browser OK button and close dialog
  3831. hCtrl = GetDlgItem(hDlg, OK_cmdID)
  3832. WButtonClick (_hwnd(hCtrl), TIMEOUT)
  3833. end if
  3834. endif 'hTB20 = 0
  3835. hList = GetDlgItem (hTB20, TAPI_API_List)
  3836. if WListItemExists (_hwnd(hList), lineTranDlg_API, TIMEOUT) then
  3837. WListItemDblClk (_hwnd(hList), lineTranDlg_API, TIMEOUT)
  3838. else
  3839. logitem (CurrentLoggingLevel, "Unable to Find " + lineTranDlg_API + " in TB20 listbox")
  3840. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  3841. goto StopTestCase
  3842. endif
  3843. '** Get Handles to Dialing Properties, My Location and all child controls
  3844. hProperties = WFndWndC (PROPERTIES_CAPTION, DIALOG_CLASS, w_flags, WTIMEOUT)
  3845. lTranslateDialog = hProperties
  3846. if hProperties = 0 then
  3847. logitem (CurrentLoggingLevel, "Unable to Find " + PROPERTIES_CAPTION + " Window")
  3848. logitem (CurrentLoggingLevel, "Ending Call Waiting test")
  3849. goto StopTestCase
  3850. endif
  3851. ' Get and validate My Location Tab handle
  3852. hMLTab = WFndWndC (tab_MY_LOCATION, DIALOG_CLASS, W_Flags, WTIMEOUT)
  3853. TotalTestCases = TotalTestCases + 1
  3854. teststring.TC_Num = 34
  3855. teststring.Expect_Res = "Valid My Location Handle"
  3856. teststring.Actual_Res = "Tab Handle =" + Str$(hMLTab)
  3857. if hMLTab = 0 then
  3858. teststring.Apprase = "FAIL *"
  3859. FailedTestCases = FailedTestCases + 1
  3860. LogCase (teststring)
  3861. else
  3862. teststring.Apprase = "Pass"
  3863. LogCase (teststring)
  3864. endif
  3865. StopTestCase:
  3866. end function 'lTranslateDialog
  3867. '$ENDIF