-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cases.py
More file actions
82 lines (70 loc) · 2.03 KB
/
Copy pathtest_cases.py
File metadata and controls
82 lines (70 loc) · 2.03 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
75
76
77
78
79
80
81
82
import unittest
from appium.webdriver.common.mobileby import MobileBy
from page_objects import MainScreen, NoteScreen
from driver import Driver
from testdata import TestData
class NotesTestCases(unittest.TestCase):
def setUp(self):
"""
Initializes a driver
"""
self.driver = Driver()
def test_verify_empty_notes(self):
"""
Verifies if main screen is empty
"""
main = MainScreen(self.driver)
main.get_started_btn()
main.google_offer_skip()
main.is_empty()
def test_add_a_note(self):
"""
Adds a new note
"""
main = MainScreen(self.driver)
note = NoteScreen(self.driver)
main.add_a_note()
note.add_title()
note.go_back_to_main()
main.verify_if_note_exist(TestData.title)
def test_search_a_note(self):
"""
Search for a note
"""
main = MainScreen(self.driver)
note = NoteScreen(self.driver)
main.search_a_note()
note.go_back_to_main()
def test_edit_a_note(self):
"""
Edits a note
"""
main = MainScreen(self.driver)
note = NoteScreen(self.driver)
main.open_a_note()
note.edit_note_title()
note.go_back_to_main()
main.verify_if_note_exist(TestData.edited_title)
def test_search_not_existed_note(self):
"""
Search a note by old title - before edition
"""
main = MainScreen(self.driver)
main.search_a_note_no_result()
def test_delete_a_note(self):
"""
Deletes a note
"""
main = MainScreen(self.driver)
note = NoteScreen(self.driver)
main.open_a_note()
note.delete_a_note()
main.is_empty()
def tearDown(self):
"""
Turns off a driver
"""
self.driver.instance.quit()
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(NotesTestCases)
unittest.TextTestRunner(verbosity=2).run(suite)