diff --git a/APhotoManager/script-#116.py b/APhotoManager/script-#116.py new file mode 100644 index 0000000..c1a007b --- /dev/null +++ b/APhotoManager/script-#116.py @@ -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) diff --git a/AnkiDroid/script-#4200.py b/AnkiDroid/script-#4200.py index 7139e75..00e3294 100644 --- a/AnkiDroid/script-#4200.py +++ b/AnkiDroid/script-#4200.py @@ -10,13 +10,51 @@ def wait(seconds=2): print("wait 1 second ..") time.sleep(1) +def enAbleDontKeepA(d): + d.press("home") + wait() + + out = d(resourceId="com.android.launcher3:id/layout").child(index="1").child(index="2").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search Apps…").set_text("Settings") + if out: + print("SUCCESS") + wait() + + out = d(resourceId="com.android.launcher3:id/icon", text="Settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Search settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search…").set_text("keep activities") + if out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() if __name__ == '__main__': avd_serial = sys.argv[1] d = u2.connect(avd_serial) - d.shell("settings put global always_finish_activities 1") + enAbleDontKeepA(d) d.app_start("com.ichi2.anki") wait() @@ -85,7 +123,7 @@ if __name__ == '__main__': print("Success: press save") wait() - d.shell("settings put global always_finish_activities 0") + while True: d.service("uiautomator").stop() time.sleep(2) diff --git a/FirefoxLite/script-#4881.py b/FirefoxLite/script-#4881.py new file mode 100644 index 0000000..ba7d5d9 --- /dev/null +++ b/FirefoxLite/script-#4881.py @@ -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) diff --git a/FirefoxLite/script-#4942.py b/FirefoxLite/script-#4942.py new file mode 100644 index 0000000..3137438 --- /dev/null +++ b/FirefoxLite/script-#4942.py @@ -0,0 +1,107 @@ +# 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) + +def enAbleDontKeepA(d): + d.press("home") + wait() + + out = d(resourceId="com.android.launcher3:id/layout").child(index="1").child(index="2").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search Apps…").set_text("Settings") + if out: + print("SUCCESS") + wait() + + out = d(resourceId="com.android.launcher3:id/icon", text="Settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Search settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search…").set_text("keep activities") + if out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + +if __name__ == '__main__': + + avd_serial = sys.argv[1] + d = u2.connect(avd_serial) + + enAbleDontKeepA(d) + + 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(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() + + 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) diff --git a/FirefoxLite/script-#5085.py b/FirefoxLite/script-#5085.py new file mode 100644 index 0000000..4de132e --- /dev/null +++ b/FirefoxLite/script-#5085.py @@ -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) diff --git a/Frost/script-#1323.py b/Frost/script-#1323.py new file mode 100644 index 0000000..61b02c1 --- /dev/null +++ b/Frost/script-#1323.py @@ -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) diff --git a/MaterialFBook/script-#224.py b/MaterialFBook/script-#224.py new file mode 100644 index 0000000..ec469a3 --- /dev/null +++ b/MaterialFBook/script-#224.py @@ -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) diff --git a/Omni-Notes/script-#745.py b/Omni-Notes/script-#745.py new file mode 100644 index 0000000..010af7f --- /dev/null +++ b/Omni-Notes/script-#745.py @@ -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) diff --git a/Phonograph/music1.mp3 b/Phonograph/music1.mp3 new file mode 100644 index 0000000..0479bbf Binary files /dev/null and b/Phonograph/music1.mp3 differ diff --git a/Phonograph/music2.mp3 b/Phonograph/music2.mp3 new file mode 100644 index 0000000..d1cb097 Binary files /dev/null and b/Phonograph/music2.mp3 differ diff --git a/Phonograph/script-#112.py b/Phonograph/script-#112.py new file mode 100644 index 0000000..e926d41 --- /dev/null +++ b/Phonograph/script-#112.py @@ -0,0 +1,53 @@ +# bug reproduction script for bug #112 of Phonograph +# This one requires two songs in the music folder +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 push music1.mp3 sdcard/Music") + os.system("adb push music2.mp3 sdcard/Music") + + d.app_start("com.kabouzeid.gramophone.debug") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.kabouzeid.gramophone.debug": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(text="GET STARTED").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="SHUFFLE ALL").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) diff --git a/Scarlet-Notes/script-#114.py b/Scarlet-Notes/script-#114.py new file mode 100644 index 0000000..48e11d9 --- /dev/null +++ b/Scarlet-Notes/script-#114.py @@ -0,0 +1,123 @@ +# bug reproduction script for bug #114 of Scarlet-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("com.bijoysingh.quicknote") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.bijoysingh.quicknote": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(resourceId="com.bijoysingh.quicknote:id/lithoBottomToolbar").child(index="0").child(index="1").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Add Notebook").set_text("myBook") + if out: + print("SUCCESS") + wait() + + d.press("enter") + print("SUCCESS") + wait() + + out = d(text="myBook").click() + if out: + print("SUCCESS") + wait() + + + out = d(resourceId="com.bijoysingh.quicknote:id/lithoBottomToolbar", index="2").child(index="0").child(index="3").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Add Heading…").set_text("Note1") + if out: + print("SUCCESS") + wait() + + d.press("back") + print("SUCCESS") + wait() + + d.press("back") + print("SUCCESS") + wait() + + out = d(resourceId="com.bijoysingh.quicknote:id/lithoBottomToolbar", index="2").child(index="0").child(index="3").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Add Heading…").set_text("Note2") + if out: + print("SUCCESS") + wait() + + d.press("back") + print("SUCCESS") + wait() + + d.press("back") + print("SUCCESS") + wait() + + out = d(text="Note1").long_click() + if out: + print("SUCCESS") + wait() + + d.press("back") + wait() + + out = d(text="Lock Note").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="com.bijoysingh.quicknote:id/lithoBottomToolbar", index="2").child(index="0").child(index="0").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Locked").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="com.bijoysingh.quicknote:id/lithoPreBottomToolbar", index="1").click(offset=(0.05, 0.5)) + 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) diff --git a/WordPress/script-#10302.py b/WordPress/script-#10302.py new file mode 100644 index 0000000..5749bdc --- /dev/null +++ b/WordPress/script-#10302.py @@ -0,0 +1,50 @@ +# bug reproduction script for bug #10302 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(text="HELP").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) diff --git a/WordPress/script-#10363.py b/WordPress/script-#10363.py new file mode 100644 index 0000000..ef56e7c --- /dev/null +++ b/WordPress/script-#10363.py @@ -0,0 +1,96 @@ +# bug reproduction script for bug #10363 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.TextView", resourceId="org.wordpress.android:id/login_site_button_text").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input").set_text( + "testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Blog Posts").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Switch to list view").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) diff --git a/WordPress/script-#10547.py b/WordPress/script-#10547.py new file mode 100644 index 0000000..7a24eca --- /dev/null +++ b/WordPress/script-#10547.py @@ -0,0 +1,157 @@ +# bug reproduction script for bug #10547 of wordpress +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) + +def enAbleDontKeepA(d): + d.press("home") + wait() + + out = d(resourceId="com.android.launcher3:id/layout").child(index="1").child(index="2").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search Apps…").set_text("Settings") + if out: + print("SUCCESS") + wait() + + out = d(resourceId="com.android.launcher3:id/icon", text="Settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Search settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search…").set_text("keep activities") + if out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + +if __name__ == '__main__': + + avd_serial = sys.argv[1] + d = u2.connect(avd_serial) + + enAbleDontKeepA(d) + + d.app_start("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.TextView", resourceId="org.wordpress.android:id/login_site_button_text").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait(5) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/quick_action_buttons_container").child(index="2").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DRAFTS").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(text="Edit").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="More options").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Preview").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(description="Navigate up").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) diff --git a/WordPress/script-#10876.py b/WordPress/script-#10876.py new file mode 100644 index 0000000..d6b3838 --- /dev/null +++ b/WordPress/script-#10876.py @@ -0,0 +1,111 @@ +# bug reproduction script for bug #10876 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.TextView", resourceId="org.wordpress.android:id/login_site_button_text").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait(5) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/bottom_nav_new_post_button").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Share your story here…").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/format_bottom_bar_undo").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/format_bottom_bar_redo").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/format_bar_button_media_collapsed").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) diff --git a/WordPress/script-#11135.py b/WordPress/script-#11135.py new file mode 100644 index 0000000..43a94a2 --- /dev/null +++ b/WordPress/script-#11135.py @@ -0,0 +1,106 @@ +# bug reproduction script for bug #11135 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.TextView", resourceId="org.wordpress.android:id/login_site_button_text").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait(5) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/bottom_nav_reader_button").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(resourceId="org.wordpress.android:id/card_view").click() + if not out: + print("SUCCESS") + wait(5) + + out = d(resourceId="org.wordpress.android:id/count_comments").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/button_expand").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) diff --git a/WordPress/script-#11992.py b/WordPress/script-#11992.py new file mode 100644 index 0000000..ee1bb2d --- /dev/null +++ b/WordPress/script-#11992.py @@ -0,0 +1,155 @@ +# bug reproduction script for bug #11992 of wordpress +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) + +def enAbleDontKeepA(d): + d.press("home") + wait() + + out = d(resourceId="com.android.launcher3:id/layout").child(index="1").child(index="2").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search Apps…").set_text("Settings") + if out: + print("SUCCESS") + wait() + + out = d(resourceId="com.android.launcher3:id/icon", text="Settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Search settings").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search…").set_text("keep activities") + if out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Don’t keep activities").click() + if not out: + print("SUCCESS") + wait() + +if __name__ == '__main__': + + avd_serial = sys.argv[1] + d = u2.connect(avd_serial) + + enAbleDontKeepA(d) + + d.app_start("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.LinearLayout", resourceId="org.wordpress.android:id/login_site_button").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + wait(5) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/bottom_nav_reader_button").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(description="My Site. View your site and manage it, including stats.").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/scroll_view").swipe("up") + if not out: + print("SUCCESS") + wait() + + out = d(text="Blog Posts").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(description="Navigate up").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Blog Posts").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) diff --git a/WordPress/script-#6530.py b/WordPress/script-#6530.py new file mode 100644 index 0000000..b92358f --- /dev/null +++ b/WordPress/script-#6530.py @@ -0,0 +1,204 @@ +# bug reproduction script for bug #6530 of wordpress +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.android.camera2") + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.android.camera2": + break + # d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + for x in range(15): + out = d(resourceId="com.android.camera2:id/shutter_button").click() + if not out: + print("SUCCESS") + wait(3) + + + d.app_start("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/secondary_button").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="TextInputLayout", text="Username").child(className="android.widget.EditText").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + out = d(className="TextInputLayout", text="Password").child(className="android.widget.EditText").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + wait(10) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="TRY IT").click() + if not out: + print("SUCCESS") + wait() + + out = d(description="Navigate up").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Blog Posts").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/fab_button").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Share your story here…").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/format_bar_button_media").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="0").long_click() + if out: + print("SUCCESS") + wait() + + for x in range(2, 9): + out = d(resourceId="org.wordpress.android:id/recycler").child(index=str(x)).long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").swipe("up") + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="6").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="7").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="8").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").swipe("up") + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="6").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="7").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/recycler").child(index="8").long_click() + if out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/mnu_confirm_selection").click() + if not out: + print("SUCCESS") + wait(1) + + out = d(text="TURN ON").click() + if not out: + print("SUCCESS") + wait(1) + + out = d(description="Navigate up").click() + if not out: + print("SUCCESS") + wait(1) + + out = d(resourceId="org.wordpress.android:id/btn_trash").click() + if not out: + print("SUCCESS") + wait(1) + + out = d(text="DELETE").click() + if not out: + print("SUCCESS") + wait(1) + + 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) diff --git a/WordPress/script-#7182.py b/WordPress/script-#7182.py new file mode 100644 index 0000000..967e085 --- /dev/null +++ b/WordPress/script-#7182.py @@ -0,0 +1,85 @@ +# bug reproduction script for bug #7182 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/secondary_button").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="TextInputLayout", text="Username").child(className="android.widget.EditText").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + wait() + + out = d(className="TextInputLayout", text="Password").child(className="android.widget.EditText").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + d.set_orientation("l") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + wait(10) + + d.set_orientation("n") + + 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) diff --git a/WordPress/script-#8659.py b/WordPress/script-#8659.py new file mode 100644 index 0000000..6c9c8cf --- /dev/null +++ b/WordPress/script-#8659.py @@ -0,0 +1,125 @@ +# bug reproduction script for bug #8659 of wordpress +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("org.wordpress.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "org.wordpress.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/login_button").click() + if not out: + print("SUCCESS: press login button") + + wait() + out = d(className="android.widget.TextView", resourceId="org.wordpress.android:id/login_site_button_text").click() + if not out: + print("SUCCESS: press login in via site address") + + wait() + out = d(className="android.widget.EditText").set_text("testkkksite.wordpress.com") + if out: + print("SUCCESS: input site address") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Username").set_text( + "testkkksite") + if out: + print("SUCCESS: input user name") + + wait() + d.press("back") + + wait() + out = d(className="android.widget.EditText", resourceId="org.wordpress.android:id/input", text="Password").set_text( + "W11j141993") + if out: + print("SUCCESS: input password") + + wait() + out = d(className="android.widget.Button", resourceId="org.wordpress.android:id/primary_button").click() + if not out: + print("SUCCESS: press next") + wait(10) + + out = d(text="CONTINUE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="org.wordpress.android:id/nav_reader").click() + if not out: + print("SUCCESS") + wait(5) + + out = d(resourceId="org.wordpress.android:id/menu_reader_search").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Search WordPress").set_text("a") + if out: + print("SUCCESS") + wait() + + d.click(0.925, 0.9167) + wait() + + out = d(text="SITES").click() + if not out: + print("SUCCESS") + wait() + + for x in range(4): + out = d(resourceId="org.wordpress.android:id/recycler_view").swipe("up", steps=5) + if out: + print("SUCCESS") + + wait() + + out = d(resourceId="org.wordpress.android:id/recycler_view").child(index="7").click() + if not out: + print("SUCCESS") + wait(5) + + out = d(description="Navigate up").click() + if not out: + print("SUCCESS") + wait(5) + + 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) diff --git a/collect/script-#3222.py b/collect/script-#3222.py new file mode 100644 index 0000000..0bdefd2 --- /dev/null +++ b/collect/script-#3222.py @@ -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) diff --git a/commons/script-#1385.py b/commons/script-#1385.py new file mode 100644 index 0000000..c2821ac --- /dev/null +++ b/commons/script-#1385.py @@ -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) diff --git a/commons/script-#1391.py b/commons/script-#1391.py new file mode 100644 index 0000000..911554d --- /dev/null +++ b/commons/script-#1391.py @@ -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) diff --git a/commons/script-#1581.py b/commons/script-#1581.py new file mode 100644 index 0000000..d5d4e53 --- /dev/null +++ b/commons/script-#1581.py @@ -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) diff --git a/commons/script-#2123.py b/commons/script-#2123.py new file mode 100644 index 0000000..0c31495 --- /dev/null +++ b/commons/script-#2123.py @@ -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) diff --git a/commons/script-#3244.py b/commons/script-#3244.py new file mode 100644 index 0000000..f30d212 --- /dev/null +++ b/commons/script-#3244.py @@ -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) diff --git a/geohashdroid/script-#73.py b/geohashdroid/script-#73.py new file mode 100644 index 0000000..572aeca --- /dev/null +++ b/geohashdroid/script-#73.py @@ -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) diff --git a/nextcloud/script-#1918.py b/nextcloud/script-#1918.py new file mode 100644 index 0000000..dd5312b --- /dev/null +++ b/nextcloud/script-#1918.py @@ -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) diff --git a/nextcloud/script-#4026.py b/nextcloud/script-#4026.py new file mode 100644 index 0000000..3c58199 --- /dev/null +++ b/nextcloud/script-#4026.py @@ -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) diff --git a/nextcloud/script-#4792.py b/nextcloud/script-#4792.py new file mode 100644 index 0000000..51599df --- /dev/null +++ b/nextcloud/script-#4792.py @@ -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) diff --git a/nextcloud/script-#5173.py b/nextcloud/script-#5173.py new file mode 100644 index 0000000..1ec5d02 --- /dev/null +++ b/nextcloud/script-#5173.py @@ -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) diff --git a/open-event-attendee-android/script-#2198.py b/open-event-attendee-android/script-#2198.py new file mode 100644 index 0000000..07fb3c0 --- /dev/null +++ b/open-event-attendee-android/script-#2198.py @@ -0,0 +1,59 @@ +# bug reproduction script for bug #2198 of attendee +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.eventyay.attendee") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.eventyay.attendee": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(text="Skip").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Skip for now").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="com.eventyay.attendee:id/searchFragment").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Anything").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) diff --git a/openlauncher/script-#67.py b/openlauncher/script-#67.py new file mode 100644 index 0000000..91012e9 --- /dev/null +++ b/openlauncher/script-#67.py @@ -0,0 +1,53 @@ +# bug reproduction script for bug #67 of openlauncher +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.benny.openlauncher") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.benny.openlauncher": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(text="SKIP").click() + if not out: + print("SUCCESS") + wait() + + d.swipe(0.0, 0.5, 0.5, 0.5) + print("SUCCESS") + wait() + + out = d(resourceId="com.benny.openlauncher:id/minBar").child(index="6").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) diff --git a/osmeditor4android/script-#637.py b/osmeditor4android/script-#637.py new file mode 100644 index 0000000..ce283f1 --- /dev/null +++ b/osmeditor4android/script-#637.py @@ -0,0 +1,140 @@ +# bug reproduction script for bug #637 of osmeditor +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("de.blau.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "de.blau.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(text="OKAY").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/location_current").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="LOAD").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(resourceId="de.blau.android:id/menu_config").click() + if not out: + print("SUCCESS") + wait() + + for x in range(2): + out = d(resourceId="de.blau.android:id/list").swipe("up", steps=10) + if out: + print("SUCCESS") + wait(1) + + out = d(text="Validator preferences").click() + if not out: + print("SUCCESS") + wait() + + for x in range(6): + out = d(resourceId="de.blau.android:id/listViewResurvey").child(index="0").child(index="0").child(text="amenity").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DELETE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="name").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DELETE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="opening_hours").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DELETE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="wheelchair").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DELETE").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/listViewResurvey").child(index="0").child(index="0").child( + text="shop").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/resurvey_value").set_text("*") + if out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/display").set_text("0") + if out: + print("SUCCESS") + wait() + + out = d(text="SAVE").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="DONE").click() + if not out: + print("SUCCESS") + wait() + + d.press("back") + print("SUCCESS") + + 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) diff --git a/osmeditor4android/script-#729.py b/osmeditor4android/script-#729.py new file mode 100644 index 0000000..7bbe5b7 --- /dev/null +++ b/osmeditor4android/script-#729.py @@ -0,0 +1,94 @@ +# bug reproduction script for bug #729 of osmeditor +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("de.blau.android") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "de.blau.android": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(text="OKAY").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/location_current").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="LOAD").click() + if not out: + print("SUCCESS") + wait(10) + + out = d(resourceId="de.blau.android:id/map_view").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/floatingLock").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/map_view").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="android:id/select_dialog_listview").child(textContains="Footway").click() + if not out: + print("SUCCESS") + wait() + + out = d(resourceId="de.blau.android:id/cab_stub").child(index="0").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Presets").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Preset search string").set_text("search") + if out: + print("SUCCESS") + wait() + + out = d(className="android.widget.EditText", text="search").click(offset=(0.95, 0.5)) + 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) diff --git a/sunflower/script-#239.py b/sunflower/script-#239.py new file mode 100644 index 0000000..971a30e --- /dev/null +++ b/sunflower/script-#239.py @@ -0,0 +1,55 @@ +# bug reproduction script for bug #239 of sunflower +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.google.samples.apps.sunflower") + wait() + + current_app = d.app_current() + print(current_app) + while True: + if current_app['package'] == "com.google.samples.apps.sunflower": + break + #d.app_start("org.odk.collect.android") + time.sleep(2) + wait() + + out = d(description="Navigate up").click() + if not out: + print("SUCCESS") + wait() + + out = d(text="Plant list").click() + if not out: + print("SUCCESS") + wait() + + x1, y1 = d(text="Beet").center() + x2, y2 = d(text="Avocado").center() + + d(className="androidx.recyclerview.widget.RecyclerView").gesture((x1, y1), (x2, y2), (x1, y1), (x2, y2), steps=50) + print("SUCCESS") + + 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)