mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-04 10:44:23 +00:00
7b4802db83
- Created new test case with basic create group chat scenario. - Added specific data folder for `tst_groupChat`. - Removed deprecated data folder. - Added dynamic login (depending on the account). - Added global account information in `suite_status/data` folder. - Added new group chat validations, title, history texts, members added and send chat message. - Replaced some ids by objectNames. - Some improvements in `names.py`. - Onboarding objects refactor. Fixes #6444
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
from enum import Enum
|
|
import time
|
|
from drivers.SquishDriver import *
|
|
from drivers.SquishDriverVerification import *
|
|
from drivers.SDKeyboardCommands import *
|
|
|
|
|
|
class CreateChatComponents(Enum):
|
|
#MAIN_VIEW = "createChatView_view"
|
|
CONTACTS_LIST = "createChatView_contactsList"
|
|
CONFIRM_BTN = "createChatView_confirmBtn"
|
|
|
|
class StatusCreateChatScreen:
|
|
|
|
def select_user(self, name):
|
|
[found, user_obj] = self.__find_user(name)
|
|
if found:
|
|
return click_obj(user_obj)
|
|
return verify(found, "User not found: " + name)
|
|
|
|
def create_chat(self, members):
|
|
# Select members:
|
|
for member in members[0:]:
|
|
time.sleep(0.2) # It is important bc the list changes its content after selecting a user so, it needs a while to be updated
|
|
self.select_user(member[0])
|
|
|
|
# Confirm creation:
|
|
click_obj_by_name(CreateChatComponents.CONFIRM_BTN.value)
|
|
|
|
def __find_user(self, name):
|
|
[loaded, contactsList] = is_loaded(CreateChatComponents.CONTACTS_LIST.value)
|
|
if loaded:
|
|
for index in range(contactsList.count):
|
|
user = contactsList.itemAtIndex(index)
|
|
if(user.userName == name):
|
|
return True, user
|
|
return False, None
|
|
|
|
|