-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathguide_scripts.py
More file actions
77 lines (62 loc) · 2.83 KB
/
guide_scripts.py
File metadata and controls
77 lines (62 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import unittest
import uiautomator2 as u2
from time import sleep
from kea2 import interruptable, kea2_breakpoint
class Omni_Notes_Unittest_Sample(unittest.TestCase):
def setUp(self):
self.d = u2.connect()
def test_unittest_rotation(self):
self.d.set_orientation('l')
sleep(1)
self.d.set_orientation('n')
sleep(1)
self.d.set_orientation('r')
sleep(1)
self.d.set_orientation('n')
sleep(1)
@interruptable()
def test_unittest_add_note_add_category(self):
'''
add note -> add category
'''
self.d(resourceId="it.feio.android.omninotes.alpha:id/fab_expand_menu_button").long_click()
sleep(1)
self.d(resourceId="it.feio.android.omninotes.alpha:id/detail_content").set_text("Hello world")
sleep(2)
self.d(resourceId="it.feio.android.omninotes.alpha:id/menu_category").click()
sleep(0.5)
kea2_breakpoint()
self.d(resourceId="it.feio.android.omninotes.alpha:id/md_buttonDefaultPositive").click()
sleep(0.5)
self.d(resourceId="it.feio.android.omninotes.alpha:id/category_title").set_text("aaa")
self.d(resourceId="it.feio.android.omninotes.alpha:id/save").click()
@interruptable()
def test_unittest_delete_note_search(self):
'''
add note -> delete note -> search title
'''
self.d(resourceId="it.feio.android.omninotes.alpha:id/fab_expand_menu_button").long_click()
self.d(resourceId="it.feio.android.omninotes.alpha:id/detail_title").set_text("Hello112233")
self.d(resourceId="it.feio.android.omninotes.alpha:id/detail_content").set_text("Hello world")
self.d(description="drawer open").click()
self.d(resourceId="it.feio.android.omninotes.alpha:id/note_title").long_click()
self.d(description="More options").click()
self.d(text="Trash").click()
self.d(resourceId="it.feio.android.omninotes.alpha:id/menu_search").click()
self.d(resourceId="it.feio.android.omninotes.alpha:id/search_src_text").set_text("Hello112233")
self.d.press("enter")
@interruptable()
def test_unitttest_add_tag_show_tags(self):
'''
add note -> add tag -> show tags
'''
self.d(resourceId="it.feio.android.omninotes.alpha:id/fab_expand_menu_button").long_click()
self.d(resourceId="it.feio.android.omninotes.alpha:id/detail_content").set_text("hello kea2! #hello")
self.d(description = "More options").click()
if self.d(text="Disable checklist").exists():
self.d(text="Disable checklist").click()
else:
self.d.press("back")
self.d(resourceId="it.feio.android.omninotes.alpha:id/menu_tag").click()
def tearDown(self):
print("================default teardown=============")