Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Testing started at 11:46 PM ...
- /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
- 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
- ============================= test session starts ==============================
- platform darwin -- Python 3.7.0, pytest-3.8.1, py-1.6.0, pluggy-0.7.1
- rootdir: /Users/i.mamutkina/PycharmProjects/python_training/test, inifile:
- plugins: bdd-3.0.0, allure-pytest-2.5.4collected 1 item
- test_delete_group_from_contact.py F
- test_delete_group_from_contact.py:5 (test_delete_group_from_contact)
- app = <fixture.application.Application object at 0x1088af4e0>
- orm = <fixture.orm.ORMFixture object at 0x1089f7f28>
- def test_delete_group_from_contact(app, orm):
- # If group list is empty, then add new group
- if len(orm.get_group_list()) == 0:
- app.group.open_groups_page()
- app.group.create(Group(name="Group for adding contact"))
- # Get again group list because it could be changed after if conditions
- group_list = orm.get_group_list()
- # Get contact list from random selected group
- selected_group = random.choice(group_list)
- #if len(orm.get_contacts_in_group(selected_group)) == 0:
- #app.navigation.open_edit_page()
- #app.contact.create(
- #Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
- #photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
- #company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
- #work="99887744556",
- #fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
- #email3="cat_3@gmail.com", homepage="Changed homepage",
- #bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
- #address2="123 Main str, 40 apr, San Carlos",
- #phone2="385263354", notes="New changed notes!"))
- contact_list = orm.get_contacts_in_group(selected_group)
- if len(contact_list) == 0:
- app.navigation.open_home_page()
- if len(orm.get_contact_list()) == 0:
- app.navigation.open_edit_page()
- app.contact.create(
- Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
- photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
- company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
- work="99887744556",
- fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
- email3="cat_3@gmail.com", homepage="Changed homepage",
- bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
- address2="123 Main str, 40 apr, San Carlos",
- phone2="385263354", notes="New changed notes!"))
- contact_list = orm.get_contacts_in_group(selected_group)
- selected_contact = random.choice(orm.get_contact_list())
- #app.contact.select_contact_by_id(selected_contact.id)
- app.navigation.open_home_page()
- app.contact.add_group_to_contact(selected_contact.id)
- # Get count of contacts which are inside selected group
- count_contacts_in_group_before_deleting_contact = len(contact_list)
- # Choose one random contact from this list
- app.navigation.open_home_page()
- > selected_contact = random.choice(contact_list)
- test_delete_group_from_contact.py:51:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <random.Random object at 0x7ff503888418>, seq = []
- def choice(self, seq):
- """Choose a random element from a non-empty sequence."""
- try:
- i = self._randbelow(len(seq))
- except ValueError:
- > raise IndexError('Cannot choose from an empty sequence') from None
- E IndexError: Cannot choose from an empty sequence
- /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py:261: IndexError
- [100%]
- =================================== FAILURES ===================================
- ________________________ test_delete_group_from_contact ________________________
- app = <fixture.application.Application object at 0x1088af4e0>
- orm = <fixture.orm.ORMFixture object at 0x1089f7f28>
- def test_delete_group_from_contact(app, orm):
- # If group list is empty, then add new group
- if len(orm.get_group_list()) == 0:
- app.group.open_groups_page()
- app.group.create(Group(name="Group for adding contact"))
- # Get again group list because it could be changed after if conditions
- group_list = orm.get_group_list()
- # Get contact list from random selected group
- selected_group = random.choice(group_list)
- #if len(orm.get_contacts_in_group(selected_group)) == 0:
- #app.navigation.open_edit_page()
- #app.contact.create(
- #Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
- #photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
- #company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
- #work="99887744556",
- #fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
- #email3="cat_3@gmail.com", homepage="Changed homepage",
- #bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
- #address2="123 Main str, 40 apr, San Carlos",
- #phone2="385263354", notes="New changed notes!"))
- contact_list = orm.get_contacts_in_group(selected_group)
- if len(contact_list) == 0:
- app.navigation.open_home_page()
- if len(orm.get_contact_list()) == 0:
- app.navigation.open_edit_page()
- app.contact.create(
- Contact(firstname="Ekaterina", middlename="E.Smithes", lastname="Smithes", nickname="Cat",
- photo="/Users/i.mamutkina/Desktop/photo.png", title="Manager",
- company="Facebook", address="13 Main str, 9 apr, SF", home="1122334455", mobile="33221166554",
- work="99887744556",
- fax="fax-745-126-789", email="cat_1@gmail.com", email2="cat_2@gmail.com",
- email3="cat_3@gmail.com", homepage="Changed homepage",
- bday="10", bmonth="April", byear="1998", aday="19", amonth="December", ayear="1999",
- address2="123 Main str, 40 apr, San Carlos",
- phone2="385263354", notes="New changed notes!"))
- contact_list = orm.get_contacts_in_group(selected_group)
- selected_contact = random.choice(orm.get_contact_list())
- #app.contact.select_contact_by_id(selected_contact.id)
- app.navigation.open_home_page()
- app.contact.add_group_to_contact(selected_contact.id)
- # Get count of contacts which are inside selected group
- count_contacts_in_group_before_deleting_contact = len(contact_list)
- # Choose one random contact from this list
- app.navigation.open_home_page()
- > selected_contact = random.choice(contact_list)
- test_delete_group_from_contact.py:51:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <random.Random object at 0x7ff503888418>, seq = []
- def choice(self, seq):
- """Choose a random element from a non-empty sequence."""
- try:
- i = self._randbelow(len(seq))
- except ValueError:
- > raise IndexError('Cannot choose from an empty sequence') from None
- E IndexError: Cannot choose from an empty sequence
- /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py:261: IndexError
- ========================== 1 failed in 15.36 seconds ===========================
- Process finished with exit code 0
Add Comment
Please, Sign In to add comment