diff --git a/.github/workflows/api_workflow.yml b/.github/workflows/api_workflow.yml
index ee569489..fee9b760 100644
--- a/.github/workflows/api_workflow.yml
+++ b/.github/workflows/api_workflow.yml
@@ -41,7 +41,7 @@ jobs:
fi
source $HOME/.bp-venv/bin/activate
- sh api_run.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
+ sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
@@ -103,7 +103,7 @@ jobs:
fi
source $HOME/.bp-venv/bin/activate
- sh api_run.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
+ sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
diff --git a/README.md b/README.md
index 78fb7264..ec2853b9 100755
--- a/README.md
+++ b/README.md
@@ -324,7 +324,7 @@ Reference Link - https://pypi.org/project/pytest-xdist/
(back to top)
-Command for local run on chrome (also ./web_local_run.sh)
+Command for local run on chrome (also ./local_run_web.sh)
```shell
-v -s --gherkin-terminal-reporter --driver=Chrome --html="./output/reports/" --self-contained-html --capability headless True --tags="web_tests" --reruns 1 --reruns-delay 2 -n=2
```
diff --git a/bp_core/backend/common/step_definitions/__init__.py b/bp_core/backend/common/step_definitions/__init__.py
deleted file mode 100644
index 525bc18a..00000000
--- a/bp_core/backend/common/step_definitions/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-"""step_definitions.py
-
-Package for Common Step Definitions for API Testing
-"""
diff --git a/bp_core/frontend/common/step_definitions/__init__.py b/bp_core/frontend/common/step_definitions/__init__.py
index e1c8957f..b6a15d69 100644
--- a/bp_core/frontend/common/step_definitions/__init__.py
+++ b/bp_core/frontend/common/step_definitions/__init__.py
@@ -1,14 +1,12 @@
-from .api_bdd import *
-from .browser_navigation_window_tabs_and_screenshots import *
+from .browser_navigation import *
from .click_touch_and_keyboard_actions import *
-from .date_time_and_pause import *
+from .date_time import *
from .dropdowns import *
-from .element_existence_visibility_and_attribute_assertion import *
+from .attribute_assertion import *
from .environment_variables import *
from .excel_and_csv import *
from .html_tables import *
-from .ionic_hybrid_mobile_apps_steps import *
from .mobile_device_actions import *
-from .swipe_scroll_move_hover_drag_and_drop import *
-from .text_assertion_editing_and_generation import *
+from .swipe_drag_and_drop import *
+from .text_assertion_editing import *
from .visual_comparison import *
diff --git a/bp_core/frontend/common/step_definitions/api_bdd.py b/bp_core/frontend/common/step_definitions/api_bdd.py
deleted file mode 100644
index a8dfb571..00000000
--- a/bp_core/frontend/common/step_definitions/api_bdd.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import structlog
-
-from _pytest.fixtures import FixtureRequest
-from pytest_bdd import parsers, when, then
-from pytest_check import check
-from bp_core.backend.common.step_definitions.steps_common import set_request_endpoint, set_request_headers, \
- add_json_payload, make_api_request, get_api_response
-from bp_core.frontend.common.helpers.app import context_manager
-from assertpy import assert_that
-from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics
-from bp_core.frontend.common.step_definitions.steps_common import UI_API_CALL, MOBILE_SUFFIX
-from bp_core.utils.bp_storage import BPStorage
-
-
-logger = structlog.get_logger(__name__)
-
-
-# WEB context Predefined Step
-# ID 1501
-@when(parsers.re("I '(?P.*)' an API request having base URL '(?P.*)' with endpoint '(?P.*)' with headers '(?P.*)' and payload '(?P.*)' and store the response value"))
-def send_api_request_store_value_bp_storage(selenium_generics: SeleniumGenerics, request: FixtureRequest, request_type: str, base_url: str, endpoint: str, headers: str, payload: str):
- api_response_container = dict()
- set_request_endpoint(request, base_url=base_url, endpoint=endpoint, request_name=UI_API_CALL)
- set_request_headers(request, headers=headers, request_name=UI_API_CALL)
- add_json_payload(request, json_payload=payload, request_name=UI_API_CALL)
- make_api_request(request, api_response_container=api_response_container, request_type=request_type, request_name=UI_API_CALL)
- BPStorage.store_api_bdd_response(get_api_response(request, api_response_container=api_response_container, request_name=UI_API_CALL))
-
-
-# WEB & MOBILE contexts Predefined Step
-# ID 1502
-@then(parsers.re("(With soft assertion '(?P.*)' )?The (button|element) '(?P.*)' has the text equal with the API BDD response key '(?P.*)'"))
-def api_contains_text(selenium_generics: SeleniumGenerics, locators, soft_assert: str, locator_path: str, key: str):
- if MOBILE_SUFFIX in locator_path:
- with context_manager(selenium_generics):
- actual_text = selenium_generics.get_element_text(locators.parse_and_get(locator_path, selenium_generics))
- else:
- actual_text = selenium_generics.get_element_text(locators.parse_and_get(locator_path, selenium_generics))
- if soft_assert is not None and soft_assert.lower() == 'true':
- with check:
- assert_that(actual_text).is_equal_to(BPStorage.get_api_bdd_response().json()[key])
- else:
- assert_that(actual_text).is_equal_to(BPStorage.get_api_bdd_response().json()[key])
diff --git a/bp_core/frontend/common/step_definitions/element_existence_visibility_and_attribute_assertion.py b/bp_core/frontend/common/step_definitions/attribute_assertion.py
similarity index 96%
rename from bp_core/frontend/common/step_definitions/element_existence_visibility_and_attribute_assertion.py
rename to bp_core/frontend/common/step_definitions/attribute_assertion.py
index 52206bf9..887d2227 100644
--- a/bp_core/frontend/common/step_definitions/element_existence_visibility_and_attribute_assertion.py
+++ b/bp_core/frontend/common/step_definitions/attribute_assertion.py
@@ -1,11 +1,3 @@
-"""
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-"""
import polling
import structlog
@@ -23,7 +15,6 @@
# WEB context Predefined Step
-# ID 501
@given(parsers.re(r"(With soft assertion '(?P.*)' )?The attribute '(?P.*)' of element '(?P.*)' is the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re(r"(With soft assertion '(?P.*)' )?The attribute '(?P.*)' of element '(?P.*)' is the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
@@ -47,7 +38,6 @@ def check_property_is(selenium_generics: SeleniumGenerics, locators: Locators, s
# WEB context Predefined Step
-# ID 502
@given(parsers.re(r"(With soft assertion '(?P.*)' )?The attribute '(?P.*)' of element '(?P.*)' is not the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re(r"(With soft assertion '(?P.*)' )?The attribute '(?P.*)' of element '(?P.*)' is not the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
@@ -71,7 +61,6 @@ def check_property_is_not(selenium_generics: SeleniumGenerics, locators: Locator
# WEB context Predefined Step
-# ID 503
@given(parsers.re(r"(With soft assertion '(?P.*)' )?The css attribute '(?P.*)' of element '(?P.*)' is the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re(r"(With soft assertion '(?P.*)' )?The css attribute '(?P.*)' of element '(?P.*)' is the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
@@ -94,7 +83,6 @@ def check_css_property_is(attribute, selenium_generics: SeleniumGenerics, locato
# WEB context Predefined Step
-# ID 504
@given(parsers.re(r"(With soft assertion '(?P.*)' )?The css attribute '(?P.*)' of element '(?P.*)' is not the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re(r"(With soft assertion '(?P.*)' )?The css attribute '(?P.*)' of element '(?P.*)' is not the value '(?P.*)'(\s+)?((?:within)\s+(?:')(?P\w+)(?:') seconds)?$"),
@@ -117,7 +105,6 @@ def check_css_property_is_not(attribute, selenium_generics: SeleniumGenerics, lo
# WEB & MOBILE contexts Predefined Step
-# ID 505 & 506 & 507
@given(parsers.re("(With soft assertion '(?P.*)' )?There is an element '(?P.*)' on the page"))
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is displayed"))
@when(parsers.re("(With soft assertion '(?P.*)' )?There is an element '(?P.*)' on the page"))
@@ -144,7 +131,6 @@ def element_displayed(selenium_generics: SeleniumGenerics, locators: Locators, s
# WEB & MOBILE contexts Predefined Step
-# ID 508 & 509 & 510
@given(parsers.re("(With soft assertion '(?P.*)' )?There is no element '(?P.*)' on the page"))
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not displayed"))
@when(parsers.re("(With soft assertion '(?P.*)' )?There is no element '(?P.*)' on the page"))
@@ -171,7 +157,6 @@ def element_not_displayed(selenium_generics: SeleniumGenerics, locators: Locator
# WEB & MOBILE contexts Predefined Step
-# ID 511
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' appears exactly '(?P.*)' times"),
converters=dict(occurrence_count=data_manager.text_formatted), )
def check_element_exists(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path, occurrence_count: int, ):
@@ -193,7 +178,6 @@ def check_element_exists(selenium_generics: SeleniumGenerics, locators: Locators
# WEB & MOBILE contexts Predefined Step
-# ID 512
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' does not appear exactly '(?P.*)' times"),
converters=dict(occurrence_count=data_manager.text_formatted), )
def check_element_not_exists(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path, occurrence_count: int, ):
@@ -215,7 +199,6 @@ def check_element_not_exists(selenium_generics: SeleniumGenerics, locators: Loca
# WEB & MOBILE contexts Predefined Step
-# ID 513
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' becomes visible within '(?P.*)' seconds"),
converters=dict(wait_for=data_manager.text_formatted), )
def wait_for_displayed(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path: str, wait_for: int, ):
@@ -234,8 +217,6 @@ def wait_for_displayed(selenium_generics: SeleniumGenerics, locators: Locators,
assert selenium_generics.is_element_visible(locators.parse_and_get(locator_path, selenium_generics), int(wait_for))
-# WEB & MOBILE contexts Predefined Step
-# ID 514
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' becomes invisible within '(?P.*)' seconds"),
converters=dict(wait_for=data_manager.text_formatted), )
def wait_for_not_displayed(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path: str, wait_for: int):
@@ -257,7 +238,7 @@ def wait_for_not_displayed(selenium_generics: SeleniumGenerics, locators: Locato
# WEB context Predefined Step
-# ID 515
+
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' is within the viewport"))
def check_within_viewport(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert:str, locator_path: str):
if soft_assert is not None and soft_assert.lower() == 'true':
@@ -268,7 +249,6 @@ def check_within_viewport(selenium_generics: SeleniumGenerics, locators: Locator
# WEB context Predefined Step
-# ID 516
@then(parsers.re("(With soft assertion '(?P.*)' )?I expect that element '(?P.*)' is not within the viewport"))
def check_within_viewport(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path):
if soft_assert is not None and soft_assert.lower() == 'true':
@@ -278,8 +258,6 @@ def check_within_viewport(selenium_generics: SeleniumGenerics, locators: Locator
assert not selenium_generics._is_in_viewport(locators.parse_and_get(locator_path, selenium_generics))
-# WEB & MOBILE contexts Predefined Step
-# ID 517
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is enabled"))
@when(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is enabled"))
@then(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is enabled"))
@@ -301,7 +279,6 @@ def element_enabled(selenium_generics: SeleniumGenerics, locators: Locators, sof
# WEB & MOBILE contexts Predefined Step
-# ID 518
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not enabled"))
@when(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not enabled"))
@then(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not enabled"))
@@ -318,7 +295,6 @@ def element_not_enabled(selenium_generics: SeleniumGenerics, locators: Locators,
# WEB context Predefined Step
-# ID 519
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is selected"))
@when(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is selected"))
@then(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is selected"))
@@ -332,7 +308,6 @@ def element_selected(selenium_generics: SeleniumGenerics, locators: Locators, so
# WEB context Predefined Step
-# ID 520
@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not selected"))
@when(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not selected"))
@then(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not selected"))
diff --git a/bp_core/frontend/common/step_definitions/browser_navigation_window_tabs_and_screenshots.py b/bp_core/frontend/common/step_definitions/browser_navigation.py
similarity index 100%
rename from bp_core/frontend/common/step_definitions/browser_navigation_window_tabs_and_screenshots.py
rename to bp_core/frontend/common/step_definitions/browser_navigation.py
diff --git a/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py b/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py
index 21a290fa..2ce0c636 100644
--- a/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py
+++ b/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py
@@ -1,10 +1,4 @@
-"""
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-"""
import structlog
from pytest_bdd import parsers, given, when, then
from bp_core.frontend.common.helpers.app import context_manager
@@ -18,7 +12,6 @@
# WEB & MOBILE contexts Predefined Step
-# ID 201, 208
@given(parsers.re("I click on (checkbox|button|dropdown|item|element) '(?P.*)'"))
@given(parsers.re("I tap on '(?P.*)'"))
@when(parsers.re("I click on (checkbox|button|dropdown|item|element) '(?P.*)'"))
@@ -32,7 +25,6 @@ def click_on_locator(selenium_generics: SeleniumGenerics, locators: Locators, lo
# WEB context Predefined Step - Chrome Only
-# ID 202
@given(parsers.re(
"(I wait for maximum '(?P\\d+)' seconds, and )?I click on '(?P.+)'"))
@when(parsers.re(
@@ -43,7 +35,6 @@ def click_element(selenium_generics: SeleniumGenerics, locators: Locators, locat
# WEB context Predefined Step
-# ID 203
@given(parsers.re("I (double click|doubleclick) on '(?P.*)'"))
@when(parsers.re("I (double click|doubleclick) on '(?P.*)'"))
def dbl_click_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path: str):
@@ -51,7 +42,6 @@ def dbl_click_element(selenium_generics: SeleniumGenerics, locators: Locators, l
# WEB context Predefined Step
-# ID 204
@given(parsers.re("I click on SVG element '(?P.*)'"))
@when(parsers.re("I click on SVG element '(?P.*)'"))
def click_svg_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path):
@@ -59,7 +49,6 @@ def click_svg_element(selenium_generics: SeleniumGenerics, locators: Locators, l
# WEB context Predefined Step
-# ID 205
@given(parsers.re("I click on type:'(?P.*)' element with text equal to '(?P.*)'"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re("I click on type:'(?P.*)' element with text equal to '(?P.*)'"),
@@ -69,7 +58,6 @@ def click_on_text(selenium_generics: SeleniumGenerics, element_type, value: str)
# WEB context Predefined Step
-# ID 206
@given(parsers.re("I click on type:'(?P.*)' that contains the text:'(?P.*)'"),
converters=dict(value=data_manager.text_formatted), )
@when(parsers.re("I click on type:'(?P.*)' that contains the text:'(?P.*)'"),
@@ -79,7 +67,6 @@ def click_on_partial_text(selenium_generics: SeleniumGenerics, element_type, val
# WEB contexts Predefined Step
-# ID 207
@given(parsers.re(
"I click on element with visible text '(?PEQUALS|CONTAINS|STARTS_WITH|ENDS_WITH)' '(?P.*)'"),
converters=dict(value=data_manager.text_formatted), )
@@ -96,7 +83,6 @@ def click_on_element_by_visible_text(selenium_generics: SeleniumGenerics, locato
# MOBILE context Predefined Step
-# ID 209
@given(parsers.re("I long tap on element '(?P.*)'"))
@when(parsers.re("I long tap on element '(?P.*)'"))
def long_tap(selenium_generics: SeleniumGenerics, locators: Locators, locator: str):
@@ -105,7 +91,6 @@ def long_tap(selenium_generics: SeleniumGenerics, locators: Locators, locator: s
# MOBILE contexts Predefined Step
-# ID 210
@given(parsers.re(
"I tap '(?PBOTTOM_LEFT|BOTTOM_RIGHT|TOP_LEFT|TOP_RIGHT)' corner of element '(?P.*)'")) # noqa
@when(parsers.re(
@@ -123,7 +108,6 @@ def click_element_corner(selenium_generics: SeleniumGenerics, locators: Locators
# MOBILE context Predefined Step
-# ID 211
@given(parsers.re(
"On '(?PAndroid|iOS)' I tap on the x='(?P.*)' % and y='(?P.*)' % of element '(?P.*)'"))
@when(parsers.re(
@@ -138,7 +122,6 @@ def tap_with_percentage(selenium_generics: SeleniumGenerics, locators, platform:
# ANDROID MOBILE context Predefined Step
-# ID 212
@given("On android, I tap on back navigation")
@when("On android, I tap on back navigation")
def tap_back_nav(selenium_generics: SeleniumGenerics):
@@ -148,7 +131,6 @@ def tap_back_nav(selenium_generics: SeleniumGenerics):
# iOS MOBILE context Predefined Step
-# ID 213
@given(parsers.re("On iOS, I navigate back to app after clicking on '(?P.*)'"))
@when(parsers.re("On iOS, I navigate back to app after clicking on '(?P.*)'"))
def navigate_back_to_app(selenium_generics: SeleniumGenerics, locators: Locators, locator: str):
@@ -158,7 +140,6 @@ def navigate_back_to_app(selenium_generics: SeleniumGenerics, locators: Locators
# WEB context Predefined Step
-# ID 214
@given(parsers.re("I press '(?P.*)'"))
@when(parsers.re("I press '(?P.*)'"))
def press_key_not_focused_on_element(selenium_generics: SeleniumGenerics, key: str):
@@ -167,7 +148,6 @@ def press_key_not_focused_on_element(selenium_generics: SeleniumGenerics, key: s
# WEB context Predefined Step
-# ID 215
@given(parsers.re("I focus over '(?P.*)' then I press '(?P.*)'"))
@when(parsers.re("I focus over '(?P.*)' then I press '(?P.*)'"))
def press_key_on_element(selenium_generics: SeleniumGenerics, locator_path: str, key: str, locators: Locators):
@@ -177,7 +157,6 @@ def press_key_on_element(selenium_generics: SeleniumGenerics, locator_path: str,
# WEB context Predefined Step
-# ID 216
@when(parsers.re("I click item '(?P.*)' for element '(?P.*)'"),
converters=dict(inner_text=data_manager.text_formatted), )
def add_item_for_element(selenium_generics: SeleniumGenerics, locators: Locators, inner_text: str, locator_path: str):
diff --git a/bp_core/frontend/common/step_definitions/date_time_and_pause.py b/bp_core/frontend/common/step_definitions/date_time.py
similarity index 100%
rename from bp_core/frontend/common/step_definitions/date_time_and_pause.py
rename to bp_core/frontend/common/step_definitions/date_time.py
diff --git a/bp_core/frontend/common/step_definitions/environment_variables.py b/bp_core/frontend/common/step_definitions/environment_variables.py
index 51735a0a..7ed9996c 100644
--- a/bp_core/frontend/common/step_definitions/environment_variables.py
+++ b/bp_core/frontend/common/step_definitions/environment_variables.py
@@ -26,7 +26,6 @@
# WEB & MOBILE contexts Predefined Step
-# ID 801
@given(parsers.re("I get text from element '(?P.*)' and save as environment variable '(?P.*)'"))
@when(parsers.re("I get text from element '(?P.*)' and save as environment variable '(?P.*)'"))
def get_text_from_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path: str, env_var: str, ):
@@ -38,7 +37,6 @@ def get_text_from_element(selenium_generics: SeleniumGenerics, locators: Locator
os.environ[env_var] = returned_text
-# ID 802
@given(parsers.re("I get text from element '(?P.*)' between '(?P.*)' and '(?P.*)' boundaries, and save as environment variable '(?P.*)'"),
converters=dict(initial_string=data_manager.text_formatted, final_string=data_manager.text_formatted), )
@when(parsers.re("I get text from element '(?P.*)' between '(?P.*)' and '(?P.*)' boundaries, and save as environment variable '(?P.*)'"),
@@ -53,7 +51,6 @@ def get_text_from_element(selenium_generics: SeleniumGenerics, locators: Locator
# WEB context Predefined Step
-# ID 803
@given(parsers.re("I write within the HTML report the environment variable '(?P.*)' value"))
@when(parsers.re("I write within the HTML report the environment variable '(?P.*)' value"))
@then(parsers.re("I write within the HTML report the environment variable '(?P.*)' value"))
@@ -65,7 +62,6 @@ def write_html_report_os_environ_value(selenium_generics: SeleniumGenerics, env_
# WEB context Predefined Step
-# ID 804
@given(parsers.re("I store '(?P.*)' environment variable in .local.env config file"))
@when(parsers.re("I store '(?P.*)' environment variable in .local.env config file"))
def store_env_variable_in_local_env(key: str):
@@ -81,7 +77,6 @@ def store_env_variable_in_local_env(key: str):
raise FileNotFoundError("File not found: .local.env")
-# ID 806, 909
@given(parsers.re("I get text from '(?P.*)' on '(?P.*)' of excel file '(?P.*)' and save it as environment variable with name '(?P.*)'"),
converters=dict(cell=data_manager.text_formatted, sheet_name=data_manager.text_formatted))
@when(parsers.re("I get text from '(?P.*)' on '(?P.*)' of excel file '(?P.*)' and save it as environment variable with name '(?P.*)'"),
@@ -92,7 +87,6 @@ def write_text_to_excel_file(cell: str, sheet_name: str, file_path: str, env_var
os.environ[env_var] = text
-# ID 807, 910
@given(parsers.re("I get text of '(?P.*)' of excel file '(?P.*)' and save it as environment variables"),
converters=dict(sheet_name=data_manager.text_formatted))
@when(parsers.re("I get text of '(?P.*)' of excel file '(?P.*)' and save it as environment variables"),
@@ -115,7 +109,6 @@ def store_excel_data_as_env_vars(sheet_name: str, file_path: str):
os.environ[key] = str(value)
-# ID 808, 920
@given(parsers.re("I get text from '(?P.*)' cell of csv file '(?P.*)' and save it as env variable with name '(?P.*)'"),
converters=dict(cell=data_manager.text_formatted))
@when(parsers.re("I get text from '(?P.*)' cell of csv file '(?P.*)' and save it as env variable with name '(?P.*)'"),
diff --git a/bp_core/frontend/common/step_definitions/excel_and_csv.py b/bp_core/frontend/common/step_definitions/excel_and_csv.py
index c3ceac46..dc4ab6a2 100644
--- a/bp_core/frontend/common/step_definitions/excel_and_csv.py
+++ b/bp_core/frontend/common/step_definitions/excel_and_csv.py
@@ -1,11 +1,3 @@
-"""
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-"""
-
import os
import csv
import structlog
diff --git a/bp_core/frontend/common/step_definitions/html_tables.py b/bp_core/frontend/common/step_definitions/html_tables.py
index 659f19df..438db539 100644
--- a/bp_core/frontend/common/step_definitions/html_tables.py
+++ b/bp_core/frontend/common/step_definitions/html_tables.py
@@ -12,7 +12,6 @@
logger = structlog.get_logger(__name__)
-# ID 1101, 1102
@then(parsers.re("I expect table '(?P.*)' headers ('(?P.*)' )?to match:(?P.*)",
flags=re.S, ), converters=dict(data_table=data_table_horizontal_converter),)
def verify_table_headers_match_exactly(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, data_table, header_tag_path):
@@ -25,7 +24,6 @@ def verify_table_headers_match_exactly(selenium_generics: SeleniumGenerics, loca
assert_that(columns_present).is_equal_to(expected_columns)
-# ID 1103, 1104
@then(parsers.re("I expect table '(?P.*)' headers ('(?P.*)' )?to contain:(?P.*)",
flags=re.S, ), converters=dict(data_table=data_table_horizontal_converter), )
def verify_table_headers_contain_columns(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, data_table, header_tag_path):
@@ -38,7 +36,6 @@ def verify_table_headers_contain_columns(selenium_generics: SeleniumGenerics, lo
assert_that(columns_present).contains(*expected_columns)
-# ID 1105
@then(parsers.re("I expect the column in table '(?P.*)' has the values:(?P.*)",
flags=re.S, ), converters=dict(data_table=data_table_horizontal_converter), )
def verify_table_column_contain_values(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, data_table):
@@ -61,7 +58,6 @@ def verify_table_column_contain_values(selenium_generics: SeleniumGenerics, loca
assert len(selenium_generics.get_elements(cell_locator)) > 0
-# ID 1106
@then(parsers.re("I expect that '(?P.*)' row has the value '(?P.*)' in column '(?P.*)' of table '(?P.*)'"),
converters=dict(expected_text=data_manager.text_formatted), )
def verify_column_contain_value(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, row, column, expected_text: str):
@@ -82,7 +78,6 @@ def verify_column_contain_value(selenium_generics: SeleniumGenerics, locators: L
assert len(selenium_generics.get_elements(cell_locator)) > 0
-# ID 1107
@then(parsers.re("I expect that '(?P.*)' row in table '(?P.*)' has the following values:(?P.*)",
flags=re.S, ), converters=dict(data_table=data_table_horizontal_converter), )
def verify_table_row_contain_values(selenium_generics: SeleniumGenerics, locators: Locators, row, locator_path, data_table):
@@ -109,7 +104,6 @@ def verify_table_row_contain_values(selenium_generics: SeleniumGenerics, locator
assert len(selenium_generics.get_elements(cell_locator)) > 0
-# ID 1108
@then(parsers.re("I expect that table '(?P.*)' has '(?P.*)' rows"),
converters=dict(value=data_manager.text_formatted), )
def verify_column_contain_value(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, value: int):
diff --git a/bp_core/frontend/common/step_definitions/ionic_hybrid_mobile_apps_steps.py b/bp_core/frontend/common/step_definitions/ionic_hybrid_mobile_apps_steps.py
deleted file mode 100644
index 6c268f6a..00000000
--- a/bp_core/frontend/common/step_definitions/ionic_hybrid_mobile_apps_steps.py
+++ /dev/null
@@ -1,456 +0,0 @@
-"""
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
-"""
-import time
-import structlog
-import re
-
-from datetime import datetime, timedelta
-from pytest_bdd import parsers, given, when
-from bp_core.frontend.common.helpers.app import context_manager
-from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException
-from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics
-from bp_core.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX
-from bp_core.frontend.common.utils.locator_parser import Locators
-from bp_core.utils import data_manager
-from bp_core.utils.exceptions import YearAscendingException
-
-logger = structlog.get_logger(__name__)
-
-
-# WEB context Predefined Step
-# ID 1301
-@given(parsers.re("(On '(?PAndroid|iOS)' )?I click on element with text '(?P.*)' on wheel picker '(?P.*)'"),
- converters=dict(element_text=data_manager.text_formatted),)
-@when(parsers.re("(On '(?PAndroid|iOS)' )?I click on element with text '(?P.*)' on wheel picker '(?P.*)'"),
- converters=dict(element_text=data_manager.text_formatted),)
-def click_on_wheel_picker_element(selenium_generics: SeleniumGenerics, locators: Locators, locator_path: str, element_text: str, mobile_platform: str):
- current_platform = selenium_generics.driver.capabilities['platformName'].lower()
- mobile_platform = mobile_platform.lower() if mobile_platform else current_platform
- picker_elements = selenium_generics.get_elements(locators.parse_and_get(locator_path, selenium_generics))
-
- def get_currently_displayed_elements(elements, starting_from, direction):
- elements_ = elements[starting_from::-1] if direction else elements[starting_from:]
- is_displayed = False
- result = dict()
- for idx, element in enumerate(elements_):
- if element.is_displayed():
- is_displayed = True
- result[idx] = element
- else:
- if is_displayed:
- break
- keys = list(result.keys())
- keys.sort()
- new_first_displayed_element = starting_from - keys[-1] if direction else keys[0] + starting_from
- sorted_displayed_elements = {k: result[k] for k in keys}
- return sorted_displayed_elements, new_first_displayed_element
-
- def try_to_click_on_the_element(elements, text):
- for index in elements.keys():
- if displayed_elements[index].text == text:
- selenium_generics.click(displayed_elements[index], max_wait_time=1)
- return True
- return False
-
- if current_platform == mobile_platform.lower():
- first_displayed_element = 0
- reverse = False
- for _ in range(len(picker_elements)):
- displayed_elements, first_displayed_element = get_currently_displayed_elements(picker_elements, first_displayed_element, reverse)
- highest_key = max(displayed_elements.keys())
- if try_to_click_on_the_element(elements=displayed_elements, text=element_text):
- return
- try:
- displayed_elements[highest_key].click()
- except ElementNotVisibleException:
- continue
- # If the element is not found we search the other direction
- else:
- first_displayed_element = len(picker_elements)
- reverse = True
- for _ in range(len(picker_elements)):
- displayed_elements, first_displayed_element = get_currently_displayed_elements(picker_elements, first_displayed_element, reverse)
- highest_key = max(displayed_elements.keys())
- if try_to_click_on_the_element(elements=displayed_elements, text=element_text):
- return
- try:
- displayed_elements[highest_key].click()
- except ElementNotVisibleException:
- continue
- raise NoSuchElementException(f"Wheel picker element with text: {element_text} not found")
-
-
-# ID 1302
-@given(parsers.re(r"On Android I select (?:the day '(?P.*)' month '(?P.*)' year '(?P.*)'|the date '(?P.*)' days from now) on Ionic date wheel picker with days '(?P.*)' months '(?P.*)' years '(?P.*)'"))
-@when(parsers.re(r"On Android I select (?:the day '(?P.*)' month '(?P.*)' year '(?P.*)'|the date '(?P.*)' days from now) on Ionic date wheel picker with days '(?P.*)' months '(?P.*)' years '(?P.*)'"))
-def click_on_android_date_wheel_picker_element(selenium_generics: SeleniumGenerics, locators: Locators, days_path, months_path, years_path, days_from_now=None, day=None, month=None, year=None):
- if selenium_generics.is_android():
- days_elements = locators.parse_and_get(days_path, selenium_generics)
- months_elements = locators.parse_and_get(months_path, selenium_generics)
- years_elements = locators.parse_and_get(years_path, selenium_generics)
-
- months = {1: "January", 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July", 8: "August",
- 9: "September", 10: "October", 11: "November", 12: "December"}
-
- def get_current_month_name(given_month: int):
- return next((name_ for month_, name_ in months.items() if month_ == given_month), None)
-
- if days_from_now:
- days_from_now = int(days_from_now)
- current_date = datetime.now()
- new_date = current_date + timedelta(days=days_from_now)
- day = str(new_date.day)
- month = get_current_month_name(new_date.month)
- year = str(new_date.year)
-
- def element_generator():
- element_locators = [years_elements, months_elements, days_elements]
- for element_locator in element_locators:
- yield get_elements(element_locator)
-
- def get_elements(locator_):
- elements = selenium_generics.get_elements(locator_)
- for _ in range(3):
- time.sleep(3)
- if elements == selenium_generics.get_elements(locator_):
- break
- elements = selenium_generics.get_elements(locator_)
- return elements
-
- def get_currently_displayed_elements(elements, starting_from, direction):
- elements_ = elements[starting_from::-1] if direction else elements[starting_from:]
- is_displayed = False
- result = dict()
- for idx, element in enumerate(elements_):
- if element.is_displayed():
- is_displayed = True
- result[idx] = element
- else:
- if is_displayed:
- break
- keys = list(result.keys())
- keys.sort()
- new_first_displayed_element = starting_from - keys[-1] if direction else keys[0] + starting_from
- sorted_displayed_elements = {k: result[k] for k in keys}
- return sorted_displayed_elements, new_first_displayed_element
-
- def try_to_click_on_the_element(elements, text):
- for index in elements.keys():
- if displayed_elements[index].text == text:
- try:
- selenium_generics.click(displayed_elements[index], max_wait_time=1)
- return True
- except Exception:
- selenium_generics.scroll_into_view(displayed_elements[index])
- selenium_generics.click(displayed_elements[index], max_wait_time=1)
- return True
- return False
-
- first_displayed_element = 0
- reverse, clicked = False, False
- element_iterator = element_generator()
- for date_part, element_text in zip(element_iterator, (year, month, day)):
- for _ in range(len(date_part)):
- displayed_elements, first_displayed_element = get_currently_displayed_elements(date_part, first_displayed_element, reverse)
- highest_key = max(displayed_elements.keys())
- if try_to_click_on_the_element(elements=displayed_elements, text=element_text):
- clicked = True
- break
- try:
- displayed_elements[highest_key].click()
- clicked = False
- except ElementNotVisibleException:
- continue
- if not clicked:
- for date_part, element_text in zip((years_elements, months_elements, days_elements), (year, month, day)):
- first_displayed_element = len(date_part)
- reverse = True
- for _ in range(len(date_part)):
- displayed_elements, first_displayed_element = get_currently_displayed_elements(date_part, first_displayed_element, reverse)
- highest_key = max(displayed_elements.keys())
- if try_to_click_on_the_element(elements=displayed_elements, text=element_text):
- clicked = True
- break
- try:
- displayed_elements[highest_key].click()
- clicked = False
- except ElementNotVisibleException:
- continue
- if not clicked:
- raise NoSuchElementException(f"Wheel picker element with text: {element_text} not found")
-
-
-# ID 1303
-@given(parsers.re(r"On iOS I select (?:the day '(?P.*)' month '(?P.*)' year '(?P.*)'|the date '(?P.*)' days from now) on Ionic date wheel picker '(?P.*)'"))
-@when(parsers.re(r"On iOS I select (?:the day '(?P.*)' month '(?P.*)' year '(?P.*)'|the date '(?P.*)' days from now) on Ionic date wheel picker '(?P.*)'"))
-def click_on_ios_date_wheel_picker_element_native(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, days_from_now=None, day=None, month=None, year=None):
- if selenium_generics.driver.capabilities['platformName'].lower() == 'ios':
- current_day, current_month, current_year = datetime.now().day, datetime.now().month, datetime.now().year
- months = {1: "January", 2: "February", 3: "March", 4: "April", 5: "May", 6: "June", 7: "July", 8: "August",
- 9: "September", 10: "October", 11: "November", 12: "December"}
-
- def identify_pattern(data):
- year_pattern = re.compile(r"^\d{4}$")
- day_pattern = re.compile(r"^(0?[1-9]|[1-2]\d|3[0-1])$")
- if year_pattern.match(data):
- return "year", f"{year}"
- elif day_pattern.match(data):
- return "day", f"{day}"
- elif not data.isnumeric():
- return "month", f"{month}"
- else:
- raise ValueError(f"Unrecognized element text: {data}")
-
- def is_year_ascending(elements, types):
- results = identify_current_date_elements(elements, types)
- for key, value in results.items():
- if value[0] == 'year':
- before, after = None, None
- try:
- before = elements[key - 1]
- if identify_pattern(before.text)[0] != "year":
- before = None
- raise YearAscendingException
- except YearAscendingException:
- after = elements[key + 1]
- if before:
- if int(before.text) > int(elements[key].text):
- return False
- return True
- elif after:
- if int(after.text) > int(elements[key].text):
- return True
- return False
-
- def get_current_month_name(given_month: int):
- return next((name_ for month_, name_ in months.items() if month_ == given_month), None)
-
- def is_later(date_part, order=None):
- result = True
- if date_part[0] == 'month':
- given_month_number = next((month_ for month_, name_ in months.items() if name_ == date_part[1]), None)
- if given_month_number is None:
- raise ValueError(f"Bad month value: {given_month_number}")
- elif given_month_number < current_month:
- result = False
- elif date_part[0] == 'year':
- if order:
- if int(date_part[1]) < current_year:
- result = False
- else:
- if int(date_part[1]) > current_year:
- result = False
- elif date_part[0] == 'day' and int(date_part[1]) < current_day:
- result = False
- return result
-
- def identify_current_date_elements(elements, types):
- results = dict()
- for idx, e in enumerate(elements):
- if e.text in (str(current_day), get_current_month_name(current_month), str(current_year)):
- _type = identify_pattern(e.text)[0]
- if _type in types:
- results[idx] = identify_pattern(e.text)
- return results
-
- def find_elements(locator, max_attempts=3):
- counter = 0
- while counter < max_attempts:
- result = selenium_generics.get_elements(locator)
- if result:
- return result
- time.sleep(5)
- counter += 1
- raise NoSuchElementException(f"Elements with locator: {locator} not found")
-
- if days_from_now:
- days_from_now = int(days_from_now)
- current_date = datetime.now()
- new_date = current_date + timedelta(days=days_from_now)
- day = new_date.day
- month = get_current_month_name(new_date.month)
- year = new_date.year
-
- if MOBILE_SUFFIX in locator_path:
- with context_manager(selenium_generics):
- types_ = ["day", "month", "year"]
- if all(date_part is not None for date_part in (day, month, year)):
- for i in range(3):
- picker_elements = find_elements(locators.parse_and_get(locator_path, selenium_generics))
- current_elements = identify_current_date_elements(picker_elements, types_)
- year_order = is_year_ascending(picker_elements, ["year",])
- key, value = list(current_elements.keys())[0], current_elements[list(current_elements.keys())[0]]
- if is_later(value, year_order):
- _elements = picker_elements[key:]
- else:
- _elements = picker_elements[:key + 1][::-1]
- for element in _elements:
- element_match = element.text == identify_pattern(element.text)[1]
- selenium_generics.click(element)
- time.sleep(2) # Additional wait time once there is a transition in the elements after the click
- if element_match:
- types_.remove(identify_pattern(element.text)[0])
- break
- else:
- raise ValueError(f"Expected to have all values: day {day}, month: {month}, year: {year}")
-
-
-# ID 1304
-@given(parsers.re(r"On Android I select (?:the hour '(?P.*)' minute '(?P.*)' in time period '(?P.*)'|the time '(?P.*)' minutes from now) on Ionic time wheel picker with minutes '(?P.*)' hours '(?P.*)' time period '(?P.*)'"))
-@when(parsers.re(r"On Android I select (?:the hour '(?P.*)' minute '(?P.*)' in time period '(?P.*)'|the time '(?P.*)' minutes from now) on Ionic time wheel picker with minutes '(?P.*)' hours '(?P.*)' time period '(?P.*)'"))
-def click_on_android_time_wheel_picker_element(selenium_generics: SeleniumGenerics, locators: Locators, minutes_path, hours_path, time_period_path, minutes_from_now=None, hour=None, minute=None, time_period=None):
- if selenium_generics.is_android():
- minutes_elements = locators.parse_and_get(minutes_path, selenium_generics)
- hours_elements = locators.parse_and_get(hours_path, selenium_generics)
- time_period_elements = locators.parse_and_get(time_period_path, selenium_generics)
-
- def convert_to_12h(hours_24h):
- if hours_24h == 0:
- return "12", "AM"
- elif 1 <= hours_24h <= 11:
- return str(hours_24h), "AM"
- elif hours_24h == 12:
- return "12", "PM"
- else:
- return str(hours_24h - 12), "PM"
-
- if minutes_from_now:
- minutes_from_now = int(minutes_from_now)
- current_date = datetime.now()
- new_date = current_date + timedelta(minutes=minutes_from_now)
- minute = str(new_date.minute)
- hour, time_period = convert_to_12h(new_date.hour)
-
- def get_elements(locator_):
- elements = selenium_generics.get_elements(locator_)
- for _ in range(3):
- time.sleep(3)
- if elements == selenium_generics.get_elements(locator_):
- break
- elements = selenium_generics.get_elements(locator_)
- return elements
-
- hours = get_elements(hours_elements)
- for element in hours:
- if element.text == hour:
- try:
- selenium_generics.click(element, max_wait_time=1)
- break
- except Exception:
- selenium_generics.scroll_into_view(element)
- selenium_generics.click(element, max_wait_time=1)
- break
-
- minutes = get_elements(minutes_elements)
- for element in minutes:
- if element.text == minute:
- try:
- selenium_generics.click(element, max_wait_time=1)
- break
- except Exception:
- selenium_generics.scroll_into_view(element)
- selenium_generics.click(element, max_wait_time=1)
- break
-
- time_period_ = get_elements(time_period_elements)
- for element in time_period_:
- if element.text.lower() == time_period.lower():
- try:
- selenium_generics.click(element, max_wait_time=1)
- break
- except Exception:
- selenium_generics.scroll_into_view(element)
- selenium_generics.click(element, max_wait_time=1)
- break
-
-
-# ID 1305
-@given(parsers.re(r"On iOS I select (?:the hour '(?P.*)' minute '(?P.*)' in time period '(?P.*)'|the time '(?P.*)' minutes from now) on Ionic time wheel picker '(?P.*)'"))
-@when(parsers.re(r"On iOS I select (?:the hour '(?P.*)' minute '(?P.*)' in time period '(?P.*)'|the time '(?P.*)' minutes from now) on Ionic time wheel picker '(?P.*)'"))
-def click_on_ios_time_wheel_picker_element_native(selenium_generics: SeleniumGenerics, locators: Locators, locator_path, minutes_from_now=None, hour=None, minute=None, time_period=None):
- if selenium_generics.driver.capabilities['platformName'].lower() == 'ios':
- def convert_to_12h(hours_24h):
- if hours_24h == 0:
- return "12", "AM"
- elif 1 <= hours_24h <= 11:
- return str(hours_24h), "AM"
- elif hours_24h == 12:
- return "12", "PM"
- else:
- return str(hours_24h - 12), "PM"
-
- current_time = selenium_generics.driver.device_time
- timestamp_format = '%Y-%m-%dT%H:%M:%S%z'
- timestamp_datetime = datetime.strptime(current_time, timestamp_format)
- current_hour, current_minute = timestamp_datetime.hour, str(timestamp_datetime.minute)
- current_hour, current_time_period = convert_to_12h(current_hour)
- time_period = time_period if time_period else current_time_period
-
- def find_elements(locator, max_attempts=3):
- counter = 0
- while counter < max_attempts:
- result = selenium_generics.get_elements(locator)
- if result:
- return result
- time.sleep(5)
- counter += 1
- raise NoSuchElementException(f"Elements with locator: {locator} not found")
-
- def identify_current_hour_index(elements):
- for idx, e in enumerate(elements):
- if e.text == str(current_hour):
- return idx
- raise ElementNotVisibleException(f"Element with current hour: {current_hour} not found")
-
- def identify_current_minute_index(elements):
- for idx, e in enumerate(elements):
- if e.text == str(current_minute):
- return idx
- raise ElementNotVisibleException(f"Element with current minute: {current_minute} not found")
-
- def click_on_the_element(elements_, expected_text):
- for e in elements_:
- if e.text == str(expected_text):
- time.sleep(1)
- e.click()
- break
- if e.text == current_hour:
- continue
- time.sleep(1)
- e.click()
-
- if minutes_from_now:
- minutes_from_now = int(minutes_from_now)
- new_date = timestamp_datetime + timedelta(minutes=minutes_from_now)
- minute = str(new_date.minute)
- hour, time_period = convert_to_12h(new_date.hour)
- if MOBILE_SUFFIX in locator_path:
- with context_manager(selenium_generics):
- hour_elements = find_elements(locators.parse_and_get(locator_path, selenium_generics))[:12]
- current_hour_index = identify_current_hour_index(hour_elements)
- if int(hour) == 12:
- hour_elements_ = hour_elements[:current_hour_index + 1][::-1]
- click_on_the_element(hour_elements_, hour)
- elif int(current_hour) > int(hour) and int(current_hour) != 12:
- hour_elements_ = hour_elements[:current_hour_index + 1][::-1]
- click_on_the_element(hour_elements_, hour)
- else:
- hour_elements_ = hour_elements[current_hour_index:13]
- click_on_the_element(hour_elements_, hour)
-
- minute_elements = find_elements(locators.parse_and_get(locator_path, selenium_generics))[12:72]
- current_minute_index = identify_current_minute_index(minute_elements)
- if int(current_minute) > int(minute):
- minute_elements_ = minute_elements[:current_minute_index + 1][::-1]
- click_on_the_element(minute_elements_, minute)
- else:
- minute_elements_ = minute_elements[current_minute_index:72]
- click_on_the_element(minute_elements_, minute)
-
- time_period_elements = find_elements(locators.parse_and_get(locator_path, selenium_generics))[72:74]
- click_on_the_element(time_period_elements, time_period)
diff --git a/bp_core/frontend/common/step_definitions/mobile_device_actions.py b/bp_core/frontend/common/step_definitions/mobile_device_actions.py
index d0e18425..61bfe8a8 100644
--- a/bp_core/frontend/common/step_definitions/mobile_device_actions.py
+++ b/bp_core/frontend/common/step_definitions/mobile_device_actions.py
@@ -11,25 +11,6 @@
logger = structlog.get_logger(__name__)
-# MOBILE Predefined Step
-# ID 1201
-@when(parsers.re("I turn '(?PON|OFF)' the network connectivity in Browserstack"))
-@then(parsers.re("I turn '(?PON|OFF)' the network connectivity in Browserstack"))
-def change_network_status(selenium, request: FixtureRequest, network_status: str):
- NETWORK_STATUS = "CHANGE_NETWORK_STATUS_IN_BROWSERSTACK"
- payload = {"networkProfile": "no-network"} if network_status.lower() == "off" else {"networkProfile": "reset"}
- api_response = dict()
- set_request_endpoint(request, base_url="https://api-cloud.browserstack.com/app-automate/sessions/",
- endpoint=f"{selenium.session_id}/update_network.json", request_name=NETWORK_STATUS)
- selenium_host = request.session.config.option.selenium_host
- BS_USERNAME = selenium_host[0: selenium_host.index(":")]
- BS_PASSWORD = selenium_host[selenium_host.index(":") + 1: selenium_host.index("@")]
- setup_basic_auth(request=request, username=BS_USERNAME, password=BS_PASSWORD)
- add_json_payload(request, json_payload=payload, request_name=NETWORK_STATUS)
- make_api_request(request, api_response, request_type="PUT", request_name=NETWORK_STATUS)
- assert get_api_response(request, api_response, request_name=NETWORK_STATUS).status_code == 200
-
-
# MOBILE Predefined Step
# ID 1202
@when("I reset the mobile app")
diff --git a/bp_core/frontend/common/step_definitions/swipe_scroll_move_hover_drag_and_drop.py b/bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py
similarity index 98%
rename from bp_core/frontend/common/step_definitions/swipe_scroll_move_hover_drag_and_drop.py
rename to bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py
index 77d5e037..a3202a38 100644
--- a/bp_core/frontend/common/step_definitions/swipe_scroll_move_hover_drag_and_drop.py
+++ b/bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py
@@ -12,7 +12,6 @@
# WEB context Predefined Step
-# ID 301
@given(parsers.re("I drag and drop element '(?P | | | |