Guest User

Untitled

a guest
Dec 3rd, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.54 KB | None | 0 0
  1. Testing started at 11:46 PM ...
  2. /usr/local/bin/python3.7 "/Applications/PyCharm CE.app/Contents/helpers/pycharm/_jb_pytest_runner.py" --path /Users/i.mamutkina/PycharmProjects/python_training/test/test_delete_group_from_contact.py
  3. Launching pytest with arguments /Users/i.mamutkina/PycharmProjects/python_training/test/test_delete_group_from_contact.py in /Users/i.mamutkina/PycharmProjects/python_training/test
  4.  
  5. ============================= test session starts ==============================
  6. platform darwin -- Python 3.7.0, pytest-3.8.1, py-1.6.0, pluggy-0.7.1
  7. rootdir: /Users/i.mamutkina/PycharmProjects/python_training/test, inifile:
  8. plugins: bdd-3.0.0, allure-pytest-2.5.4collected 1 item
  9.  
  10. test_delete_group_from_contact.py F
  11. test_delete_group_from_contact.py:5 (test_delete_group_from_contact)
  12. app = <fixture.application.Application object at 0x1088af4e0>
  13. orm = <fixture.orm.ORMFixture object at 0x1089f7f28>
  14.  
  15. def test_delete_group_from_contact(app, orm):
  16. # If group list is empty, then add new group
  17. if len(orm.get_group_list()) == 0:
  18. app.group.open_groups_page()
  19. app.group.create(Group(name="Group for adding contact"))
  20. # Get again group list because it could be changed after if conditions
  21. group_list = orm.get_group_list()
  22. # Get contact list from random selected group
  23. selected_group = random.choice(group_list)
  24. #if len(orm.get_contacts_in_group(selected_group)) == 0:
  25. #app.navigation.open_edit_page()
  26. #app.contact.create(
  27. #Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
  28. #photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
  29. #company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
  30. #work="99887744556",
  31. #fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
  32. #email3="cat_3@gmail.com", homepage="Changed homepage",
  33. #bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
  34. #address2="123 Main str, 40 apr, San Carlos",
  35. #phone2="385263354", notes="New changed notes!"))
  36. contact_list = orm.get_contacts_in_group(selected_group)
  37. if len(contact_list) == 0:
  38. app.navigation.open_home_page()
  39. if len(orm.get_contact_list()) == 0:
  40. app.navigation.open_edit_page()
  41. app.contact.create(
  42. Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
  43. photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
  44. company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
  45. work="99887744556",
  46. fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
  47. email3="cat_3@gmail.com", homepage="Changed homepage",
  48. bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
  49. address2="123 Main str, 40 apr, San Carlos",
  50. phone2="385263354", notes="New changed notes!"))
  51. contact_list = orm.get_contacts_in_group(selected_group)
  52. selected_contact = random.choice(orm.get_contact_list())
  53. #app.contact.select_contact_by_id(selected_contact.id)
  54. app.navigation.open_home_page()
  55. app.contact.add_group_to_contact(selected_contact.id)
  56. # Get count of contacts which are inside selected group
  57. count_contacts_in_group_before_deleting_contact = len(contact_list)
  58. # Choose one random contact from this list
  59. app.navigation.open_home_page()
  60. > selected_contact = random.choice(contact_list)
  61.  
  62. test_delete_group_from_contact.py:51:
  63. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  64.  
  65. self = <random.Random object at 0x7ff503888418>, seq = []
  66.  
  67. def choice(self, seq):
  68. """Choose a random element from a non-empty sequence."""
  69. try:
  70. i = self._randbelow(len(seq))
  71. except ValueError:
  72. > raise IndexError('Cannot choose from an empty sequence') from None
  73. E IndexError: Cannot choose from an empty sequence
  74.  
  75. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py:261: IndexError
  76. [100%]
  77.  
  78. =================================== FAILURES ===================================
  79. ________________________ test_delete_group_from_contact ________________________
  80.  
  81. app = <fixture.application.Application object at 0x1088af4e0>
  82. orm = <fixture.orm.ORMFixture object at 0x1089f7f28>
  83.  
  84. def test_delete_group_from_contact(app, orm):
  85. # If group list is empty, then add new group
  86. if len(orm.get_group_list()) == 0:
  87. app.group.open_groups_page()
  88. app.group.create(Group(name="Group for adding contact"))
  89. # Get again group list because it could be changed after if conditions
  90. group_list = orm.get_group_list()
  91. # Get contact list from random selected group
  92. selected_group = random.choice(group_list)
  93. #if len(orm.get_contacts_in_group(selected_group)) == 0:
  94. #app.navigation.open_edit_page()
  95. #app.contact.create(
  96. #Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
  97. #photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
  98. #company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
  99. #work="99887744556",
  100. #fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
  101. #email3="cat_3@gmail.com", homepage="Changed homepage",
  102. #bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
  103. #address2="123 Main str, 40 apr, San Carlos",
  104. #phone2="385263354", notes="New changed notes!"))
  105. contact_list = orm.get_contacts_in_group(selected_group)
  106. if len(contact_list) == 0:
  107. app.navigation.open_home_page()
  108. if len(orm.get_contact_list()) == 0:
  109. app.navigation.open_edit_page()
  110. app.contact.create(
  111. Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
  112. photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
  113. company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
  114. work="99887744556",
  115. fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
  116. email3="cat_3@gmail.com", homepage="Changed homepage",
  117. bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
  118. address2="123 Main str, 40 apr, San Carlos",
  119. phone2="385263354", notes="New changed notes!"))
  120. contact_list = orm.get_contacts_in_group(selected_group)
  121. selected_contact = random.choice(orm.get_contact_list())
  122. #app.contact.select_contact_by_id(selected_contact.id)
  123. app.navigation.open_home_page()
  124. app.contact.add_group_to_contact(selected_contact.id)
  125. # Get count of contacts which are inside selected group
  126. count_contacts_in_group_before_deleting_contact = len(contact_list)
  127. # Choose one random contact from this list
  128. app.navigation.open_home_page()
  129. > selected_contact = random.choice(contact_list)
  130.  
  131. test_delete_group_from_contact.py:51:
  132. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  133.  
  134. self = <random.Random object at 0x7ff503888418>, seq = []
  135.  
  136. def choice(self, seq):
  137. """Choose a random element from a non-empty sequence."""
  138. try:
  139. i = self._randbelow(len(seq))
  140. except ValueError:
  141. > raise IndexError('Cannot choose from an empty sequence') from None
  142. E IndexError: Cannot choose from an empty sequence
  143.  
  144. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py:261: IndexError
  145. ========================== 1 failed in 15.36 seconds ===========================
  146. Process finished with exit code 0
Add Comment
Please, Sign In to add comment