@@ -81,8 +81,59 @@ def GoHome(self, isHD, login):
81
81
def Login (self , user , password ):
82
82
self .urlold = self .driver .current_url
83
83
print ("Login urlold=" , self .urlold )
84
- self .LoginQQ (user , password )
85
- # self.SaveCookie(self.fileCookie)
84
+ webcmd = WebDriverCmd (self .driver )
85
+
86
+ # <span data-v-5bf2336f="">创建游戏</span>
87
+ # key = "//span[contains(text(),上传APK)]"
88
+ # <input class="checkbox phone-login__check" type="checkbox" name="read" id="is-agree-login-or-register">
89
+ # key = "//input[@id='is-agree-login-or-register']"
90
+ key = "//label[@for='is-agree-login-or-register']"
91
+ # item = webcmd.Find(key,True)
92
+ # if item is not None:
93
+ # print("find agree-login-or-register")
94
+ # webcmd.DoCmd(item,CmdType.CLICK_SCRIPT)
95
+
96
+
97
+
98
+ # 等待选择qq
99
+ while True :
100
+ time .sleep (1 )
101
+ self .urlnew = self .driver .current_url
102
+ print ("select qq urlnew=" , self .urlnew )
103
+ if self .urlnew != self .urlold :
104
+ print ("select qq Finish =" , self .urlnew )
105
+ break
106
+
107
+ # webcmd.WaitKeyBoard("q")
108
+
109
+
110
+ # # 选择 qq登陆
111
+ # key = "//a[@data-social-provider='qq']"
112
+ # webcmd.AddCmd(CmdType.CLICK_SCRIPT,key)
113
+ # webcmd.Run(True)
114
+
115
+
116
+ # # global-tip-modal-1791e1fb5e2
117
+ # key = "//section[contains(@id,'global-tip-modal-')]"
118
+ # section = webcmd.Find(key,True)
119
+
120
+ # key = ".//button[@class='btn btn-primary' and @data-default-text='确定']"
121
+ # item = webcmd.FindChild(section,key,False)
122
+ # if item is not None:
123
+ # print("find button 确定")
124
+ # webcmd.DoCmd(item,CmdType.CLICK)
125
+ # # <button class="btn btn-primary" data-default-text="确定">确定</button>
126
+
127
+ # # 等待勾选
128
+ # webcmd.WaitKeyBoard("q")
129
+
130
+ # time.sleep(2)
131
+
132
+
133
+
134
+
135
+ self .urlold = self .driver .current_url
136
+ self .LoginQQ (user , password )
86
137
87
138
# 等待登录成功
88
139
while True :
@@ -352,35 +403,138 @@ def UploadScreenShot(self, webcmd,isHD,lan,applan):
352
403
item = webcmd .FindChild (item_root ,key ,True )
353
404
354
405
def CreateApp (self , isHD ):
355
- url = "https://www.taptap.com/developer/app-create/14628"
406
+ appid = mainAppInfo .GetAppId (isHD , Source .TAPTAP )
407
+ if len (appid )> 1 :
408
+ self .FillAppInfo (isHD ,appid )
409
+ return
410
+
411
+ # url = "https://www.taptap.com/developer/app-create/14628"
412
+ url = "https://developer.taptap.com/14628/create-app"
356
413
self .driver .get (url )
357
414
time .sleep (1 )
358
- self .UpLoadApk (isHD )
415
+ webcmd = WebDriverCmd (self .driver )
416
+
417
+ # <span data-v-5bf2336f="">创建游戏</span>
418
+ # key = "//span[contains(text(),上传APK)]"
419
+ # key = "//span[text()='创建游戏']"
420
+ # item = webcmd.Find(key,True)
421
+
422
+
423
+ # name
424
+ # <input data-v-194bf4a0="" type="text" maxlength="50" class="ant-input ant-input-lg">
425
+ name = self .GetAppName (isHD , Source .LANGUAGE_CN ,Source .TAPTAP )
426
+ print (name )
427
+
428
+ print ("\r \n " )
429
+ print ("\r \n " )
430
+
431
+
432
+ detail = self .GetAppDetail (isHD , Source .LANGUAGE_CN )
433
+ print (detail )
434
+
435
+ key = "//input[@class='ant-input ant-input-lg']"
436
+ # 等待网页加载完成
437
+ item = webcmd .Find (key ,True )
438
+
439
+ webcmd .AddCmd (CmdType .INPUT ,key ,name )
440
+
441
+ webcmd .Run (True )
442
+
443
+
444
+ # 上传icon
445
+ key = "//div[@class='tds-upload-item__operations']"
446
+ webcmd .AddCmd (CmdType .CLICK ,key )
447
+ webcmd .Run (True )
448
+
449
+ # key = "//svg[@id='iconshanchu_Delete']"
450
+ # # 等待
451
+ # item = webcmd.Find(key,True)
452
+ # webcmd.AddCmd(CmdType.CLICK,key)
453
+ # webcmd.Run(True)
454
+
455
+ # iconyanjingzhengkai_EyeOpen1
456
+ key = "//div[@class='tds-upload__icon']"
457
+ # 等待
458
+ item = webcmd .Find (key ,True )
459
+ webcmd .DoCmd (item ,CmdType .CLICK )
460
+
461
+ # icon end
462
+
463
+ icon = mainResource .GetOutPutIconPathWin32 ( mainResource .GetProjectOutPut (), Source .TAPTAP , isHD )+ "\\ icon_android_512.png"
464
+ print (icon )
465
+ if Platform .isMacSystem ():
466
+ icon = icon .replace ("\\ " ,"/" )
467
+ icon = FileUtil .GetLastDirofDir (icon )
468
+ test = 0
469
+
470
+ # webcmd.Run(True)
471
+ self .OpenFileBrowser (icon , True )
472
+ time .sleep (1 )
473
+
474
+ # self.UpLoadApk(isHD)
475
+
476
+ # wait save
477
+ self .urlold = self .driver .current_url
478
+ while True :
479
+ time .sleep (1 )
480
+ self .urlnew = self .driver .current_url
481
+ print ("wait save urlnew=" , self .urlnew )
482
+ if self .urlnew != self .urlold :
483
+ print ("wait save Finish =" , self .urlnew )
484
+ break
485
+
486
+ # https://developer.taptap.com/14628/app/214597/submit-records?panel=update
487
+ url = self .driver .current_url
488
+
489
+
490
+ strfind = "app/"
491
+ idx = url .find (strfind )+ len (strfind )
492
+ appid = url [idx :]
493
+ strend = "/"
494
+ idx = appid .find (strend )
495
+ appid = appid [0 :idx ]
496
+ print (appid )
497
+ mainAppInfo .SetAppId (isHD , Source .ANDROID , Source .TAPTAP , appid )
359
498
360
499
# url = "https://www.taptap.com/developer/fill-form/14628"
361
500
# self.driver.get(url)
362
501
# time.sleep(1)
363
502
364
- self .FillAppInfo (isHD )
503
+ self .FillAppInfo (isHD ,appid )
504
+
505
+ def FillAppInfo (self , isHD ,appid ):
506
+ # url = "https://developer.taptap.com/14628/app/214597/update-app?panel=appInfo"
507
+ url = "https://developer.taptap.com/14628/app/" + str (appid )+ "/update-app?panel=appInfo"
508
+ self .driver .get (url )
509
+ time .sleep (1 )
365
510
366
- def FillAppInfo (self , isHD ):
367
-
368
511
webcmd = WebDriverCmd (self .driver )
369
512
370
513
# 等待文件長傳結束
371
- key = "//a[@title='基础信息 ']"
514
+ key = "//span[text()='游戏资料 ']"
372
515
item = webcmd .Find (key ,True )
373
516
374
- # default zh_CN en_US
375
- # self.lanKeys =(self.LAN_KEY_default,self.LAN_KEY_CN, self.LAN_KEY_EN)
376
- # applans = (Source.LANGUAGE_CN,Source.LANGUAGE_CN, Source.LANGUAGE_EN)
377
-
378
- # default zh_CN
379
- # self.lanKeys =(self.LAN_KEY_default,self.LAN_KEY_CN)
380
- # applans = (Source.LANGUAGE_EN,Source.LANGUAGE_CN)
517
+
381
518
self .lanKeys = [self .LAN_KEY_CN ,self .LAN_KEY_EN ]
382
519
applans = [Source .LANGUAGE_CN ,Source .LANGUAGE_EN ]
383
520
521
+ detail = self .GetAppDetail (isHD , Source .LANGUAGE_CN )
522
+ print (detail )
523
+
524
+ # <textarea data-v-b0e9536c="" class="ant-input"></textarea>
525
+ key = "//textarea[@class='ant-input']"
526
+ webcmd .AddCmd (CmdType .INPUT ,key ,detail )
527
+
528
+ webcmd .Run (True )
529
+
530
+
531
+ # screenshot
532
+ # key = "//div[@class='tds-upload__icon']"
533
+ # # 等待
534
+ # item = webcmd.Find(key,True)
535
+ # webcmd.DoCmd(item,CmdType.CLICK)
536
+
537
+ return
384
538
# addlans = ("chs","en")
385
539
# addlans = ("default","chs")
386
540
addlans = ["chs" ]
@@ -437,40 +591,7 @@ def FillAppInfo(self, isHD):
437
591
key = "//div[@id='AnchorGameData']"
438
592
item_div = webcmd .Find (key )
439
593
440
- # 管理多语言
441
- # key = ".//button[@class='float-r btn--edit ant-btn ant-btn-primary ant-btn-background-ghost']"
442
- # subitem = webcmd.FindChild(item_div,key)
443
- # webcmd.DoCmd(subitem,CmdType.CLICK)
444
-
445
-
446
-
447
- # webcmd.AddCmd(CmdType.CLICK, "//a[@id='manage-trans-btn']", "", 1)
448
- # # trans-select-chs
449
- # for lan in range(0, len(addlans)):
450
- # key = "//input[@id='trans-select-"+addlans[lan]+"']"
451
- # print(key)
452
- # webcmd.AddCmd2(CmdType.CLICK, key)
453
-
454
- # webcmd.AddCmd(CmdType.CLICK, "//button[@id='manage-trans-submit']", "", 1)
455
-
456
- # webcmd.Run(True)
457
-
458
-
459
- # webcmd.AddCmd( CmdType.CLICK, "//a[@aria-controls='chs']", "", 1)
460
- # webcmd.Run(True)
461
- # key = "//input[@type='file' and @data-target='#banner_1_android-"+"cn"+"']"
462
- # key = "//input[@data-target='#banner_1_android']"
463
- # key = "//input[@data-target='#icon']"
464
- # key = "//input[@type='file' and @data-target='#icon']"
465
- # key = "//input[@type='file' and @data-target='#icon-zh_CN']"
466
-
467
- # #icon
468
- # # key ="//input[@id='banner_1_android-input']"
469
- # # key ="//span[@class='fileinput-button fixed-size banner']"
470
-
471
-
472
-
473
-
594
+
474
595
475
596
476
597
for lan in range (0 , len (self .lanKeys )):
@@ -693,7 +814,7 @@ def SearchApp(self, ishd):
693
814
webcmd = WebDriverCmd (self .driver )
694
815
695
816
self .driver .get (
696
- "https://www .taptap.com/developer/dashboard/ 14628/apps " )
817
+ "https://developer .taptap.com/14628/all-app " )
697
818
time .sleep (2 )
698
819
699
820
key = "//input[@class='ant-select-search__field']"
@@ -730,8 +851,12 @@ def SearchApp(self, ishd):
730
851
def Run (self ,type , isHD ):
731
852
self .Init ()
732
853
print ("AppStoreTaptap Run isHD=" ,str (isHD ))
854
+ # try:
733
855
self .GoHome (isHD , True )
734
856
self .Login ("651577315" , "qq31415926" )
857
+ # except Exception as e:
858
+ # print("Login eror=",e)
859
+
735
860
736
861
if type == "createapp" :
737
862
self .CreateApp (isHD )
0 commit comments