add new scripts
This commit is contained in:
parent
b2032860e1
commit
0e10ea8738
|
@ -0,0 +1,47 @@
|
|||
# bug reproduction script for bug #116 of APhotoManager
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("de.k3b.android.androFotoFinder")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "de.k3b.android.androFotoFinder":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press more options")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press Settings")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,87 @@
|
|||
# bug reproduction script for bug #4881 of firefoxlite
|
||||
# this one requires a 1080*1920 screen.
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
os.system(
|
||||
"adb root && adb shell am start -n org.mozilla.rocket.debug.ting/org.mozilla.focus.activity.MainActivity")
|
||||
# d.app_start("org.mozilla.rocket.debug.ting")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "org.mozilla.rocket.debug.ting":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="org.mozilla.rocket.debug.ting:id/bottom_bar_home").click()
|
||||
if not out:
|
||||
print("Success: press shop")
|
||||
wait()
|
||||
|
||||
out = d(text="Enter a product name").set_text("desk")
|
||||
if out:
|
||||
print("Success: enter desk")
|
||||
wait()
|
||||
|
||||
out = d(text="desk", resourceId="org.mozilla.rocket.debug.ting:id/suggestion_item").click()
|
||||
if not out:
|
||||
print("Success: press desk")
|
||||
wait(15)
|
||||
|
||||
d.click(760, 544)
|
||||
print("Success: press Videos")
|
||||
wait(10)
|
||||
|
||||
out = d(className="android.webkit.WebView").swipe("up")
|
||||
if out:
|
||||
print("Success: scroll down")
|
||||
wait()
|
||||
|
||||
d.click(493, 1597)
|
||||
print("Success: press Video")
|
||||
wait(30)
|
||||
|
||||
d.click(549, 608)
|
||||
print("Success: press Video")
|
||||
wait(5)
|
||||
|
||||
d.click(1020, 875)
|
||||
print("Success: press Video")
|
||||
wait(1)
|
||||
|
||||
d.click(1020, 875)
|
||||
print("Success: press Video")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,71 @@
|
|||
# bug reproduction script for bug #4942 of firefoxlite
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
os.system(
|
||||
"adb root && adb shell am start -n org.mozilla.rocket.debug.ting/org.mozilla.focus.activity.MainActivity")
|
||||
# d.app_start("org.mozilla.rocket.debug.ting")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "org.mozilla.rocket.debug.ting":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.shell("settings put global always_finish_activities 1")
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="YouTube").click()
|
||||
if not out:
|
||||
print("Success: press YouTube")
|
||||
wait(10)
|
||||
|
||||
d.press("home")
|
||||
print("Success: press home")
|
||||
|
||||
d.press("recent")
|
||||
print("Success: press recent")
|
||||
|
||||
out = d(text="Firefox Lite Dev").click()
|
||||
if not out:
|
||||
print("Success: press Firefox Lite Dev")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="org.mozilla.rocket.debug.ting:id/counter_box").click()
|
||||
if not out:
|
||||
print("Success: press Firefox Lite Dev")
|
||||
wait()
|
||||
|
||||
d.shell("settings put global always_finish_activities 0")
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,67 @@
|
|||
# bug reproduction script for bug #5085 of firefoxlite
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
os.system(
|
||||
"adb root && adb shell am start -n org.mozilla.rocket.debug.ting/org.mozilla.focus.activity.MainActivity")
|
||||
# d.app_start("org.mozilla.rocket.debug.ting")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "org.mozilla.rocket.debug.ting":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="org.mozilla.rocket.debug.ting:id/menu_icon").click()
|
||||
if not out:
|
||||
print("Success: press menu")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press Settings")
|
||||
wait()
|
||||
|
||||
out = d(text="Language").click()
|
||||
if not out:
|
||||
print("Success: press Language")
|
||||
wait()
|
||||
|
||||
out = d(text="Basa Jawa").click()
|
||||
if not out:
|
||||
print("Success: press Basa Jawa")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,84 @@
|
|||
# bug reproduction script for bug #1323 of Frost
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("com.pitchedapps.frost.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.pitchedapps.frost.debug":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="m_login_email").set_text("droidfuzzer@163.com")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="m_login_password").set_text("droid.fuzzing")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", text="Log In ").click()
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait(30)
|
||||
|
||||
out = d(text="SKIP").click()
|
||||
if out:
|
||||
print("SUCCESS: press SKIP")
|
||||
wait()
|
||||
|
||||
out = d(className="androidx.appcompat.app.ActionBar$Tab", index="3").click()
|
||||
if not out:
|
||||
print("Success: press menu")
|
||||
wait()
|
||||
|
||||
d.press("home")
|
||||
print("Success: press home")
|
||||
wait()
|
||||
|
||||
d.shell("svc data disable")
|
||||
|
||||
print("Success: disable network")
|
||||
wait()
|
||||
|
||||
d.app_stop("com.pitchedapps.frost.debug")
|
||||
print("stop app")
|
||||
wait()
|
||||
|
||||
d.app_start("com.pitchedapps.frost.debug")
|
||||
print("re-start app")
|
||||
wait()
|
||||
|
||||
d.shell("svc data enable")
|
||||
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,45 @@
|
|||
# bug reproduction script for bug #224 of MaterialFBook
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("me.zeeroooo.materialfb")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "me.zeeroooo.materialfb":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
x, y = d(className="android.webkit.WebView").center()
|
||||
d.long_click(x, y-105, duration=1)
|
||||
print("Success: long click web page")
|
||||
wait()
|
||||
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,89 @@
|
|||
# bug reproduction script for bug #745 of Omni-Notes
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("it.feio.android.omninotes")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "it.feio.android.omninotes":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="it.feio.android.omninotes:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="it.feio.android.omninotes:id/fab_note").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Content").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="it.feio.android.omninotes:id/menu_attachment").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Camera").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.android.camera2:id/shutter_button").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.android.camera2:id/done_button").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="it.feio.android.omninotes:id/root").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="it.feio.android.omninotes:id/gridview_item_picture").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,70 @@
|
|||
# bug reproduction script for bug #3222 of collect
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
os.system("adb root && adb shell am start -n org.odk.collect.android/org.odk.collect.android.activities.MainMenuActivity")
|
||||
#d.app_start("org.odk.collect.android")
|
||||
#d.shell("am start -n org.odk.collect.android/org.odk.collect.android.activities.MainMenuActivity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "org.odk.collect.android":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press more options")
|
||||
wait()
|
||||
|
||||
out = d(text="General Settings").click()
|
||||
if not out:
|
||||
print("Success: press General Settings")
|
||||
wait()
|
||||
|
||||
out = d(text="Form management").click()
|
||||
if not out:
|
||||
print("Success: press Form management")
|
||||
wait()
|
||||
|
||||
out = d(text="Hide old form versions").click()
|
||||
if not out:
|
||||
print("Success: press Hide old form versions")
|
||||
wait()
|
||||
|
||||
d.press("back")
|
||||
d.press("back")
|
||||
print("Success: doulbe back")
|
||||
|
||||
out = d(text="Fill Blank Form").click()
|
||||
if not out:
|
||||
print("Success: press Fill Blank Form")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,105 @@
|
|||
# bug reproduction script for bug #1385 of commons
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("fr.free.nrw.commons.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "fr.free.nrw.commons.debug":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/welcomeYesButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginUsername").set_text(
|
||||
"DroidFuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginPassword").set_text(
|
||||
"droid.fuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/loginButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Nearby").click()
|
||||
if not out:
|
||||
print("Success: press Nearby")
|
||||
wait(15)
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons.debug:id/action_display_list").click()
|
||||
if not out:
|
||||
print("Success: press display list")
|
||||
wait()
|
||||
|
||||
out = d(text="Genetic Information Research Institute").click()
|
||||
if not out:
|
||||
print("Success: press Genetic Information Research Institute")
|
||||
wait()
|
||||
|
||||
d.set_orientation("l")
|
||||
wait()
|
||||
d.freeze_rotation("n")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons.debug:id/action_display_list").click()
|
||||
if not out:
|
||||
print("Success: press display list")
|
||||
wait()
|
||||
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,121 @@
|
|||
# bug reproduction script for bug #1391 of commons
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("fr.free.nrw.commons.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "fr.free.nrw.commons.debug":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/welcomeYesButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginUsername").set_text(
|
||||
"DroidFuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginPassword").set_text(
|
||||
"droid.fuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/loginButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Nearby").click()
|
||||
if not out:
|
||||
print("Success: press Nearby")
|
||||
wait(15)
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons.debug:id/fab_recenter").click()
|
||||
if not out:
|
||||
print("SUCCESS: press center")
|
||||
wait()
|
||||
|
||||
d.press(697, 1085)
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons.debug:id/bottom_sheet_details").swipe("up")
|
||||
if not out:
|
||||
print("SUCCESS: swip up")
|
||||
wait()
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press Settings")
|
||||
wait()
|
||||
|
||||
out = d(text="Night mode").click()
|
||||
if not out:
|
||||
print("Success: press Night mode")
|
||||
wait()
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Nearby").click()
|
||||
if not out:
|
||||
print("Success: press Nearby")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,99 @@
|
|||
# bug reproduction script for bug #1581 of commons
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("fr.free.nrw.commons.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "fr.free.nrw.commons.debug":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.shell("settings put secure location_providers_allowed -gps")
|
||||
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/welcomeYesButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginUsername").set_text(
|
||||
"DroidFuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons.debug:id/loginPassword").set_text(
|
||||
"droid.fuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons.debug:id/loginButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Nearby").click()
|
||||
if not out:
|
||||
print("Success: press Nearby")
|
||||
wait()
|
||||
|
||||
out = d(text="ENABLE GPS").click()
|
||||
if not out:
|
||||
print("Success: press ENABLE GPS")
|
||||
wait()
|
||||
|
||||
d.shell("settings put secure location_providers_allowed +gps")
|
||||
print("Success: enable gps")
|
||||
wait()
|
||||
|
||||
d.press("back")
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,99 @@
|
|||
# bug reproduction script for bug #2123 of commons
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("fr.free.nrw.commons")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "fr.free.nrw.commons":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons:id/welcomeYesButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons:id/loginUsername").set_text(
|
||||
"DroidFuzzing2")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons:id/loginPassword").set_text(
|
||||
"droid.fuzzing2")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons:id/loginButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(10)
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("Success: press Open")
|
||||
wait()
|
||||
|
||||
out = d(text="Explore").click()
|
||||
if not out:
|
||||
print("Success: press Explore")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons:id/action_search").click()
|
||||
if not out:
|
||||
print("Success: press search")
|
||||
wait()
|
||||
|
||||
out = d(text="Search Commons").set_text("apple")
|
||||
if out:
|
||||
print("Success: set search text")
|
||||
wait(5)
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons:id/categoryImageView").click()
|
||||
if not out:
|
||||
print("Success: press the first pic")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,107 @@
|
|||
# bug reproduction script for bug #3244 of commons
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("fr.free.nrw.commons")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "fr.free.nrw.commons":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
wait()
|
||||
d.swipe_ext("left")
|
||||
print("swipe left")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons:id/finishTutorialButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons:id/login_username").set_text(
|
||||
"DroidFuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="fr.free.nrw.commons:id/login_password").set_text(
|
||||
"droid.fuzzing5")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
d.press("back")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.Button", resourceId="fr.free.nrw.commons:id/login_button").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(15)
|
||||
|
||||
out = d(text="NEARBY").click()
|
||||
if not out:
|
||||
print("Success: press NEARBY")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons:id/list_sheet").click()
|
||||
if not out:
|
||||
print("Success: press display list")
|
||||
wait()
|
||||
|
||||
out = d(text="Googleplex").click()
|
||||
if not out:
|
||||
print("Success: press Googleplex")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="fr.free.nrw.commons:id/cameraButton").click()
|
||||
if not out:
|
||||
print("Success: press Camera")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.android.camera2:id/shutter_button").click()
|
||||
if not out:
|
||||
print("Success: press Camera")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.android.camera2:id/done_button").click()
|
||||
if not out:
|
||||
print("Success: press Camera")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,55 @@
|
|||
# bug reproduction script for bug #73 of geohashdroid
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("net.exclaimindustries.geohashdroid")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.exclaimindustries.geohashdroid":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="Cool").click()
|
||||
if not out:
|
||||
print("Success: press Cool")
|
||||
wait()
|
||||
|
||||
out = d(text="GRATICULE").click()
|
||||
if not out:
|
||||
print("Success: press GRATICULE")
|
||||
wait()
|
||||
|
||||
out = d(text="Globalhash!").click()
|
||||
if not out:
|
||||
print("Success: press Globalhash!")
|
||||
wait()
|
||||
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,103 @@
|
|||
# bug reproduction script for bug #1918 of nextcloud
|
||||
# this one requires a 1080*1920 screen
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("com.nextcloud.client")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.nextcloud.client":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", resourceId="com.nextcloud.client:id/skip").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="com.nextcloud.client:id/hostUrlInput").set_text(
|
||||
"https://efss.qloud.my/")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.nextcloud.client:id/testServerButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(20)
|
||||
|
||||
d.click(537, 1188)
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="user").set_text("droidfuzzer@163.com")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="password").set_text("droid.fuzzing")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
out = d(text="Log in").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(text="Grant access").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(30)
|
||||
|
||||
out = d(description="Open").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="All files").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Nextcloud.png").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Send/Share").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,80 @@
|
|||
# bug reproduction script for bug #4026 of nextcloud
|
||||
# this one requires a 1080*1920 screen
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("com.nextcloud.client")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.nextcloud.client":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", resourceId="com.nextcloud.client:id/login").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="com.nextcloud.client:id/hostUrlInput").set_text(
|
||||
"https://efss.qloud.my/")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.nextcloud.client:id/testServerButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(20)
|
||||
|
||||
d.click(537, 1188)
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="user").set_text("droidfuzzer@163.com")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="password").set_text("droid.fuzzing")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
out = d(text="Log in").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(text="Grant access").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(30)
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,126 @@
|
|||
# bug reproduction script for bug #4792 of nextcloud
|
||||
# this one requires a 1080*1920 screen
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("com.nextcloud.client")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.nextcloud.client":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", resourceId="com.nextcloud.client:id/login").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="com.nextcloud.client:id/hostUrlInput").set_text(
|
||||
"https://efss.qloud.my/")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.nextcloud.client:id/testServerButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(20)
|
||||
|
||||
d.click(537, 1188)
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="user").set_text("droidfuzzer@163.com")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="password").set_text("droid.fuzzing")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Log in").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(text="Grant access").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(30)
|
||||
|
||||
out = d(description="Open sidebar").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Auto upload").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Set up a custom folder").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Remote folder").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="New folder").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Name").set_text("A")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Create").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
|
@ -0,0 +1,106 @@
|
|||
# bug reproduction script for bug #5173 of nextcloud
|
||||
# this one requires a 1080*1920 screen
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
for i in range(0, seconds):
|
||||
print("wait 1 second ..")
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
avd_serial = sys.argv[1]
|
||||
d = u2.connect(avd_serial)
|
||||
|
||||
d.app_start("com.nextcloud.client")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.nextcloud.client":
|
||||
break
|
||||
#d.app_start("org.odk.collect.android")
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", resourceId="com.nextcloud.client:id/login").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="com.nextcloud.client:id/hostUrlInput").set_text(
|
||||
"https://efss.qloud.my/")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.nextcloud.client:id/testServerButton").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(20)
|
||||
|
||||
d.click(537, 1188)
|
||||
|
||||
wait()
|
||||
out = d(className="android.widget.EditText", resourceId="user").set_text("droidfuzzer@163.com")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="password").set_text("droid.fuzzing")
|
||||
if out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Log in").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(5)
|
||||
|
||||
out = d(text="Grant access").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait(30)
|
||||
|
||||
out = d(description="Open sidebar").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Auto upload").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Set up a custom folder").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
out = d(text="Remote folder").click()
|
||||
if not out:
|
||||
print("SUCCESS")
|
||||
wait()
|
||||
|
||||
while True:
|
||||
d.service("uiautomator").stop()
|
||||
time.sleep(2)
|
||||
out = d.service("uiautomator").running()
|
||||
if not out:
|
||||
print("DISCONNECT UIAUTOMATOR2 SUCCESS")
|
||||
break
|
||||
time.sleep(2)
|
Loading…
Reference in New Issue