Skip to content

Move button tests to pytest #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion JDI/web/selenium/driver/web_driver_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
class WebDriverProvider:
@staticmethod
def get_chrome_driver_path():
chrome = "/chromedriver.exe" if sys.platform.startswith("win") else "chromedriver"
chrome = ".\chromedriver.exe" if sys.platform.startswith("win") else "chromedriver"
return os.path.join(JDISettings.get_driver_path(), chrome)
3 changes: 2 additions & 1 deletion jdi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ driver=chrome
domain=https://jdi-framework.github.io/tests
timeout_wait_element=5
timeout_wait_pageLoad=5
drivers_folder=.\
;/drivers_folder=.\
drivers_folder=C:\Users\Andrei_Zhidelev\projects\jdi-python\
driver_getLatest=true
8 changes: 2 additions & 6 deletions tests/jdi_uitests_webtests/test/common/button_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
from JDI.jdi_assert.testing.assertion import Assert
from tests.jdi_uitests_webtests.main.enums.preconditions import Preconditions
from tests.jdi_uitests_webtests.main.page_objects.epam_jdi_site import EpamJDISite
from tests.jdi_uitests_webtests.test.init_tests import InitTests


@pytest.mark.web
class ButtonTests(InitTests):
class TestButton:

button = EpamJDISite.metals_colors_page.calculate_button

def setUp(self):
super(ButtonTests, self).setUp(self.id().split(".")[-1])
def test_click(self, epam_site):
Preconditions.METALS_AND_COLORS_PAGE.is_in_state()

def test_click(self):
self.button.click()
Assert.assert_element_test(self.button, "CALCULATE")
3 changes: 1 addition & 2 deletions tests/jdi_uitests_webtests/test/complex/dropdown_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
from tests.jdi_uitests_webtests.main.enums.preconditions import Preconditions
from tests.jdi_uitests_webtests.main.page_objects.epam_jdi_site import EpamJDISite
from tests.jdi_uitests_webtests.main.utils.common_action_data import CommonActionsData
from tests.jdi_uitests_webtests.test.init_tests import InitTests

MSG = "Colors: value changed to Blue"


@pytest.fixture(params=[True, False], ids=["Dropdown", "Dropdown expanded"])
def dropdown_setup(request, site):
def dropdown_setup(request, epam_site):
dropdown = EpamJDISite.metals_colors_page.color_dropdown
Preconditions.METALS_AND_COLORS_PAGE.is_in_state()
if request.param:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import pytest

from JDI.jdi_assert.testing.assertion import Assert
from tests.jdi_uitests_webtests.main.enums.entities import Odds
from tests.jdi_uitests_webtests.main.enums.preconditions import Preconditions
from tests.jdi_uitests_webtests.main.page_objects.epam_jdi_site import EpamJDISite
from tests.jdi_uitests_webtests.main.page_objects.sections.summary import SelectorSummary
from tests.jdi_uitests_webtests.main.utils.common_action_data import CommonActionsData
from tests.jdi_uitests_webtests.test.init_tests import InitTests
from tests.jdi_uitests_webtests.main.page_objects.epam_jdi_site import \
EpamJDISite
from tests.jdi_uitests_webtests.main.page_objects.sections.summary import \
SelectorSummary
from tests.jdi_uitests_webtests.main.utils.common_action_data import \
CommonActionsData

MSG = "Summary (Odd): value changed to 7"

import pytest


@pytest.fixture
def selector_site(site):
def selector_site(epam_site):
Preconditions.METALS_AND_COLORS_PAGE.is_in_state()


Expand Down
3 changes: 1 addition & 2 deletions tests/jdi_uitests_webtests/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import unittest

import pytest

Expand All @@ -14,7 +13,7 @@


@pytest.fixture(scope="class")
def site():
def epam_site():
WebSite.init(EpamJDISite)
logger.info("Run Tests from '{}' file".format(__name__))
EpamJDISite.home_page.open()
Expand Down
2 changes: 1 addition & 1 deletion utils/get_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def compose_download_link(build) -> str:


if __name__ == "__main__":
release = get_last_release("87.0.4280")
release = get_last_release("90.0.4430")
download_link = compose_download_link(build=release)
download_driver(download_link)