2022-05-26 15:00:00 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2022-06-07 23:44:48 +00:00
|
|
|
# ******************************************************************************
|
2022-05-26 15:00:00 +00:00
|
|
|
# Status.im
|
2022-06-07 23:44:48 +00:00
|
|
|
# *****************************************************************************/
|
2022-05-26 15:00:00 +00:00
|
|
|
# /**
|
|
|
|
# * \file steps.py
|
|
|
|
# *
|
|
|
|
# * \test Status Desktop - Login
|
|
|
|
# * \date February 2022
|
|
|
|
# * \brief This file contains snippets of script code to be executed as the .feature
|
|
|
|
# * file is processed.
|
|
|
|
# * The decorators Given/When/Then/Step can be used to associate a script snippet
|
|
|
|
# * with a pattern which is matched against the steps being executed.
|
|
|
|
# *****************************************************************************
|
|
|
|
from common.Common import *
|
2022-07-13 13:14:52 +00:00
|
|
|
import time
|
2022-06-07 23:44:48 +00:00
|
|
|
|
2022-09-29 14:35:16 +00:00
|
|
|
from screens.StatusMainScreen import StatusMainScreen
|
|
|
|
from screens.StatusChatScreen import StatusChatScreen
|
|
|
|
|
|
|
|
_statusMain = StatusMainScreen()
|
|
|
|
_statusChat = StatusChatScreen()
|
|
|
|
|
2022-07-20 12:14:50 +00:00
|
|
|
@Given("the user starts the application with a specific data folder |any|")
|
2022-08-18 17:51:18 +00:00
|
|
|
def step(context, data_folder_path):
|
2022-07-20 12:14:50 +00:00
|
|
|
waitFor(lambda: currentApplicationContext().detach(), 500)
|
|
|
|
time.sleep(5)
|
|
|
|
clear_directory(context.userData["status_data_folder_path"])
|
2022-08-18 17:51:18 +00:00
|
|
|
copy_directory(data_folder_path, context.userData["status_data_folder_path"])
|
2022-07-20 12:14:50 +00:00
|
|
|
startApplication(context.userData["aut_name"])
|
|
|
|
|
2022-06-16 01:46:45 +00:00
|
|
|
@When("the user restarts the app")
|
2022-05-26 15:00:00 +00:00
|
|
|
def step(context):
|
2022-07-13 13:14:52 +00:00
|
|
|
waitFor(lambda: currentApplicationContext().detach(), 500)
|
|
|
|
time.sleep(5)
|
2022-07-20 12:14:50 +00:00
|
|
|
startApplication(context.userData["aut_name"])
|
|
|
|
|
2022-06-01 02:43:53 +00:00
|
|
|
@When("user inputs the following |any| with ui-component |any|")
|
2022-05-26 15:00:00 +00:00
|
|
|
def step(context, text, obj):
|
|
|
|
input_text(text, obj)
|
2022-06-07 23:44:48 +00:00
|
|
|
|
2022-06-01 02:43:53 +00:00
|
|
|
|
|
|
|
@When("user clicks on the following ui-component |any|")
|
|
|
|
def step(context, obj):
|
|
|
|
click_on_an_object(obj)
|
2022-05-26 15:00:00 +00:00
|
|
|
|
2022-09-29 14:35:16 +00:00
|
|
|
@When("user joins chat room |any|")
|
|
|
|
def step(context, room):
|
|
|
|
_statusMain.join_chat_room(room)
|
|
|
|
_statusChat.verify_chat_title(room)
|
|
|
|
|
2022-05-26 15:00:00 +00:00
|
|
|
|
2022-06-01 02:43:53 +00:00
|
|
|
@Then("the following ui-component |any| is not enabled")
|
2022-05-26 15:00:00 +00:00
|
|
|
def step(context, obj):
|
2022-08-19 15:23:09 +00:00
|
|
|
object_not_enabled(obj)
|