feat(@DesktopApp): Basic Chat Scenario (Squish Test)

Ticket: https://github.com/status-im/status-desktop/issues/5718

Include Basic chat Scenario
This commit is contained in:
femi 2022-06-07 16:19:52 +01:00 committed by Olufemi Ade-Olusile
parent c7888f5aed
commit 3c81a9dcfc
10 changed files with 154 additions and 7 deletions

View File

@ -1,7 +1,37 @@
# ******************************************************************************
# Status.im
# *****************************************************************************/
# /**
# * \file StatusChatScreen.py
# *
# * \date June 2022
# * \brief Chat Main Screen.
# *****************************************************************************/
from enum import Enum
from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *
class ChatComponents(Enum):
StatusIcon = "statusIcon_StatusIcon_2"
PUBLIC_CHAT_ICON = "mainWindow_dropRectangle_Rectangle"
JOIN_PUBLIC_CHAT = "join_public_chat_StatusMenuItemDelegate"
class ChatNamePopUp(Enum):
CHAT_NAME_TEXT = "chat_name_PlaceholderText"
class StatusChatScreen:
def __init__(self):
pass
verify_screen_is_loaded(MainScreenComponents.SEARCH_TEXT_FIELD.value)
def joinChatRoom(self, room):
click_obj_by_name(MainScreenComponents.PUBLIC_CHAT_ICON.value)
click_obj_by_name(MainScreenComponents.JOIN_PUBLIC_CHAT.value)
type(ChatNamePopUp.CHAT_NAME_TEXT.value, room)

View File

@ -0,0 +1,39 @@
# ******************************************************************************
# Status.im
# *****************************************************************************/
# /**
# * \file StatusMainScreen.py
# *
# * \date June 2022
# * \brief Home Screen.
# *****************************************************************************/
from enum import Enum
from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *
class MainScreenComponents(Enum):
SEARCH_TEXT_FIELD = "mainWindow_edit_TextEdit"
PUBLIC_CHAT_ICON = "mainWindow_dropRectangle_Rectangle"
JOIN_PUBLIC_CHAT = "join_public_chat_StatusMenuItemDelegate"
class ChatNamePopUp(Enum):
CHAT_NAME_TEXT = "chat_name_PlaceholderText"
INPUT_ROOM_TOPIC_TEXT = "inputValue_StyledTextField"
class StatusMainScreen:
def __init__(self):
verify_screen_is_loaded(MainScreenComponents.SEARCH_TEXT_FIELD.value)
def joinChatRoom(self, room):
click_obj_by_name(MainScreenComponents.PUBLIC_CHAT_ICON.value)
click_obj_by_name(MainScreenComponents.JOIN_PUBLIC_CHAT.value)
type(ChatNamePopUp.INPUT_ROOM_TOPIC_TEXT.value, room)
#type(ChatNamePopUp.CHAT_NAME_TEXT.value, room)

View File

