2022-08-15 21:01:12 +00:00
|
|
|
from screens.StatusSearchScreen import StatusSearchScreen
|
|
|
|
|
|
|
|
_searchScreen = StatusSearchScreen()
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
#########################
|
|
|
|
### PRECONDITIONS region:
|
|
|
|
#########################
|
|
|
|
@Given("the user opens the search menu")
|
2022-08-15 21:01:12 +00:00
|
|
|
def step(context):
|
|
|
|
_searchScreen.open_search_menu()
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Given("the user searches for \"|any|\"")
|
2022-08-15 21:01:12 +00:00
|
|
|
def step(context, search_term):
|
|
|
|
_searchScreen.search_for(search_term)
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
#########################
|
|
|
|
### ACTIONS region:
|
|
|
|
#########################
|
2022-08-15 21:01:12 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@When("the user clicks on the search result for channel \"|any|\"")
|
2022-08-15 21:01:12 +00:00
|
|
|
def step(context, channel_name):
|
2022-10-25 12:44:28 +00:00
|
|
|
_searchScreen.click_on_channel(channel_name)
|
|
|
|
|
|
|
|
@When("the user searches the random message")
|
|
|
|
def step(context):
|
|
|
|
_searchScreen.search_for(context.userData["randomMessage"])
|
2022-08-15 21:01:12 +00:00
|
|
|
|
|
|
|
@When("the user clicks on the search result for the random message")
|
|
|
|
def step(context):
|
2022-10-25 12:44:28 +00:00
|
|
|
_searchScreen.click_on_message(context.userData["randomMessage"])
|
|
|
|
|
|
|
|
#########################
|
|
|
|
### VERIFICATIONS region:
|
|
|
|
#########################
|
|
|
|
|
|
|
|
@Then("the search menu shows |integer| results")
|
|
|
|
def step(context, amount: int):
|
|
|
|
_searchScreen.verify_number_of_results(amount)
|