2022-06-08 00:17:02 +00:00
|
|
|
|
2022-06-07 15:19:52 +00:00
|
|
|
from screens.StatusMainScreen import StatusMainScreen
|
2022-06-07 23:37:11 +00:00
|
|
|
from screens.StatusChatScreen import StatusChatScreen
|
2022-07-20 12:14:50 +00:00
|
|
|
from screens.StatusCreateChatScreen import StatusCreateChatScreen
|
|
|
|
|
2022-06-07 15:19:52 +00:00
|
|
|
|
|
|
|
_statusMain = StatusMainScreen()
|
2022-06-07 23:37:11 +00:00
|
|
|
_statusChat = StatusChatScreen()
|
2022-07-20 12:14:50 +00:00
|
|
|
_statusCreateChatView = StatusCreateChatScreen()
|
2022-06-07 15:19:52 +00:00
|
|
|
|
|
|
|
@When("user joins chat room |any|")
|
|
|
|
def step(context, room):
|
2022-07-20 12:14:50 +00:00
|
|
|
_statusMain.join_chat_room(room)
|
|
|
|
|
|
|
|
@When("the user creates a group chat adding users")
|
|
|
|
def step(context):
|
|
|
|
_statusMain.open_start_chat_view()
|
|
|
|
_statusCreateChatView.create_chat(context.table)
|
|
|
|
|
|
|
|
@When("the user clicks on |any| chat")
|
|
|
|
def step(context, chatName):
|
|
|
|
_statusMain.open_chat(chatName)
|
2022-06-07 15:19:52 +00:00
|
|
|
|
2022-06-07 23:37:11 +00:00
|
|
|
@Then("user is able to send chat message")
|
|
|
|
def step(context):
|
|
|
|
table = context.table
|
|
|
|
for row in table[1:]:
|
2022-07-20 12:14:50 +00:00
|
|
|
_statusChat.send_message(row[0])
|
|
|
|
_statusChat.verify_last_message_sent(row[0])
|
|
|
|
|
|
|
|
@Then("the group chat is created")
|
|
|
|
def step(context):
|
|
|
|
_statusChat = StatusChatScreen()
|
|
|
|
|
|
|
|
@Then("the group chat history contains \"|any|\" message")
|
|
|
|
def step(context, createdTxt):
|
|
|
|
_statusChat.verify_chat_created_message_is_displayed_in_history(createdTxt)
|
|
|
|
|
|
|
|
@Then("the group chat title is |any|")
|
|
|
|
def step(context, title):
|
|
|
|
_statusChat.verify_chat_title(title)
|
|
|
|
|
|
|
|
@Then("the group chat contains the following members")
|
|
|
|
def step(context):
|
|
|
|
_statusChat.verify_members_added(context.table)
|
|
|
|
|
|
|
|
@Then("the group chat is up to chat sending \"|any|\" message")
|
|
|
|
def step(context, message):
|
|
|
|
_statusChat.send_message(message)
|
2022-07-28 18:58:19 +00:00
|
|
|
_statusChat.verify_last_message_sent(message)
|
|
|
|
|
|
|
|
@Then("the user can reply to the message at index |any| with \"|any|\"")
|
|
|
|
def step(context, message_index, message):
|
|
|
|
_statusChat.reply_to_message_at_index(message_index, message)
|
2022-07-20 12:14:50 +00:00
|
|
|
_statusChat.verify_last_message_sent(message)
|