feat(tst_chatsNavigation): Restored chats navigation tests

This commit is contained in:
Igor Sirotin 2022-11-18 18:25:47 +03:00 committed by Igor Sirotin
parent 93eaf0fdfd
commit a8406b9158
6 changed files with 63 additions and 27 deletions

View File

@ -69,7 +69,7 @@ def step(context, text, obj):
@When("the user clicks on the following ui-component \"|any|\"") @When("the user clicks on the following ui-component \"|any|\"")
def step(context: any, obj: str): def step(context: any, obj: str):
the_user_clicks_on_the_following_ui_component(obj) init_steps.the_user_clicks_on_the_following_ui_component(obj)
@When("the user joins chat room \"|any|\"") @When("the user joins chat room \"|any|\"")
def step(context, room): def step(context, room):
@ -88,9 +88,9 @@ def step(context, obj):
########################################################################### ###########################################################################
def the_user_restarts_the_app(context: any): def the_user_restarts_the_app(context: any):
waitFor(lambda: currentApplicationContext().detach(), 500) init_steps.waitFor(lambda: init_steps.currentApplicationContext().detach(), 500)
time.sleep(5) time.sleep(5)
startApplication(context.userData["aut_name"]) init_steps.startApplication(context.userData["aut_name"])
def the_user_joins_chat_room(room: str): def the_user_joins_chat_room(room: str):
init_steps.the_user_joins_chat_room(room) init_steps.the_user_joins_chat_room(room)

View File

@ -2,6 +2,6 @@ AUT=nim_status_client
ENVVARS=envvars ENVVARS=envvars
LANGUAGE=Python LANGUAGE=Python
OBJECTMAPSTYLE=script OBJECTMAPSTYLE=script
TEST_CASES=tst_ChatFlow tst_groupChat tst_adminGroupChat TEST_CASES=tst_ChatFlow tst_groupChat tst_adminGroupChat tst_chatsNavigation
VERSION=3 VERSION=3
WRAPPERS=Qt WRAPPERS=Qt

View File

@ -48,11 +48,6 @@ Feature: Status Desktop Chat Basic Flows
| reply | | reply |
| This is a reply | | This is a reply |
# TODO: This scenario should be extracted to a different feature file bc it doesn't accomplish the background steps since it needs to change/specify the chat room
# Scenario: The user joins a room and marks it as read
# When the user joins chat room test
# And the user marks the channel "test" as read
# # TODO find a way to validate that it worked
Scenario Outline: The user can delete his/her own message Scenario Outline: The user can delete his/her own message
Given the user sends a chat message "<message>" Given the user sends a chat message "<message>"
@ -131,24 +126,6 @@ Feature: Status Desktop Chat Basic Flows
| message | | message |
| wow I'm so cool | | wow I'm so cool |
# TODO: This scenario should be extracted to a different feature file bc it doesn't accomplish the background steps since it needs to change/specify the chat room
# @merge
# Scenario: The user sees chats sorted by most recent activity
# When the user joins chat room "first-chat"
# And the user joins chat room "second-chat"
# And the user joins chat room "third-chat"
# Then the user chats are sorted accordingly
# | third-chat |
# | second-chat |
# | first-chat |
# When the user switches to "second-chat" chat
# And the user sends a random chat message
# Then the random chat message is displayed
# And the user chats are sorted accordingly
# | second-chat |
# | third-chat |
# | first-chat |
Scenario: The user can type message with emoji autoreplace Scenario: The user can type message with emoji autoreplace
When the user sends a chat message "Hello :)" When the user sends a chat message "Hello :)"
Then the last chat message contains "🙂" Then the last chat message contains "🙂"

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
import steps.commonInitSteps as init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
_chat_room = "test"
@OnFeatureStart
def hook(context):
init_steps.context_init(context, testSettings)
init_steps.signs_up_process_steps(context, _user, _password)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnScenarioStart
def hook(context):
init_steps.the_user_opens_the_chat_section()

View File

@ -0,0 +1,24 @@
Feature: Status Desktop Chat Navigation
Scenario: The user joins a room and marks it as read
When the user joins chat room "test"
And the user marks the channel "test" as read
# TODO find a way to validate that it worked
@merge
Scenario: The user sees chats sorted by most recent activity
When the user joins chat room "first-chat"
And the user joins chat room "second-chat"
And the user joins chat room "third-chat"
Then the user chats are sorted accordingly
| third-chat |
| second-chat |
| first-chat |
When the user switches to "second-chat" chat
And the user sends a random chat message
Then the random chat message is displayed
And the user chats are sorted accordingly
| second-chat |
| third-chat |
| first-chat |

View File

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