Skip to content

Commit

Permalink
wait for group info to load
Browse files Browse the repository at this point in the history
  • Loading branch information
NavpreetDevpuri committed Oct 17, 2020
1 parent 965f346 commit 654e4f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 5 additions & 1 deletion tithiwa/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def _wait_for_group_to_open_then_exit(self, groupname):
self._exit_from_group()

def _exit_from_group(self):
self._wait_for_group_info_to_load()
chatinfo = self._wait_for_an_presence_of_element(SELECTORS.CHATROOM.INFO).get_attribute('innerText')
if chatinfo.find('You') == -1:
print(f'{STRINGS.CHECK_CHAR} Done. You are already exited the group.')
Expand All @@ -180,7 +181,10 @@ def _exit_from_group(self):
def _wait_for_group_info_to_load(self):
chatinfo = 'click here for group info'
while chatinfo == 'click here for group info':
chatinfo = self._wait_for_an_presence_of_element(SELECTORS.CHATROOM.INFO).get_attribute('innerText')
try:
chatinfo = self._wait_for_an_presence_of_element(SELECTORS.CHATROOM.INFO).get_attribute('innerText')
except:
pass

# create_group('yeh', ["Navpreet Devpuri"])

Expand Down
10 changes: 3 additions & 7 deletions tithiwa/temp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
# tithiwabot.generate_session()
tithiwabot.open_session()

tithiwabot.create_group("Group made by tithiwa1", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa2", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa3", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa4", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa5", ["Navpreet Devpuri"])
tithiwabot.exit_from_group('Group made by tithiwa3')
tithiwabot.exit_from_groups(['Group made by tithiwa3', 'Group made by tithiwa4', 'Group made by tithiwa1'])
tithiwabot.create_group("Group made by tithiwa", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa", ["Navpreet Devpuri"])
tithiwabot.create_group("Group made by tithiwa", ["Navpreet Devpuri"])
tithiwabot.exit_from_all_groups()
# tithiwabot.chatroom.send_message_to_number("919592140593", "Yess, from tithiwa")
# tithiwabot.quit()
Expand Down

0 comments on commit 654e4f4

Please sign in to comment.