From 7964450ebd983341ddde030fa4ee80be5195c170 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Fri, 22 Mar 2024 14:21:39 +0500 Subject: [PATCH 1/3] main folder name changed --- .../setup_tests/test_installation_check.py | 135 ------------------ conftest.py | 8 +- .../test_project/features/api/test_feature.py | 2 +- .../shared_steps/api_sample.py | 2 +- .../shared_steps/common_steps.py | 14 +- .../test_steps/test_api_steps.py | 2 +- .../test_steps/test_mobile_steps.py | 4 +- .../test_steps/test_site_steps.py | 2 +- {bp_core => main}/.pylintrc | 0 {bp_core => main}/backend/api_utils/utils.py | 4 +- {bp_core => main}/backend/backend_plugin.py | 0 .../common/step_definitions/steps_common.py | 4 +- .../backend/common/utils/auth.py | 0 .../backend/common/utils/custom_exceptions.py | 0 .../backend/common/utils/helpers.py | 2 +- .../backend/common/utils/logger_config.py | 0 .../backend/common/utils/utils.py | 2 +- .../frontend/common/helpers/app.py | 0 .../frontend/common/helpers/browser.py | 4 +- .../frontend/common/helpers/elements.py | 8 +- .../common/helpers/selenium_generics.py | 8 +- .../common/helpers/standalone_compare.py | 2 +- .../frontend/common/helpers/web_compare.py | 6 +- .../common/step_definitions/__init__.py | 0 .../step_definitions/attribute_assertion.py | 10 +- .../step_definitions/browser_navigation.py | 10 +- .../click_touch_and_keyboard_actions.py | 10 +- .../common/step_definitions/date_time.py | 8 +- .../common/step_definitions/dropdowns.py | 12 +- .../step_definitions/environment_variables.py | 12 +- .../common/step_definitions/excel_and_csv.py | 2 +- .../common/step_definitions/html_tables.py | 10 +- .../step_definitions/mobile_device_actions.py | 6 +- .../common/step_definitions/steps_common.py | 0 .../step_definitions/swipe_drag_and_drop.py | 8 +- .../text_assertion_editing.py | 12 +- .../step_definitions/visual_comparison.py | 10 +- .../frontend/common/utils/containers.py | 2 +- .../frontend/common/utils/locator_parser.py | 4 +- .../frontend/common/utils/visual_utils.py | 0 .../frontend/common/utils/wait.py | 2 +- {bp_core => main}/frontend/frontend_plugin.py | 8 +- .../lib/pytest_testrail_client/__init__.py | 0 .../lib/pytest_testrail_client/_category.py | 26 ++-- .../lib/pytest_testrail_client/_enums.py | 0 .../lib/pytest_testrail_client/_exception.py | 0 .../lib/pytest_testrail_client/_session.py | 0 .../lib/pytest_testrail_client/_utils.py | 0 .../lib/pytest_testrail_client/helper.py | 0 .../pytest_testrail_client/model/__init__.py | 0 .../lib/pytest_testrail_client/model/case.py | 4 +- .../pytest_testrail_client/model/case_type.py | 0 .../lib/pytest_testrail_client/model/plan.py | 4 +- .../pytest_testrail_client/model/priority.py | 0 .../pytest_testrail_client/model/project.py | 2 +- .../pytest_testrail_client/model/result.py | 4 +- .../lib/pytest_testrail_client/model/run.py | 2 +- .../pytest_testrail_client/model/section.py | 2 +- .../pytest_testrail_client/model/status.py | 0 .../lib/pytest_testrail_client/model/suite.py | 2 +- .../pytest_testrail_client/model/templates.py | 0 .../lib/pytest_testrail_client/model/test.py | 2 +- .../pytest_testrail_client.py | 16 +-- .../pytest_testrail_client/testrail_api.py | 0 .../notifications/slack_plugin.py | 0 .../notifications/teams_plugin.py | 0 {bp_core => main}/plugin.py | 16 +-- .../setup/setup_scripts/__init__.py | 0 .../setup/setup_scripts/download_assets.py | 2 +- .../setup/setup_scripts/text_formatting.py | 0 .../setup/setup_tests/__init__.py | 0 .../setup/setup_tests/conftest.py | 0 .../setup_tests/test_installation_check.py | 135 ++++++++++++++++++ {bp_core => main}/utils/bp_storage.py | 0 {bp_core => main}/utils/data_manager.py | 2 +- {bp_core => main}/utils/dataset_handler.py | 4 +- {bp_core => main}/utils/env_variables.py | 2 +- {bp_core => main}/utils/exceptions.py | 0 {bp_core => main}/utils/faker_data.py | 0 {bp_core => main}/utils/gherkin_utils.py | 0 {bp_core => main}/utils/html_custom_style.css | 0 {bp_core => main}/utils/log_handler.py | 0 .../utils/pytest_terminal_report.py | 0 {bp_core => main}/utils/singleton.py | 0 {bp_core => main}/utils/utils.py | 0 pytest.ini | 2 +- setup_install.py | 4 +- 87 files changed, 283 insertions(+), 283 deletions(-) delete mode 100644 bp_core/setup/setup_tests/test_installation_check.py rename {bp_core => main}/.pylintrc (100%) rename {bp_core => main}/backend/api_utils/utils.py (93%) rename {bp_core => main}/backend/backend_plugin.py (100%) rename {bp_core => main}/backend/common/step_definitions/steps_common.py (99%) rename {bp_core => main}/backend/common/utils/auth.py (100%) rename {bp_core => main}/backend/common/utils/custom_exceptions.py (100%) rename {bp_core => main}/backend/common/utils/helpers.py (99%) rename {bp_core => main}/backend/common/utils/logger_config.py (100%) rename {bp_core => main}/backend/common/utils/utils.py (97%) rename {bp_core => main}/frontend/common/helpers/app.py (100%) rename {bp_core => main}/frontend/common/helpers/browser.py (98%) rename {bp_core => main}/frontend/common/helpers/elements.py (99%) rename {bp_core => main}/frontend/common/helpers/selenium_generics.py (96%) rename {bp_core => main}/frontend/common/helpers/standalone_compare.py (74%) rename {bp_core => main}/frontend/common/helpers/web_compare.py (89%) rename {bp_core => main}/frontend/common/step_definitions/__init__.py (100%) rename {bp_core => main}/frontend/common/step_definitions/attribute_assertion.py (98%) rename {bp_core => main}/frontend/common/step_definitions/browser_navigation.py (98%) rename {bp_core => main}/frontend/common/step_definitions/click_touch_and_keyboard_actions.py (96%) rename {bp_core => main}/frontend/common/step_definitions/date_time.py (95%) rename {bp_core => main}/frontend/common/step_definitions/dropdowns.py (97%) rename {bp_core => main}/frontend/common/step_definitions/environment_variables.py (95%) rename {bp_core => main}/frontend/common/step_definitions/excel_and_csv.py (99%) rename {bp_core => main}/frontend/common/step_definitions/html_tables.py (95%) rename {bp_core => main}/frontend/common/step_definitions/mobile_device_actions.py (86%) rename {bp_core => main}/frontend/common/step_definitions/steps_common.py (100%) rename {bp_core => main}/frontend/common/step_definitions/swipe_drag_and_drop.py (96%) rename {bp_core => main}/frontend/common/step_definitions/text_assertion_editing.py (98%) rename {bp_core => main}/frontend/common/step_definitions/visual_comparison.py (87%) rename {bp_core => main}/frontend/common/utils/containers.py (98%) rename {bp_core => main}/frontend/common/utils/locator_parser.py (97%) rename {bp_core => main}/frontend/common/utils/visual_utils.py (100%) rename {bp_core => main}/frontend/common/utils/wait.py (94%) rename {bp_core => main}/frontend/frontend_plugin.py (98%) rename {bp_core => main}/lib/pytest_testrail_client/__init__.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/_category.py (98%) rename {bp_core => main}/lib/pytest_testrail_client/_enums.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/_exception.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/_session.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/_utils.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/helper.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/__init__.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/case.py (96%) rename {bp_core => main}/lib/pytest_testrail_client/model/case_type.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/plan.py (97%) rename {bp_core => main}/lib/pytest_testrail_client/model/priority.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/project.py (97%) rename {bp_core => main}/lib/pytest_testrail_client/model/result.py (96%) rename {bp_core => main}/lib/pytest_testrail_client/model/run.py (98%) rename {bp_core => main}/lib/pytest_testrail_client/model/section.py (95%) rename {bp_core => main}/lib/pytest_testrail_client/model/status.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/suite.py (95%) rename {bp_core => main}/lib/pytest_testrail_client/model/templates.py (100%) rename {bp_core => main}/lib/pytest_testrail_client/model/test.py (96%) rename {bp_core => main}/lib/pytest_testrail_client/pytest_testrail_client.py (98%) rename {bp_core => main}/lib/pytest_testrail_client/testrail_api.py (100%) rename {bp_core => main}/notifications/slack_plugin.py (100%) rename {bp_core => main}/notifications/teams_plugin.py (100%) rename {bp_core => main}/plugin.py (98%) rename {bp_core => main}/setup/setup_scripts/__init__.py (100%) rename {bp_core => main}/setup/setup_scripts/download_assets.py (97%) rename {bp_core => main}/setup/setup_scripts/text_formatting.py (100%) rename {bp_core => main}/setup/setup_tests/__init__.py (100%) rename {bp_core => main}/setup/setup_tests/conftest.py (100%) create mode 100644 main/setup/setup_tests/test_installation_check.py rename {bp_core => main}/utils/bp_storage.py (100%) rename {bp_core => main}/utils/data_manager.py (93%) rename {bp_core => main}/utils/dataset_handler.py (92%) rename {bp_core => main}/utils/env_variables.py (96%) rename {bp_core => main}/utils/exceptions.py (100%) rename {bp_core => main}/utils/faker_data.py (100%) rename {bp_core => main}/utils/gherkin_utils.py (100%) rename {bp_core => main}/utils/html_custom_style.css (100%) rename {bp_core => main}/utils/log_handler.py (100%) rename {bp_core => main}/utils/pytest_terminal_report.py (100%) rename {bp_core => main}/utils/singleton.py (100%) rename {bp_core => main}/utils/utils.py (100%) diff --git a/bp_core/setup/setup_tests/test_installation_check.py b/bp_core/setup/setup_tests/test_installation_check.py deleted file mode 100644 index 6ab80aa4..00000000 --- a/bp_core/setup/setup_tests/test_installation_check.py +++ /dev/null @@ -1,135 +0,0 @@ -import os -import pytest -from assertpy import assert_that - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_root_folder(): - assert_that(os.path.isfile("./.editorconfig")).is_true() - assert_that(os.path.isfile("./.gitignore")).is_true() - assert_that(os.path.isfile("./conftest.py")).is_true() - assert_that(os.path.isfile("./setup_install.sh")).is_true() - assert_that(os.path.isfile("./setup_install.py")).is_true() - assert_that(os.path.isfile("./pytest.ini")).is_true() - assert_that(os.path.isfile("./README.md")).is_true() - assert_that(os.path.isfile("./requirements.txt")).is_true() - assert_that(os.path.isfile("./docker-compose.yml")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_bp_core_folder(): - assert_that(os.path.isfile("./bp_core/.pylintrc")).is_true() - assert_that(os.path.isfile("./bp_core/plugin.py")).is_true() - assert_that(os.path.isfile("./bp_core/notifications/slack_plugin.py")).is_true() - assert_that(os.path.isfile("./bp_core/notifications/teams_plugin.py")).is_true() - assert_that(os.path.isdir("./bp_core/backend")).is_true() - assert_that(os.path.isdir("./bp_core/frontend")).is_true() - assert_that(os.path.isdir("./bp_core/setup")).is_true() - assert_that(os.path.isdir("./bp_core/lib")).is_true() - assert_that(os.path.isdir("./bp_core/utils")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_common_ui_folder(): - assert_that( - os.path.isfile("./bp_core/frontend/common/helpers/elements.py") - ).is_true() - assert_that( - os.path.isfile("./bp_core/frontend/common/helpers/browser.py") - ).is_true() - assert_that( - os.path.isfile("./bp_core/frontend/common/helpers/selenium_generics.py") - ).is_true() - assert_that( - os.path.isfile("./bp_core/frontend/common/helpers/app.py") - ).is_true() - assert_that( - os.path.isfile("./bp_core/frontend/common/helpers/web_compare.py") - ).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_screenshots_folder(): - assert_that(os.path.isdir("./output/screenshots")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_step_definitions_folder(): - assert_that(os.path.isdir("./bp_core/frontend/common/step_definitions")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/browser_navigation.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/date_time.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/dropdowns.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/attribute_assertion.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/environment_variables.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/excel_and_csv.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/html_tables.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/mobile_device_actions.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/text_assertion_editing.py")).is_true() - assert_that(os.path.isfile("./bp_core/frontend/common/step_definitions/visual_comparison.py")).is_true() - assert_that(os.path.isfile("./bp_core/backend/common/step_definitions/steps_common.py")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_test_data_folder(): - assert_that(os.path.isdir("./test_data")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_utils_folder(): - assert_that(os.path.isdir("./bp_core/utils")).is_true() - assert_that(os.path.isfile("./bp_core/utils/env_variables.py")).is_true() - assert_that(os.path.isfile("./bp_core/utils/gherkin_utils.py")).is_true() - assert_that(os.path.isfile("./bp_core/utils/utils.py")).is_true() - assert_that(os.path.isfile("./bp_core/utils/faker_data.py")).is_true() - assert_that(os.path.isfile("./bp_core/utils/pytest_terminal_report.py")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_configs_folder(): - assert_that(os.path.isdir("./env_configs")).is_true() - assert_that(os.path.isfile("./env_configs/.local.env")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_lib_folder(): - assert_that(os.path.isdir("./bp_core/lib")).is_true() - assert_that(os.path.isdir("./bp_core/lib/pytest_testrail_client")).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_installation_folder(): - assert_that(os.path.isdir("./bp_core/setup")).is_true() - assert_that(os.path.isdir("./bp_core/setup/setup_scripts")).is_true() - assert_that(os.path.isdir("./bp_core/setup/setup_tests")).is_true() - assert_that( - os.path.isfile("./bp_core/setup/setup_scripts/download_assets.py") - ).is_true() - - -@pytest.mark.nondestructive -@pytest.mark.automated -@pytest.mark.setup_check -def test_check_binaries_folder(): - assert_that(os.path.isdir("./webdriver")).is_true() diff --git a/conftest.py b/conftest.py index ed047d68..d7162a23 100755 --- a/conftest.py +++ b/conftest.py @@ -1,5 +1,5 @@ -pytest_plugins = ["bp_core.plugin", - "bp_core.lib.pytest_testrail_client.pytest_testrail_client", - "bp_core.notifications.slack_plugin", - "bp_core.notifications.teams_plugin" +pytest_plugins = ["main.plugin", + "main.lib.pytest_testrail_client.pytest_testrail_client", + "main.notifications.slack_plugin", + "main.notifications.teams_plugin" ] diff --git a/frontend/test_project/features/api/test_feature.py b/frontend/test_project/features/api/test_feature.py index 4b946eaf..75678810 100644 --- a/frontend/test_project/features/api/test_feature.py +++ b/frontend/test_project/features/api/test_feature.py @@ -1,7 +1,7 @@ from os import environ import pytest -from bp_core.backend.common.step_definitions.steps_common import * +from main.backend.common.step_definitions.steps_common import * from assertpy import assert_that from openai import OpenAI diff --git a/frontend/test_project/step_definitions/shared_steps/api_sample.py b/frontend/test_project/step_definitions/shared_steps/api_sample.py index 792c8d30..ab24ec3b 100644 --- a/frontend/test_project/step_definitions/shared_steps/api_sample.py +++ b/frontend/test_project/step_definitions/shared_steps/api_sample.py @@ -1,6 +1,6 @@ from pytest_bdd import when, parsers -from bp_core.backend.api_utils.utils import ( +from main.backend.api_utils.utils import ( post_request, get_request, put_request, diff --git a/frontend/test_project/step_definitions/shared_steps/common_steps.py b/frontend/test_project/step_definitions/shared_steps/common_steps.py index 1b1d453f..d13c6681 100644 --- a/frontend/test_project/step_definitions/shared_steps/common_steps.py +++ b/frontend/test_project/step_definitions/shared_steps/common_steps.py @@ -1,19 +1,19 @@ import datetime from pytest_bdd import when, parsers, given, then -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.locator_parser import Locators +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics import re from assertpy import assert_that from selenium.webdriver.common.by import By -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from pathlib import Path -from bp_core.utils import data_manager +from main.utils import data_manager -from bp_core.frontend.common.step_definitions.attribute_assertion import \ +from main.frontend.common.step_definitions.attribute_assertion import \ element_displayed, wait_for_displayed -from bp_core.frontend.common.step_definitions.click_touch_and_keyboard_actions import click_on_locator -from bp_core.frontend.common.step_definitions.text_assertion_editing import set_element_value, \ +from main.frontend.common.step_definitions.click_touch_and_keyboard_actions import click_on_locator +from main.frontend.common.step_definitions.text_assertion_editing import set_element_value, \ element_equals_text MOBILE_SUFFIX = "_mob" diff --git a/frontend/test_project/step_definitions/test_steps/test_api_steps.py b/frontend/test_project/step_definitions/test_steps/test_api_steps.py index 64a896e3..e7d55c11 100644 --- a/frontend/test_project/step_definitions/test_steps/test_api_steps.py +++ b/frontend/test_project/step_definitions/test_steps/test_api_steps.py @@ -5,7 +5,7 @@ from frontend.test_project.step_definitions.shared_steps.api_common import * from frontend.test_project.step_definitions.shared_steps.api_sample import * from frontend.test_project.step_definitions.shared_steps.api_assertions import * -from bp_core.plugin import PROJECT_DIR +from main.plugin import PROJECT_DIR scenarios(os.path.join(PROJECT_DIR, "frontend/test_project/features/api/api_tests.feature")) diff --git a/frontend/test_project/step_definitions/test_steps/test_mobile_steps.py b/frontend/test_project/step_definitions/test_steps/test_mobile_steps.py index ff0efcc7..6e5d945c 100644 --- a/frontend/test_project/step_definitions/test_steps/test_mobile_steps.py +++ b/frontend/test_project/step_definitions/test_steps/test_mobile_steps.py @@ -1,9 +1,9 @@ import os from pytest_bdd import scenarios -from bp_core.plugin import PROJECT_DIR +from main.plugin import PROJECT_DIR from frontend.test_project.step_definitions.shared_steps.common_steps import * -from bp_core.frontend.common.step_definitions import * +from main.frontend.common.step_definitions import * scenarios(os.path.join(PROJECT_DIR, "frontend/test_project/features/mobile/ios_login.feature")) diff --git a/frontend/test_project/step_definitions/test_steps/test_site_steps.py b/frontend/test_project/step_definitions/test_steps/test_site_steps.py index 121e208b..66a90765 100644 --- a/frontend/test_project/step_definitions/test_steps/test_site_steps.py +++ b/frontend/test_project/step_definitions/test_steps/test_site_steps.py @@ -2,7 +2,7 @@ from pytest_bdd import scenarios from frontend.test_project.step_definitions.shared_steps.common_steps import * -from bp_core.plugin import PROJECT_DIR +from main.plugin import PROJECT_DIR scenarios(os.path.join(PROJECT_DIR, "frontend/test_project/features/web/login_tests.feature")) scenarios(os.path.join(PROJECT_DIR, "frontend/test_project/features/visual/visual_tests.feature")) diff --git a/bp_core/.pylintrc b/main/.pylintrc similarity index 100% rename from bp_core/.pylintrc rename to main/.pylintrc diff --git a/bp_core/backend/api_utils/utils.py b/main/backend/api_utils/utils.py similarity index 93% rename from bp_core/backend/api_utils/utils.py rename to main/backend/api_utils/utils.py index 94f04eca..fc566865 100644 --- a/bp_core/backend/api_utils/utils.py +++ b/main/backend/api_utils/utils.py @@ -4,8 +4,8 @@ import requests -from bp_core.backend.common.utils.custom_exceptions import InvalidFileFormatException, FileNotFoundException -from bp_core.backend.common.utils.logger_config import logger +from main.backend.common.utils.custom_exceptions import InvalidFileFormatException, FileNotFoundException +from main.backend.common.utils.logger_config import logger session = requests.Session() diff --git a/bp_core/backend/backend_plugin.py b/main/backend/backend_plugin.py similarity index 100% rename from bp_core/backend/backend_plugin.py rename to main/backend/backend_plugin.py diff --git a/bp_core/backend/common/step_definitions/steps_common.py b/main/backend/common/step_definitions/steps_common.py similarity index 99% rename from bp_core/backend/common/step_definitions/steps_common.py rename to main/backend/common/step_definitions/steps_common.py index 71e33e3f..11d54c01 100644 --- a/bp_core/backend/common/step_definitions/steps_common.py +++ b/main/backend/common/step_definitions/steps_common.py @@ -9,8 +9,8 @@ import structlog from pytest import FixtureRequest -from bp_core.backend.common.utils import utils, helpers, auth as boilerplate_auth -from bp_core.utils import data_manager +from main.backend.common.utils import utils, helpers, auth as boilerplate_auth +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/backend/common/utils/auth.py b/main/backend/common/utils/auth.py similarity index 100% rename from bp_core/backend/common/utils/auth.py rename to main/backend/common/utils/auth.py diff --git a/bp_core/backend/common/utils/custom_exceptions.py b/main/backend/common/utils/custom_exceptions.py similarity index 100% rename from bp_core/backend/common/utils/custom_exceptions.py rename to main/backend/common/utils/custom_exceptions.py diff --git a/bp_core/backend/common/utils/helpers.py b/main/backend/common/utils/helpers.py similarity index 99% rename from bp_core/backend/common/utils/helpers.py rename to main/backend/common/utils/helpers.py index b4aa1d3a..ca49a747 100644 --- a/bp_core/backend/common/utils/helpers.py +++ b/main/backend/common/utils/helpers.py @@ -10,7 +10,7 @@ import structlog from requests.auth import AuthBase -from bp_core.utils.exceptions import ApiException +from main.utils.exceptions import ApiException logger = structlog.get_logger(__name__) diff --git a/bp_core/backend/common/utils/logger_config.py b/main/backend/common/utils/logger_config.py similarity index 100% rename from bp_core/backend/common/utils/logger_config.py rename to main/backend/common/utils/logger_config.py diff --git a/bp_core/backend/common/utils/utils.py b/main/backend/common/utils/utils.py similarity index 97% rename from bp_core/backend/common/utils/utils.py rename to main/backend/common/utils/utils.py index 2e36a31e..541726d0 100644 --- a/bp_core/backend/common/utils/utils.py +++ b/main/backend/common/utils/utils.py @@ -6,7 +6,7 @@ from collections import namedtuple from pathlib import Path from typing import Tuple -from bp_core.utils import env_variables +from main.utils import env_variables Dataset = namedtuple("Dataset", "request_args set_env") diff --git a/bp_core/frontend/common/helpers/app.py b/main/frontend/common/helpers/app.py similarity index 100% rename from bp_core/frontend/common/helpers/app.py rename to main/frontend/common/helpers/app.py diff --git a/bp_core/frontend/common/helpers/browser.py b/main/frontend/common/helpers/browser.py similarity index 98% rename from bp_core/frontend/common/helpers/browser.py rename to main/frontend/common/helpers/browser.py index a3f95868..03ef2c8a 100644 --- a/bp_core/frontend/common/helpers/browser.py +++ b/main/frontend/common/helpers/browser.py @@ -10,8 +10,8 @@ from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait -from bp_core.frontend.common.utils.containers import WindowPosition, WindowSize -from bp_core.utils.exceptions import BrowserException +from main.frontend.common.utils.containers import WindowPosition, WindowSize +from main.utils.exceptions import BrowserException logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/helpers/elements.py b/main/frontend/common/helpers/elements.py similarity index 99% rename from bp_core/frontend/common/helpers/elements.py rename to main/frontend/common/helpers/elements.py index 2b3a40f4..53f8c205 100644 --- a/bp_core/frontend/common/helpers/elements.py +++ b/main/frontend/common/helpers/elements.py @@ -21,11 +21,11 @@ from selenium.webdriver.support.select import Select from selenium.webdriver.support.ui import WebDriverWait -from bp_core.frontend.common.utils import wait -from bp_core.frontend.common.utils.containers import Locator, ShadowLocator, ValidLocatorTypes -from bp_core.frontend.common.utils.locator_parser import parse_locator +from main.frontend.common.utils import wait +from main.frontend.common.utils.containers import Locator, ShadowLocator, ValidLocatorTypes +from main.frontend.common.utils.locator_parser import parse_locator from selenium.common.exceptions import ElementNotVisibleException, NoSuchElementException -from bp_core.frontend.common.utils.wait import wait_until +from main.frontend.common.utils.wait import wait_until logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/helpers/selenium_generics.py b/main/frontend/common/helpers/selenium_generics.py similarity index 96% rename from bp_core/frontend/common/helpers/selenium_generics.py rename to main/frontend/common/helpers/selenium_generics.py index 9da7a20f..5350853a 100644 --- a/bp_core/frontend/common/helpers/selenium_generics.py +++ b/main/frontend/common/helpers/selenium_generics.py @@ -11,10 +11,10 @@ from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver.remote.webelement import WebElement -from bp_core.frontend.common.helpers.browser import BrowserInteraction -from bp_core.frontend.common.helpers.elements import ElementInteraction -from bp_core.frontend.common.utils.containers import Locator, ShadowLocator -from bp_core.frontend.common.helpers.app import App +from main.frontend.common.helpers.browser import BrowserInteraction +from main.frontend.common.helpers.elements import ElementInteraction +from main.frontend.common.utils.containers import Locator, ShadowLocator +from main.frontend.common.helpers.app import App logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/helpers/standalone_compare.py b/main/frontend/common/helpers/standalone_compare.py similarity index 74% rename from bp_core/frontend/common/helpers/standalone_compare.py rename to main/frontend/common/helpers/standalone_compare.py index af35b745..7e744064 100644 --- a/bp_core/frontend/common/helpers/standalone_compare.py +++ b/main/frontend/common/helpers/standalone_compare.py @@ -1,4 +1,4 @@ -from bp_core.frontend.common.utils import visual_utils +from main.frontend.common.utils import visual_utils # Short Ciruit are_images_same function to are_two_images_look_same function # in this helper module. diff --git a/bp_core/frontend/common/helpers/web_compare.py b/main/frontend/common/helpers/web_compare.py similarity index 89% rename from bp_core/frontend/common/helpers/web_compare.py rename to main/frontend/common/helpers/web_compare.py index f7c339c5..5da4c0a1 100644 --- a/bp_core/frontend/common/helpers/web_compare.py +++ b/main/frontend/common/helpers/web_compare.py @@ -1,9 +1,9 @@ import typing from selenium.webdriver.remote.webelement import WebElement -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.frontend.common.utils.containers import Locator, ShadowLocator -from bp_core.frontend.common.utils import visual_utils +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.containers import Locator, ShadowLocator +from main.frontend.common.utils import visual_utils def are_two_webelements_look_same( diff --git a/bp_core/frontend/common/step_definitions/__init__.py b/main/frontend/common/step_definitions/__init__.py similarity index 100% rename from bp_core/frontend/common/step_definitions/__init__.py rename to main/frontend/common/step_definitions/__init__.py diff --git a/bp_core/frontend/common/step_definitions/attribute_assertion.py b/main/frontend/common/step_definitions/attribute_assertion.py similarity index 98% rename from bp_core/frontend/common/step_definitions/attribute_assertion.py rename to main/frontend/common/step_definitions/attribute_assertion.py index 887d2227..839362cd 100644 --- a/bp_core/frontend/common/step_definitions/attribute_assertion.py +++ b/main/frontend/common/step_definitions/attribute_assertion.py @@ -3,13 +3,13 @@ from pytest_bdd import parsers, given, when, then from pytest_check import check -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from selenium.common.exceptions import TimeoutException 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 MOBILE_SUFFIX -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/browser_navigation.py b/main/frontend/common/step_definitions/browser_navigation.py similarity index 98% rename from bp_core/frontend/common/step_definitions/browser_navigation.py rename to main/frontend/common/step_definitions/browser_navigation.py index 9d357ed6..01beb9e9 100644 --- a/bp_core/frontend/common/step_definitions/browser_navigation.py +++ b/main/frontend/common/step_definitions/browser_navigation.py @@ -11,12 +11,12 @@ from pathlib import Path from pytest_bdd import parsers, given, when, then from pytest_check import check -from bp_core.frontend.common.utils.containers import WindowSize +from main.frontend.common.utils.containers import WindowSize from assertpy import assert_that -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils import data_manager -from bp_core.utils.utils import remote_execute_cmd_commands +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.locator_parser import Locators +from main.utils import data_manager +from main.utils.utils import remote_execute_cmd_commands logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py b/main/frontend/common/step_definitions/click_touch_and_keyboard_actions.py similarity index 96% rename from bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py rename to main/frontend/common/step_definitions/click_touch_and_keyboard_actions.py index 2ce0c636..0ae3d00f 100644 --- a/bp_core/frontend/common/step_definitions/click_touch_and_keyboard_actions.py +++ b/main/frontend/common/step_definitions/click_touch_and_keyboard_actions.py @@ -1,12 +1,12 @@ import structlog from pytest_bdd import parsers, given, when, then -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from selenium.common.exceptions import NoSuchElementException -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 main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/date_time.py b/main/frontend/common/step_definitions/date_time.py similarity index 95% rename from bp_core/frontend/common/step_definitions/date_time.py rename to main/frontend/common/step_definitions/date_time.py index ccc347a4..76557f16 100644 --- a/bp_core/frontend/common/step_definitions/date_time.py +++ b/main/frontend/common/step_definitions/date_time.py @@ -11,10 +11,10 @@ from datetime import datetime, timedelta from pytest_bdd import parsers, given, when -from bp_core.frontend.common.helpers.app import context_manager -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 main.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/dropdowns.py b/main/frontend/common/step_definitions/dropdowns.py similarity index 97% rename from bp_core/frontend/common/step_definitions/dropdowns.py rename to main/frontend/common/step_definitions/dropdowns.py index b4158ad5..cd248f89 100644 --- a/bp_core/frontend/common/step_definitions/dropdowns.py +++ b/main/frontend/common/step_definitions/dropdowns.py @@ -11,15 +11,15 @@ from pytest_bdd import parsers, given, when, then from pytest_check import check -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from selenium.common.exceptions import NoSuchElementException 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 MOBILE_SUFFIX -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils.gherkin_utils import data_table_vertical_converter -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators +from main.utils.gherkin_utils import data_table_vertical_converter +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/environment_variables.py b/main/frontend/common/step_definitions/environment_variables.py similarity index 95% rename from bp_core/frontend/common/step_definitions/environment_variables.py rename to main/frontend/common/step_definitions/environment_variables.py index 7ed9996c..368f260e 100644 --- a/bp_core/frontend/common/step_definitions/environment_variables.py +++ b/main/frontend/common/step_definitions/environment_variables.py @@ -15,12 +15,12 @@ from pathlib import Path from openpyxl.reader.excel import load_workbook from pytest_bdd import parsers, given, when, then -from bp_core.frontend.common.helpers.app import context_manager -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.bp_storage import BPStorage +from main.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators +from main.utils import data_manager +from main.utils.bp_storage import BPStorage logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/excel_and_csv.py b/main/frontend/common/step_definitions/excel_and_csv.py similarity index 99% rename from bp_core/frontend/common/step_definitions/excel_and_csv.py rename to main/frontend/common/step_definitions/excel_and_csv.py index dc4ab6a2..94de1de9 100644 --- a/bp_core/frontend/common/step_definitions/excel_and_csv.py +++ b/main/frontend/common/step_definitions/excel_and_csv.py @@ -7,7 +7,7 @@ from openpyxl.reader.excel import load_workbook from pytest_bdd import parsers, given, when, then from assertpy import assert_that -from bp_core.utils import data_manager +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/html_tables.py b/main/frontend/common/step_definitions/html_tables.py similarity index 95% rename from bp_core/frontend/common/step_definitions/html_tables.py rename to main/frontend/common/step_definitions/html_tables.py index 438db539..d091d498 100644 --- a/bp_core/frontend/common/step_definitions/html_tables.py +++ b/main/frontend/common/step_definitions/html_tables.py @@ -3,11 +3,11 @@ from pytest_bdd import parsers, then from assertpy import assert_that -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils.exceptions import DataTableException -from bp_core.utils.gherkin_utils import data_table_horizontal_converter -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.locator_parser import Locators +from main.utils.exceptions import DataTableException +from main.utils.gherkin_utils import data_table_horizontal_converter +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/mobile_device_actions.py b/main/frontend/common/step_definitions/mobile_device_actions.py similarity index 86% rename from bp_core/frontend/common/step_definitions/mobile_device_actions.py rename to main/frontend/common/step_definitions/mobile_device_actions.py index 61bfe8a8..833c6ee5 100644 --- a/bp_core/frontend/common/step_definitions/mobile_device_actions.py +++ b/main/frontend/common/step_definitions/mobile_device_actions.py @@ -3,10 +3,10 @@ from _pytest.fixtures import FixtureRequest from pytest_bdd import parsers, when, then -from bp_core.backend.common.step_definitions.steps_common import set_request_endpoint, \ +from main.backend.common.step_definitions.steps_common import set_request_endpoint, \ add_json_payload, make_api_request, get_api_response, setup_basic_auth -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/steps_common.py b/main/frontend/common/step_definitions/steps_common.py similarity index 100% rename from bp_core/frontend/common/step_definitions/steps_common.py rename to main/frontend/common/step_definitions/steps_common.py diff --git a/bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py b/main/frontend/common/step_definitions/swipe_drag_and_drop.py similarity index 96% rename from bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py rename to main/frontend/common/step_definitions/swipe_drag_and_drop.py index a3202a38..1b83ae06 100644 --- a/bp_core/frontend/common/step_definitions/swipe_drag_and_drop.py +++ b/main/frontend/common/step_definitions/swipe_drag_and_drop.py @@ -2,11 +2,11 @@ import structlog from pytest_bdd import parsers, given, when -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from selenium.common.exceptions import NoSuchElementException -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.locator_parser import Locators +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/text_assertion_editing.py b/main/frontend/common/step_definitions/text_assertion_editing.py similarity index 98% rename from bp_core/frontend/common/step_definitions/text_assertion_editing.py rename to main/frontend/common/step_definitions/text_assertion_editing.py index cf595bb3..666e47ee 100644 --- a/bp_core/frontend/common/step_definitions/text_assertion_editing.py +++ b/main/frontend/common/step_definitions/text_assertion_editing.py @@ -4,15 +4,15 @@ from pytest_bdd import parsers, given, when, then from pytest_check import check -from bp_core.frontend.common.helpers.app import context_manager +from main.frontend.common.helpers.app import context_manager from selenium.common.exceptions import NoSuchElementException 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 MOBILE_SUFFIX -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.utils.faker_data import DataUtils -from bp_core.utils import data_manager +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.step_definitions.steps_common import MOBILE_SUFFIX +from main.frontend.common.utils.locator_parser import Locators +from main.utils.faker_data import DataUtils +from main.utils import data_manager logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/step_definitions/visual_comparison.py b/main/frontend/common/step_definitions/visual_comparison.py similarity index 87% rename from bp_core/frontend/common/step_definitions/visual_comparison.py rename to main/frontend/common/step_definitions/visual_comparison.py index f3971b1e..29fe399b 100644 --- a/bp_core/frontend/common/step_definitions/visual_comparison.py +++ b/main/frontend/common/step_definitions/visual_comparison.py @@ -4,11 +4,11 @@ from pytest_bdd import parsers, then from pytest_check import check -from bp_core.frontend.common.helpers.selenium_generics import SeleniumGenerics -from bp_core.frontend.common.utils.locator_parser import Locators -from bp_core.frontend.common.helpers.standalone_compare import are_two_images_look_same -from bp_core.utils.gherkin_utils import data_table_horizontal_converter -from bp_core.frontend.common.helpers.web_compare import (are_two_webelements_look_same, are_two_webpages_look_same) +from main.frontend.common.helpers.selenium_generics import SeleniumGenerics +from main.frontend.common.utils.locator_parser import Locators +from main.frontend.common.helpers.standalone_compare import are_two_images_look_same +from main.utils.gherkin_utils import data_table_horizontal_converter +from main.frontend.common.helpers.web_compare import (are_two_webelements_look_same, are_two_webpages_look_same) logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/utils/containers.py b/main/frontend/common/utils/containers.py similarity index 98% rename from bp_core/frontend/common/utils/containers.py rename to main/frontend/common/utils/containers.py index 3c96d4ae..875c4de4 100644 --- a/bp_core/frontend/common/utils/containers.py +++ b/main/frontend/common/utils/containers.py @@ -3,7 +3,7 @@ from collections import UserList, namedtuple from enum import Enum -from bp_core.utils.exceptions import LocatorException +from main.utils.exceptions import LocatorException WindowSize = namedtuple("WindowSize", "width height") WindowPosition = namedtuple("WindowPosition", "x y") diff --git a/bp_core/frontend/common/utils/locator_parser.py b/main/frontend/common/utils/locator_parser.py similarity index 97% rename from bp_core/frontend/common/utils/locator_parser.py rename to main/frontend/common/utils/locator_parser.py index e5373f71..7e3e0c6a 100644 --- a/bp_core/frontend/common/utils/locator_parser.py +++ b/main/frontend/common/utils/locator_parser.py @@ -7,8 +7,8 @@ from pathlib import Path import structlog -from bp_core.frontend.common.utils.containers import Locator, ShadowLocator, ValidLocatorTypes -from bp_core.utils.exceptions import LocatorException +from main.frontend.common.utils.containers import Locator, ShadowLocator, ValidLocatorTypes +from main.utils.exceptions import LocatorException logger = structlog.get_logger(__name__) diff --git a/bp_core/frontend/common/utils/visual_utils.py b/main/frontend/common/utils/visual_utils.py similarity index 100% rename from bp_core/frontend/common/utils/visual_utils.py rename to main/frontend/common/utils/visual_utils.py diff --git a/bp_core/frontend/common/utils/wait.py b/main/frontend/common/utils/wait.py similarity index 94% rename from bp_core/frontend/common/utils/wait.py rename to main/frontend/common/utils/wait.py index 7ba8caf1..585de845 100644 --- a/bp_core/frontend/common/utils/wait.py +++ b/main/frontend/common/utils/wait.py @@ -1,7 +1,7 @@ import time from typing import Callable -from bp_core.plugin import logger +from main.plugin import logger def wait_until( diff --git a/bp_core/frontend/frontend_plugin.py b/main/frontend/frontend_plugin.py similarity index 98% rename from bp_core/frontend/frontend_plugin.py rename to main/frontend/frontend_plugin.py index 9aeba3d4..cbc0a231 100644 --- a/bp_core/frontend/frontend_plugin.py +++ b/main/frontend/frontend_plugin.py @@ -9,16 +9,16 @@ from pytest_bdd import parser as pytest_bdd_parser from selenium.webdriver.common.proxy import Proxy, ProxyType -from bp_core.frontend.common.step_definitions import * -from bp_core.frontend.common.utils.locator_parser import Locators +from main.frontend.common.step_definitions import * +from main.frontend.common.utils.locator_parser import Locators from pytest_selenium.drivers import appium from pytest_selenium.drivers import remote import logging -from bp_core.lib.pytest_testrail_client.pytest_testrail_client import _step_error -from bp_core.utils.utils import save_base64_as_png, TEMP_SCREENSHOTS, logger +from main.lib.pytest_testrail_client.pytest_testrail_client import _step_error +from main.utils.utils import save_base64_as_png, TEMP_SCREENSHOTS, logger from pytest_selenium import drivers, split_class_and_test_names diff --git a/bp_core/lib/pytest_testrail_client/__init__.py b/main/lib/pytest_testrail_client/__init__.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/__init__.py rename to main/lib/pytest_testrail_client/__init__.py diff --git a/bp_core/lib/pytest_testrail_client/_category.py b/main/lib/pytest_testrail_client/_category.py similarity index 98% rename from bp_core/lib/pytest_testrail_client/_category.py rename to main/lib/pytest_testrail_client/_category.py index e9771114..9713b1a7 100644 --- a/bp_core/lib/pytest_testrail_client/_category.py +++ b/main/lib/pytest_testrail_client/_category.py @@ -5,19 +5,19 @@ from typing import List, Union from pathlib import Path -from bp_core.lib.pytest_testrail_client._enums import METHODS -from bp_core.lib.pytest_testrail_client._exception import TestRailError -from bp_core.lib.pytest_testrail_client.model.case import Case -from bp_core.lib.pytest_testrail_client.model.case_type import CaseType -from bp_core.lib.pytest_testrail_client.model.plan import Entry, Plan -from bp_core.lib.pytest_testrail_client.model.priority import Priority -from bp_core.lib.pytest_testrail_client.model.project import Project -from bp_core.lib.pytest_testrail_client.model.result import Result -from bp_core.lib.pytest_testrail_client.model.section import Section -from bp_core.lib.pytest_testrail_client.model.status import Status -from bp_core.lib.pytest_testrail_client.model.suite import Suite -from bp_core.lib.pytest_testrail_client.model.templates import Template -from bp_core.lib.pytest_testrail_client.model.test import Test +from main.lib.pytest_testrail_client._enums import METHODS +from main.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client.model.case import Case +from main.lib.pytest_testrail_client.model.case_type import CaseType +from main.lib.pytest_testrail_client.model.plan import Entry, Plan +from main.lib.pytest_testrail_client.model.priority import Priority +from main.lib.pytest_testrail_client.model.project import Project +from main.lib.pytest_testrail_client.model.result import Result +from main.lib.pytest_testrail_client.model.section import Section +from main.lib.pytest_testrail_client.model.status import Status +from main.lib.pytest_testrail_client.model.suite import Suite +from main.lib.pytest_testrail_client.model.templates import Template +from main.lib.pytest_testrail_client.model.test import Test class BaseCategory: diff --git a/bp_core/lib/pytest_testrail_client/_enums.py b/main/lib/pytest_testrail_client/_enums.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/_enums.py rename to main/lib/pytest_testrail_client/_enums.py diff --git a/bp_core/lib/pytest_testrail_client/_exception.py b/main/lib/pytest_testrail_client/_exception.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/_exception.py rename to main/lib/pytest_testrail_client/_exception.py diff --git a/bp_core/lib/pytest_testrail_client/_session.py b/main/lib/pytest_testrail_client/_session.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/_session.py rename to main/lib/pytest_testrail_client/_session.py diff --git a/bp_core/lib/pytest_testrail_client/_utils.py b/main/lib/pytest_testrail_client/_utils.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/_utils.py rename to main/lib/pytest_testrail_client/_utils.py diff --git a/bp_core/lib/pytest_testrail_client/helper.py b/main/lib/pytest_testrail_client/helper.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/helper.py rename to main/lib/pytest_testrail_client/helper.py diff --git a/bp_core/lib/pytest_testrail_client/model/__init__.py b/main/lib/pytest_testrail_client/model/__init__.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/model/__init__.py rename to main/lib/pytest_testrail_client/model/__init__.py diff --git a/bp_core/lib/pytest_testrail_client/model/case.py b/main/lib/pytest_testrail_client/model/case.py similarity index 96% rename from bp_core/lib/pytest_testrail_client/model/case.py rename to main/lib/pytest_testrail_client/model/case.py index dbe8a8c2..03ec7375 100644 --- a/bp_core/lib/pytest_testrail_client/model/case.py +++ b/main/lib/pytest_testrail_client/model/case.py @@ -1,7 +1,7 @@ from datetime import datetime -from bp_core.lib.pytest_testrail_client._exception import TestRailError -from bp_core.lib.pytest_testrail_client.helper import custom_methods +from main.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client.helper import custom_methods class Case(object): diff --git a/bp_core/lib/pytest_testrail_client/model/case_type.py b/main/lib/pytest_testrail_client/model/case_type.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/model/case_type.py rename to main/lib/pytest_testrail_client/model/case_type.py diff --git a/bp_core/lib/pytest_testrail_client/model/plan.py b/main/lib/pytest_testrail_client/model/plan.py similarity index 97% rename from bp_core/lib/pytest_testrail_client/model/plan.py rename to main/lib/pytest_testrail_client/model/plan.py index 1d05dc9d..57710825 100644 --- a/bp_core/lib/pytest_testrail_client/model/plan.py +++ b/main/lib/pytest_testrail_client/model/plan.py @@ -1,7 +1,7 @@ from datetime import datetime -from bp_core.lib.pytest_testrail_client._exception import TestRailError -from bp_core.lib.pytest_testrail_client.model.run import Run +from main.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client.model.run import Run class Plan(object): diff --git a/bp_core/lib/pytest_testrail_client/model/priority.py b/main/lib/pytest_testrail_client/model/priority.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/model/priority.py rename to main/lib/pytest_testrail_client/model/priority.py diff --git a/bp_core/lib/pytest_testrail_client/model/project.py b/main/lib/pytest_testrail_client/model/project.py similarity index 97% rename from bp_core/lib/pytest_testrail_client/model/project.py rename to main/lib/pytest_testrail_client/model/project.py index 979e7c20..5c9d9519 100644 --- a/bp_core/lib/pytest_testrail_client/model/project.py +++ b/main/lib/pytest_testrail_client/model/project.py @@ -1,6 +1,6 @@ from datetime import datetime -from bp_core.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client._exception import TestRailError class Project(object): diff --git a/bp_core/lib/pytest_testrail_client/model/result.py b/main/lib/pytest_testrail_client/model/result.py similarity index 96% rename from bp_core/lib/pytest_testrail_client/model/result.py rename to main/lib/pytest_testrail_client/model/result.py index c9cde9e0..9822856b 100644 --- a/bp_core/lib/pytest_testrail_client/model/result.py +++ b/main/lib/pytest_testrail_client/model/result.py @@ -1,7 +1,7 @@ from datetime import datetime, timedelta -from bp_core.lib.pytest_testrail_client._exception import TestRailError -from bp_core.lib.pytest_testrail_client.helper import ( +from main.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client.helper import ( custom_methods, testrail_duration_to_timedelta, ) diff --git a/bp_core/lib/pytest_testrail_client/model/run.py b/main/lib/pytest_testrail_client/model/run.py similarity index 98% rename from bp_core/lib/pytest_testrail_client/model/run.py rename to main/lib/pytest_testrail_client/model/run.py index 9b2f8f92..03bcbccb 100644 --- a/bp_core/lib/pytest_testrail_client/model/run.py +++ b/main/lib/pytest_testrail_client/model/run.py @@ -1,6 +1,6 @@ from datetime import datetime -from bp_core.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client._exception import TestRailError class Run(object): diff --git a/bp_core/lib/pytest_testrail_client/model/section.py b/main/lib/pytest_testrail_client/model/section.py similarity index 95% rename from bp_core/lib/pytest_testrail_client/model/section.py rename to main/lib/pytest_testrail_client/model/section.py index 75d86211..e23573d6 100644 --- a/bp_core/lib/pytest_testrail_client/model/section.py +++ b/main/lib/pytest_testrail_client/model/section.py @@ -1,4 +1,4 @@ -from bp_core.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client._exception import TestRailError class Section(object): diff --git a/bp_core/lib/pytest_testrail_client/model/status.py b/main/lib/pytest_testrail_client/model/status.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/model/status.py rename to main/lib/pytest_testrail_client/model/status.py diff --git a/bp_core/lib/pytest_testrail_client/model/suite.py b/main/lib/pytest_testrail_client/model/suite.py similarity index 95% rename from bp_core/lib/pytest_testrail_client/model/suite.py rename to main/lib/pytest_testrail_client/model/suite.py index d6e3329b..f39ab6c9 100644 --- a/bp_core/lib/pytest_testrail_client/model/suite.py +++ b/main/lib/pytest_testrail_client/model/suite.py @@ -1,6 +1,6 @@ from datetime import datetime -from bp_core.lib.pytest_testrail_client._exception import TestRailError +from main.lib.pytest_testrail_client._exception import TestRailError class Suite(object): diff --git a/bp_core/lib/pytest_testrail_client/model/templates.py b/main/lib/pytest_testrail_client/model/templates.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/model/templates.py rename to main/lib/pytest_testrail_client/model/templates.py diff --git a/bp_core/lib/pytest_testrail_client/model/test.py b/main/lib/pytest_testrail_client/model/test.py similarity index 96% rename from bp_core/lib/pytest_testrail_client/model/test.py rename to main/lib/pytest_testrail_client/model/test.py index 0c976d97..14a6437e 100644 --- a/bp_core/lib/pytest_testrail_client/model/test.py +++ b/main/lib/pytest_testrail_client/model/test.py @@ -1,4 +1,4 @@ -from bp_core.lib.pytest_testrail_client.helper import ( +from main.lib.pytest_testrail_client.helper import ( custom_methods, testrail_duration_to_timedelta, ) diff --git a/bp_core/lib/pytest_testrail_client/pytest_testrail_client.py b/main/lib/pytest_testrail_client/pytest_testrail_client.py similarity index 98% rename from bp_core/lib/pytest_testrail_client/pytest_testrail_client.py rename to main/lib/pytest_testrail_client/pytest_testrail_client.py index afd4216b..0b7dd02f 100644 --- a/bp_core/lib/pytest_testrail_client/pytest_testrail_client.py +++ b/main/lib/pytest_testrail_client/pytest_testrail_client.py @@ -14,14 +14,14 @@ import pytest_bdd.parser import structlog -from bp_core.lib.pytest_testrail_client.model.case import Case -from bp_core.lib.pytest_testrail_client.model.plan import Entry -from bp_core.lib.pytest_testrail_client.model.result import Result -from bp_core.lib.pytest_testrail_client.model.section import Section -from bp_core.lib.pytest_testrail_client.model.suite import Suite -from bp_core.lib.pytest_testrail_client.testrail_api import TestRailAPI, validate_setup -from bp_core.utils.bp_storage import BPStorage -from bp_core.utils.utils import remove_chars_from_string, TEMP_SCREENSHOTS, remove_multiple_spaces +from main.lib.pytest_testrail_client.model.case import Case +from main.lib.pytest_testrail_client.model.plan import Entry +from main.lib.pytest_testrail_client.model.result import Result +from main.lib.pytest_testrail_client.model.section import Section +from main.lib.pytest_testrail_client.model.suite import Suite +from main.lib.pytest_testrail_client.testrail_api import TestRailAPI, validate_setup +from main.utils.bp_storage import BPStorage +from main.utils.utils import remove_chars_from_string, TEMP_SCREENSHOTS, remove_multiple_spaces from ._exception import TestRailError from ._utils import _get_feature, _get_list_of_files, _write_feature diff --git a/bp_core/lib/pytest_testrail_client/testrail_api.py b/main/lib/pytest_testrail_client/testrail_api.py similarity index 100% rename from bp_core/lib/pytest_testrail_client/testrail_api.py rename to main/lib/pytest_testrail_client/testrail_api.py diff --git a/bp_core/notifications/slack_plugin.py b/main/notifications/slack_plugin.py similarity index 100% rename from bp_core/notifications/slack_plugin.py rename to main/notifications/slack_plugin.py diff --git a/bp_core/notifications/teams_plugin.py b/main/notifications/teams_plugin.py similarity index 100% rename from bp_core/notifications/teams_plugin.py rename to main/notifications/teams_plugin.py diff --git a/bp_core/plugin.py b/main/plugin.py similarity index 98% rename from bp_core/plugin.py rename to main/plugin.py index dad16f35..1b3864b3 100644 --- a/bp_core/plugin.py +++ b/main/plugin.py @@ -25,16 +25,16 @@ from cucumber_tag_expressions import parse -from bp_core.utils.dataset_handler import DatasetHandler +from main.utils.dataset_handler import DatasetHandler # do not remove this unused import. this sets up pytest short summary. from selenium.common.exceptions import WebDriverException # do not remove this unused import. this sets up logging. -from bp_core.utils import log_handler -from bp_core.utils.env_variables import EnvVariables, load_env_from_local_dotenv_file -from bp_core.utils.bp_storage import BPStorage -from bp_core.utils.utils import initialize_output_dirs, remove_chars_from_string, zip_screenshots_files, \ +from main.utils import log_handler +from main.utils.env_variables import EnvVariables, load_env_from_local_dotenv_file +from main.utils.bp_storage import BPStorage +from main.utils.utils import initialize_output_dirs, remove_chars_from_string, zip_screenshots_files, \ save_base64_as_png, TEMP_SCREENSHOTS logger = structlog.get_logger(__name__) @@ -74,7 +74,7 @@ def pytest_configure(config: pytest_config.Config) -> None: config.option.markexpr = "not not_in_scope" is_driver = [arg for arg in config.invocation_params.args if "driver" in arg] if is_driver and not os.environ.get('BOILERPLATE_INSTALLATION'): - config.pluginmanager.import_plugin("bp_core.frontend.frontend_plugin") + config.pluginmanager.import_plugin("main.frontend.frontend_plugin") # reset values & delete files when using BPStorage bp_storage.set_api_testing(False) @@ -328,11 +328,11 @@ def pytest_collection_modifyitems( for item in items: if pytest.mark.api.mark in item.own_markers and pytest.mark.not_in_scope.mark not in item.own_markers: bp_storage.set_api_testing(True) - config.pluginmanager.import_plugin("bp_core.backend.backend_plugin") + config.pluginmanager.import_plugin("main.backend.backend_plugin") break if not bp_storage.is_api_testing() and not os.environ.get('BOILERPLATE_INSTALLATION'): - config.pluginmanager.import_plugin("bp_core.frontend.frontend_plugin") + config.pluginmanager.import_plugin("main.frontend.frontend_plugin") "2. API & UI - common implementation" diff --git a/bp_core/setup/setup_scripts/__init__.py b/main/setup/setup_scripts/__init__.py similarity index 100% rename from bp_core/setup/setup_scripts/__init__.py rename to main/setup/setup_scripts/__init__.py diff --git a/bp_core/setup/setup_scripts/download_assets.py b/main/setup/setup_scripts/download_assets.py similarity index 97% rename from bp_core/setup/setup_scripts/download_assets.py rename to main/setup/setup_scripts/download_assets.py index fb5b039c..e5d5bc9e 100644 --- a/bp_core/setup/setup_scripts/download_assets.py +++ b/main/setup/setup_scripts/download_assets.py @@ -3,7 +3,7 @@ import shutil import requests -from bp_core.utils.env_variables import EnvVariables +from main.utils.env_variables import EnvVariables BROWSERSTACK_LOCAL_MAC = ( "https://www.browserstack.com/browserstack-local/BrowserStackLocal-darwin-x64.zip" diff --git a/bp_core/setup/setup_scripts/text_formatting.py b/main/setup/setup_scripts/text_formatting.py similarity index 100% rename from bp_core/setup/setup_scripts/text_formatting.py rename to main/setup/setup_scripts/text_formatting.py diff --git a/bp_core/setup/setup_tests/__init__.py b/main/setup/setup_tests/__init__.py similarity index 100% rename from bp_core/setup/setup_tests/__init__.py rename to main/setup/setup_tests/__init__.py diff --git a/bp_core/setup/setup_tests/conftest.py b/main/setup/setup_tests/conftest.py similarity index 100% rename from bp_core/setup/setup_tests/conftest.py rename to main/setup/setup_tests/conftest.py diff --git a/main/setup/setup_tests/test_installation_check.py b/main/setup/setup_tests/test_installation_check.py new file mode 100644 index 00000000..49f2bc5d --- /dev/null +++ b/main/setup/setup_tests/test_installation_check.py @@ -0,0 +1,135 @@ +import os +import pytest +from assertpy import assert_that + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_root_folder(): + assert_that(os.path.isfile("./.editorconfig")).is_true() + assert_that(os.path.isfile("./.gitignore")).is_true() + assert_that(os.path.isfile("./conftest.py")).is_true() + assert_that(os.path.isfile("./setup_install.sh")).is_true() + assert_that(os.path.isfile("./setup_install.py")).is_true() + assert_that(os.path.isfile("./pytest.ini")).is_true() + assert_that(os.path.isfile("./README.md")).is_true() + assert_that(os.path.isfile("./requirements.txt")).is_true() + assert_that(os.path.isfile("./docker-compose.yml")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_main_folder(): + assert_that(os.path.isfile("./main/.pylintrc")).is_true() + assert_that(os.path.isfile("./main/plugin.py")).is_true() + assert_that(os.path.isfile("./main/notifications/slack_plugin.py")).is_true() + assert_that(os.path.isfile("./main/notifications/teams_plugin.py")).is_true() + assert_that(os.path.isdir("./main/backend")).is_true() + assert_that(os.path.isdir("./main/frontend")).is_true() + assert_that(os.path.isdir("./main/setup")).is_true() + assert_that(os.path.isdir("./main/lib")).is_true() + assert_that(os.path.isdir("./main/utils")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_common_ui_folder(): + assert_that( + os.path.isfile("./main/frontend/common/helpers/elements.py") + ).is_true() + assert_that( + os.path.isfile("./main/frontend/common/helpers/browser.py") + ).is_true() + assert_that( + os.path.isfile("./main/frontend/common/helpers/selenium_generics.py") + ).is_true() + assert_that( + os.path.isfile("./main/frontend/common/helpers/app.py") + ).is_true() + assert_that( + os.path.isfile("./main/frontend/common/helpers/web_compare.py") + ).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_screenshots_folder(): + assert_that(os.path.isdir("./output/screenshots")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_step_definitions_folder(): + assert_that(os.path.isdir("./main/frontend/common/step_definitions")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/browser_navigation.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/click_touch_and_keyboard_actions.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/date_time.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/dropdowns.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/attribute_assertion.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/environment_variables.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/excel_and_csv.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/html_tables.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/mobile_device_actions.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/swipe_drag_and_drop.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/text_assertion_editing.py")).is_true() + assert_that(os.path.isfile("./main/frontend/common/step_definitions/visual_comparison.py")).is_true() + assert_that(os.path.isfile("./main/backend/common/step_definitions/steps_common.py")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_test_data_folder(): + assert_that(os.path.isdir("./test_data")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_utils_folder(): + assert_that(os.path.isdir("./main/utils")).is_true() + assert_that(os.path.isfile("./main/utils/env_variables.py")).is_true() + assert_that(os.path.isfile("./main/utils/gherkin_utils.py")).is_true() + assert_that(os.path.isfile("./main/utils/utils.py")).is_true() + assert_that(os.path.isfile("./main/utils/faker_data.py")).is_true() + assert_that(os.path.isfile("./main/utils/pytest_terminal_report.py")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_configs_folder(): + assert_that(os.path.isdir("./env_configs")).is_true() + assert_that(os.path.isfile("./env_configs/.local.env")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_lib_folder(): + assert_that(os.path.isdir("./main/lib")).is_true() + assert_that(os.path.isdir("./main/lib/pytest_testrail_client")).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_installation_folder(): + assert_that(os.path.isdir("./main/setup")).is_true() + assert_that(os.path.isdir("./main/setup/setup_scripts")).is_true() + assert_that(os.path.isdir("./main/setup/setup_tests")).is_true() + assert_that( + os.path.isfile("./main/setup/setup_scripts/download_assets.py") + ).is_true() + + +@pytest.mark.nondestructive +@pytest.mark.automated +@pytest.mark.setup_check +def test_check_binaries_folder(): + assert_that(os.path.isdir("./webdriver")).is_true() diff --git a/bp_core/utils/bp_storage.py b/main/utils/bp_storage.py similarity index 100% rename from bp_core/utils/bp_storage.py rename to main/utils/bp_storage.py diff --git a/bp_core/utils/data_manager.py b/main/utils/data_manager.py similarity index 93% rename from bp_core/utils/data_manager.py rename to main/utils/data_manager.py index 17453baf..ae66946d 100644 --- a/bp_core/utils/data_manager.py +++ b/main/utils/data_manager.py @@ -1,7 +1,7 @@ import os import re -from bp_core.utils.dataset_handler import DatasetHandler +from main.utils.dataset_handler import DatasetHandler def text_formatted(string_to_format: str): diff --git a/bp_core/utils/dataset_handler.py b/main/utils/dataset_handler.py similarity index 92% rename from bp_core/utils/dataset_handler.py rename to main/utils/dataset_handler.py index 25a732a5..a15430f5 100644 --- a/bp_core/utils/dataset_handler.py +++ b/main/utils/dataset_handler.py @@ -1,8 +1,8 @@ import re from collections import deque -from bp_core.utils.exceptions import DatasetHandlerException -from bp_core.utils.singleton import SingletonMeta +from main.utils.exceptions import DatasetHandlerException +from main.utils.singleton import SingletonMeta class DatasetHandler(metaclass=SingletonMeta): diff --git a/bp_core/utils/env_variables.py b/main/utils/env_variables.py similarity index 96% rename from bp_core/utils/env_variables.py rename to main/utils/env_variables.py index cc8bfed7..d7dea89b 100644 --- a/bp_core/utils/env_variables.py +++ b/main/utils/env_variables.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Union from dotenv import load_dotenv -from bp_core.utils.singleton import SingletonMeta +from main.utils.singleton import SingletonMeta def load_env_from_local_dotenv_file( diff --git a/bp_core/utils/exceptions.py b/main/utils/exceptions.py similarity index 100% rename from bp_core/utils/exceptions.py rename to main/utils/exceptions.py diff --git a/bp_core/utils/faker_data.py b/main/utils/faker_data.py similarity index 100% rename from bp_core/utils/faker_data.py rename to main/utils/faker_data.py diff --git a/bp_core/utils/gherkin_utils.py b/main/utils/gherkin_utils.py similarity index 100% rename from bp_core/utils/gherkin_utils.py rename to main/utils/gherkin_utils.py diff --git a/bp_core/utils/html_custom_style.css b/main/utils/html_custom_style.css similarity index 100% rename from bp_core/utils/html_custom_style.css rename to main/utils/html_custom_style.css diff --git a/bp_core/utils/log_handler.py b/main/utils/log_handler.py similarity index 100% rename from bp_core/utils/log_handler.py rename to main/utils/log_handler.py diff --git a/bp_core/utils/pytest_terminal_report.py b/main/utils/pytest_terminal_report.py similarity index 100% rename from bp_core/utils/pytest_terminal_report.py rename to main/utils/pytest_terminal_report.py diff --git a/bp_core/utils/singleton.py b/main/utils/singleton.py similarity index 100% rename from bp_core/utils/singleton.py rename to main/utils/singleton.py diff --git a/bp_core/utils/utils.py b/main/utils/utils.py similarity index 100% rename from bp_core/utils/utils.py rename to main/utils/utils.py diff --git a/pytest.ini b/pytest.ini index 7104920f..2b44e860 100755 --- a/pytest.ini +++ b/pytest.ini @@ -13,7 +13,7 @@ log_format = %(asctime)s - %(levelname)s %(message)s log_date_format = %Y-%m-%d %H:%M:%S selenium_exclude_debug = screenshot addopts = - --css=bp_core/utils/html_custom_style.css --cache-clear + --css=main/utils/html_custom_style.css --cache-clear # Allure Report arguments --clean-alluredir --alluredir=output/allure/results diff --git a/setup_install.py b/setup_install.py index 613d077b..091de9d9 100755 --- a/setup_install.py +++ b/setup_install.py @@ -7,7 +7,7 @@ import venv from collections import namedtuple from pathlib import Path -from bp_core.setup.setup_scripts.text_formatting import BColors, print_red, print_green, print_cyan +from main.setup.setup_scripts.text_formatting import BColors, print_red, print_green, print_cyan TERMINAL_WIDTH = 100 try: @@ -23,7 +23,7 @@ def install_selenium_drivers(): print_green(_ := "Installing Selenium Drivers") print_green("-" * len(_)) - from bp_core.setup.setup_scripts.download_assets import get_bs_local_by_platform + from main.setup.setup_scripts.download_assets import get_bs_local_by_platform PROJECT_DIR = Path.cwd() TEMP_DIR = PROJECT_DIR / "temp" From 36cf3aeadb9743124b58b775c7192b12d67ca77e Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Fri, 22 Mar 2024 14:23:33 +0500 Subject: [PATCH 2/3] main folder name changed --- .github/workflows/docker_android_workflow.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 08292102..b05980bd 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -93,11 +93,6 @@ jobs: screencapture screenshot.jpg $ANDROID_HOME/platform-tools/adb exec-out screencap -p > emulator.png - - name: Check out code - id: co_code - if: steps.start_emulator.outcome == 'success' - uses: actions/checkout@v4 - - name: Setup dependencies id: setup_dependencies if: steps.co_code.outcome == 'success' From e0229ef3bce97c51499791211dd5b700d867e1a9 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Fri, 22 Mar 2024 16:03:59 +0500 Subject: [PATCH 3/3] ci_runs --- .github/workflows/api_workflow.yml | 266 ++++++++++++++--------------- .github/workflows/ui_workflow.yml | 66 +++++-- local_run_api.sh => ci_run_api.sh | 0 ci_run_web.sh | 7 + 4 files changed, 190 insertions(+), 149 deletions(-) rename local_run_api.sh => ci_run_api.sh (100%) create mode 100755 ci_run_web.sh diff --git a/.github/workflows/api_workflow.yml b/.github/workflows/api_workflow.yml index fee9b760..bbcc8cc6 100644 --- a/.github/workflows/api_workflow.yml +++ b/.github/workflows/api_workflow.yml @@ -1,140 +1,140 @@ name: API Workflow env: - TAGS: "api" - BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_API_USERNAME}} - BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}} + TAGS: "api" + BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_API_USERNAME}} + BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}} on: - schedule: - - cron: '0 21 * * *' - workflow_dispatch: - inputs: - tags: - description: 'Tags' - required: true - default: 'api' + schedule: + - cron: '0 21 * * *' + workflow_dispatch: + inputs: + tags: + description: 'Tags' + required: true + default: 'api' jobs: - run-api-test-schedule: - if: github.event_name == 'schedule' - name: API Regression - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Check out code - uses: actions/checkout@v4 - - - name: Setup dependencies - run: | - sh setup_install.sh - - - name: Run tests - run: | - if [ "${{ github.event.inputs.tags }}" != "" ] - then - TAGS="${{ github.event.inputs.tags }}" - fi - - source $HOME/.bp-venv/bin/activate - sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" - - - name: Get Allure history - uses: actions/checkout@v4 - if: always() - continue-on-error: true - with: - ref: gh-pages - path: gh-pages - - - name: Allure Report - uses: simple-elf/allure-report-action@v1.7 - if: always() - with: - gh_pages: gh-pages - allure_results: allure-results - allure_history: allure-history - - - name: Deploy report to Github Pages - if: always() - uses: peaceiris/actions-gh-pages@v3 - with: - PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: allure-history - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results - path: | - ./*.html - ./output/ - ./assets/ - if: ${{ always() }} - - run-api-test-on-local: - if: github.event_name != 'schedule' - name: API Regression - runs-on: ubuntu-latest - steps: - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Check out code - uses: actions/checkout@v4 - - - name: Setup dependencies - run: | - sh setup_install.sh - - - name: Run tests - run: | - if [ "${{ github.event.inputs.tags }}" != "" ] - then - TAGS="${{ github.event.inputs.tags }}" - fi - - source $HOME/.bp-venv/bin/activate - sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" - - - name: Get Allure history - uses: actions/checkout@v4 - if: always() - continue-on-error: true - with: - ref: gh-pages - path: gh-pages - - - name: Allure Report - uses: simple-elf/allure-report-action@v1.7 - if: always() - with: - gh_pages: gh-pages - allure_results: allure-results - allure_history: allure-history - - - name: Deploy report to Github Pages - if: always() - uses: peaceiris/actions-gh-pages@v3 - with: - PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: allure-history - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results - path: | - ./*.html - ./output/ - ./assets/ - if: ${{ always() }} \ No newline at end of file + run-api-test-schedule: + if: github.event_name == 'schedule' + name: API Regression + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Check out code + uses: actions/checkout@v4 + + - name: Setup dependencies + run: | + sh setup_install.sh + + - name: Run tests + run: | + if [ "${{ github.event.inputs.tags }}" != "" ] + then + TAGS="${{ github.event.inputs.tags }}" + fi + + source $HOME/.bp-venv/bin/activate + sh ci_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" + + - name: Get Allure history + uses: actions/checkout@v4 + if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Allure Report + uses: simple-elf/allure-report-action@v1.7 + if: always() + with: + gh_pages: gh-pages + allure_results: allure-results + allure_history: allure-history + + - name: Deploy report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v3 + with: + PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: allure-history + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: | + ./*.html + ./output/ + ./assets/ + if: ${{ always() }} + + run-api-test-on-local: + if: github.event_name != 'schedule' + name: API Regression + runs-on: ubuntu-latest + steps: + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Check out code + uses: actions/checkout@v4 + + - name: Setup dependencies + run: | + sh setup_install.sh + + - name: Run tests + run: | + if [ "${{ github.event.inputs.tags }}" != "" ] + then + TAGS="${{ github.event.inputs.tags }}" + fi + + source $HOME/.bp-venv/bin/activate + sh ci_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" + + - name: Get Allure history + uses: actions/checkout@v4 + if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Allure Report + uses: simple-elf/allure-report-action@v1.7 + if: always() + with: + gh_pages: gh-pages + allure_results: allure-results + allure_history: allure-history + + - name: Deploy report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v3 + with: + PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: allure-history + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: | + ./*.html + ./output/ + ./assets/ + if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/ui_workflow.yml b/.github/workflows/ui_workflow.yml index 08205cf3..f975f6c8 100644 --- a/.github/workflows/ui_workflow.yml +++ b/.github/workflows/ui_workflow.yml @@ -162,15 +162,8 @@ jobs: - name: Run All Tests run: | env - source $HOME/.bp-venv/bin/activate - - python -m pytest -v --driver Remote --selenium-host '${{secrets.BROWSERSTACK_API_USERNAME}}:${{secrets.BROWSERSTACK_ACCESS_KEY}}@hub-cloud.browserstack.com' \ - --variables ${{ matrix.config_file }} --tags="${{ matrix.tags }}" \ - --base-url="${{ matrix.baseurl }}" \ - --capability headless False \ - --reruns 1 --reruns-delay 5 \ - --html=report.html \ - --self-contained-html -n ${{ matrix.concurrent_thread }} \ + source $HOME/.bp-venv/bin/activate + sh ci_run_web.sh ${{secrets.BROWSERSTACK_API_USERNAME}} ${{secrets.BROWSERSTACK_ACCESS_KEY}} "${{ matrix.config_file }}" "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" "$BASE_URL" $concurrent_thread # --pytest-testrail-export-test-results \ # --testrail-project-id "${{ env.TESTRAIL_PROJECT_ID }}" \ # --pytest-testrail-test-plan-id "${{ env.TEST_PLAN_ID }}" \ @@ -183,6 +176,29 @@ jobs: with: local-testing: stop if: ${{ always() }} + - name: Get Allure history + uses: actions/checkout@v4 + if: always() + continue-on-error: true + with: + ref: gh-pages-1 + path: gh-pages-1 + + - name: Allure Report + uses: simple-elf/allure-report-action@v1.7 + if: always() + with: + gh_pages: gh-pages-1 + allure_results: allure-results + allure_history: allure-history + + - name: Deploy report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v3 + with: + PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} + PUBLISH_BRANCH: gh-pages-1 + PUBLISH_DIR: allure-history - name: Upload HTML run report in the Artifacts Folder uses: actions/upload-artifact@v4 @@ -302,13 +318,7 @@ jobs: env source $HOME/.bp-venv/bin/activate - python -m pytest -v --driver Remote \ - --selenium-host '${{secrets.BROWSERSTACK_API_USERNAME}}:${{secrets.BROWSERSTACK_ACCESS_KEY}}@hub-cloud.browserstack.com' \ - --variables "$BROWSER" \ - --capability headless False \ - --reruns 1 --reruns-delay 5 \ - --tags="$TAGS" --base-url="$BASE_URL" --html=report.html \ - --self-contained-html -n $concurrent_thread + sh ci_run_web.sh ${{secrets.BROWSERSTACK_API_USERNAME}} ${{secrets.BROWSERSTACK_ACCESS_KEY}} "$BROWSER" "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" "$BASE_URL" $concurrent_thread - name: BrowserStackLocal Stop uses: browserstack/github-actions/setup-local@master @@ -316,6 +326,30 @@ jobs: local-testing: stop if: ${{ always() }} + - name: Get Allure history + uses: actions/checkout@v4 + if: always() + continue-on-error: true + with: + ref: gh-pages-1 + path: gh-pages-1 + + - name: Allure Report + uses: simple-elf/allure-report-action@v1.7 + if: always() + with: + gh_pages: gh-pages-1 + allure_results: allure-results + allure_history: allure-history + + - name: Deploy report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v3 + with: + PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }} + PUBLISH_BRANCH: gh-pages-1 + PUBLISH_DIR: allure-history + - name: Upload HTML run report in the Artifacts Folder uses: actions/upload-artifact@v4 with: diff --git a/local_run_api.sh b/ci_run_api.sh similarity index 100% rename from local_run_api.sh rename to ci_run_api.sh diff --git a/ci_run_web.sh b/ci_run_web.sh new file mode 100755 index 00000000..16246abe --- /dev/null +++ b/ci_run_web.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Run Web tests +python -m pytest -v -s --gherkin-terminal-reporter --driver=Remote --selenium-host $1':'$2'@hub-cloud.browserstack.com' --variables=$3 --html="./output/reports/" \ +--tags=$4 --reruns 1 --reruns-delay 2 --self-contained-html --capability headless False --slack-webhook-url=$5 --slack-channel=pytest-test-automation \ +--slack-results-url=https://tweag.github.io/pytest-automation-boilerplate --teams-webhook-url=$6 \ +--teams-results-url=https://tweag.github.io/pytest-automation-boilerplate --base-url=$7 -n=$8 \ No newline at end of file