Best Python code snippet using fMBT_python
KYC.py
Source:KYC.py
...47 if funcOp == 2:48 connect(Const.TEST_SITE_URL)49 50 clickTestMode(funcOp)51 visualLog('KYC click Id Card Mode')52 enterPrivacyInfo(idKindOp)53 visualLog('KYC enter Privacy Info')54 selectTypeOfId(idKindOp)55 visualLog('KYC select ID Card')56 uploadIdImageFile(idKindOp)57 visualLog('KYC upload ID Card Image File')58 verifyEnteredIdInfo(idKindOp)59 visualLog('KYC verify Id Card Info')60 61 if funcOp == 2:62 logResultToFile(sys._getframe().f_code.co_name)63 clickReTestButton()64 65 66def testIdCard_DriversLicenseMode(funcOp = 2, idKindOp = 3):67 """68 ì´ì ë©´íì¦ ê²ì¬ ìëí í
ì¤í¸69 70 ì¸ì¦ ê¸°ë¥ funcOp71 2: ì ë¶ì¦ ì¸ì¦72 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 73 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)74 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦75 6: ê³ì¢ ì¸ì¦76 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦77 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦78 79 ì ë¶ì¦ ì¢
ë¥ idKindOp80 2: 주민ë±ë¡ì¦81 3: ì´ì ë©´íì¦82 4: íêµ ì¬ê¶83 5: ì¸êµ ì¬ê¶84 6: ì¸êµì¸ë±ë¡ì¦85 """86 87 if funcOp == 2:88 connect(Const.TEST_SITE_URL)89 clickTestMode(funcOp)90 visualLog('KYC click Drivers License Mode')91 enterPrivacyInfo(idKindOp)92 visualLog('KYC enter Privacy Info')93 selectTypeOfId(idKindOp)94 visualLog('KYC select Drivers License')95 uploadIdImageFile(idKindOp)96 visualLog('KYC upload Drivers License File')97 verifyEnteredIdInfo(idKindOp)98 visualLog('KYC verify Drivers License Info')99 100 if funcOp == 2:101 logResultToFile(sys._getframe().f_code.co_name)102 clickReTestButton()103def testIdCard_PassportMode(funcOp = 2, idKindOp = 4):104 """105 íêµ ì¬ê¶ ê²ì¬ ìëí í
ì¤í¸ 106 107 ì¸ì¦ ê¸°ë¥ funcOp108 2: ì ë¶ì¦ ì¸ì¦109 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 110 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)111 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦112 6: ê³ì¢ ì¸ì¦113 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦114 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦115 116 ì ë¶ì¦ ì¢
ë¥ idKindOp117 2: 주민ë±ë¡ì¦118 3: ì´ì ë©´íì¦119 4: íêµ ì¬ê¶120 5: ì¸êµ ì¬ê¶121 6: ì¸êµì¸ë±ë¡ì¦122 """123 124 if funcOp == 2:125 connect(Const.TEST_SITE_URL)126 clickTestMode(funcOp)127 visualLog('KYC click Passport Mode')128 enterPrivacyInfo(idKindOp)129 visualLog('KYC enter Privacy Info')130 selectTypeOfId(idKindOp)131 visualLog('KYC select Passport')132 uploadIdImageFile(idKindOp)133 visualLog('KYC upload Passport File')134 verifyEnteredIdInfo(idKindOp)135 visualLog('KYC verify Passport Info')136 137 if funcOp == 2:138 logResultToFile(sys._getframe().f_code.co_name)139 clickReTestButton()140 141def testIdCard_foreignPassportMode(funcOp = 2, idKindOp = 5):142 """143 ì¸êµ ì¬ê¶ ê²ì¬ ìëí í
ì¤í¸144 145 ì¸ì¦ ê¸°ë¥ funcOp146 2: ì ë¶ì¦ ì¸ì¦147 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 148 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)149 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦150 6: ê³ì¢ ì¸ì¦151 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦152 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦153 154 ì ë¶ì¦ ì¢
ë¥ idKindOp155 2: 주민ë±ë¡ì¦156 3: ì´ì ë©´íì¦157 4: íêµ ì¬ê¶158 5: ì¸êµ ì¬ê¶159 6: ì¸êµì¸ë±ë¡ì¦160 """161 162 if funcOp == 2:163 connect(Const.TEST_SITE_URL)164 165 clickTestMode(funcOp)166 visualLog('KYC click Foreign Passport Mode')167 enterPrivacyInfo(idKindOp)168 visualLog('KYC enter Privacy Info')169 selectTypeOfId(idKindOp)170 visualLog('KYC select Foreign Passport')171 uploadIdImageFile(idKindOp)172 visualLog('KYC upload Foreign Passport File')173 verifyEnteredIdInfo(idKindOp)174 visualLog('KYC verify Foreign Passport Info')175 176 if funcOp == 2:177 logResultToFile(sys._getframe().f_code.co_name)178 clickReTestButton()179 180def testIdCard_alienRegistrationMode(funcOp = 2, idKindOp = 6):181 """182 ì¸êµì¸ë±ë¡ì¦ ê²ì¬ ìëí í
ì¤í¸183 184 ì¸ì¦ ê¸°ë¥ funcOp185 2: ì ë¶ì¦ ì¸ì¦186 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 187 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)188 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦189 6: ê³ì¢ ì¸ì¦190 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦191 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦192 193 ì ë¶ì¦ ì¢
ë¥ idKindOp194 2: 주민ë±ë¡ì¦195 3: ì´ì ë©´íì¦196 4: íêµ ì¬ê¶197 5: ì¸êµ ì¬ê¶198 6: ì¸êµì¸ë±ë¡ì¦199 """200 201 if funcOp == 2:202 connect(Const.TEST_SITE_URL)203 clickTestMode(funcOp)204 visualLog('KYC click Alien Registration Mode')205 enterPrivacyInfo(idKindOp)206 visualLog('KYC enter Privacy Info')207 selectTypeOfId(idKindOp)208 visualLog('KYC select Alien Registration')209 uploadIdImageFile(idKindOp)210 visualLog('KYC upload Alien Registration File')211 verifyEnteredIdInfo(idKindOp)212 visualLog('KYC verify Alien Registration Info')213 214 if funcOp == 2:215 logResultToFile(sys._getframe().f_code.co_name)216 clickReTestButton()217def testFaceIdMode(funcOp = 3, idKindOp = 2):218 """219 ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ ê²ì¬ ìëí í
ì¤í¸220 221 ì¸ì¦ ê¸°ë¥ funcOp222 2: ì ë¶ì¦ ì¸ì¦223 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 224 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)225 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦226 6: ê³ì¢ ì¸ì¦227 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦228 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦229 230 ì ë¶ì¦ ì¢
ë¥ idKindOp231 2: 주민ë±ë¡ì¦232 3: ì´ì ë©´íì¦233 4: íêµ ì¬ê¶234 5: ì¸êµ ì¬ê¶235 6: ì¸êµì¸ë±ë¡ì¦236 """237 238 if funcOp == 3:239 connect(Const.TEST_SITE_URL)240 241 testIdCardMode(funcOp, idKindOp)242 243 # ì¼êµ´ ì´¬ì ë²í¼ í´ë¦244 faceShootBtn = WebDriverWait(driver, Const.TIMEOUT_TEN_SECOND).until(245 EC.element_to_be_clickable(246 (By.XPATH, Const.TAKE_SELFIE_XPATH)247 )248 )249 faceShootBtn.click()250 251 # because chrome_options.add_argument('--use-fake-ui-for-media-stream')252 logger.info('Access Camera Auth Alert Pass.')253 254 # Execute JavaScript ìì255 # driver.execute_script("alert('[KYC Auto Test] ì¼êµ´ì ì¸ìí´ì£¼ì¸ì.')")256 # # Alert íì¸ì ë를 ëê¹ì§ ë기257 # WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(alert_is_not_present())258 259 # 'íë©´ ìì ìì¼ë¡ ì¼êµ´ì ë§ì¶°ì£¼ì¸ì.' ì¼êµ´ì¸ì íë©´ì´ ì¬ë¼ì§ëê¹ì§ 기ë¤ë¦¬ë ì½ë.260 WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(261 EC.invisibility_of_element(262 (By.XPATH, Const.FACE_RECOGNITION_TEXT_XPATH)263 )264 )265 266 if funcOp == 3:267 # ì´ê±°ë ë§ì§ë§ ì±ê³µíë©´ì´ ë°ëê¹ì§ 기ë¤ë¦¬ë ì½ë.268 # 'ë³¸ì¸ ì¸ì¦ ìë£'269 WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(270 EC.text_to_be_present_in_element(271 (By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH), 272 Const.COMPLETED_CERTIFICATION_TEXT273 )274 )275 276 # ì±ê³µ ì¬ë¶ ì²´í¬277 result = None278 successText = driver.find_element(By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH)279 if successText.text == Const.COMPLETED_CERTIFICATION_TEXT:280 result = Const.SUCCESS281 else:282 logger.info('unexcepted message: ' + successText.text)283 result = Const.FAILED284 285 logResultToFile(sys._getframe().f_code.co_name)286 clickReTestButton()287def testFaceIdLivenessMode(funcOp = 4, idKindOp = 2):288 """289 ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) ê²ì¬ ìëí í
ì¤í¸290 291 ì¸ì¦ ê¸°ë¥ funcOp292 2: ì ë¶ì¦ ì¸ì¦293 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 294 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)295 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦296 6: ê³ì¢ ì¸ì¦297 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦298 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦299 300 ì ë¶ì¦ ì¢
ë¥ idKindOp301 2: 주민ë±ë¡ì¦302 3: ì´ì ë©´íì¦303 4: íêµ ì¬ê¶304 5: ì¸êµ ì¬ê¶305 6: ì¸êµì¸ë±ë¡ì¦306 """307 308 if funcOp == 4:309 connect(Const.TEST_SITE_URL)310 311 testIdCardMode(funcOp, idKindOp)312 313 # ì¼êµ´ ì´¬ì ë²í¼ í´ë¦314 faceShootBtn = WebDriverWait(driver, Const.TIMEOUT_TEN_SECOND).until(315 EC.element_to_be_clickable(316 (By.XPATH, Const.TAKE_SELFIE_XPATH)317 )318 )319 faceShootBtn.click()320 321 # because chrome_options.add_argument('--use-fake-ui-for-media-stream')322 logger.info('Camera auth alert passed.')323 324 # Execute JavaScript ìì325 # driver.execute_script("alert('[KYC Auto Test] ì¼êµ´ì ì¸ìí´ì£¼ì¸ì.')")326 # # Alert íì¸ì ë를 ëê¹ì§ ë기327 # WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(alert_is_not_present())328 329 # 'íë©´ ìì ìì¼ë¡ ì¼êµ´ì ë§ì¶°ì£¼ì¸ì.' ì¼êµ´ì¸ì íë©´ì´ ì¬ë¼ì§ëê¹ì§ 기ë¤ë¦¬ë ì½ë.330 WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(331 EC.invisibility_of_element(332 (By.XPATH, Const.FACE_RECOGNITION_TEXT_XPATH)333 )334 )335 336 if funcOp == 4:337 try:338 # ì´ê±°ë ë§ì§ë§ ì±ê³µíë©´ì´ ë°ëê¹ì§ 기ë¤ë¦¬ë ì½ë.339 # 'ë³¸ì¸ ì¸ì¦ ìë£'340 WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(341 EC.text_to_be_present_in_element(342 (By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH), 343 Const.COMPLETED_CERTIFICATION_TEXT344 )345 )346 347 # ì±ê³µ ì¬ë¶ ì²´í¬348 result = None349 successText = driver.find_element(By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH)350 if successText.text == Const.COMPLETED_CERTIFICATION_TEXT:351 result = Const.SUCCESS352 else:353 logger.info('unexcepted message: ' + successText.text)354 result = Const.FAILED355 356 except (TimeoutException) as e:357 # ì±ê³µ ë©ìì§ë¥¼ ì°¾ì§ ëª»íë©´ ì¤í¨ë¡ ê°ì£¼íê³ ì§í358 # 'ì¼êµ´ ì¸ì¦ ì¤í¨'359 if existsElement(By.XPATH, Const.FAILED_CERTIFICATION_TEXT_XPATH):360 failText = driver.find_element(By.XPATH, Const.FAILED_CERTIFICATION_TEXT_XPATH)361 if failText.text == Const.FAILED_CERTIFICATION_TEXT:362 errorCode = driver.find_element(By.XPATH, Const.FAILED_CERTIFICATION_ERROR_CODE_XPATH)363 logger.info(errorCode.text)364 result = Const.FAILED365 else:366 logger.error(e.msg)367 result = Const.FAILED368 369 elif existsElement(By.XPATH, Const.FAILED_CERTIFICATION_VCARD_ERROR_CODE_TITLE_XPATH):370 # 'ì¼êµ´ ê°ì§ ì¤í¨'371 vCardErrorTitle = driver.find_element(By.XPATH, Const.FAILED_CERTIFICATION_VCARD_ERROR_CODE_TITLE_XPATH)372 vCardErrorcode = driver.find_element(By.XPATH, Const.FAILED_CERTIFICATION_VCARD_ERROR_CODE_XPATH)373 logger.error(vCardErrorTitle.text + ": " + vCardErrorcode.text)374 result = Const.FAILED375 376 else:377 logger.error(e.msg)378 result = Const.FAILED379 if funcOp == 4:380 logResultToFile(sys._getframe().f_code.co_name)381 clickReTestButton()382def testFaceIdLivenessAccountMode(funcOp = 5, idKindOp = 2):383 """384 ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦ ê²ì¬ ìëí í
ì¤í¸385 386 ì¸ì¦ ê¸°ë¥ funcOp387 2: ì ë¶ì¦ ì¸ì¦388 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 389 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)390 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦391 6: ê³ì¢ ì¸ì¦392 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦393 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦394 395 ì ë¶ì¦ ì¢
ë¥ idKindOp396 2: 주민ë±ë¡ì¦397 3: ì´ì ë©´íì¦398 4: íêµ ì¬ê¶399 5: ì¸êµ ì¬ê¶400 6: ì¸êµì¸ë±ë¡ì¦401 """402 403 if funcOp == 5:404 connect(Const.TEST_SITE_URL)405 406 testFaceIdLivenessMode(funcOp, idKindOp)407 408 testAccountMode(funcOp, idKindOp)409 410 if funcOp == 5:411 logResultToFile(sys._getframe().f_code.co_name)412 clickReTestButton()413 414 415def testAccountMode(funcOp = 6, idKindOp = 2):416 """417 ê³ì¢ ì¸ì¦ ê²ì¬ ìëí í
ì¤í¸418 419 ì¸ì¦ ê¸°ë¥ funcOp420 2: ì ë¶ì¦ ì¸ì¦421 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 422 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)423 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦424 6: ê³ì¢ ì¸ì¦425 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦426 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦427 428 ì ë¶ì¦ ì¢
ë¥ idKindOp429 2: 주민ë±ë¡ì¦430 3: ì´ì ë©´íì¦431 4: íêµ ì¬ê¶432 5: ì¸êµ ì¬ê¶433 6: ì¸êµì¸ë±ë¡ì¦434 """435 if funcOp == 6:436 connect(Const.TEST_SITE_URL)437 438 clickTestMode(funcOp)439 visualLog('KYC click Account Mode')440 enterPrivacyInfo(idKindOp)441 visualLog('KYC enter Privacy Info')442 443 # ê³ì¢ ì
ë ¥ ë²í¼ í´ë¦444 enterAccountBtn = WebDriverWait(driver, Const.TIMEOUT_TEN_SECOND).until(445 EC.element_to_be_clickable(446 (By.XPATH, Const.ENTER_ACCOUNT_BUTTON_XPATH)447 )448 )449 enterAccountBtn.click()450 # ê³ì¢ì¸ì¦ íë©´ì´ ë°ëê¹ì§ 기ë¤ë¦¬ë ì½ë.451 WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(452 EC.text_to_be_present_in_element(453 (By.XPATH, Const.VERIFICATION_ACCOUNT_TEXT_XPATH), 454 Const.VERIFICATION_ACCOUNT_TEXT455 )456 )457 458 # ìí/ì¦ê¶ì¬ ì í ë¡ì§459 # ìíì´ Default ì´ë¯ë¡, ì
ë ¥í BANK_NAME ì ìíëª
목ë¡ê³¼ ë¹êµíê³ ,460 # ìíëª
ì´ ìëê²½ì° ì¦ê¶ì¬ëª
목ë¡ê³¼ ë¹êµíì¬ ì 보를 ì
ë ¥íë ë¡ì§.461 bankNStockSelectBtn = WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(462 EC.element_to_be_clickable(463 (By.XPATH, Const.SELECT_BANK_N_STOCK_XPATH)464 )465 )466 bankNStockSelectBtn.click()467 banklist = driver.find_elements(By.XPATH, Const.BANK_LIST_ITEM_XPATH)468 469 visualLog(f'banklist length is {len(banklist)}')470 bankItem = isContainText(Const.BANK_NAME, banklist)471 472 # Const.BANK_NAME ì¼ë¡ ìíëª
목ë¡ìì í´ë¦ ìë473 if bankItem:474 bankItem.click()475 else:476 # Const.BANK_NAME ì´ ìíëª
목ë¡ì ìì¼ë©´477 # ì¦ê¶ì¬ Tab í´ë¦ í, ì¦ê¶ì¬ 목ë¡ì´ ë³´ì¼ ëê¹ì§ ë기.478 driver.find_element(By.XPATH, Const.STOCK_TAB_XPATH).click()479 WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(480 EC.presence_of_element_located(481 (By.XPATH, Const.BANK_LIST_ITEM_XPATH))482 )483 484 stocklist = driver.find_elements(By.XPATH, Const.BANK_LIST_ITEM_XPATH)485 # ìí 목ë¡ì ì»ì í, ì¦ê¶ì¬ íì ëë¬, ì¦ê¶ì¬ 목ë¡ì ì»ì ë, 486 # list[ìí ëª©ë¡ ì + ì¦ê¶ì¬ ëª©ë¡ ì] ëì´ ë°íëë ë¯í íìì¼ë¡ ì¸í´ íí°ë§íë ì½ë.487 stocklist = [stock for stock in stocklist if stock.text != '']488 visualLog(f'stocklist length is {len(stocklist)}')489 stockItem = isContainText(Const.BANK_NAME, stocklist)490 491 if stockItem:492 stockItem.click()493 else:494 raise Exception(Const.BANK_NAME + 'ì ìíëª
/ì¦ê¶ì¬ëª
목ë¡ì ììµëë¤. ë¤ì íì¸ í ê°ì ìì íê³ ìëí´ì£¼ì¸ì.')495 496 # ì´ ë°©ìì ìë¨497 # driver.execute_script("arguments[0].innerHTML = ' KBêµë¯¼ '", bankNStockSelectBtn)498 499 # ê³ì¢ë²í¸ ì
ë ¥500 nameTextField = WebDriverWait(driver, Const.TIMEOUT_TEN_SECOND).until(EC.element_to_be_clickable((By.XPATH, Const.ENTER_ACCOUNT_NUMBER_XPATH)))501 nameTextField.send_keys(Const.ACCOUNT_NUMBER)502 503 oneWonSendBtn = driver.find_element(By.XPATH, Const.SEND_ONE_WON_BUTTON_XPATH)504 oneWonSendBtn.click()505 506 try:507 # ì¬ê¸°ì ìí ì ê² ìê° ì, catch 문ì¼ë¡ ì´ë.508 WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(509 EC.presence_of_element_located(510 (By.XPATH, Const.ENTER_VERIFY_CODE_BUTTON_XPATH)511 )512 )513 514 # 5ë¶ ë´ë¡ ì¸ì¦ ë²í¸ 4ì리 ì
ë ¥íë ë¡ì§.515 verifyCodeBtn = WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE * Const.TIMEOUT_FIVE_SECOND).until(516 EC.element_to_be_clickable(517 (By.XPATH, Const.ENTER_VERIFY_CODE_BUTTON_XPATH)518 )519 )520 verifyCodeBtn.click()521 522 # ì´ê±°ë ë§ì§ë§ ì±ê³µíë©´ì´ ë°ëê¹ì§ 기ë¤ë¦¬ë ì½ë.523 # 'ë³¸ì¸ ì¸ì¦ ìë£'524 WebDriverWait(driver, Const.TIMEOUT_FIVE_SECOND).until(525 EC.text_to_be_present_in_element(526 (By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH), 527 Const.COMPLETED_CERTIFICATION_TEXT528 )529 )530 531 # ì±ê³µ ì¬ë¶ ì²´í¬532 result = None533 successText = driver.find_element(By.XPATH, Const.COMPLETED_CERTIFICATION_TEXT_XPATH)534 if successText.text == Const.COMPLETED_CERTIFICATION_TEXT:535 result = Const.SUCCESS536 else:537 logger.info('unexcepted message: ' + successText.text)538 result = Const.FAILED539 540 except (TimeoutException) as e:541 # ì±ê³µ ë©ìì§ë¥¼ ì°¾ì§ ëª»íë©´ ì¤í¨ë¡ ê°ì£¼íê³ ì§í542 # 'ì í¨ìê° ë§ë£ë¡ ì¸í´ ì¸ì¦ì ì¤í¨'543 if existsElement(By.XPATH, Const.FAILED_VERIFICATION_TEXT_XPATH):544 failText = driver.find_element(By.XPATH, Const.FAILED_VERIFICATION_TEXT_XPATH)545 if failText.text == Const.FAILED_VERIFICATION_TEXT:546 logger.error(failText.text)547 result = Const.FAILED548 549 # ì
ë ¥í ì ë³´ê° ë³¸ì¸ê³¼ ë§ì§ ìë¤ë ì¤ë¥ ì²ë¦¬ íì.550 else:551 logger.error(e.msg)552 result = Const.FAILED553 554 if funcOp == 6:555 logResultToFile(sys._getframe().f_code.co_name)556 clickReTestButton()557def testIdCardAccountMode(funcOp = 7, idKindOp = 2):558 """559 ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦ ê²ì¬ ìëí í
ì¤í¸560 561 ì¸ì¦ ê¸°ë¥ funcOp562 2: ì ë¶ì¦ ì¸ì¦563 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 564 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)565 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦566 6: ê³ì¢ ì¸ì¦567 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦568 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦569 570 ì ë¶ì¦ ì¢
ë¥ idKindOp571 2: 주민ë±ë¡ì¦572 3: ì´ì ë©´íì¦573 4: íêµ ì¬ê¶574 5: ì¸êµ ì¬ê¶575 6: ì¸êµì¸ë±ë¡ì¦576 """577 if funcOp == 7:578 visualLog('KYC click Id Card Account Mode') 579 connect(Const.TEST_SITE_URL)580 581 testIdCardMode(funcOp, idKindOp)582 583 testAccountMode(funcOp, idKindOp)584 585 if funcOp == 7:586 logResultToFile(sys._getframe().f_code.co_name)587 clickReTestButton()588def testFaceIdAccountMode(funcOp = 8, idKindOp = 2):589 """590 ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦ ê²ì¬ ìëí í
ì¤í¸591 592 ì¸ì¦ ê¸°ë¥ funcOp593 2: ì ë¶ì¦ ì¸ì¦594 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 595 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)596 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦597 6: ê³ì¢ ì¸ì¦598 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦599 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦600 601 ì ë¶ì¦ ì¢
ë¥ idKindOp602 2: 주민ë±ë¡ì¦603 3: ì´ì ë©´íì¦604 4: íêµ ì¬ê¶605 5: ì¸êµ ì¬ê¶606 6: ì¸êµì¸ë±ë¡ì¦607 """608 if funcOp == 8:609 visualLog('KYC click Face Id Account Mode')610 connect(Const.TEST_SITE_URL)611 612 testFaceIdMode(funcOp, idKindOp)613 614 testAccountMode(funcOp, idKindOp)615 616 if funcOp == 8:617 logResultToFile(sys._getframe().f_code.co_name)618 clickReTestButton()619 620 621 622 623def connect(url):624 """625 # MAIN íì´ì§626 """627 628 visualLog(sys._getframe().f_code.co_name)629 630 # íì´ì§ ê°ì ¸ì¤ê¸° (ì ì)631 driver.get(url)632 logger.info(url)633 # íë©´ í¬ê¸° ì§ì 634 # Windows Xbox Recordë¡ ë
¹ííë ¤ë©´ ì°½ í¬ê¸° ë³ê²½ í, ë
¹í를 ììí´ì¼ íë¤.635 # driver.set_window_rect(0, 0, 800, 1000) # í¹ì ì¢í(x,y)ì í¬ê¸°(width,height)ë¡ ë³ê²½636 # Debug Window ì¤ì ì¬ë¶ ë²í¼637 postMsgToggleBtn = driver.find_element(638 By.XPATH, Const.POST_MSG_TOGGLE_BUTTON_XPATH)639 # postMsgToggleBtn.click()640 # ê°ì¸ì ë³´ ìµì
ì²´í¬ë°ì¤641 privacyOpCheckBtn = driver.find_element(642 By.XPATH, Const.PRIVACY_OPTION_CHECK_XPATH)643 privacyOpCheckBtn.click()644def clickTestMode(funcOp):645 """646 2: ì ë¶ì¦ ì¸ì¦647 3: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ 648 4: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)649 5: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦650 6: ê³ì¢ ì¸ì¦651 7: ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦652 8: ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦653 """654 655 if driver:656 xPath = {657 2: r'//*[@id="logic-options"]/ul/li[1]/img',658 3: r'//*[@id="logic-options"]/ul/li[2]/img',659 4: r'//*[@id="logic-options"]/ul/li[3]/img',660 5: r'//*[@id="logic-options"]/ul/li[4]/img',661 6: r'//*[@id="logic-options"]/ul/li[5]/img',662 7: r'//*[@id="logic-options"]/ul/li[6]/img',663 8: r'//*[@id="logic-options"]/ul/li[7]/img'664 }.get(funcOp, "ìë ë©ë´")665 666 # í
ì¤í¸í ê¸°ë¥ ë²í¼667 targetBtn = driver.find_element(By.XPATH, xPath)668 targetBtn.click()669 else:670 logger.info('Please call connect() first.')671 func = {672 2: 'ì ë¶ì¦ ì¸ì¦',673 3: 'ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸',674 4: 'ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤)',675 5: 'ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸(+ë¼ì´ë¸ëì¤) | ê³ì¢ ì¸ì¦',676 6: 'ê³ì¢ ì¸ì¦',677 7: 'ì ë¶ì¦ ì¸ì¦ | ê³ì¢ ì¸ì¦',678 8: 'ì ë¶ì¦ ì¸ì¦ | ì¼êµ´íì¸ | ê³ì¢ ì¸ì¦'679 }.get(funcOp, "ìë ë©ë´")680 681 logger.info(f'ì íí ë©ë´ë {func} ì
ëë¤.')682def enterPrivacyInfo(idKindOp):683 """684 # ê°ì¸ì ë³´ ì
ë ¥ íì´ì§685 """686 687 if driver:688 # ê°ì¸ì ë³´ ì
ë ¥ íì´ì§ë iframe ì¼ë¡ ì®ê²¨ì ê²ì¬í´ì¼ ì½ëë¡ ì ê·¼ì´ ê°ë¥í¨689 kycIframe = driver.find_element(By.CSS_SELECTOR, 'iframe')690 if kycIframe:691 iframeId = kycIframe.get_attribute('id')692 if(iframeId == Const.KYC_IFRAME_TEXT):693 driver.switch_to.frame(kycIframe)694 # driver.implicitly_wait(5) # 묵ìì ë기, íì±í를 주ì´ì§ ìê°ë§í¼ê¹ì§ 기ë¤ë¦°ë¤.695 # EC.element_to_be_clickable - í´ë¹ Elementê° í´ë¦ ê°ë¥í ëê¹ì§ 주ì´ì§ ìê°ë§í¼ 기ë¤ë¦°ë¤.696 nameTextField = WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(EC.element_to_be_clickable((By.XPATH, getNameInputXPath(idKindOp))))697 nameTextField.send_keys(getUserName(idKindOp))698 699 phoneTextField = driver.find_element(By.XPATH, getPhoneInputXPath(idKindOp))700 phoneTextField.send_keys(Const.USER_PHONE)701 birthTextField = driver.find_element(By.XPATH, getBirthInputXPath(idKindOp))702 birthTextField.send_keys(getUserBirth(idKindOp))703 emailTextField = driver.find_element(By.XPATH, getEmailInputXPath(idKindOp))704 emailTextField.send_keys(Const.USER_EMAIL)705 # ë¤ì ë²í¼ í´ë¦706 nextBtn = driver.find_element(By.XPATH, Const.NEXT_BUTTON_XPATH)707 nextBtn.click()708 709 else:710 logger.info('The iframe id is incorrect. Expected: "kyc_iframe" Actual: ', iframeId)711 else:712 logger.info('Please call connect() first.')713def selectTypeOfId(idKindOp):714 """715 # ì ë¶ì¦ ë©ë´ ì í íì´ì§716 """717 718 if driver:719 # EC.element_to_be_clickable - í´ë¹ Elementê° í´ë¦ ê°ë¥í ëê¹ì§ 주ì´ì§ ìê°ë§í¼ 기ë¤ë¦°ë¤.720 choiceIdBtn = WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(EC.element_to_be_clickable((By.XPATH, getSelectTypeOfIdXPath(idKindOp))))721 # choiceIdBtn = driver.find_element(By.XPATH, getSelectTypeOfIdXPath(idKindOp))722 choiceIdBtn.click()723 724 nextBtn = driver.find_element(By.XPATH, Const.SELECT_COMPLETE_BUTTON_XPATH)725 nextBtn.click()726 else:727 logger.info('Please call connect() first.')728def uploadIdImageFile(idKindOp):729 """730 # ì ë¶ì¦ ì¬ì§ ì
ë¡ë íì´ì§731 """732 733 if driver:734 #UPLOAD_IMAGE_BUTTON_XPATH ë input type file ë¡ ë°ë¡ ì¡ìì ì¬ì©735 driver.find_element(By.CSS_SELECTOR, "input[type='file']").send_keys(getIdImageFilePath(idKindOp))736 737 submitIdBtn = driver.find_element(By.XPATH, Const.SUBMIT_ID_BUTTON_XPATH)738 submitIdBtn.click()739 740 driver.switch_to.active_element741 # EC.element_to_be_clickable - í´ë¹ Elementê° í´ë¦ ê°ë¥í ëê¹ì§ 주ì´ì§ ìê°ë§í¼ 기ë¤ë¦°ë¤.742 submitBtn = WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(EC.element_to_be_clickable((By.XPATH, Const.SUBMIT_BUTTON_XPATH)))743 submitBtn.click()744 else:745 logger.info('Please call connect() first.')746def verifyEnteredIdInfo(idKindOp):747 """748 # ê°ì¸ì ë³´ íì¸ íì´ì§749 """750 751 try:752 if driver:753 # EC.element_to_be_clickable - í´ë¹ Elementê° í´ë¦ ê°ë¥í ëê¹ì§ 주ì´ì§ ìê°ë§í¼ 기ë¤ë¦°ë¤.754 nextBtn = WebDriverWait(driver, Const.TIMEOUT_ONE_MINUTE).until(EC.element_to_be_clickable((By.XPATH, getVerifyIdInfoPageNextBtnXPath(idKindOp))))755 nextBtn.click()756 757 byTxt = By.CLASS_NAME758 targetTxt = 'v-card'759 760 # v-card ê° íìëë©´ ì§í ì¤ ì¤ë¥ê° ë°ìí ê²ì¼ë¡ ê°ì£¼.761 if existsElement(byTxt, targetTxt):762 raise Exception(driver.find_element(byTxt, targetTxt))763 else:764 raise Exception('Please call connect() first.')765 766 except Exception as e:767 if e.args.__len__() > 0 and isinstance(e.args[0], WebElement):768 logger.error(str(e.args[0].text))769 else :770 logger.error(str(e))771 772 raise e773def getNameInputXPath(funcOpNum):774 xPath = {775 2: r'//*[@id="app"]/div[1]/div/div[4]/div/input',776 3: r'//*[@id="app"]/div[1]/div/div[4]/div/input',777 4: r'//*[@id="app"]/div[1]/div/div[4]/div/input',778 5: r'//*[@id="app"]/div[1]/div/div[4]/div/input',779 6: r'//*[@id="app"]/div[1]/div/div[4]/div/input'780 }.get(funcOpNum, "ìë ë©ë´")781 782 return xPath783def getPhoneInputXPath(funcOpNum):784 xPath = {785 2: r'//*[@id="app"]/div[1]/div/div[6]/div/input',786 3: r'//*[@id="app"]/div[1]/div/div[6]/div/input',787 4: r'//*[@id="app"]/div[1]/div/div[6]/div/input',788 5: r'//*[@id="app"]/div[1]/div/div[6]/div/input',789 6: r'//*[@id="app"]/div[1]/div/div[6]/div/input'790 }.get(funcOpNum, "ìë ë©ë´")791 792 return xPath793def getBirthInputXPath(funcOpNum):794 xPath = {795 2: r'//*[@id="app"]/div[1]/div/div[8]/div/input',796 3: r'//*[@id="app"]/div[1]/div/div[8]/div/input',797 4: r'//*[@id="app"]/div[1]/div/div[8]/div/input',798 5: r'//*[@id="app"]/div[1]/div/div[8]/div/input',799 6: r'//*[@id="app"]/div[1]/div/div[8]/div/input'800 }.get(funcOpNum, "ìë ë©ë´")801 802 return xPath803def getEmailInputXPath(funcOpNum):804 xPath = {805 2: r'//*[@id="app"]/div/div/div[10]/div/input', 806 3: r'//*[@id="app"]/div/div/div[10]/div/input', 807 4: r'//*[@id="app"]/div/div/div[10]/div/input',808 5: r'//*[@id="app"]/div/div/div[10]/div/input',809 6: r'//*[@id="app"]/div/div/div[10]/div/input'810 }.get(funcOpNum, "ìë ë©ë´")811 812 return xPath813def getSelectTypeOfIdXPath(idKindOpNum):814 """815 ì ë¶ì¦ ì¢
ë¥ ë²í¸ [2 ~ 6]816 2: 주민ë±ë¡ì¦817 3: ì´ì ë©´íì¦818 4: íêµ ì¬ê¶819 5: ì¸êµ ì¬ê¶820 6: ì¸êµì¸ë±ë¡ì¦821 """822 823 xPath = {824 2: r'//*[@id="app"]/div[1]/div/div/div[5]',825 3: r'//*[@id="app"]/div[1]/div/div/div[6]',826 4: r'//*[@id="app"]/div[1]/div/div/div[7]',827 5: r'//*[@id="app"]/div[1]/div/div/div[8]',828 6: r'//*[@id="app"]/div[1]/div/div/div[9]'829 }.get(idKindOpNum, "ìë ë©ë´")830 func = {831 2: '주민ë±ë¡ì¦',832 3: 'ì´ì ë©´íì¦',833 4: 'íêµ ì¬ê¶',834 5: 'ì¸êµ ì¬ê¶',835 6: 'ì¸êµì¸ë±ë¡ì¦'836 }.get(idKindOpNum, "ìë ë©ë´")837 838 logger.info(f'ì íí ì ë¶ì¦ ì¢
ë¥ë {func} ì
ëë¤.')839 840 return xPath841def getIdImageFilePath(idKindOpNum):842 filePath = {843 2: 'C:\\idCard.jpg',844 3: 'C:\\driversLicense.jpg',845 4: 'C:\\passPort.jpg',846 5: 'C:\\foreignPassPort.jpg',847 6: 'C:\\alienRegistrationCard.jpg'848 }.get(idKindOpNum, "ìë ë©ë´")849 850 return filePath851def getVerifyIdInfoPageNextBtnXPath(idKindOpNum):852 """853 ì ë¶ì¦ ì ë³´ íì¸ íì´ì§854 """855 856 xPath = {857 2: r'//*[@id="app"]/div[1]/div/div[12]/div[2]',858 3: r'//*[@id="app"]/div[1]/div/div[14]/div[2]',859 4: r'//*[@id="app"]/div[1]/div/div[16]/div[2]',860 5: r'//*[@id="app"]/div[1]/div/div[14]/div[2]',861 6: r'//*[@id="app"]/div[1]/div/div[12]/div[2]'862 }.get(idKindOpNum, "ìë ë©ë´")863 864 return xPath865def getUserName(funcOpNum):866 xPath = {867 2: Const.USER_NAME,868 3: Const.USER_NAME,869 4: Const.PASSPORT_USER_NAME,870 5: Const.FOREIGN_USER_NAME,871 6: Const.REGISTERED_FOREIGN_USER_NAME872 }.get(funcOpNum, "ìë ë©ë´")873 874 return xPath875def getUserBirth(funcOpNum):876 xPath = {877 2: Const.USER_BIRTH,878 3: Const.USER_BIRTH,879 4: Const.PASSPORT_USER_BIRTH,880 5: Const.FOREIGN_USER_BIRTH,881 6: Const.REGISTERED_FOREIGN_USER_BIRTH882 }.get(funcOpNum, "ìë ë©ë´")883 884 return xPath885def visualLog(contents):886 """887 ë¡ê·¸ íì¼ìì ëì ì ëê² contents를 ë¨ê¸°ë í¨ì\n888 ââââ\n889 connect\n890 ââââ\n891 Args:892 contents (str): ë¡ê·¸ íì¼ì ìì±ë ë´ì©893 """894 895 horizontalChr = 'â'896 horizontalStr = ''897 898 for i in range(len(contents)):899 horizontalStr += horizontalChr900 logger.info(horizontalChr + horizontalStr + horizontalChr)901 logger.info(contents)902 logger.info(horizontalChr + horizontalStr + horizontalChr)903def logResultToFile(funcName, loggingStartWord = '"review_result"'):904 """905 : íì¤ë¡ ì ì²´ ë´ì©ì´ ëì´ì¤ë review_result íì± ê²°ê³¼ë¥¼906 : ë¤ìê³¼ ê°ì´ User Readerableí ííë¡ ë¡ê·¸íì¼ì ì¶ê°907 Args:908 funcName (str): í¸ì¶íë í¨ìëª
ì ì
ë ¥ë°ê¸° ìí´ sys._getframe().f_code.co_name ì ì
ë ¥íì¬ ì¬ì©.909 loggingStartWord (str, optional): 기ë¡ì ììí ìì¹ë¥¼ ëíë´ë 문ìì´.910 : Defaults to '"review_result"'. ex) 'WORD'911 : 문ìì´ì ë³ê²½í ëë apostrophe ë´ë¶ì ìì±í´ì¼ íë¤.912 913 Result:914 "review_result":{"id":578915 "request_time":"2022-03-10T04:12:10.699Z"916 "name":"ì¬ì©ìëª
"917 "phone_number":"ì¬ì©ìë²í¸"918 "birthday":"ìë
ìì¼"919 "result_type":1920 "result_email":1921 "result_sms":2922 "module":{"id_card_ocr":true923 "id_card_verification":true924 "face_authentication":false925 "account_verification":false926 "liveness":false}927 "id_card":{"modified":false928 "verified":true929 "id_card_image":"/9j/4AAQSkZJRgABAQEAYABgAAD//gA+Q1JFQVRPUj...ìëµ930 "id_crop_image":null931 "original_ocr_data":"{\"idType\":\"1\"932 \"userName\":\"ì¬ì©ìëª
\"933 \"juminNo1\":\"주민ë±ë¡ë²í¸ ìì리\"934 \"juminNo2\":\"주민ë±ë¡ë²í¸ ë·ì리\"935 \"_juminNo2\":\"2******\"936 \"issueDate\":\"ë°ê¸ì¼ì\"937 \"transaction_id\":\"125978368062297a9ca145e1646885532\"}"938 "modified_ocr_data":null939 "is_manual_input":false940 "is_uploaded":true941 "id_card_origin":"/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST...ìëµ942 "face_check":null943 "account":null}944 "api_response":{"result_code":"N100"945 "result_message":"ê²°ê³¼ ë©ìì§"}946 "result":"ì±ê³µ ì¬ë¶"}"947 """948 try:949 # 'goog:loggingPrefs'950 prefName = 'browser'951 952 logger.info(prefName + ': Logging start.')953 resultTargetWord = '"result":'954 result = ''955 956 # ë무 빨리 ì»ì´ìì ê°ì´ ìë ê²½ì° ëë¹íë ì½ë957 while True:958 perf = driver.get_log(prefName)959 if len(perf) > 2: break960 961 for p in perf:962 # Readerableí ííë¡ ë§ë¤ê¸° ìí replace ììê° ìì963 strLog = p['message'].replace(',"', ',\n"').replace('\\"', '"').replace('\\\\', '\\')964 965 if loggingStartWord in strLog:966 splited = strLog[967 strLog.index(loggingStartWord):968 ].split(",")969 for x in splited:970 for y in x.split(","):971 if resultTargetWord in y:972 # ìí ê²°ê³¼ ë¨ì´ë¥¼ íí°í기 ìí split ì½ë973 result = y[len(resultTargetWord) + 1:len(y) - 3]974 logger.info(y)975 976 visualLog(funcName + ' ' + result)977 978 except Exception as e:979 logger.info(prefName + ': Empty.')980def openLogFile():981 subprocess.run(['explorer', file_handler.baseFilename])982def existsElement(by: By, target: string):983 try:984 WebDriverWait(driver, Const.TIMEOUT_TEN_SECOND).until(EC.presence_of_element_located((by, target)))985 986 except (TimeoutException, NoSuchElementException) as e:987 return False988 989 return True990def isContainText(target: string, list):...
0009_auto_20170619_1112.py
Source:0009_auto_20170619_1112.py
1# -*- coding: utf-8 -*-2# Generated by Django 1.10.6 on 2017-06-19 11:123from __future__ import unicode_literals4import datetime5from django.db import migrations, models6class Migration(migrations.Migration):7 dependencies = [8 ('users', '0008_auto_20170619_1108'),9 ]10 operations = [11 migrations.AlterModelOptions(12 name='visuallog',13 options={'verbose_name': 'VisualLog', 'verbose_name_plural': 'VisualLog'},14 ),15 migrations.AlterField(16 model_name='pcguid',17 name='addtime',18 field=models.DateTimeField(blank=True, default=datetime.datetime(2017, 6, 19, 11, 12, 54, 275731), null=True, verbose_name='ç»å½éªè¯æ¶é´'),19 ),20 migrations.AlterField(21 model_name='pcguidlog',22 name='addtime',23 field=models.DateTimeField(default=datetime.datetime(2017, 6, 19, 11, 12, 54, 276375), verbose_name='loginTime'),24 ),25 migrations.AlterField(26 model_name='visuallog',27 name='addtime',28 field=models.DateTimeField(default=datetime.datetime(2017, 6, 19, 11, 12, 54, 277298), verbose_name='loginTime'),29 ),...
KYC-demo-select- driver's-license.py
Source:KYC-demo-select- driver's-license.py
...4import time5import KYC6import Const7KYC.connect(Const.TEST_SITE_URL)8KYC.visualLog('=== KYC connect ===')9KYC.clickIdCardMode()10KYC.visualLog('=== KYC clickIdCardMode ===')11KYC.enterPrivacyInfo()12KYC.visualLog('=== KYC enterPrivacyInfo ===')13KYC.selectTypeOfId()14KYC.visualLog('=== KYC selectDriversLicense ===')15KYC.uploadIdImageFile()16KYC.visualLog('=== KYC uploadDriversLicenseFile ===')17KYC.verifyEnteredIdInfo()18KYC.visualLog('=== KYC verifyIdCardInfo ===')19KYC.visualLog('=== TEST SUCCESS ===')...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!