@ -7,12 +7,14 @@
# * \date May 2022
# * \brief Sign Up and Login for new users to the app.
# *****************************************************************************/
from enum import Enum
from drivers.SquishDriver import *
from drivers.SquishDriverVerification import *
class AgreementPopUp(Enum):
OK_GOT_IT_BUTTON = "mainWindow_Ok_got_it_StatusBaseText"
ACKNOWLEDGE_CHECKBOX = "acknowledge_checkbox"
TERMS_OF_USE_CHECK_BOX = "termsOfUseCheckBox_StatusCheckBox"
GET_STARTED_BUTTON = "getStartedStatusButton_StatusButton"
@ -37,9 +39,10 @@ class SignUpComponents(Enum):
class StatusWelcomeScreen:
def __init__(self):
verify_screen_is_loaded(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
verify_screen_is_loaded(AgreementPopUp.OK_GOT_IT_BUTTON.value)
def agree_terms_conditions_and_generate_new_key(self):
click_obj_by_name(AgreementPopUp.OK_GOT_IT_BUTTON.value)
click_obj_by_name(AgreementPopUp.ACKNOWLEDGE_CHECKBOX.value)
check_obj_by_name(AgreementPopUp.TERMS_OF_USE_CHECK_BOX.value)
click_obj_by_name(AgreementPopUp.GET_STARTED_BUTTON.value)

View File

@ -38,3 +38,19 @@ mainWindow_Passwords_don_t_match_StatusBaseText = {"container": statusDesktop_ma
mainWindow_inputRectangle_Rectangle = {"container": statusDesktop_mainWindow, "id": "inputRectangle", "occurrence": 2, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_inputRectangle_Rectangle_2 = {"container": statusDesktop_mainWindow, "id": "inputRectangle", "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_You_will_not_be_able_to_recover_this_password_if_it_is_lost_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "You will not be able to recover this password if it is lost.", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_Ok_got_it_StatusBaseText = {"container": statusDesktop_mainWindow, "text": "Ok, got it", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_background_Rectangle = {"container": statusDesktop_mainWindow, "id": "background", "type": "Rectangle", "unnamed": 1, "visible": True}
o_Rectangle = {"container": statusDesktop_mainWindow_overlay, "occurrence": 2, "type": "Rectangle", "unnamed": 1, "visible": True}
edit_TextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
background_Rectangle = {"container": statusDesktop_mainWindow_overlay, "id": "background", "type": "Rectangle", "unnamed": 1, "visible": True}
statusIcon_StatusIcon = {"container": statusDesktop_mainWindow_overlay, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/clear.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
statusIcon_StatusIcon_2 = {"container": statusDesktop_mainWindow_overlay, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/close.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
o_Rectangle_2 = {"container": statusDesktop_mainWindow_overlay, "type": "Rectangle", "unnamed": 1, "visible": True}
mainWindow_statusIcon_StatusIcon = {"container": statusDesktop_mainWindow, "id": "statusIcon", "source": "qrc:/StatusQ/src/assets/img/icons/arrow-right.svg", "type": "StatusIcon", "unnamed": 1, "visible": True}
join_public_chat_StatusMenuItemDelegate = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "text": "Join public chat", "type": "StatusMenuItemDelegate", "unnamed": 1, "visible": True}
chat_name_PlaceholderText = {"container": statusDesktop_mainWindow_overlay, "text": "chat-name", "type": "PlaceholderText", "unnamed": 1, "visible": True}
inputValue_StyledTextField = {"container": statusDesktop_mainWindow_overlay, "echoMode": 0, "id": "inputValue", "type": "StyledTextField", "unnamed": 1, "visible": True}
start_chat_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "text": "Start chat", "type": "StatusBaseText", "unnamed": 1, "visible": True}
mainWindow_scrollView_ScrollView = {"container": statusDesktop_mainWindow, "id": "scrollView", "type": "ScrollView", "unnamed": 1, "visible": True}
scrollView_messageInputField_TextArea = {"container": mainWindow_scrollView_ScrollView, "id": "messageInputField", "type": "TextArea", "unnamed": 1, "visible": True}
reactionImage_SVGImage = {"container": statusDesktop_mainWindow_overlay, "id": "reactionImage", "source": "qrc:/imports/assets/icons/emojiReactions/heart.svg", "type": "SVGImage", "unnamed": 1, "visible": True}

View File

@ -0,0 +1,14 @@
from screens.StatusMainScreen import StatusMainScreen
_statusMain = StatusMainScreen()
@When("user joins chat room |any|")
def step(context, room):
_statusMain.joinChatRoom(room)
@Then("user is able to send chat message |any|")
def step(context, message):
StatusMainScreen()

View File

@ -1,6 +1,6 @@
from screens.StatusWelcomeScreen import StatusWelcomeScreen
from screens.StatusChatScreen import StatusChatScreen
from screens.StatusMainScreen import StatusMainScreen
_welcomeScreen = StatusWelcomeScreen()
@ -22,4 +22,4 @@ def step(context, username):
@Then("the user lands on the signed in app")
def step(context):
StatusChatScreen()
StatusMainScreen()

View File

@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_statusLoginPassword
TEST_CASES=tst_statusLoginPassword tst_basicChatFlow
VERSION=3
WRAPPERS=Qt

View File

@ -0,0 +1,18 @@
# This is a sample .feature file
# Squish feature files use the Gherkin language for describing features, a short example
# is given below. You can find a more extensive introduction to the Gherkin format at
# https://cucumber.io/docs/gherkin/reference/
Feature: Status Desktop Chat
As a user I want to join a room and chat.
The following scenarios cover basic chat flows.
Background:
Given A first time user lands on the status desktop and generates new key
When user inputs username tester123 and password TesTEr16843/!@00
Then the user lands on the signed in app
Scenario: User joins a room and chats
When user joins chat room test
Then user is able to send chat message Hello

View File

@ -0,0 +1,8 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps', '../shared/chatSteps')
def main():
testSettings.throwOnFailure = True
runFeatureFile('test.feature')

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
import names
def main():
startApplication("nim_status_client")
type(waitForObject(names.loginView_passwordInput), "Tester111//")
type(waitForObject(names.loginView_passwordInput), "<Return>")
type(waitForObject(names.loginView_passwordInput), "Tester111//")
type(waitForObject(names.loginView_passwordInput), "<Return>")
mouseClick(waitForObject(names.mainWindow_Enter_password_PlaceholderText), Qt.ShiftModifier, Qt.LeftButton)
type(waitForObject(names.loginView_passwordInput), "<Ctrl+V>")
mouseClick(waitForObject(names.mainWindow_dropRectangle_Rectangle), 309, 75, Qt.ShiftModifier + Qt.ControlModifier, Qt.LeftButton)
mouseClick(waitForObject(names.join_public_chat_StatusMenuItemDelegate), 45, 11, Qt.ShiftModifier + Qt.ControlModifier, Qt.LeftButton)
type(waitForObject(names.inputValue_StyledTextField), "test")
mouseClick(waitForObject(names.start_chat_StatusBaseText), Qt.ShiftModifier + Qt.ControlModifier, Qt.LeftButton)
mouseClick(waitForObject(names.mainWindow_dropRectangle_Rectangle), 144, 69, Qt.ShiftModifier + Qt.ControlModifier, Qt.LeftButton)
type(waitForObject(names.edit_TextEdit), "test")