Merge branch 'master' of github.com:the-themis-benchmarks/home
This commit is contained in:
commit
a3e83bf489
|
@ -0,0 +1,94 @@
|
|||
# bug reproduction script for bug #118 of ActivityDiary
|
||||
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.rampro.activitydiary.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "de.rampro.activitydiary.debug":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
# click the Sleeping activity
|
||||
out = d(className="android.widget.TextView", text="Sleeping").click()
|
||||
if not out:
|
||||
print("Success: press Sleeping activity")
|
||||
wait()
|
||||
|
||||
# click the Sleeping activity
|
||||
out = d(className="android.widget.ImageButton", resourceId="de.rampro.activitydiary.debug:id/fab_attach_picture").click()
|
||||
if not out:
|
||||
print("Success: press Camera")
|
||||
wait()
|
||||
|
||||
# click camera button
|
||||
out = d(className="android.widget.ImageView",
|
||||
resourceId="com.android.camera2:id/shutter_button").click()
|
||||
if not out:
|
||||
print("Success: press taking picture")
|
||||
wait()
|
||||
|
||||
# click confirm
|
||||
out = d(className="android.widget.ImageButton",
|
||||
resourceId="com.android.camera2:id/done_button").click()
|
||||
if not out:
|
||||
print("Success: press picture confirmation")
|
||||
wait()
|
||||
|
||||
# click the Cinema activity
|
||||
out = d(className="android.widget.TextView", text="Cinema").click()
|
||||
if not out:
|
||||
print("Success: press Cinema activity")
|
||||
wait()
|
||||
|
||||
# click the Navigation
|
||||
out = d(className="android.widget.ImageButton", description="Open Navigation").click()
|
||||
if not out:
|
||||
print("Success: press Navigation")
|
||||
wait()
|
||||
|
||||
# click the Diary
|
||||
out = d(className="android.widget.CheckedTextView", text="Diary").click()
|
||||
if not out:
|
||||
print("Success: press Diary")
|
||||
wait()
|
||||
|
||||
# long click the image
|
||||
out = d(className="android.widget.ImageView",
|
||||
resourceId="de.rampro.activitydiary.debug:id/picture").long_click()
|
||||
if out:
|
||||
print("Success: long click the image")
|
||||
wait()
|
||||
|
||||
# click the Okay
|
||||
out = d(className="android.widget.Button",
|
||||
text="OK").click()
|
||||
if not out:
|
||||
print("Success: long click the ok")
|
||||
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,91 @@
|
|||
# bug reproduction script for bug #285 of ActivityDiary
|
||||
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.rampro.activitydiary.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "de.rampro.activitydiary.debug":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
# click the Navigation
|
||||
out = d(className="android.widget.ImageButton", description="Open navigation").click()
|
||||
if not out:
|
||||
print("Success: press Navigation")
|
||||
wait()
|
||||
|
||||
# click the Settings
|
||||
out = d(className="android.widget.CheckedTextView", text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press Settings")
|
||||
wait()
|
||||
|
||||
# scroll down the settings
|
||||
out = d(className="android.support.v7.widget.RecyclerView", resourceId="de.rampro.activitydiary.debug:id/recycler_view").swipe("up")
|
||||
if out:
|
||||
print("Success: Scroll down")
|
||||
wait()
|
||||
|
||||
# scroll down the settings
|
||||
out = d(className="android.support.v7.widget.RecyclerView",
|
||||
resourceId="de.rampro.activitydiary.debug:id/recycler_view").swipe("up")
|
||||
if out:
|
||||
print("Success: scroll down")
|
||||
wait()
|
||||
|
||||
# click Location Service
|
||||
out = d(className="android.widget.TextView", text="Location Service").click()
|
||||
if not out:
|
||||
print("Success: press Location Service")
|
||||
wait()
|
||||
|
||||
# click Network
|
||||
out = d(className="android.widget.CheckedTextView", text="Network").click()
|
||||
if not out:
|
||||
print("Success: press Network")
|
||||
wait()
|
||||
|
||||
# click Update period
|
||||
out = d(className="android.widget.TextView", text="Update period").click()
|
||||
if not out:
|
||||
print("Success: press update period")
|
||||
wait()
|
||||
|
||||
# set the edittext to empty
|
||||
out = d(className="android.widget.EditText").set_text(text="")
|
||||
if out:
|
||||
print("Success: set text to empty")
|
||||
wait()
|
||||
|
||||
# click Ok
|
||||
out = d(className="android.widget.Button", text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
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,77 @@
|
|||
# bug reproduction script for bug #1232 of AFM
|
||||
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.amaze.filemanager")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.amaze.filemanager":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="Alarms").long_click()
|
||||
if out:
|
||||
print("Success: long click Alarms")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/cpy").click()
|
||||
if not out:
|
||||
print("Success: press copy")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ListView", resourceId="com.amaze.filemanager:id/menu_drawer")\
|
||||
.child(index="2").click()
|
||||
if not out:
|
||||
print("Success: press sdcard")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/paste").click()
|
||||
if not out:
|
||||
print("Success: press paste")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="OPEN").click()
|
||||
if not out:
|
||||
print("Success: press paste")
|
||||
wait(5)
|
||||
|
||||
out = d(className="android.widget.TextView", text="SDCARD").click()
|
||||
if not out:
|
||||
print("Success: press sdcard")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", text="SELECT").click()
|
||||
if not out:
|
||||
print("Success: press SELECT")
|
||||
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,77 @@
|
|||
# bug reproduction script for bug #1558 of AFM
|
||||
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.amaze.filemanager")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.amaze.filemanager":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="Alarms").long_click()
|
||||
if out:
|
||||
print("Success: long click Alarms")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/cpy").click()
|
||||
if not out:
|
||||
print("Success: press copy")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ListView", resourceId="com.amaze.filemanager:id/menu_drawer")\
|
||||
.child(index="2").click()
|
||||
if not out:
|
||||
print("Success: press sdcard")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/paste").click()
|
||||
if not out:
|
||||
print("Success: press paste")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="OPEN").click()
|
||||
if not out:
|
||||
print("Success: press paste")
|
||||
wait(5)
|
||||
|
||||
out = d(className="android.widget.TextView", text="SDCARD").click()
|
||||
if not out:
|
||||
print("Success: press sdcard")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", text="SELECT").click()
|
||||
if not out:
|
||||
print("Success: press SELECT")
|
||||
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,81 @@
|
|||
# bug reproduction script for bug #1796 of AFM
|
||||
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.amaze.filemanager")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.amaze.filemanager":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="Alarms").click()
|
||||
if not out:
|
||||
print("Success: press Alarms")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.amaze.filemanager:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press plus")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", resourceId="com.amaze.filemanager:id/menu_new_folder").click()
|
||||
if not out:
|
||||
print("Success: press Folder")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="com.amaze.filemanager:id/singleedittext_input").set_text(text="test")
|
||||
if out:
|
||||
print("Success: set folder name")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="CREATE").click()
|
||||
if not out:
|
||||
print("Success: press CREATE")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="test").long_click()
|
||||
if out:
|
||||
print("Success: long click test")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/cut").click()
|
||||
if not out:
|
||||
print("Success: press cut")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="test").click()
|
||||
if not out:
|
||||
print("Success: press test")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager:id/paste").click()
|
||||
if not out:
|
||||
print("Success: press paste")
|
||||
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,65 @@
|
|||
# bug reproduction script for bug #1887 of AFM
|
||||
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.amaze.filemanager.debug")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.amaze.filemanager.debug":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="Android").click()
|
||||
if not out:
|
||||
print("Success: press Android")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", text="data").click()
|
||||
if not out:
|
||||
print("Success: press data")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.TextView", resourceId="com.amaze.filemanager.debug:id/search").click()
|
||||
if not out:
|
||||
print("Success: press search")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText", resourceId="com.amaze.filemanager.debug:id/search_edit_text").set_text(text="com")
|
||||
if out:
|
||||
print("Success: set folder name")
|
||||
wait()
|
||||
|
||||
d.set_orientation('l')
|
||||
|
||||
out = d(className="android.widget.Button", text="SEARCH").click()
|
||||
if not out:
|
||||
print("Success: press data")
|
||||
wait()
|
||||
|
||||
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)
|
|
@ -0,0 +1,96 @@
|
|||
# bug reproduction script for bug #4200 of ankidroid
|
||||
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.shell("settings put global always_finish_activities 1")
|
||||
|
||||
d.app_start("com.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_note_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout")\
|
||||
.child(className="android.widget.RelativeLayout", index="1")\
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("test")
|
||||
if not out:
|
||||
print("Success: set front text")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/action_save").click()
|
||||
if not out:
|
||||
print("Success: press save")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(text="Default").click()
|
||||
if not out:
|
||||
print("Success: press default")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press more options")
|
||||
wait()
|
||||
|
||||
out = d(text="Edit note").click()
|
||||
if not out:
|
||||
print("Success: press Edit Note")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="3") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("you")
|
||||
if not out:
|
||||
print("Success: set back text")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/action_save").click()
|
||||
if not out:
|
||||
print("Success: press save")
|
||||
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,134 @@
|
|||
# bug reproduction script for bug #4451of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press settings")
|
||||
wait()
|
||||
|
||||
out = d(text="Gestures").click()
|
||||
if not out:
|
||||
print("Success: press gentures")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="android:id/checkbox").click()
|
||||
if not out:
|
||||
print("Success: check enable gestures")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(text="Reviewing").click()
|
||||
if not out:
|
||||
print("Success: press reviewing")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ListView").swipe("up", steps=10)
|
||||
if not out:
|
||||
print("Success: scroll down")
|
||||
wait(1)
|
||||
|
||||
out = d(text="Fullscreen mode").click()
|
||||
if not out:
|
||||
print("Success: press full screen mode")
|
||||
wait()
|
||||
|
||||
out = d(text="Hide the system bars and answer buttons").click()
|
||||
if not out:
|
||||
print("Success: press Hide the system bars and answer buttons")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_note_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="1") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("test")
|
||||
if out:
|
||||
print("Success: set front text")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="3") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("you")
|
||||
if out:
|
||||
print("Success: set back text")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/action_save").click()
|
||||
if not out:
|
||||
print("Success: press save")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(text="Default").click()
|
||||
if not out:
|
||||
print("Success: press default")
|
||||
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,66 @@
|
|||
# bug reproduction script for bug #4707 of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_note_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="1") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_media_button").click()
|
||||
if not out:
|
||||
print("Success: press front media")
|
||||
wait()
|
||||
|
||||
out = d(text="Add image").click()
|
||||
if not out:
|
||||
print("Success: press Add image")
|
||||
wait()
|
||||
|
||||
out = d(text="CAMERA").click()
|
||||
if not out:
|
||||
print("Success: press Add image")
|
||||
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,61 @@
|
|||
# bug reproduction script for bug #4977 of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_shared_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
d.press("back")
|
||||
print("Success: press back")
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(text="Card browser").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,56 @@
|
|||
# bug reproduction script for bug #5638 of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_note_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="1") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("\")
|
||||
if not out:
|
||||
print("Success: set front text")
|
||||
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,116 @@
|
|||
# bug reproduction script for bug #5756 of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/fab_expand_menu_button").click()
|
||||
if not out:
|
||||
print("Success: press fab button")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/add_note_action").click()
|
||||
if not out:
|
||||
print("Success: press add")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout",
|
||||
resourceId="com.ichi2.anki:id/CardEditorEditFieldsLayout") \
|
||||
.child(className="android.widget.RelativeLayout", index="1") \
|
||||
.child(resourceId="com.ichi2.anki:id/id_note_editText").set_text("aaa")
|
||||
if not out:
|
||||
print("Success: set front text")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="com.ichi2.anki:id/action_save").click()
|
||||
if not out:
|
||||
print("Success: press save")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press more options")
|
||||
wait()
|
||||
|
||||
out = d(text="Create filtered deck").click()
|
||||
if not out:
|
||||
print("Success: press Create filtered deck")
|
||||
wait()
|
||||
|
||||
out = d(text="CREATE").click()
|
||||
if not out:
|
||||
print("Success: press CREATE")
|
||||
wait()
|
||||
|
||||
out = d(text="cards selected by").click()
|
||||
if not out:
|
||||
print("Success: press cards selected by")
|
||||
wait()
|
||||
|
||||
out = d(text="Random").click()
|
||||
if not out:
|
||||
print("Success: Random")
|
||||
wait()
|
||||
|
||||
out = d(text="cards selected by").click()
|
||||
if not out:
|
||||
print("Success: press cards selected by")
|
||||
wait()
|
||||
|
||||
out = d(text="Oldest seen first").click()
|
||||
if not out:
|
||||
print("Success: Oldest seen first")
|
||||
wait()
|
||||
|
||||
x, y = d(description="Navigate up").center()
|
||||
d.double_click(x, y, duration=0.5)
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(description="", resourceId="", className="android.widget.ImageButton").click()
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(text="Filtered Deck 1").click()
|
||||
if not out:
|
||||
print("Success: Filtered Deck 1")
|
||||
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,128 @@
|
|||
# bug reproduction script for bug #6145 of ankidroid
|
||||
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.ichi2.anki")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "com.ichi2.anki":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press settings")
|
||||
wait()
|
||||
|
||||
out = d(text="AnkiDroid").click()
|
||||
if not out:
|
||||
print("Success: press AnkiDroid")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ListView").swipe("up", steps=10)
|
||||
if not out:
|
||||
print("Success: scroll down")
|
||||
wait(1)
|
||||
|
||||
out = d(text="Language").click()
|
||||
if not out:
|
||||
print("Success: press Language")
|
||||
wait()
|
||||
|
||||
out = d(text="Chinese (China)").click()
|
||||
if not out:
|
||||
print("Success: press Chinese (China)")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(text="Settings").click()
|
||||
if not out:
|
||||
print("Success: press settings")
|
||||
wait()
|
||||
|
||||
out = d(text="高级设置").click()
|
||||
if not out:
|
||||
print("Success: press 高级设置")
|
||||
wait()
|
||||
|
||||
for x in range(6):
|
||||
out = d(className="android.widget.ListView").swipe("up", steps=10)
|
||||
if not out:
|
||||
print("Success: scroll down")
|
||||
wait(1)
|
||||
|
||||
out = d(text="实验性 V2 调度器").click()
|
||||
if not out:
|
||||
print("Success: press 实验性 V2 调度器")
|
||||
wait()
|
||||
|
||||
out = d(text="确定").click()
|
||||
if not out:
|
||||
print("Success: press 确定")
|
||||
wait()
|
||||
|
||||
out = d(description="转到上一层级").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(description="转到上一层级").click()
|
||||
if not out:
|
||||
print("Success: press navigation")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press more options")
|
||||
wait()
|
||||
|
||||
out = d(text="Export collection").click()
|
||||
if not out:
|
||||
print("Success: press Export collection")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
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 #261 of andbible
|
||||
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.bible.android.activity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.bible.android.activity":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(30)
|
||||
|
||||
out = d(text="AB").click()
|
||||
if not out:
|
||||
print("Success: press AB")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
out = d(text="Bible").click()
|
||||
if not out:
|
||||
print("Success: press Bible")
|
||||
wait()
|
||||
|
||||
out = d(text="Book").click()
|
||||
if not out:
|
||||
print("Success: press Book")
|
||||
wait()
|
||||
|
||||
out = d(text="BaptistConfession1646").click()
|
||||
if not out:
|
||||
print("Success: press BaptistConfession1646")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(5)
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", resourceId="net.bible.android.activity:id/homeButton").click()
|
||||
if not out:
|
||||
print("Success: press home")
|
||||
wait()
|
||||
|
||||
out = d(text="Choose Document").click()
|
||||
if not out:
|
||||
print("Success: press Choose Document")
|
||||
wait()
|
||||
|
||||
out = d(text="Bible").click()
|
||||
if not out:
|
||||
print("Success: press Bible")
|
||||
wait()
|
||||
|
||||
out = d(text="Book").click()
|
||||
if not out:
|
||||
print("Success: press Book")
|
||||
wait()
|
||||
|
||||
out = d(text="BaptistConfession1646").click()
|
||||
if not out:
|
||||
print("Success: press BaptistConfession1646")
|
||||
wait()
|
||||
|
||||
out = d(text="Confession").click()
|
||||
if not out:
|
||||
print("Success: press Confession")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.ImageButton", resourceId="net.bible.android.activity:id/homeButton").click()
|
||||
if not out:
|
||||
print("Success: press home")
|
||||
wait()
|
||||
|
||||
out = d(text="Find").click()
|
||||
if not out:
|
||||
print("Success: press Find")
|
||||
wait()
|
||||
|
||||
out = d(text="CREATE").click()
|
||||
if not out:
|
||||
print("Success: press Find")
|
||||
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,252 @@
|
|||
# bug reproduction script for bug #261 of andbible
|
||||
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.bible.android.activity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.bible.android.activity":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(30)
|
||||
|
||||
out = d(text="AB").click()
|
||||
if not out:
|
||||
print("Success: press AB")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
for x in range(6):
|
||||
out = d(className="android.widget.ListView",
|
||||
resourceId="android:id/list").swipe("up")
|
||||
if not out:
|
||||
print("Success: scroll down")
|
||||
wait(1)
|
||||
|
||||
out = d(text="JPS").click()
|
||||
if not out:
|
||||
print("Success: press JPS")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
out = d(className="android.widget.ListView",
|
||||
resourceId="android:id/list").swipe("up")
|
||||
if out:
|
||||
print("Success: scroll down")
|
||||
wait()
|
||||
|
||||
out = d(text="KJV").click()
|
||||
if not out:
|
||||
print("Success: press KJV")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", text="⊕").click()
|
||||
if not out:
|
||||
print("Success: press plus")
|
||||
wait()
|
||||
|
||||
out = d(className="android.view.View", text="5 And God called the light Day, and the darkness He called Night, "
|
||||
"and there was evening and there was morning, the first day.").click()
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.FrameLayout", index="2").click()
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
out = d(text="JPS").click()
|
||||
if not out:
|
||||
print("Success: press JPS")
|
||||
wait()
|
||||
|
||||
out = d(text="KJV").click()
|
||||
if not out:
|
||||
print("Success: press KJV")
|
||||
wait()
|
||||
|
||||
out = d(className="android.view.View", text="5 And God called the light Day, and the darkness He called Night, "
|
||||
"and there was evening and there was morning, the first day.").click()
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
out = d(text="JPS").click()
|
||||
if not out:
|
||||
print("Success: press JPS")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press More options")
|
||||
wait()
|
||||
|
||||
out = d(text="Tabs").click()
|
||||
if not out:
|
||||
print("Success: press Tabs")
|
||||
wait()
|
||||
|
||||
out = d(text="New Tab").click()
|
||||
if not out:
|
||||
print("Success: press new Tabs")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.Button", text="⊕").click()
|
||||
if not out:
|
||||
print("Success: press plus")
|
||||
wait()
|
||||
|
||||
out = d(className="android.view.View", text="5 And God called the light Day, and the darkness He called Night, "
|
||||
"and there was evening and there was morning, the first day.").click()
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.FrameLayout", index="2").click()
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
if not out:
|
||||
print("Success: press 1.4")
|
||||
wait()
|
||||
|
||||
out = d(text="KJV").click()
|
||||
if not out:
|
||||
print("Success: press KJV")
|
||||
wait()
|
||||
|
||||
out = d(text="AB").click()
|
||||
if not out:
|
||||
print("Success: press AB")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press More options")
|
||||
wait()
|
||||
|
||||
out = d(text="Tabs").click()
|
||||
if not out:
|
||||
print("Success: press Tabs")
|
||||
wait()
|
||||
|
||||
out = d(text="Switch to Tab …").click()
|
||||
if not out:
|
||||
print("Success: press Switch to Tab …")
|
||||
wait()
|
||||
|
||||
out = d(text="Tab 1: Gen 1:1, Gen 1:1").click()
|
||||
if not out:
|
||||
print("Success: press Tab 1: Gen 1:1, Gen 1:1")
|
||||
wait()
|
||||
|
||||
out = d(text="7225").click()
|
||||
if not out:
|
||||
print("Success: press 7225")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(className="android.view.View", text="5 And G-d called the light Day, and the darkness He called Night. "
|
||||
"And there was evening and there was morning, one day. ").click()
|
||||
if not out:
|
||||
print("Success: press 1.5")
|
||||
wait()
|
||||
|
||||
out = d(text="Jewish Publication Society Old Testament", resourceId="net.bible.android.activity:id/documentTitle").long_click(duration=1)
|
||||
if out:
|
||||
print("Success: long click title")
|
||||
wait()
|
||||
|
||||
out = d(text="JPS").long_click(duration=1)
|
||||
if out:
|
||||
print("Success: long click JPS")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/delete").click()
|
||||
if not out:
|
||||
print("Success: press delete")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(description="Navigate up").click()
|
||||
if not out:
|
||||
print("Success: press Back")
|
||||
wait()
|
||||
|
||||
out = d(description="More options").click()
|
||||
if not out:
|
||||
print("Success: press More options")
|
||||
wait()
|
||||
|
||||
out = d(text="Tabs").click()
|
||||
if not out:
|
||||
print("Success: press Tabs")
|
||||
wait()
|
||||
|
||||
out = d(text="Switch to Tab …").click()
|
||||
if not out:
|
||||
print("Success: press Switch to Tab …")
|
||||
wait()
|
||||
|
||||
out = d(text="Tab 2: Gen 1:1, Gen 1:1").click()
|
||||
if not out:
|
||||
print("Success: press Tab 2: Gen 1:1, Gen 1:1")
|
||||
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,113 @@
|
|||
# bug reproduction script for bug #480 of andbible
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
print("wait for " + str(seconds) + " second")
|
||||
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.bible.android.activity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.bible.android.activity":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(30)
|
||||
|
||||
out = d(text="AB").click()
|
||||
if not out:
|
||||
print("Success: press AB")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(description="Menu").click()
|
||||
if not out:
|
||||
print("Success: press Menu")
|
||||
wait()
|
||||
|
||||
out = d(text="Manage Bookmark Labels").click()
|
||||
if not out:
|
||||
print("Success: press Manage Bookmark Labels")
|
||||
wait()
|
||||
|
||||
out = d(text="NEW LABEL").click()
|
||||
if not out:
|
||||
print("Success: press NEW LABEL")
|
||||
wait()
|
||||
|
||||
out = d(text="Name").set_text("first")
|
||||
if out:
|
||||
print("Success: set name first")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="NEW LABEL").click()
|
||||
if not out:
|
||||
print("Success: press NEW LABEL")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.LinearLayout", index="1").child(resourceId="net.bible.android.activity:id/deleteLabel").click()
|
||||
if not out:
|
||||
print("Success: press delete")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/editLabel").click()
|
||||
if not out:
|
||||
print("Success: press NEW LABEL")
|
||||
wait()
|
||||
|
||||
out = d(text="Name").set_text("second")
|
||||
if out:
|
||||
print("Success: set name second")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
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,124 @@
|
|||
# bug reproduction script for bug #697 of andbible
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
print("wait for " + str(seconds) + " second")
|
||||
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.bible.android.activity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.bible.android.activity":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="YES").click()
|
||||
if not out:
|
||||
print("Success: press YES")
|
||||
wait(30)
|
||||
|
||||
out = d(text="KJV").click()
|
||||
if not out:
|
||||
print("Success: press KJV")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(10)
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="I UNDERSTAND").click()
|
||||
if not out:
|
||||
print("Success: press I UNDERSTAND")
|
||||
wait()
|
||||
|
||||
for x in range(20):
|
||||
out = d(className="android.webkit.WebView").swipe("down", steps=10)
|
||||
if not out:
|
||||
print("Success: scroll down")
|
||||
wait(1)
|
||||
|
||||
out = d(resourceId="1.1").long_click()
|
||||
if out:
|
||||
print("Success: long click 1.1")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/myNoteAddEdit").click()
|
||||
if not out:
|
||||
print("Success: press note")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText").click()
|
||||
if not out:
|
||||
print("Success: press edit text")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText").set_text("hello")
|
||||
if not out:
|
||||
print("Success: set note")
|
||||
wait()
|
||||
|
||||
out = d.press("back")
|
||||
out = d.press("back")
|
||||
if not out:
|
||||
print("Success: double back")
|
||||
wait()
|
||||
|
||||
out = d(text="pencil16x16").click()
|
||||
if not out:
|
||||
print("Success: press note")
|
||||
wait()
|
||||
|
||||
out = d(className="android.widget.EditText").set_text("world")
|
||||
if not out:
|
||||
print("Success: set note")
|
||||
wait()
|
||||
|
||||
out = d.press("back")
|
||||
if not out:
|
||||
print("Success: press back")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/homeButton").click()
|
||||
if not out:
|
||||
print("Success: press home")
|
||||
wait()
|
||||
|
||||
out = d(text="My Notes").click()
|
||||
if not out:
|
||||
print("Success: press My Notes")
|
||||
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 #703 of andbible
|
||||
import sys
|
||||
import time
|
||||
|
||||
import uiautomator2 as u2
|
||||
|
||||
|
||||
def wait(seconds=2):
|
||||
print("wait for " + str(seconds) + " second")
|
||||
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.bible.android.activity")
|
||||
wait()
|
||||
|
||||
current_app = d.app_current()
|
||||
print(current_app)
|
||||
while True:
|
||||
if current_app['package'] == "net.bible.android.activity":
|
||||
break
|
||||
time.sleep(2)
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="YES").click()
|
||||
if not out:
|
||||
print("Success: press YES")
|
||||
wait(30)
|
||||
|
||||
out = d(text="KJV").click()
|
||||
if not out:
|
||||
print("Success: press KJV")
|
||||
wait()
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait(15)
|
||||
|
||||
out = d(text="OK").click()
|
||||
if not out:
|
||||
print("Success: press OK")
|
||||
wait()
|
||||
|
||||
out = d(text="I UNDERSTAND").click()
|
||||
if not out:
|
||||
print("Success: press I UNDERSTAND")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="3.20").long_click()
|
||||
if out:
|
||||
print("Success: long click 3.20")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/myNoteAddEdit").click()
|
||||
if not out:
|
||||
print("Success: press note")
|
||||
wait()
|
||||
|
||||
out = d(resourceId="net.bible.android.activity:id/searchButton").click()
|
||||
if not out:
|
||||
print("Success: press search")
|
||||
wait()
|
||||
|
||||
out = d(text="CREATE").click()
|
||||
if not out:
|
||||
print("Success: press create")
|
||||
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